/* ==========================================================================
   IVAO Studio · hoja de estilos
   Base: plantilla Ashley (estructura, marco, cursor, revelados, texto circular)
   reinterpretada con la identidad del portafolio de Ivana Loaiza.

   Arquitectura: Single Semantic DOM. Un solo marcado para todos los
   dispositivos; la adaptación ocurre solo en CSS con tres niveles:
     Nivel 1 · Escritorio  ≥ 992px
     Nivel 2 · Tablet      768px – 991px  (se activa el dock inferior)
     Nivel 3 · Teléfono    < 768px        (columna única, zona del pulgar)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Paleta tomada del portafolio (PDF): #A29295, #8C6163, #4F3F3A, #FFF9F9 */
  --paper: #fbf8f8;
  --white: #ffffff;
  --surface: #f2ecec;
  --ink: #2a2224;
  --ink-2: #6b5e62;
  --mauve: #a29295;        /* campo de marca · texto tinta encima (5.2:1) */
  --mauve-deep: #7a6a6e;   /* campo profundo · texto blanco encima (5.1:1) */
  --plum: #8c6163;         /* acento · enlaces, foco (5.0:1 sobre papel) */
  --on-dark: #d6cbcd;
  --line: rgba(42, 34, 36, .14);
  --line-light: rgba(255, 255, 255, .22);

  /* Tipografía: Urbanist sustituye a Cerco (licencia DEMO); Source Serif 4
     acompaña como eco de Century Schoolbook en numerales y saludos. */
  --sans: "Urbanist", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;

  --fs-display: clamp(2.75rem, 1.4rem + 5.6vw, 6rem);
  --fs-h2: clamp(2.125rem, 1.4rem + 3vw, 4.25rem);
  --fs-h3: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --fs-lead: clamp(1.125rem, 1rem + .5vw, 1.375rem);
  --fs-body: 1.0625rem;
  --fs-small: .875rem;

  /* Grilla de 8pt */
  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2rem; --s5: 3rem;
  --s6: 4rem; --s7: 6rem; --s8: 8rem; --s9: 10rem;
  --section: clamp(3.5rem, 2rem + 4.5vw, 6.5rem);
  --gutter: clamp(1rem, .5rem + 2.5vw, 3.5rem);
  --max: 82.5rem;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --dock-h: 0px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; scroll-padding-bottom: calc(var(--dock-h) + 1rem); }
[id] { scroll-margin-top: 6rem; }
a, button, summary, label, select { touch-action: manipulation; -webkit-tap-highlight-color: rgba(140, 97, 99, .15); }
input, textarea { caret-color: var(--plum); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: var(--dock-h);
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.05; letter-spacing: -.03em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--mauve); color: var(--ink); }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 4px; border-radius: 2px; }
.on-deep :focus-visible, .on-ink :focus-visible { outline-color: var(--white); }
html { scrollbar-color: var(--mauve) var(--paper); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: var(--s2); left: var(--s2); z-index: 100;
  background: var(--ink); color: var(--white); padding: var(--s1) var(--s2);
  border-radius: 999px; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); position: relative; }
/* dos secciones seguidas con el mismo fondo claro no suman sus márgenes */
.section:not([class*="on-"]) + .section:not([class*="on-"]) { padding-top: calc(var(--section) * .35); }

/* Campos de color (la marca pinta regiones completas, como las portadillas del PDF) */
.on-mauve { background: var(--mauve); color: var(--ink); }
.on-deep { background: var(--mauve-deep); color: var(--white); }
.on-ink { background: var(--ink); color: var(--white); }
.on-surface { background: var(--surface); }

