/* ==========================================================================
   Sistema Visual — Mauricio Correa Portfolio
   Fuente de verdad: ../SISTEMA_VISUAL.md — no agregar colores/fuentes nuevas.
   Dirección de diseño (skill frontend-design, 22 sep 2026): motivo visual
   recurrente = waveform de audio (grounded en el oficio real: cortar audio
   de podcasts). Sin tarjetas con sombra/borde redondeado tipo SaaS, sin
   eyebrow en mayúsculas, sin píldoras con borde en los tags.
   ========================================================================== */

:root {
  --color-primario: #0D0E10;   /* fondo principal */
  --color-secundario: #71767A; /* texto secundario, bordes, metadata */
  --color-acento: #FF1B00;     /* CTA, waveform playhead, dot de los tags */
  --color-base-oscura: #000000;
  --color-base-clara: #FAFAF9; /* texto principal sobre fondo oscuro */

  --font-display: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', 'SFMono-Regular', Consolas, monospace;

  --container-max: 1160px;
  --radius-ui: 4px;   /* botones — únicos elementos con esquina redondeada */
}

/* ---- Reset base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-primario);
  color: var(--color-base-clara);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Botones ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-acento);
  color: var(--color-base-clara);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius-ui);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.98); }

/* Pill + glassy, para que combine con la cápsula del header (no es un
   rectángulo sólido que choca contra los bordes redondeados de la barra). */
.btn--small {
  padding: 10px 20px;
  font-size: 13px;
  border-radius: 999px;
  background: rgba(255, 27, 0, 0.55);
  border: 1px solid rgba(250, 250, 249, 0.16);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
}
.btn--large {
  padding: 18px 40px;
  font-size: 16px;
}

/* ---- Header ---- */
/* Cápsula flotante glassy (referencia: trake.app) — reemplaza la barra de
   ancho completo por un panel inset del borde, mismo lenguaje de vidrio que
   el panel del CTA final (blur 18px + saturate 180%), pero en su propia
   forma de píldora, no de ancho completo. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: clamp(14px, 2.6vw, 22px) 24px 0;
  pointer-events: none;
}
.site-header__inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: 460px;
  margin: 0 auto;
  padding: 8px 8px 8px 26px;
  border-radius: 999px;
  background: rgba(20, 21, 24, 0.55);
  border: 1px solid rgba(250, 250, 249, 0.08);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.wordmark__icon {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 10vw, 120px) 0 clamp(56px, 8vw, 96px);
}

.hero__glow {
  position: absolute;
  left: 50%;
  top: 58%;
  width: min(560px, 66vw);
  height: min(560px, 66vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 27, 0, 0.30) 0%, rgba(255, 27, 0, 0.12) 42%, transparent 70%);
  filter: blur(70px);
  z-index: 0;
  pointer-events: none;
  animation: glow-breathe 9s ease-in-out infinite;
}

/* Toque de rojo más fuerte arriba, detrás de "Hi, I'm Mauricio" — capa
   aparte del glow de abajo (que ya quedó bien detrás del video) para poder
   subirle la intensidad acá sin volver a arriesgar el corte que tuvimos
   antes en la costura con el waveform. */
.hero__glow--top {
  position: absolute;
  left: 50%;
  top: 20%;
  width: min(480px, 60vw);
  height: min(480px, 60vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 27, 0, 0.48) 0%, rgba(255, 27, 0, 0.18) 45%, transparent 72%);
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
  animation: glow-breathe 9s ease-in-out infinite;
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__glow, .hero__glow--top { animation: none; }
}

.hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero__intro {
  max-width: 720px;
  margin: 0 auto;
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 8vw, 80px);
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  margin-bottom: clamp(14px, 2vw, 20px);
  opacity: 0;
  animation: rise-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__role {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(13px, 1.4vw, 15px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-acento);
  margin-bottom: clamp(14px, 2vw, 18px);
  opacity: 0;
  animation: rise-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.hero__tagline {
  color: var(--color-secundario);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto clamp(40px, 6vw, 64px);
  opacity: 0;
  animation: rise-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.18s forwards;
}

.hero .video-frame--wide {
  margin: 0 auto;
  opacity: 0;
  animation: rise-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.28s forwards;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__name, .hero__role, .hero__tagline, .hero .video-frame--wide {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ---- Video frames (compartido hero + work) ---- */
.video-frame {
  position: relative;
  background: var(--color-base-oscura);
  border: 1px solid rgba(113, 118, 122, 0.22);
  overflow: hidden;
}
.video-frame--wide {
  aspect-ratio: 16 / 9;
  max-width: 900px;
}
.video-frame--tall {
  aspect-ratio: 9 / 16;
}
.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--color-base-oscura);
  transition: opacity 0.2s ease;
}
.video-frame:hover video { opacity: 0.92; }

.video-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-secundario);
  background: var(--color-base-oscura);
}
.video-placeholder__icon {
  font-size: 26px;
  color: var(--color-secundario);
  opacity: 0.55;
}
.video-placeholder__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
}
.video-frame--empty video { display: none; }
.video-frame--empty .video-placeholder { display: flex; }