/* ---------- Tipografía ---------- */
.display { font-size: var(--fs-display); font-weight: 600; line-height: .98; letter-spacing: -.035em; }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -.02em; }
.thin { font-weight: 200; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.lead { font-size: var(--fs-lead); line-height: 1.5; font-weight: 400; max-width: 38ch; }
.muted { color: var(--ink-2); font-weight: 500; }
.on-deep .muted, .on-ink .muted { color: var(--on-dark); }
.small { font-size: var(--fs-small); }
.measure { max-width: 62ch; }
.numeral { font-family: var(--serif); font-weight: 300; line-height: 1; }

/* ---------- Botones (píldora con icono anidado, lenguaje Ashley) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 3.5rem; padding: .375rem .375rem .375rem 1.75rem;
  border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--white);
  font-weight: 600; font-size: .9375rem; letter-spacing: .01em;
  transition: scale 160ms var(--ease-out), background-color 200ms ease;
  box-shadow: 0 10px 30px -12px rgba(42, 34, 36, .45);
}
.btn__icon {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border-radius: 50%; background: rgba(255, 255, 255, .12);
}
.btn__icon svg { width: 1.125rem; height: 1.125rem; }
.btn:active { scale: .97; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #3a3033; }
}
.btn--light { background: var(--white); color: var(--ink); box-shadow: 0 10px 30px -14px rgba(42, 34, 36, .35); }
.btn--light .btn__icon { background: var(--surface); }
@media (hover: hover) and (pointer: fine) { .btn--light:hover { background: var(--paper); } }

.link-arrow {
  display: inline-flex; align-items: center; gap: .625rem;
  font-weight: 600; font-size: .9375rem; padding-block: var(--s1);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 300ms var(--ease-out);
}
.link-arrow svg { width: 1rem; height: 1rem; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .link-arrow:hover { background-size: 100% 1px; }
  .link-arrow:hover svg { transform: translateX(3px); }
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); }

/* ---------- Cabecera + navegación (un solo nav para todos los niveles) ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding-block: var(--s2);
  transition: padding 300ms var(--ease-out), top 500ms var(--ease-out);
}
.site-header.is-hidden { top: -6rem; }
/* El vidrio va en un pseudo-elemento: backdrop-filter en el propio header
   convertiría al header en bloque contenedor del dock fijo. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(251, 248, 248, .72);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid rgba(42, 34, 36, .06);
  opacity: 0; transition: opacity 300ms ease;
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-scrolled { padding-block: var(--s1); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }

.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); }
.brand svg { width: 5.25rem; height: auto; }
.brand__sub {
  font-size: .75rem; letter-spacing: .08em; color: var(--ink-2);
  padding-left: .75rem; border-left: 1px solid var(--line); line-height: 1.2;
}

.site-nav ul { display: flex; gap: var(--s4); }
.site-nav a {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 500; font-size: .9375rem; padding-block: .5rem; position: relative;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .25rem; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--ease-out);
}
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .site-nav a:hover::after { transform: scaleX(1); } }
.site-nav svg { display: none; width: 1.375rem; height: 1.375rem; }
.site-nav .nav-contact { display: none; }

.header-cta { min-height: 3rem; padding-left: 1.25rem; font-size: .875rem; }
.header-cta .btn__icon { width: 2.25rem; height: 2.25rem; }

/* ---------- Barra de progreso (Ashley) ---------- */
.progress {
  position: fixed; top: 0; right: 0; z-index: 60; width: 3px; height: 100%;
  pointer-events: none;
}
.progress span {
  display: block; width: 100%; height: 100%; background: var(--plum);
  transform: scaleY(0); transform-origin: top;
}

/* ---------- Cursor (Ashley) · solo puntero fino ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: grid; place-items: center; position: fixed; top: 0; left: 0; z-index: 90;
    width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
    background: var(--ink); color: var(--white); pointer-events: none;
    font-size: .75rem; font-weight: 600; letter-spacing: .02em;
    transition: width 300ms var(--ease-out), height 300ms var(--ease-out), margin 300ms var(--ease-out), opacity 200ms ease, background-color 200ms ease;
    opacity: 0;
  }
  .cursor.is-visible { opacity: 1; }
  .cursor span { opacity: 0; transition: opacity 200ms ease; }
  .cursor.is-link { width: 40px; height: 40px; margin: -20px 0 0 -20px; background: rgba(140, 97, 99, .18); }
  .cursor.is-view { width: 88px; height: 88px; margin: -44px 0 0 -44px; background: var(--ink); }
  .cursor.is-view span { opacity: 1; }
}

/* ---------- Preloader (Ashley, abreviado) ---------- */
.preloader { display: none; }
.js .preloader {
  display: block; position: fixed; inset: 0; z-index: 95;
  background: var(--ink); color: var(--paper);
}
.js.no-preload .preloader { display: none; }
.preloader__layer {
  position: absolute; inset: 0; display: flex; justify-content: center; align-items: center;
  font-size: clamp(1.75rem, 1.1rem + 2.2vw, 2.625rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.2;
}
.preloader__layer p { margin: 0 .9rem 0 0; opacity: 0; }
.preloader__layer .thin { font-weight: 200; }
.preloader__frame { position: relative; padding: 0 1.875rem; }
.preloader__frame p { margin: 0; font-weight: 200; }
.preloader__box { position: absolute; top: 0; left: 0; z-index: 2; width: 0; height: 100%; background: var(--mauve); opacity: 0; }
@media (max-width: 991.98px) {
  .preloader__phrase { flex-direction: column; }
  .preloader__phrase p { margin: 0 0 .25rem; }
}

/* ---------- Revelado de imágenes ---------- */
.frame { position: relative; overflow: hidden; background: var(--surface); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame--contain img { object-fit: contain; }

/* ==========================================================================
   INICIO
   ========================================================================== */
.hero { padding-top: calc(var(--s8) + var(--s3)); padding-bottom: var(--s6); overflow: hidden; }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "title media" "text media";
  grid-template-rows: auto 1fr;
  column-gap: var(--s7); row-gap: var(--s5);
}
.hero__title { grid-area: title; align-self: end; }
.hero__text { grid-area: text; display: grid; gap: var(--s4); align-content: start; }
.hero__media { grid-area: media; position: relative; align-self: end; }
.hero__photo { aspect-ratio: 4 / 5; background: var(--white); }
.hero__photo img { object-position: 50% 20%; }
.hero__caption { display: flex; justify-content: space-between; gap: var(--s2); margin-top: var(--s2); font-size: var(--fs-small); }

.circle-text {
  position: absolute; left: calc(var(--s6) * -1); bottom: var(--s5);
  width: 9.5rem; height: 9.5rem; display: grid; place-items: center;
}
.circle-text svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.circle-text text { font-size: 13.5px; letter-spacing: 3.2px; fill: var(--ink); font-family: var(--sans); font-weight: 500; }
.circle-text a {
  width: 4rem; height: 4rem; border-radius: 50%; background: var(--ink); color: var(--white);
  display: grid; place-items: center; transition: transform 160ms var(--ease-out);
}
.circle-text a:active { transform: scale(.95); }
.circle-text a svg { width: 1.25rem; height: 1.25rem; transform: rotate(90deg); }
@media (prefers-reduced-motion: no-preference) {
  .circle-text svg.ring { animation: spin 22s linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Manifiesto con imagen en línea (el "complex text" de Ashley) */
.manifesto__text { font-size: clamp(1.875rem, 1.1rem + 3vw, 3.75rem); font-weight: 500; line-height: 1.12; letter-spacing: -.03em; max-width: 22ch; }
.manifesto__text .thin { font-weight: 200; }
.pill-img {
  display: inline-block; width: 2.4em; height: .9em; border-radius: 999px; overflow: hidden;
  vertical-align: -.08em; margin-inline: .08em; background: var(--surface);
}
.pill-img img { width: 100%; height: 100%; object-fit: cover; }
.manifesto__cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s5); }
.manifesto__cols > :first-child { grid-column: 1 / span 5; }
.manifesto__cols > :last-child { grid-column: 7 / span 6; display: grid; gap: var(--s3); }

/* Encabezado de sección */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.section-head p { max-width: 36ch; }

/* ---------- Pilares: escena 3D fija (Three.js) ----------
   Sin JavaScript o sin WebGL los capítulos son una lista normal.
   Con .has-3d la escena se fija y los capítulos se alternan a cada lado. */
.stage3d { position: relative; overflow: clip; }
.stage3d__head { padding-top: var(--section); }
.stage3d__head .section-head { margin-bottom: var(--s5); }
.stage3d__canvas, .stage3d__hud { display: none; }
.stage3d__chapters { display: grid; gap: var(--s5); padding-bottom: var(--section); }
.chapter { display: grid; gap: var(--s2); max-width: 36rem; }
.chapter__num { font-size: clamp(3rem, 2.2rem + 2.6vw, 4.75rem); color: #c9b1b5; line-height: .9; }
.chapter__title { font-size: clamp(2rem, 1.3rem + 2vw, 3.25rem); line-height: 1.02; letter-spacing: -.03em; }
.chapter__title a { color: inherit; }
.chapter__title em { display: block; font-family: var(--serif); font-style: italic; font-weight: 300; color: var(--on-dark); letter-spacing: -.02em; }
.chapter__text { color: #e7dfe0; max-width: 42ch; font-size: 1.0625rem; }
.chapter__list { color: var(--on-dark); font-size: .9375rem; font-weight: 500; max-width: 46ch; }
.chapter .link-arrow { justify-self: start; }

.has-3d .stage3d__pin { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
.has-3d .stage3d__pin::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 55% at 50% 48%, rgba(162, 146, 149, .28), rgba(42, 34, 36, 0) 70%);
}
.has-3d .stage3d__canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.has-3d .stage3d__chapters { position: absolute; inset: 0; display: block; padding-bottom: 0; pointer-events: none; }
.has-3d .chapter {
  position: absolute; top: 47%; width: min(32rem, 36vw); translate: 0 -50%;
  visibility: hidden; opacity: 0; pointer-events: auto; will-change: transform, opacity, filter;
}
.has-3d .chapter[data-side="left"] { left: var(--gutter); }
.has-3d .chapter[data-side="right"] { right: var(--gutter); }
.has-3d .stage3d__hud {
  position: absolute; left: 0; right: 0; bottom: var(--s4); display: flex; align-items: center; gap: var(--s3);
  font-size: var(--fs-small); font-weight: 500; color: var(--on-dark); font-variant-numeric: tabular-nums;
}
.stage3d__hud [data-hud-count] { font-family: var(--serif); min-width: 4.5rem; }
.stage3d__track { flex: 1; height: 1px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.stage3d__track i { display: block; height: 100%; background: var(--white); transform: scaleX(0); transform-origin: left; }
.stage3d__hud [data-hud-label] { min-width: 14rem; text-align: right; }
@media (max-height: 960px) { .has-3d .chapter__list { display: none; } }

/* Cortina de transición entre páginas (Ashley) */
.curtain { position: fixed; inset: 0; z-index: 94; background: var(--mauve); transform: translateY(100%); pointer-events: none; }
.from-curtain .curtain { transform: none; }

/* Velo anti-parpadeo: lo retira el JavaScript cuando ya fijó los estados iniciales */
.js.motion [data-reveal], .js.motion [data-hero-part], .js.motion [data-split], .js.motion [data-unveil] { visibility: hidden; }

/* Titulares con SplitText: máscara por línea */
.split-line { overflow: clip; padding-bottom: .06em; margin-bottom: -.06em; }
.js .manifesto__text .split-word { opacity: .18; }
.no-motion .manifesto__text .split-word, .manifesto__text.is-done .split-word { opacity: 1; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Franja de imagen a sangre */
.bleed__statement { font-size: var(--fs-h2); font-weight: 200; letter-spacing: -.03em; line-height: 1.05; max-width: 20ch; margin-bottom: var(--s5); }
.bleed__statement strong { font-weight: 600; }
.bleed__frame { aspect-ratio: 16 / 9; }

/* Trabajo seleccionado */
.works { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s5) var(--s4); }
.work { display: grid; gap: var(--s2); align-content: start; }
.work:nth-child(1) { grid-column: 1 / span 7; }
.work:nth-child(2) { grid-column: 9 / span 4; margin-top: var(--s6); }
.work:nth-child(3) { grid-column: 1 / span 5; }
.work:nth-child(4) { grid-column: 7 / span 6; margin-top: var(--s4); }
.work:nth-child(5) { grid-column: 2 / span 6; }
.work:nth-child(6) { grid-column: 9 / span 4; margin-top: var(--s5); }
.work__open { all: unset; cursor: pointer; display: grid; gap: var(--s2); }
.work__open:focus-visible { outline: 2px solid var(--plum); outline-offset: 6px; }
.work .frame { aspect-ratio: var(--ar, 4 / 5); }
.work .frame img { transition: scale 900ms var(--ease-out); }
.works .work .frame img { scale: 1.12; } /* margen para el parallax */
@media (hover: hover) and (pointer: fine) {
  .work__open:hover .frame img { scale: 1.04; }
  .works .work__open:hover .frame img { scale: 1.16; }
}
.work__meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.work__title { font-size: 1.375rem; font-weight: 600; letter-spacing: -.015em; }
.work__tags { font-size: var(--fs-small); font-weight: 500; color: var(--ink-2); text-align: right; }

/* Directora */
.founder { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s7); align-items: center; }
.founder__photo { aspect-ratio: 4 / 5; background: var(--white); }
.founder__name { margin-bottom: var(--s2); }
.founder__role { font-family: var(--serif); font-style: italic; font-size: var(--fs-lead); color: var(--on-dark); margin-bottom: var(--s5); }
.traits { border-top: 1px solid var(--line-light); margin-bottom: var(--s5); }
.traits div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s3); padding-block: var(--s3); border-bottom: 1px solid var(--line-light); }
.traits dt { font-weight: 600; font-size: 1.125rem; letter-spacing: -.01em; }
.traits dd { margin: 0; color: var(--on-dark); }

/* Método */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); counter-reset: step; }
.step { --line: 1; position: relative; padding-top: var(--s3); display: grid; gap: var(--s2); align-content: start; }
.step::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--ink); transform: scaleX(var(--line)); transform-origin: left; }
.step__n { font-family: var(--serif); font-size: 1.125rem; color: var(--plum); }
.step h3 { font-size: 1.5rem; letter-spacing: -.02em; }