/* ---- Divisor de waveform (costura entre secciones) ---- */
.wave-divider {
  width: 100%;
  height: clamp(64px, 9vw, 110px);
  overflow: hidden;
}
.wave-divider__canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---- Featured Work ---- */
.work {
  padding: clamp(64px, 10vw, 120px) 0;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.01em;
  text-align: center;
  margin: 0 auto 16px;
}
.section-subtitle {
  color: var(--color-secundario);
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 480px;
  text-align: center;
  margin: 0 auto clamp(40px, 6vw, 64px);
}

/* Grid fijo a 2 columnas angostas, en todos los tamaños de pantalla —
   réplica exacta del layout de trake.app (no responsive a 1/2/3 columnas
   como antes). El ancho angosto + perspective es lo que hace que el giro
   3D de las tarjetas (ver main.js) se vea como en la referencia. */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 544px;
  margin: 0 auto;
  perspective: 1200px;
}
.work-card {
  transform-style: preserve-3d;
}

/* El giro/blur/oscurecido en sí se aplica vía JS (transform + filter
   inline en .video-frame y en el video/placeholder de adentro), atado 1:1
   al scroll — no es una transición CSS de una sola vez. Acá solo dejamos
   el terreno listo (perf hint) y el apagador de prefers-reduced-motion. */
.work-card .video-frame {
  position: relative;
  will-change: transform, filter;
  /* Toque glassy + rojo reactivo al giro: --tilt lo escribe main.js en cada
     frame de scroll (0 = tarjeta plana/quieta, 1 = en pleno giro de entrada
     o salida) — el halo y el brillo de vidrio suben y bajan con el propio
     movimiento de la tarjeta, no es un efecto fijo. */
  box-shadow: 0 0 calc(var(--tilt, 0) * 46px) rgba(255, 27, 0, calc(var(--tilt, 0) * 0.55));
}
.work-card .video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(250, 250, 249, 0.16), rgba(255, 27, 0, 0.24) 45%, transparent 72%);
  mix-blend-mode: screen;
  opacity: var(--tilt, 0);
}
@media (prefers-reduced-motion: reduce) {
  .work-card .video-frame,
  .work-card .media-video,
  .work-card .video-placeholder {
    transform: none !important;
    filter: none !important;
  }
  .work-card .video-frame { box-shadow: none; }
  .work-card .video-frame::after { opacity: 0 !important; }
}

.work-card__title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.35;
  padding-top: 16px;
  margin-top: 16px;
  margin-bottom: 10px;
  border-top: 1px solid rgba(113, 118, 122, 0.22);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-secundario);
}
.tag__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-acento);
  flex: none;
}

/* ---- Cierre de Featured Work: proceso en 3 pasos ---- */
/* Mismo patrón que la sección "steps" de trake.app (número chico en
   acento, título bold, descripción gris, columnas auto-fit) — con nuestra
   paleta y copy. Cierra la sección, por eso el borde arriba a modo de
   separador en vez de otro waveform. */
.work-process {
  max-width: 900px;
  margin: clamp(72px, 10vw, 120px) auto 0;
  padding-top: clamp(56px, 8vw, 88px);
  border-top: 1px solid rgba(113, 118, 122, 0.2);
}
.work-process__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: center;
  max-width: 36ch;
  margin: 0 auto clamp(40px, 6vw, 56px);
}
.work-process__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.process-step__n {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-acento);
}
.process-step__h {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.process-step__p {
  color: var(--color-secundario);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ---- CTA final ---- */
.cta {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 12vw, 140px) 0;
  text-align: center;
}
.cta__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(760px, 92vw);
  height: min(480px, 60vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 27, 0, 0.3) 0%, transparent 68%);
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}
.cta__inner {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
}
.cta__panel {
  padding: clamp(48px, 7vw, 72px) clamp(28px, 5vw, 56px);
  border-radius: 20px;
  border: 1px solid rgba(250, 250, 249, 0.08);
  background: rgba(20, 21, 24, 0.45);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}
.cta__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.cta__subtitle {
  color: var(--color-acento);
  font-size: clamp(15px, 1.8vw, 18px);
  margin-bottom: 36px;
}
.cta__microcopy {
  margin-top: 16px;
  color: var(--color-secundario);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid rgba(113, 118, 122, 0.15);
  padding: 28px 0;
}
.site-footer p {
  color: var(--color-secundario);
  font-family: var(--font-mono);
  font-size: 12px;
}