/* Formas de trabajar */
.offers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s3); align-items: stretch; }
.offer { padding: var(--s5) var(--s4); display: grid; gap: var(--s3); align-content: start; background: rgba(255, 255, 255, .28); }
.offer--feature { background: var(--ink); color: var(--white); box-shadow: 0 40px 80px -40px rgba(42, 34, 36, .6); }
.offer--feature .muted { color: var(--on-dark); }
.offer__kind { font-family: var(--serif); font-style: italic; font-size: 1.0625rem; }
.offer h3 { font-size: 1.75rem; letter-spacing: -.02em; }
.offer ul { display: grid; gap: .625rem; font-size: .9375rem; }
.offer li { display: grid; grid-template-columns: 1.25rem 1fr; gap: .5rem; }
.offer li::before { content: ""; width: .5rem; height: 1px; background: currentColor; margin-top: .8em; }
.offer .link-arrow { margin-top: auto; }

/* Trayectoria: marquesina */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding-block: var(--s4); }
.marquee__track { display: flex; width: max-content; gap: var(--s6); }
.marquee__track ul { display: flex; gap: var(--s6); flex-shrink: 0; }
.marquee__track li { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.5rem); font-weight: 200; letter-spacing: -.02em; white-space: nowrap; }
.marquee__track li:nth-child(even) { font-family: var(--serif); font-style: italic; font-weight: 300; }
@media (prefers-reduced-motion: no-preference) {
  .marquee__track { animation: marquee 48s linear infinite; }
  .marquee:hover .marquee__track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track, .marquee__track ul { flex-wrap: wrap; width: auto; }
  .marquee__track ul[aria-hidden] { display: none; }
}
.marquee-js .marquee__track { animation: none; }
@keyframes marquee { to { transform: translateX(calc(-50% - var(--s6) / 2)); } }

/* Cierre */
.closing { text-align: left; }
.closing__title { max-width: 16ch; margin-bottom: var(--s4); }

/* ---------- Pie ---------- */
.site-footer { padding-block: var(--s7) var(--s4); }
.footer__top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); gap: var(--s5); padding-bottom: var(--s5); }
.footer__brand svg { width: 8rem; color: var(--white); margin-bottom: var(--s3); }
.footer__title { font-size: var(--fs-small); color: var(--on-dark); margin-bottom: var(--s2); font-weight: 500; }
.footer__list { display: grid; gap: .5rem; }
.footer__list a { transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .footer__list a:hover { color: var(--mauve); } }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--line-light); font-size: var(--fs-small); color: var(--on-dark); }

/* ==========================================================================
   PÁGINAS INTERIORES
   ========================================================================== */
.page-hero { padding-top: calc(var(--s8) + var(--s4)); padding-bottom: var(--s6); }
.page-hero__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s5); align-items: end; }

/* Servicios */
.service { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
.service__head { grid-column: 1 / span 5; position: sticky; top: calc(var(--s8) + var(--s2)); display: grid; gap: var(--s3); }
.service__num { font-size: clamp(4rem, 3rem + 4vw, 7rem); color: var(--plum); }
.on-deep .service__num { color: var(--white); }
.service__body { grid-column: 7 / span 6; display: grid; gap: var(--s5); }
.service__media { aspect-ratio: var(--ar, 4 / 3); }
.facts { display: grid; gap: 0; border-top: 1px solid var(--line); }
.on-deep .facts { border-color: var(--line-light); }
.facts div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s3); padding-block: var(--s3); border-bottom: 1px solid var(--line); }
.on-deep .facts div { border-color: var(--line-light); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.packshot { background: var(--mauve); display: grid; place-items: center; aspect-ratio: 1; }
.packshot img { width: 82%; height: auto; }

.faq { border-top: 1px solid var(--line); max-width: 56rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  padding-block: var(--s3); font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary span { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: transform 300ms var(--ease-out); }
.faq summary span svg { width: .875rem; height: .875rem; }
.faq details[open] summary span { transform: rotate(45deg); }
.faq details p { padding-bottom: var(--s3); max-width: 62ch; color: var(--ink-2); }

/* Portafolio */
.filters { display: flex; flex-wrap: wrap; gap: var(--s1); margin-bottom: var(--s5); }
.filter {
  min-height: 2.75rem; padding: 0 1.125rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-weight: 500; font-size: .9375rem;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
}
.filter:active { transform: scale(.97); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .filter:hover { border-color: var(--ink); } }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5) var(--s4); }
.gallery-grid .work { grid-column: auto; margin-top: 0; }
.gallery-grid .work:nth-child(3n+2) { transform: translateY(var(--s6)); }
.gallery-grid .work[hidden] { display: none; }
.gallery-grid.is-filtered .work { transform: none; }
.gallery-empty { padding-block: var(--s6); color: var(--ink-2); }

/* Diálogo de proyecto (un único <dialog> reutilizado) */
.case {
  width: min(100%, 72rem); max-width: none; max-height: none; height: 100%;
  margin: 0 0 0 auto; padding: 0; border: 0; background: var(--paper); color: var(--ink);
  overscroll-behavior: contain;
}
.case::backdrop { background: rgba(42, 34, 36, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@media (prefers-reduced-transparency: reduce) { .case::backdrop { backdrop-filter: none; background: rgba(42, 34, 36, .7); } }
.case[open] { animation: case-in 420ms var(--ease-drawer); }
@keyframes case-in { from { transform: translateX(8%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .case[open] { animation: fade 200ms ease; } }
@keyframes fade { from { opacity: 0; } }
.case__inner { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: var(--s5) var(--gutter) var(--s7); }
.case__bar { position: sticky; top: calc(var(--s5) * -1); display: flex; justify-content: flex-end; margin: calc(var(--s5) * -1) calc(var(--gutter) * -1) var(--s3); padding: var(--s2) var(--gutter); background: rgba(251, 248, 248, .9); z-index: 2; }
.case__close { width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid var(--line); background: var(--white); cursor: pointer; display: grid; place-items: center; transition: transform 160ms var(--ease-out); }
.case__close:active { transform: scale(.95); }
.case__close svg { width: 1rem; height: 1rem; }
.case__head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s5); margin-bottom: var(--s6); }
.case__tags { font-size: var(--fs-small); color: var(--ink-2); margin-top: var(--s2); }
.case__text { display: grid; gap: var(--s2); }
.case__credit { font-size: var(--fs-small); color: var(--ink-2); font-style: italic; font-family: var(--serif); }
.case__images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.case__images figure { margin: 0; background: var(--surface); }
.case__images figure.is-wide { grid-column: 1 / -1; }
.case__images img { width: 100%; height: auto; }
.case__next { margin-top: var(--s6); display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }

/* Estudio */
.about-hero__frame { aspect-ratio: 3 / 2; }
.hello { font-family: var(--serif); font-weight: 600; font-size: clamp(3rem, 2rem + 4vw, 5.5rem); color: var(--plum); letter-spacing: -.02em; line-height: 1; margin-bottom: var(--s4); }
.bio { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s7); align-items: start; }
.bio__text { display: grid; gap: var(--s3); }
.timeline { border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: var(--s3); padding-block: var(--s2); border-bottom: 1px solid var(--line); }
.timeline .year { font-family: var(--serif); color: var(--plum); font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s7); }
.certs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.certs figure { margin: 0; display: grid; gap: var(--s2); }
.certs .frame { aspect-ratio: 4 / 3; }
.certs figcaption { font-size: var(--fs-small); color: var(--ink-2); }

/* Contacto */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s7); align-items: start; }
.channels { display: grid; gap: 0; border-top: 1px solid var(--line); margin-top: var(--s5); }
.channels a { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding-block: var(--s3); border-bottom: 1px solid var(--line); }
.channels small { display: block; color: var(--ink-2); font-size: var(--fs-small); }
.channels strong { font-weight: 600; font-size: 1.125rem; }
.channels svg { width: 1rem; height: 1rem; flex: none; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s3); background: var(--white); padding: var(--s5); box-shadow: 0 30px 70px -40px rgba(42, 34, 36, .35); }
.field { display: grid; gap: .5rem; }
.field--full { grid-column: 1 / -1; }
.field label, .field legend { font-weight: 600; font-size: .9375rem; }
.field .hint { font-size: var(--fs-small); color: var(--ink-2); }
.input {
  width: 100%; color: var(--ink); min-height: 3.25rem; padding: .75rem 1rem; border: 1px solid rgba(42, 34, 36, .22);
  border-radius: 12px; background-color: var(--paper); transition: border-color 200ms ease, box-shadow 200ms ease;
}
textarea.input { min-height: 8rem; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a2224' stroke-width='1.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; background-size: 1rem; padding-right: 2.75rem; }
.input:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px rgba(140, 97, 99, .18); }
.input[aria-invalid="true"] { border-color: #a3343a; }
.error { color: #a3343a; font-size: var(--fs-small); min-height: 1.25em; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s1); border: 0; padding: 0; margin: 0; }
.chips legend { margin-bottom: .5rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; border-radius: 999px; border: 1px solid rgba(42, 34, 36, .22); cursor: pointer; font-size: .9375rem; transition: background-color 200ms ease, color 200ms ease; }
.chip input:checked + span { background: var(--ink); color: var(--white); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--plum); outline-offset: 3px; }
.form__foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s2); }
.form__status { font-size: var(--fs-small); color: var(--ink-2); }

.notfound { min-height: 100svh; display: grid; align-content: center; }

/* ==========================================================================
   NIVEL 1 · ESCRITORIO grande
   ========================================================================== */
@media (min-width: 1400px) {
  .hero__grid { gap: var(--s8); }
}

/* ==========================================================================
   NIVEL 2 · TABLET (768 – 991px) · y todo lo menor a 992px
   Se activa el dock inferior; el mismo <nav> cambia de lugar.
   ========================================================================== */
@media (max-width: 991.98px) {
  :root { --dock-h: calc(4.75rem + env(safe-area-inset-bottom)); }

  .site-nav {
    position: fixed; left: var(--s2); right: var(--s2);
    bottom: calc(var(--s1) + env(safe-area-inset-bottom)); z-index: 55;
    border-radius: 24px; padding: .375rem;
    background: rgba(255, 255, 255, .7);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    backdrop-filter: blur(40px) saturate(180%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(0, 0, 0, .06), 0 16px 40px -16px rgba(42, 34, 36, .35);
  }
  @media (prefers-reduced-transparency: reduce) { .site-nav { background: var(--white); backdrop-filter: none; } }
  .site-nav ul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .25rem; }
  .site-nav li { display: flex; }
  .site-nav a {
    flex: 1; flex-direction: column; justify-content: center; gap: .125rem;
    min-height: 3.5rem; border-radius: 18px; font-size: .6875rem; font-weight: 600; letter-spacing: .01em;
    color: var(--ink-2); transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
  }
  .site-nav a:active { transform: scale(.96); }
  .site-nav a::after { display: none; }
  .site-nav svg { display: block; }
  .site-nav a[aria-current="page"] { color: var(--ink); background: rgba(162, 146, 149, .22); }
  .site-nav .nav-contact { display: flex; }
  .site-nav .nav-contact a { background: var(--ink); color: var(--white); }
  .site-nav .nav-contact a[aria-current="page"] { background: var(--plum); color: var(--white); }
  .header-cta { display: none; }

  .progress { display: none; }

  .hero { padding-top: calc(var(--s7) + var(--s3)); }
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "title title" "text media"; grid-template-rows: auto auto; column-gap: var(--s4); }
  .hero__text { align-self: center; }
  .circle-text { left: calc(var(--s5) * -1); bottom: var(--s6); width: 8rem; height: 8rem; }
  .circle-text text { font-size: 12.5px; }

  .manifesto__cols { grid-template-columns: 1fr 1fr; gap: var(--s4); }
  .manifesto__cols > :first-child, .manifesto__cols > :last-child { grid-column: auto; }

  .section-head { flex-direction: column; align-items: start; }
  .has-3d .chapter { width: min(24rem, 40vw); }
  .has-3d .chapter__title { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
  .has-3d .stage3d__hud { bottom: calc(var(--dock-h) + var(--s2)); }
  .stage3d__hud [data-hud-label] { min-width: 0; }

  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s3); }
  .work:nth-child(n) { grid-column: auto; margin-top: 0; }
  .work:nth-child(even) { margin-top: var(--s4); }

  .founder { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--s5); align-items: start; }
  .traits div { grid-template-columns: 1fr; gap: .25rem; }

  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s5); }
  .offers { grid-template-columns: 1fr; }
  .offer--feature { order: -1; }

  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }

  .page-hero { padding-top: calc(var(--s7) + var(--s3)); }
  .page-hero__grid { grid-template-columns: 1fr; }
  .service__head { grid-column: 1 / -1; position: static; }
  .service__body { grid-column: 1 / -1; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid .work:nth-child(3n+2) { transform: none; }
  .gallery-grid .work:nth-child(even) { transform: translateY(var(--s5)); margin-top: 0; }
  .gallery-grid.is-filtered .work { transform: none; }
  .bio, .contact, .two-col { grid-template-columns: 1fr; gap: var(--s6); }
  .certs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
  .case__head { grid-template-columns: 1fr; gap: var(--s3); }
  .case { width: 100%; }
}

/* ==========================================================================
   NIVEL 3 · TELÉFONO (< 768px) · columna única, zona del pulgar
   ========================================================================== */
@media (max-width: 767.98px) {
  body { font-size: 1rem; }
  .brand svg { width: 4.5rem; }
  .brand__sub { display: none; }

  .hero { padding-top: calc(var(--s6) + var(--s3)); padding-bottom: var(--s5); }
  .hero__grid { grid-template-columns: 1fr; grid-template-areas: "title" "text" "media"; row-gap: var(--s4); }
  .hero__media { max-width: 26rem; }
  .circle-text { left: auto; right: var(--s2); bottom: var(--s6); width: 7.5rem; height: 7.5rem; }
  .actions { gap: var(--s2) var(--s3); }
  .actions .btn { width: 100%; justify-content: space-between; }

  .manifesto__cols { grid-template-columns: 1fr; margin-top: var(--s5); }
  .pill-img { width: 2em; }

  /* Teléfono arriba, capítulo abajo en la zona del pulgar */
  .has-3d .chapter, .has-3d .chapter[data-side] {
    top: auto; left: var(--gutter); right: var(--gutter); width: auto; translate: none;
    bottom: calc(var(--dock-h) + 3.25rem); gap: var(--s1);
  }
  .has-3d .chapter__num { font-size: 2.25rem; }
  .has-3d .chapter__title { font-size: 1.75rem; }
  .has-3d .chapter__list { display: none; }
  .has-3d .chapter__text { font-size: .9375rem; }
  .has-3d .stage3d__pin::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 58%; pointer-events: none;
    background: linear-gradient(rgba(42, 34, 36, 0), rgba(42, 34, 36, .92) 38%);
  }
  .has-3d .stage3d__chapters, .has-3d .stage3d__hud { z-index: 1; }
  .stage3d__hud [data-hud-label] { display: none; }

  .bleed__statement { margin-bottom: var(--s4); }
  .bleed__frame { aspect-ratio: 4 / 3; }

  .works { grid-template-columns: 1fr; gap: var(--s5); }
  .work:nth-child(even) { margin-top: 0; }
  .work__meta { flex-direction: column; gap: .125rem; }
  .work__tags { text-align: left; }

  .founder { grid-template-columns: 1fr; gap: var(--s5); }
  .founder__photo { max-width: 26rem; }

  .steps { grid-template-columns: 1fr; gap: var(--s4); }
  .offer { padding: var(--s4) var(--s3); }

  .footer__top { grid-template-columns: 1fr; gap: var(--s4); padding-bottom: var(--s5); }
  .site-footer { padding-top: var(--s6); }

  .service { gap: var(--s3); }
  .facts div { grid-template-columns: 1fr; gap: .25rem; }
  .gallery-grid { grid-template-columns: 1fr; gap: var(--s5); }
  .gallery-grid .work:nth-child(even) { transform: none; }
  .certs { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 3.5rem minmax(0, 1fr); }
  .case__images { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; padding: var(--s4) var(--s3); }
  .form__foot .btn { width: 100%; justify-content: space-between; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .filter { flex: none; }
}

/* Teléfonos estrechos (< 576px) */
@media (max-width: 575.98px) {
  .site-nav { left: var(--s1); right: var(--s1); }
  .site-nav a { font-size: .625rem; }
}

/* Campo trampa anti-spam: invisible para personas */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status a { color: var(--plum); font-weight: 600; }
