/* ============================================================
   Despachos IGH — Derecho de Familia · Cáceres
   Paleta cálida (off-white + carboncillo) · Poppins + DM Mono
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 92px; -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

/* ── Tokens ── */
:root {
  --bg:        #f3f1ec;
  --bg-2:      #ebe8e1;
  --ink:       #1b1917;
  --ink-soft:  #4c4740;
  --muted:     #938c81;
  --line:      #dcd7cd;
  --dark:      #2a2621;
  --dark-2:    #171411;
  --on-dark:   #f3f1ec;
  --on-dark-soft: #b3a99d;
  --line-dark: rgba(243,241,236,0.14);
  --accent:    #41513c;
  --brand:     #1ab987;

  --font: 'Poppins', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SFMono-Regular', monospace;
  --num: 'Space Grotesk', system-ui, sans-serif;

  --step-label: clamp(0.7rem, 0.66rem + 0.12vw, 0.78rem);
  --step-sm:    0.875rem;
  --step-body:  clamp(1rem, 0.95rem + 0.2vw, 1.12rem);
  --step-lead:  clamp(1.12rem, 1rem + 0.5vw, 1.4rem);
  --step-h3:    clamp(1.3rem, 1.05rem + 1vw, 1.9rem);
  --step-h2:    clamp(2.1rem, 1.3rem + 3vw, 3.9rem);
  --step-display: clamp(2.7rem, 1.4rem + 5.4vw, 6rem);

  --wrap: 1280px;
  --side: clamp(20px, 5vw, 80px);
  --radius: 14px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --photo: grayscale(0.82) sepia(0.14) contrast(1.03) brightness(1.02);
}

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Layout helpers ── */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--side); }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--step-label);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.4rem;
}
.eyebrow--light { color: var(--on-dark-soft); }

.section-title {
  font-size: var(--step-h2);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 16ch;
  text-wrap: balance;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--step-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  transition: transform .5s var(--ease), background-color .35s var(--ease), color .35s var(--ease), opacity .35s var(--ease);
}
.btn__arrow { display: inline-block; transition: transform .45s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn__label { display: inline-flex; align-items: center; gap: 0.55em; }

.btn--solid {
  background: var(--ink);
  color: var(--on-dark);
  padding: 1.05em 2.3em;
  font-size: 0.82rem;
  white-space: nowrap;
  border-radius: 100px;
}
.btn--solid:hover { transform: translateY(-2px); }

.btn--light {
  background: var(--bg);
  color: var(--ink);
  padding: 1.05em 2.3em;
  font-size: 0.82rem;
  white-space: nowrap;
  border-radius: 100px;
}
.btn--light:hover { transform: translateY(-2px); }

.btn--text {
  position: relative;
  padding: 0.4em 0;
  color: var(--ink);
}
.btn--text::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(1); transform-origin: right; transition: transform .5s var(--ease);
}
.btn--text:hover::after { transform: scaleX(0); transform-origin: left; }


/* ============================================================
   Intro
   ============================================================ */
.intro {
  position: fixed; inset: 0; z-index: 200;
  background: var(--dark-2); color: var(--on-dark);
  display: grid; place-items: center;
  pointer-events: none;
}
.intro__inner {
  display: flex; gap: 0.35em;
  font-size: clamp(1.8rem, 5vw, 3.4rem); font-weight: 600; letter-spacing: -0.03em;
  overflow: hidden;
}
.intro__word { display: inline-block; transform: translateY(110%); }
.no-js .intro, .intro.is-hidden { display: none; }

/* ============================================================
   Nav
   ============================================================ */
.nav {
  --nx: 50%;
  --ny: 50%;
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease), backdrop-filter .4s var(--ease);
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    260px circle at var(--nx) var(--ny),
    color-mix(in srgb, var(--ink) 9%, transparent),
    transparent 72%
  );
  transition: opacity .18s cubic-bezier(0.23, 1, 0.32, 1);
}
.nav.is-hot::before { opacity: 1; }
.nav__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding: clamp(12px, 1.6vw, 18px) clamp(16px, 2.4vw, 36px);
  display: grid;
  /* Columnas laterales iguales: el menú queda en el centro real del viewport */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(0.75rem, 1.6vw, 1.75rem);
  transition: padding .4s var(--ease);
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}
.nav.is-scrolled .nav__inner { padding-block: clamp(10px, 1.4vw, 14px); }
.nav.is-hidden { transform: none; }

/* Nav legible sobre hero oscuro (solo al inicio, sin scroll) */
body.hero-oscuro .nav:not(.is-scrolled) {
  color: var(--on-dark);
}
body.hero-oscuro .nav:not(.is-scrolled)::before {
  background: radial-gradient(
    260px circle at var(--nx) var(--ny),
    color-mix(in srgb, var(--on-dark) 14%, transparent),
    transparent 72%
  );
}
body.hero-oscuro .nav:not(.is-scrolled) .brand__sub,
body.hero-oscuro .nav:not(.is-scrolled) .nav__links a { color: var(--on-dark-soft); }
body.hero-oscuro .nav:not(.is-scrolled) .nav__links a:hover { color: var(--on-dark); }
body.hero-oscuro .nav:not(.is-scrolled) .nav__links a::after { background: var(--on-dark); }
body.hero-oscuro .nav:not(.is-scrolled) .burger span { background: var(--on-dark); }
body.hero-oscuro .nav:not(.is-scrolled) .btn--solid {
  background: var(--on-dark); color: var(--ink);
}
body.hero-oscuro .nav:not(.is-scrolled) .brand__name { color: var(--on-dark); }
body.hero-oscuro .nav:not(.is-scrolled) .brand__sub { color: var(--on-dark-soft); }

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1;
  grid-column: 1;
  justify-self: start;
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
  transition: transform .18s cubic-bezier(0.23, 1, 0.32, 1);
}
.brand__logo {
  display: block;
  height: clamp(32px, 3.2vw, 40px);
  width: auto;
  flex: 0 0 auto;
}
.brand__lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.32rem;
  min-width: 0;
  padding-left: 0.75rem;
  border-left: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
}
body.hero-oscuro .nav:not(.is-scrolled) .brand__lockup {
  border-left-color: color-mix(in srgb, var(--on-dark) 22%, transparent);
}
.brand__name {
  font-weight: 500;
  font-size: clamp(0.9rem, 0.95vw, 1.05rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.brand__sub {
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.15;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 2;
  justify-self: center;
  gap: clamp(1.1rem, 2vw, 2.1rem);
  white-space: nowrap;
}
.nav__links a {
  font-size: clamp(0.82rem, 0.9vw, 0.9rem);
  font-weight: 400;
  color: var(--ink-soft);
  position: relative;
  padding: 0.35em 0;
  transition: color .18s cubic-bezier(0.23, 1, 0.32, 1), transform .18s cubic-bezier(0.23, 1, 0.32, 1);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: center;
  transition: transform .18s cubic-bezier(0.23, 1, 0.32, 1);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }

.nav__cta {
  flex-shrink: 0;
  padding: 0.85em 1.55em;
  font-size: 0.82rem;
}
.nav__actions {
  display: flex;
  align-items: center;
  grid-column: 3;
  justify-self: end;
  gap: 0.65rem;
}
.nav__inner > .nav__cta {
  grid-column: 3;
  justify-self: end;
}

@media (max-width: 1100px) {
  .nav__links { gap: 1rem; }
  .brand__name { font-size: 0.9rem; }
  .brand__logo { height: 32px; }
}

@media (hover: hover) and (pointer: fine) {
  .nav.is-hot .brand { transform: translateY(-1px); }
  .nav__links a:hover { transform: translateY(-1px); }
  .nav__cta {
    transition: transform .18s cubic-bezier(0.23, 1, 0.32, 1);
  }
  .nav.is-hot .nav__cta:hover { transform: translateY(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .nav::before,
  .nav.is-hot .brand,
  .nav__links a,
  .nav__links a::after,
  .nav__cta {
    transition: none;
  }
  .nav.is-hot .brand,
  .nav__links a:hover,
  .nav.is-hot .nav__cta:hover {
    transform: none;
  }
}

.burger { display: none; width: 44px; height: 44px; position: relative; }
.burger span {
  position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--ink);
  transition: transform .4s var(--ease), opacity .3s var(--ease);
}
.burger span:nth-child(1) { top: 18px; }
.burger span:nth-child(2) { bottom: 18px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* Mobile menu */
.mobile {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  padding: calc(96px + env(safe-area-inset-top, 0px)) var(--side) calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; justify-content: safe center; gap: 1.4rem;
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(-100%); transition: transform .55s var(--ease);
  visibility: hidden;
}
.mobile.is-open { transform: translateY(0); visibility: visible; }
.mobile__links { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile__links a {
  font-size: clamp(2rem, 9vw, 3rem); font-weight: 500; letter-spacing: -0.03em;
  padding: 0.2em 0;
}
.mobile__cta { align-self: flex-start; margin-top: 1rem; }

/* ============================================================
   CTA flotante persistente
   ============================================================ */
.float-cta {
  position: fixed;
  z-index: 95;
  right: max(16px, var(--side));
  bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 18px));
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.float-cta.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.float-cta[hidden] { display: none !important; }
.float-cta__call {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  color: var(--on-dark);
  background: color-mix(in srgb, var(--dark-2) 92%, transparent);
  border: 1px solid var(--line-dark);
  box-shadow: 0 16px 40px rgba(23, 20, 17, 0.28);
  backdrop-filter: blur(14px) saturate(1.1);
  transition: background-color .3s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
}
.float-cta__call svg { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) {
@media (hover: hover) and (pointer: fine) {
  .float-cta__call:hover {
    transform: scale(1.06);
    box-shadow: 0 18px 44px rgba(23, 20, 17, 0.34);
  }
}
}

@media (max-width: 640px) {
  .float-cta {
    right: 14px;
    bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 14px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .float-cta { transition: none; }
}

/* ============================================================
   Hero · corredor de imágenes
   ============================================================ */
.stage {
  --fondo: var(--bg);
  --texto: var(--ink);
  --suave: color-mix(in srgb, var(--ink) 64%, transparent);
  --linea: color-mix(in srgb, var(--ink) 18%, transparent);
  --acento: var(--accent);
  --sobre-acento: var(--on-dark);
  --e-salida: var(--ease);
  --e-suave: var(--ease-io);
  --gutter: var(--side);
  position: relative;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  background: var(--fondo);
  color: var(--texto);
  transition: background-color .6s var(--e-suave), color .6s var(--e-suave);
}
.stage[data-tema="oscuro"] {
  --fondo: var(--dark-2);
  --texto: var(--on-dark);
  --suave: color-mix(in srgb, var(--on-dark) 66%, transparent);
  --linea: var(--line-dark);
  --sobre-acento: var(--on-dark);
}

.saltar {
  position: absolute;
  left: var(--side);
  top: -60px;
  z-index: 110;
  background: var(--accent);
  color: var(--on-dark);
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}
.saltar:focus { top: 12px; }

.sr {
  position: absolute;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; list-style: none;
}

.lanes { position: absolute; inset: 0; will-change: transform; }

.card {
  position: absolute; left: 50%; top: 50%;
  margin: 0; overflow: hidden; border-radius: 8px;
  background: var(--dark);
  outline: 1px solid color-mix(in srgb, var(--texto) 16%, transparent);
  outline-offset: -1px;
  will-change: transform, opacity;
  backface-visibility: hidden;
  opacity: 0;
}
.card picture, .card img { display: block; width: 100%; height: 100%; }
.card img {
  object-fit: cover;
  filter: grayscale(1) contrast(1.14) brightness(1.06);
  transition: filter .45s var(--e-suave);
  pointer-events: none;
}
.card .vel {
  position: absolute; inset: 0;
  background: var(--fondo); opacity: .7; pointer-events: none;
}
.card::after {
  content: ""; position: absolute; inset: 0;
  background: var(--fondo); opacity: 0;
  transition: opacity .45s var(--e-suave); pointer-events: none;
}
.velo {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(
    ellipse 42% 38% at 50% 48%,
    color-mix(in srgb, var(--fondo) 78%, transparent) 0,
    color-mix(in srgb, var(--fondo) 36%, transparent) 55%,
    transparent 100%
  );
}

.hud {
  position: absolute; right: 0; bottom: 0; z-index: 5;
  height: 84px; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 var(--gutter); pointer-events: none;
  opacity: 0; transition: opacity 1s var(--e-suave) .9s;
}
.hud > * { pointer-events: auto; }
body.listo .hud { opacity: 1; }

.centro {
  position: absolute; inset: 0; z-index: 4;
  display: grid; place-content: center; justify-items: center;
  text-align: center;
  padding: 100px var(--gutter) 96px;
  pointer-events: none;
}
.stage h1#titulo {
  margin: 0;
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(2.75rem, 6.8vw, 5.75rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-wrap: balance;
  max-width: 14ch;
}
.stage h1#titulo .l {
  display: block; overflow: hidden;
  padding: .06em .12em .1em; margin: -.06em -.12em -.1em;
}
.stage h1#titulo .l > span { display: inline-block; transform: translateY(112%); }
.stage h1#titulo .hl {
  position: relative; display: inline-block;
  color: var(--sobre-acento);
  padding: 0 .14em; margin: 0 .02em 0 -.14em;
}
.stage h1#titulo .hl::before {
  content: ""; position: absolute; inset: .08em 0 .06em;
  background: var(--acento); border-radius: .06em;
  transform: scaleX(0); transform-origin: left; z-index: -1;
}
.stage .sub {
  margin: clamp(18px, 2.4vw, 28px) 0 0;
  max-width: 42ch;
  font-size: clamp(0.95rem, 1.05vw, 1.125rem);
  line-height: 1.5;
  font-weight: 400;
  color: var(--suave);
  text-wrap: pretty;
  opacity: 0; transform: translateY(14px);
}
.stage .cta {
  --mx: 50%; --my: 50%;
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  overflow: hidden; isolation: isolate;
  margin-top: clamp(20px, 2.4vw, 30px);
  padding: 15px 22px 15px 24px; border-radius: 999px;
  border: 1px solid var(--texto);
  font: 500 0.9rem var(--font); letter-spacing: -.01em;
  text-decoration: none; color: inherit;
  pointer-events: auto;
  opacity: 0; transform: translateY(14px);
  transition: color .45s var(--e-salida), border-color .45s var(--e-salida);
  will-change: transform;
}
.stage .cta::before {
  content: ""; position: absolute; z-index: -1;
  left: var(--mx); top: var(--my);
  width: 420px; height: 420px; margin: -210px 0 0 -210px;
  border-radius: 50%; background: var(--acento);
  transform: scale(0); transition: transform .6s var(--e-salida);
}
.stage .cta:hover, .stage .cta:focus-visible {
  color: var(--sobre-acento); border-color: var(--acento);
}
.stage .cta:hover::before, .stage .cta:focus-visible::before { transform: scale(1); }
.stage .cta:active { transform: scale(0.97); }
.stage .cta svg { width: 18px; height: 18px; transition: transform .5s var(--e-salida); }
.stage .cta:hover svg { transform: translateX(4px); }

.btn-stage {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--linea);
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--fondo) 72%, transparent);
  backdrop-filter: blur(8px);
  color: inherit; cursor: pointer; padding: 0;
  transition: background-color .3s, border-color .3s, transform .5s var(--e-salida);
}
.btn-stage:hover { border-color: var(--texto); transform: scale(1.08); }
.btn-stage:active { transform: scale(0.97); }
.btn-stage svg { width: 14px; height: 14px; fill: currentColor; }
.btn-stage .i-play { display: none; }
.btn-stage[aria-pressed="true"] .i-play { display: block; }
.btn-stage[aria-pressed="true"] .i-pause { display: none; }

body.listo .stage h1#titulo .l > span {
  transform: none; transition: transform 1.15s var(--e-salida);
}
body.listo .stage h1#titulo .l:nth-child(2) > span { transition-delay: .09s; }
body.listo .stage h1#titulo .hl::before {
  transform: scaleX(1); transition: transform .9s var(--e-salida) .55s;
}
body.listo .stage .sub {
  opacity: 1; transform: none;
  transition: opacity .9s var(--e-salida) .6s, transform .9s var(--e-salida) .6s;
}
body.listo .stage .cta {
  opacity: 1; transform: none;
  transition: opacity .9s var(--e-salida) .75s, transform .9s var(--e-salida) .75s,
    color .45s var(--e-salida), border-color .45s var(--e-salida);
}

@media (max-width: 760px) {
  .hud { height: 76px; }
  /* Hero móvil: título arriba, texto separado y CTA anclado abajo
     (a la altura del botón de pausa, un pelín por encima) */
  .centro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: clamp(96px, 16vh, 150px);
    padding-bottom: 104px;
  }
  .stage .sub { max-width: 34ch; margin-top: clamp(22px, 6vw, 34px); }
  .stage .cta {
    margin-top: auto;
    background: color-mix(in srgb, var(--fondo) 66%, transparent);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
  }
}
@media (max-height: 560px) { .stage .sub { display: none; } }
@media (max-aspect-ratio: 9/10) {
  .stage h1#titulo { font-size: clamp(2.4rem, 11vw, 4.2rem); }
}

@media (prefers-reduced-motion: reduce) {
  .stage h1#titulo .l > span { transform: none; }
  .stage h1#titulo .hl::before { transform: scaleX(1); }
  .stage .sub, .stage .cta, .hud { opacity: 1; transform: none; }
}

/* ============================================================
   Marquee
   ============================================================ */
.marquee {
  background: var(--dark-2); color: var(--on-dark);
  padding: 20px 0; overflow: hidden; white-space: nowrap;
  border-block: 1px solid var(--line-dark);
}
.marquee__track { display: inline-flex; align-items: center; gap: 2.2rem; will-change: transform; }
.marquee__track span {
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.14em;
  text-transform: uppercase;
}
.marquee__dot { color: var(--accent); filter: brightness(1.7); }

/* ============================================================
   El despacho · libro de tres páginas (dark)
   ============================================================ */
.despacho {
  --book-ease: cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  height: 320vh;
  background: var(--dark);
  color: var(--on-dark);
}
.despacho__pin {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.despacho__frame {
  width: 100%;
  display: grid;
  gap: clamp(16px, 2.4vh, 28px);
  padding-block: clamp(72px, 8vh, 96px) clamp(20px, 3vh, 32px);
}
.despacho__head {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
}
.despacho__title {
  margin: 0;
  font-size: clamp(1.85rem, 3.8vw, 3rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
  max-width: 16ch;
}
.despacho__lede {
  margin: 0;
  max-width: 42ch;
  color: var(--on-dark-soft);
  font-weight: 300;
  font-size: var(--step-body);
  line-height: 1.55;
  text-wrap: pretty;
}
.despacho :focus-visible { outline-color: var(--on-dark); }

/* Libro */
.book {
  display: grid;
  gap: 1.25rem;
  justify-items: center;
}
.book__stage {
  position: relative;
  width: min(880px, 100%);
  height: min(52vh, 480px);
  perspective: 2200px;
  transform-style: preserve-3d;
}
.book__spine {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 10px;
  background: color-mix(in srgb, var(--dark-2) 70%, #000);
  border-radius: 4px 0 0 4px;
  z-index: 10;
  box-shadow: 2px 0 12px color-mix(in srgb, #000 35%, transparent);
  pointer-events: none;
}
.book__page {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
  backface-visibility: hidden;
}
.book__page[data-book-page="0"] { z-index: 3; }
.book__page[data-book-page="1"] { z-index: 2; }
.book__page[data-book-page="2"] { z-index: 1; }
.book__face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  background: #201c18;
  border-radius: 0 var(--radius) var(--radius) 0;
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow: 8px 12px 28px color-mix(in srgb, #000 28%, transparent);
}
.book__media {
  margin: 0;
  position: relative;
  min-height: 0;
  background: #0e0c0a;
}
.book__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: var(--photo);
  display: block;
}
.book__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: clamp(22px, 3.5vw, 40px);
  background: #241f1a;
}
.book__kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--on-dark) 55%, transparent);
}
.book__heading {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}
.book__text {
  margin: 0;
  max-width: 32ch;
  color: var(--on-dark-soft);
  font-weight: 300;
  font-size: var(--step-body);
  line-height: 1.55;
  text-wrap: pretty;
}

.book__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  justify-content: center;
}
.book__dot {
  font-size: var(--step-sm);
  font-weight: 500;
  color: color-mix(in srgb, var(--on-dark) 40%, transparent);
  padding: 0.25em 0;
  cursor: pointer;
  transition: color .35s var(--book-ease), transform .15s var(--book-ease);
}
.book__dot.is-on,
.book__dot[aria-current="true"] { color: var(--on-dark); }
.book__dot:hover { color: var(--on-dark); }
.book__dot:active { transform: scale(0.97); }

/* Fallback: móvil / reduced-motion / sin JS → las tres páginas en el flujo.
   La cara no puede seguir en position:absolute: el escenario colapsa a 0
   y overflow:hidden recorta Experiencia, Cercanía y el texto de cada página. */
.despacho.is-static {
  height: auto;
  padding: clamp(80px, 12vw, 140px) 0;
}
.despacho.is-static .despacho__pin {
  position: static;
  height: auto;
  min-height: 0;
  overflow: visible;
}
.despacho.is-static .despacho__frame {
  padding-block: 0;
  gap: clamp(28px, 5vw, 48px);
}
.despacho.is-static .despacho__head {
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}
.despacho.is-static .despacho__title { max-width: 18ch; }
.despacho.is-static .book__stage {
  aspect-ratio: auto;
  height: auto;
  perspective: none;
  transform-style: flat;
  display: grid;
  gap: clamp(1.15rem, 3vw, 1.75rem);
}
.despacho.is-static .book__spine { display: none; }
.despacho.is-static .book__page {
  position: relative;
  inset: auto;
  height: auto;
  transform: none !important;
  opacity: 1 !important;
  z-index: auto !important;
  backface-visibility: visible;
  transform-style: flat;
}
.despacho.is-static .book__face {
  position: relative;
  inset: auto;
  height: auto;
  min-height: 0;
  border-radius: var(--radius);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  backface-visibility: visible;
  transform-style: flat;
}
.despacho.is-static .book__media { min-height: 220px; aspect-ratio: 4 / 3; }
.despacho.is-static .book__copy { min-width: 0; }
.despacho.is-static .book__nav { display: none; }

@media (max-width: 900px) {
  .despacho {
    height: auto;
    padding: clamp(80px, 12vw, 140px) 0;
  }
  .despacho__pin {
    position: static;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .despacho__frame { padding-block: 0; gap: clamp(28px, 5vw, 48px); }
  .despacho__head { grid-template-columns: 1fr; gap: 1rem; align-items: start; }
  .despacho__title { max-width: 18ch; }
  .book__stage {
    height: auto;
    perspective: none;
    transform-style: flat;
    display: grid;
    gap: clamp(1.15rem, 3vw, 1.75rem);
  }
  .book__spine { display: none; }
  .book__page {
    position: relative;
    inset: auto;
    height: auto;
    transform: none !important;
    opacity: 1 !important;
    z-index: auto !important;
    backface-visibility: visible;
    transform-style: flat;
  }
  .book__face {
    position: relative;
    inset: auto;
    height: auto;
    min-height: 0;
    border-radius: var(--radius);
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    backface-visibility: visible;
    transform-style: flat;
  }
  .book__media { min-height: 220px; aspect-ratio: 4 / 3; }
  .book__copy { min-width: 0; padding-right: 4.2rem; }
  .book__nav { display: none; }
}

@media (max-width: 720px) {
  .despacho .book__face,
  .despacho.is-static .book__face { grid-template-columns: 1fr; }
  .despacho .book__media,
  .despacho.is-static .book__media { aspect-ratio: 16 / 10; min-height: 0; }
  /* Retrato de Isabel (Experiencia): encuadre más alto y centrado en la cara */
  .despacho .book__page[data-book-page="1"] .book__media,
  .despacho.is-static .book__page[data-book-page="1"] .book__media { aspect-ratio: 4 / 5; }
  .despacho .book__page[data-book-page="1"] .book__media img,
  .despacho.is-static .book__page[data-book-page="1"] .book__media img { object-position: center 20%; }
}

@media (prefers-reduced-motion: reduce) {
  .despacho { height: auto; padding: clamp(80px, 12vw, 140px) 0; }
  .despacho__pin { position: static; height: auto; min-height: 0; overflow: visible; }
  .despacho__frame { padding-block: 0; }
  .book__stage { height: auto; perspective: none; transform-style: flat; display: grid; gap: 1.5rem; }
  .book__spine { display: none; }
  .book__page, .book__face {
    position: relative; inset: auto; height: auto; min-height: 0;
    transform: none !important; opacity: 1 !important;
    backface-visibility: visible; transform-style: flat;
  }
  .book__media { min-height: 220px; }
  .book__nav { display: none; }
}

/* ============================================================
   Áreas · timeline horizontal con scroll
   ============================================================ */
.areas { position: relative; height: 380vh; background: var(--bg); }
.areas__pin { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; align-items: center; }
.areas__rail {
  display: flex; align-items: center; gap: 6vw;
  padding-left: var(--side); padding-right: clamp(340px, 42vw, 620px);
  will-change: transform;
}
.rail__intro { flex: 0 0 auto; width: 30vw; max-width: 460px; }
.rail__title { font-size: var(--step-h2); font-weight: 500; line-height: 1.02; letter-spacing: -0.03em; margin-bottom: 1.4rem; text-wrap: balance; }
.rail__lead { color: var(--ink-soft); font-weight: 300; max-width: 40ch; }
.rail__hint { display: inline-flex; align-items: center; gap: .5em; margin-top: 2.2rem; font-family: var(--mono); font-size: var(--step-label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rail__hint span { animation: hintmove 1.8s var(--ease) infinite; }
@keyframes hintmove { 0%,100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

.rail__media { flex: 0 0 auto; width: 22vw; height: 62vh; overflow: hidden; border-radius: var(--radius); background: var(--bg-2); }
.rail__media img { width: 100%; height: 100%; object-fit: cover; filter: var(--photo); }

.rail__axis { position: relative; flex: 0 0 auto; display: flex; align-items: stretch; gap: 3vw; height: 62vh; }
.axis__line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.axis__fill { display: block; height: 100%; width: 0%; background: var(--ink); }

.tl { position: relative; flex: 0 0 auto; width: 26vw; max-width: 420px; }
.tl__dot { position: absolute; left: 0; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); transform: translate(-50%,-50%) scale(1); z-index: 2; }
.tl__stem { position: absolute; left: 0; width: 1px; background: var(--ink); }
.tl--top .tl__stem { bottom: 50%; height: 40%; transform-origin: bottom; }
.tl--bottom .tl__stem { top: 50%; height: 40%; transform-origin: top; }
.tl__body { position: absolute; left: 0; width: 100%; padding-left: 1.8vw; }
.tl--top .tl__body { bottom: 52%; }
.tl--bottom .tl__body { top: 52%; }
.tl__n {
  display: block;
  font-family: var(--num);
  font-weight: 300;
  font-size: 1.05rem;
  color: var(--muted);
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  margin-bottom: .9rem;
}
.tl__t { font-size: clamp(1.3rem, 2.1vw, 2rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; overflow: hidden; padding-bottom: .14em; margin-bottom: .7rem; }
.tl__t > span { display: inline-block; }
.tl__d { color: var(--ink-soft); font-weight: 300; font-size: var(--step-body); max-width: 34ch; }

.js .tl__dot { transform: translate(-50%,-50%) scale(0); }
.js .tl__stem { transform: scaleY(0); }
.js .tl__t > span { transform: translateY(115%); }
.js .tl__n, .js .tl__d { opacity: 0; }

/* fallback estático (móvil / movimiento reducido) */
.areas.is-static { height: auto; }
.areas.is-static .areas__pin { position: static; height: auto; overflow: visible; display: block; }
.areas.is-static .areas__rail { flex-direction: column; align-items: stretch; gap: clamp(36px,6vw,64px); transform: none !important; padding: clamp(70px,11vw,130px) var(--side); }
.areas.is-static .rail__intro { width: 100%; max-width: none; }
.areas.is-static .rail__hint { display: none; }
.areas.is-static .rail__media { width: 100%; height: clamp(220px,45vw,360px); }
.areas.is-static .rail__axis { flex-direction: column; height: auto; gap: 0; }
.areas.is-static .axis__line { display: none; }
.areas.is-static .tl { width: 100%; max-width: none; padding: clamp(24px,5vw,34px) 0; border-top: 1px solid var(--line); }
.areas.is-static .tl__dot, .areas.is-static .tl__stem { display: none; }
.areas.is-static .tl__body { position: static; padding-left: 0; padding-right: 4.2rem; }
.areas.is-static .tl__t > span { transform: none !important; }
.areas.is-static .tl__n, .areas.is-static .tl__d { opacity: 1 !important; }

/* Reveal al hacer scroll en móvil (intro, media y cada área) */
.areas.is-reveal .rail__intro,
.areas.is-reveal .rail__media,
.areas.is-reveal .tl {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .72s var(--ease), transform .72s var(--ease);
  will-change: opacity, transform;
}
.areas.is-reveal .rail__media { transform: translateY(30px) scale(1.02); }
.areas.is-reveal .rail__intro.is-shown,
.areas.is-reveal .rail__media.is-shown,
.areas.is-reveal .tl.is-shown {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Proceso
   ============================================================ */
.proceso { padding: clamp(80px, 12vw, 160px) 0; background: var(--bg-2); }
.bigtext {
  font-size: clamp(1.55rem, 4.1vw, 3.3rem);
  font-weight: 500; line-height: 1.18; letter-spacing: -0.03em;
  max-width: 26ch; margin: 1.2rem 0 clamp(56px, 8vw, 110px);
  text-wrap: balance;
}
.bigtext .w { display: inline-block; opacity: 0.15; will-change: opacity; }
.proceso__track { position: relative; }
.proceso__line { position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line); }
.proceso__line span { display: block; height: 100%; width: 0; background: var(--ink); will-change: width; }
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2vw, 28px);
  padding-top: clamp(28px, 3vw, 44px);
}
.step {
  --mx: 50%;
  --my: 30%;
  --tx: 0px;
  --ty: 0px;
  position: relative;
  isolation: isolate;
  padding: clamp(18px, 2vw, 26px) clamp(16px, 1.8vw, 22px);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  transition:
    opacity .45s cubic-bezier(0.23, 1, 0.32, 1),
    transform .45s cubic-bezier(0.23, 1, 0.32, 1),
    background-color .45s cubic-bezier(0.23, 1, 0.32, 1);
  transform: translate3d(var(--tx), var(--ty), 0);
  will-change: transform, opacity;
}
.step__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  z-index: 0;
  background: radial-gradient(
    180px circle at var(--mx) var(--my),
    color-mix(in srgb, var(--accent) 22%, transparent),
    transparent 68%
  );
  transition: opacity .35s cubic-bezier(0.23, 1, 0.32, 1);
}
.step__n,
.step__t,
.step p { position: relative; z-index: 1; }
.step__n {
  display: inline-block;
  font-family: var(--num);
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color .35s cubic-bezier(0.23, 1, 0.32, 1), transform .35s cubic-bezier(0.23, 1, 0.32, 1);
  transform: translate3d(calc(var(--tx) * -0.6), calc(var(--ty) * -0.6), 0) scale(var(--ns, 1));
  will-change: transform;
}
.step__t {
  font-size: var(--step-h3);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 1.1rem 0 0.65rem;
}
.step p { color: var(--ink-soft); font-weight: 300; font-size: var(--step-body); }

.steps.is-hot .step:not(.is-on) { opacity: 0.38; }
.step.is-on {
  background: var(--bg);
  opacity: 1;
}
.step.is-on .step__glow { opacity: 1; }
.step.is-on .step__n { color: var(--accent); --ns: 1.08; }
.step:active { transform: translate3d(var(--tx), var(--ty), 0) scale(0.985); }

@media (hover: hover) and (pointer: fine) {
  .steps:hover .step:not(:hover):not(.is-on) { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  .step,
  .step__n,
  .step__glow { transition: none; transform: none !important; }
  .step__glow { display: none; }
  .steps.is-hot .step:not(.is-on) { opacity: 1; }
}

/* ============================================================
   Galería
   ============================================================ */
.gallery { display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 22px); padding: clamp(80px, 12vw, 150px) var(--side) clamp(14px, 1.6vw, 22px); }
.gallery__head { padding-inline: 0; max-width: none; margin: 0 0 clamp(34px, 5vw, 60px); }
.gallery__title { max-width: 18ch; margin-bottom: 1.2rem; }
.gallery__lead { color: var(--ink-soft); font-weight: 300; max-width: 62ch; }
.gallery__row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 1.6vw, 22px); }
.gallery__item { position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: 16/10; background: var(--bg-2); }
.gallery__item--wide { aspect-ratio: 16/9; }
.gallery__item img {
  width: 100%; height: 108%; object-fit: cover; filter: var(--photo);
  transition: filter .6s var(--ease), transform 1.2s var(--ease); will-change: transform;
}
.gallery__item:hover img { filter: none; }

/* ============================================================
   Equipo
   ============================================================ */
.equipo { padding: clamp(80px, 12vw, 160px) 0; }
.equipo__head { margin-bottom: clamp(40px, 6vw, 72px); }
.equipo__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.6vw, 40px); }
.member { perspective: 1000px; }
.member__photo {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 3/4; background: var(--bg-2); margin-bottom: 1.3rem;
  transform-style: preserve-3d; transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  will-change: transform;
}
.member__photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  filter: var(--photo); transition: filter .6s var(--ease), transform 1s var(--ease);
}
.member:hover .member__photo { box-shadow: 0 30px 60px -30px rgba(27,25,23,0.45); }
@media (hover: hover) and (pointer: fine) {
  @media (hover: hover) and (pointer: fine) {
  .member:hover .member__photo img { filter: none; transform: scale(1.05); }
}
}
.member__name { font-size: var(--step-h3); font-weight: 500; letter-spacing: -0.02em; }
.member__role {
  font-family: var(--mono); font-size: var(--step-label); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-top: 0.4rem;
}

/* ============================================================
   Cáceres
   ============================================================ */
.caceres { position: relative; overflow: hidden; color: var(--on-dark); padding: clamp(100px, 16vw, 200px) 0; }
.caceres__bg { position: absolute; inset: -12% 0; z-index: 0; will-change: transform; }
.caceres__bg img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.4) brightness(0.82); }
.caceres__overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(23,20,17,0.88) 0%, rgba(23,20,17,0.62) 55%, rgba(23,20,17,0.4) 100%); }
.caceres__inner { position: relative; z-index: 2; }
.caceres__title { font-size: var(--step-h2); font-weight: 500; line-height: 1.04; letter-spacing: -0.03em; max-width: 18ch; text-wrap: balance; }
.caceres__text { color: var(--on-dark-soft); font-weight: 300; max-width: 46ch; margin-top: 1.6rem; font-size: var(--step-lead); }

/* ============================================================
   FAQ
   ============================================================ */
.faq { padding: clamp(80px, 12vw, 160px) 0; }
.faq__grid { display: grid; grid-template-columns: 0.9fr 1.3fr; gap: clamp(40px, 6vw, 100px); align-items: start; }
.faq__aside { position: sticky; top: 120px; }
.faq__aside .section-title { max-width: 14ch; margin-bottom: 1.4rem; }
.faq__note { color: var(--ink-soft); font-weight: 300; max-width: 34ch; margin-bottom: 1.6rem; }
.faq__list { border-top: 1px solid var(--line); padding-right: 4.5rem; }
.qa { border-bottom: 1px solid var(--line); }
.qa__q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  text-align: left; padding: clamp(20px, 2.4vw, 30px) 0;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 500; letter-spacing: -0.02em;
  transition: color .3s var(--ease);
}
.qa__q:hover { color: var(--accent); }
.qa__icon { position: relative; flex-shrink: 0; width: 18px; height: 18px; }
.qa__icon::before, .qa__icon::after {
  content: ""; position: absolute; background: currentColor; transition: transform .4s var(--ease);
}
.qa__icon::before { top: 50%; left: 0; width: 100%; height: 1.5px; transform: translateY(-50%); }
.qa__icon::after { left: 50%; top: 0; width: 1.5px; height: 100%; transform: translateX(-50%); }
.qa__q[aria-expanded="true"] .qa__icon::after { transform: translateX(-50%) scaleY(0); }
.qa__a { overflow: hidden; height: 0; }
.qa__a p { padding-bottom: clamp(20px, 2.4vw, 30px); color: var(--ink-soft); font-weight: 300; max-width: 60ch; }

/* ============================================================
   Contacto
   ============================================================ */
.contacto { background: var(--dark-2); color: var(--on-dark); padding: clamp(80px, 12vw, 160px) 0; }
.contacto__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(40px, 6vw, 100px); align-items: start; }
.contacto__title { font-size: var(--step-display); font-weight: 500; line-height: 0.98; letter-spacing: -0.035em; margin-bottom: 1.2rem; text-wrap: balance; }
.contacto__lead { color: var(--on-dark-soft); font-weight: 300; max-width: 42ch; font-size: var(--step-lead); margin-bottom: 2.2rem; }

.form__honeypot {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%);
  white-space: nowrap !important;
  border: 0 !important;
}
.form__honeypot input { width: 1px !important; max-width: 1px; min-width: 0; }
.form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-width: 560px;
}
.form--stage {
  position: relative;
  padding: clamp(22px, 3vw, 34px);
  border-radius: 14px;
  background: #201c18;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--on-dark) 10%, transparent);
}
.form__chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.2rem;
  margin-bottom: 0.4rem;
}
.form__live {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
}
.form__live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a9c6a0;
  box-shadow: 0 0 0 0 color-mix(in srgb, #a9c6a0 55%, transparent);
  animation: formPulse 1.6s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}
.form.is-user .form__live-dot {
  background: var(--on-dark-soft);
  animation: none;
  box-shadow: none;
}
@keyframes formPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, #a9c6a0 45%, transparent); }
  50% { box-shadow: 0 0 0 7px transparent; }
}
.form__hint {
  margin: 0;
  font-size: var(--step-sm);
  font-weight: 300;
  color: color-mix(in srgb, var(--on-dark) 48%, transparent);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
  padding: 0.55rem 0.7rem 0.75rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--on-dark) 3.5%, transparent);
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease);
}
.field.is-typing {
  background: color-mix(in srgb, var(--on-dark) 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-dark) 16%, transparent);
}
.field.is-typing::after {
  content: "";
  position: absolute;
  right: 0.85rem;
  bottom: 1.05rem;
  width: 2px;
  height: 1.05em;
  background: var(--on-dark);
  animation: caretBlink 0.9s steps(1) infinite;
  pointer-events: none;
}
@keyframes caretBlink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.field > span {
  font-family: var(--mono);
  font-size: var(--step-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
}
.field input, .field textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-dark);
  padding: 0.55rem 0;
  color: var(--on-dark);
  font-size: var(--step-body);
  font-weight: 300;
  transition: border-color .3s var(--ease);
  resize: vertical;
  caret-color: var(--on-dark);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--on-dark); }
.field input::placeholder, .field textarea::placeholder { color: transparent; }
.form.is-demo .field input,
.form.is-demo .field textarea {
  color: color-mix(in srgb, var(--on-dark) 78%, transparent);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: var(--step-sm);
  color: var(--on-dark-soft);
  font-weight: 300;
  padding: 0.2rem 0.2rem 0;
}
.check input { margin-top: 0.2em; accent-color: var(--on-dark); width: 16px; height: 16px; flex-shrink: 0; }
.check a { text-decoration: underline; text-underline-offset: 2px; }
.form__submit {
  align-self: flex-start;
  margin-top: 0.35rem;
  min-width: min(100%, 220px);
  justify-content: center;
}
.form__submit:active { transform: scale(0.97); }
.form__status { font-size: var(--step-sm); color: var(--on-dark-soft); min-height: 1.2em; }
.form__status.is-ok { color: #a9c6a0; }

@media (prefers-reduced-motion: reduce) {
  .form__live-dot { animation: none; }
  .field.is-typing::after { animation: none; opacity: 1; }
}

.contacto__info { display: grid; gap: clamp(28px, 3vw, 40px); }
.info__k { font-family: var(--mono); font-size: var(--step-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-soft); }
.info__v { font-size: var(--step-lead); font-weight: 300; margin-top: 0.6rem; line-height: 1.45; }
.info__v a { overflow-wrap: anywhere; }
.info__v a { position: relative; }
.info__v a::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 100%; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.info__v a:hover::after { transform: scaleX(1); }

/* ============================================================
   Footer
   ============================================================ */
.footer { position: relative; overflow: visible; background: var(--dark-2); color: var(--on-dark-soft); padding: clamp(50px, 6vw, 84px) 0 0; border-top: 1px solid var(--line-dark); }
.footer .wrap { position: relative; z-index: 2; }

.footer__main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(28px, 4vw, 64px); padding-bottom: clamp(40px, 5vw, 64px); }
.footer__mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  width: fit-content;
}
.footer__wordmark {
  display: block;
  height: clamp(28px, 3.4vw, 40px);
  width: auto;
  max-width: min(78vw, 320px);
  object-fit: contain;
  object-position: left center;
}
.footer__mark-box {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--on-dark); color: var(--dark-2);
  font-weight: 700; font-size: 0.78rem; letter-spacing: -0.02em;
}
.footer__mark-name {
  color: color-mix(in srgb, var(--on-dark-soft) 80%, transparent);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.footer__tagline { margin-top: 1.3rem; max-width: 34ch; font-weight: 300; font-size: var(--step-sm); line-height: 1.6; }

.footer__col { display: flex; flex-direction: column; gap: 0.85rem; }
.footer__col-k { font-family: var(--mono); font-size: var(--step-label); letter-spacing: 0.14em; text-transform: uppercase; color: color-mix(in srgb, var(--on-dark-soft) 70%, transparent); margin-bottom: 0.4rem; }
.footer__col a { font-size: var(--step-sm); transition: color .3s var(--ease); width: fit-content; max-width: 100%; }
.footer__col a:hover { color: var(--on-dark); }
.footer__addr { font-size: var(--step-sm); line-height: 1.6; overflow-wrap: anywhere; }

.footer__meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: clamp(24px, 3vw, 36px) 0; border-top: 1px solid var(--line-dark); font-size: var(--step-sm); }
.footer__credits { font-size: 0.72rem; color: color-mix(in srgb, var(--on-dark-soft) 55%, transparent); max-width: 70ch; padding-bottom: clamp(20px, 3vw, 32px); }
.footer__credits a { text-decoration: underline; text-underline-offset: 2px; }

/* ── Wordmark: Despacho IGH Abogados ── */
.footer__wordwrap {
  position: relative; z-index: 1;
  overflow: visible;
  width: 100%;
  margin-top: clamp(8px, 1.5vw, 20px);
  padding: 0;
  box-sizing: border-box;
}
.footer__wordline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  column-gap: clamp(1.4rem, 4vw, 3.25rem);
  width: 100%;
  padding: 0 var(--side);
  box-sizing: border-box;
  line-height: 1;
}
.footer__word {
  display: inline-block;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg,
    rgba(243,241,236,0.22) 0%,
    rgba(243,241,236,0.58) 28%,
    #ffffff 50%,
    rgba(243,241,236,0.58) 72%,
    rgba(243,241,236,0.22) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: wordshine 7s linear infinite;
}
.footer__word--core {
  font-size: clamp(5.2rem, 26vw, 17rem);
  letter-spacing: -0.04em;
  line-height: 0.72;
  justify-self: center;
  z-index: 0;
  margin-bottom: -0.08em;
  padding-bottom: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 28%, transparent 94%);
  mask-image: linear-gradient(to bottom, #000 28%, transparent 94%);
  transform: translateY(4%);
}
.footer__word--side {
  font-size: clamp(1.2rem, 3vw, 2.55rem);
  letter-spacing: -0.02em;
  line-height: 1.35;
  position: relative;
  z-index: 2;
  white-space: nowrap;
  overflow: visible;
  padding-bottom: 0.28em;
  margin-top: clamp(0.55rem, 1.8vw, 1.55rem);
}
.footer__word--side[data-wm="left"] {
  justify-self: end;
  text-align: right;
}
.footer__word--side[data-wm="right"] {
  justify-self: start;
  text-align: left;
}
.footer__word .ch {
  display: inline-block;
  overflow: visible;
  line-height: 1.35;
  vertical-align: baseline;
}
.js .footer__word--side {
  opacity: 0;
  filter: blur(6px);
  transform: translate3d(0, 0.35em, 0);
}
.js .footer__word--side[data-wm="left"] {
  transform: translate3d(0.55em, 0.2em, 0);
}
.js .footer__word--side[data-wm="right"] {
  transform: translate3d(-0.55em, 0.2em, 0);
}
.js .footer__word--core {
  transform: translateY(4%) scale(0.96);
}
.js .footer__wordwrap.is-in .footer__word--side,
.js .footer__wordwrap.is-static .footer__word--side,
.no-js .footer__word--side {
  opacity: 1;
  filter: none;
  transform: none;
}
.js .footer__wordwrap.is-in .footer__word--core,
.js .footer__wordwrap.is-static .footer__word--core,
.no-js .footer__word--core {
  transform: translateY(4%) scale(1);
}
.js .footer__wordwrap.is-in .footer__word--side .ch,
.js .footer__wordwrap.is-static .footer__word--side .ch,
.no-js .footer__word--side .ch {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}
.footer__wordwrap::before {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(88%, 1100px); height: 120%; z-index: -1;
  background: radial-gradient(ellipse at center bottom, rgba(243,241,236,0.14), transparent 68%);
  filter: blur(22px); animation: wordglow 7s ease-in-out infinite;
  opacity: 0.55;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  pointer-events: none;
}
.js .footer__wordwrap.is-in::before {
  opacity: 1;
  transform: translateX(-50%) scale(1.06);
}
@keyframes wordshine { to { background-position: -220% 0; } }
@keyframes wordglow { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.95; } }

@media (max-width: 720px) {
  /* Lockup lateral: Despacho · IGH · Abogados en una sola línea.
     IGH sigue siendo la pieza grande, pero deja sitio a las dos palabras. */
  .footer__wordwrap {
    padding-bottom: max(5.25rem, calc(env(safe-area-inset-bottom, 0px) + 4.75rem));
  }
  .footer__wordline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    justify-content: center;
    column-gap: clamp(0.45rem, 2.4vw, 0.9rem);
    row-gap: 0;
  }
  .footer__word--core {
    order: 0;
    font-size: clamp(3.05rem, 17.5vw, 6.25rem);
    line-height: 0.82;
    margin: 0;
    justify-self: center;
    transform: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .footer__word--side {
    font-size: clamp(1rem, 3.9vw, 1.22rem);
    line-height: 1;
    margin: 0;
    padding: 0 0 0.06em;
    letter-spacing: -0.03em;
    white-space: nowrap;
    /* El degradado metálico apaga las letras de los extremos a este tamaño. */
    background: none;
    color: #f3f1ec;
    -webkit-text-fill-color: #f3f1ec;
    -webkit-background-clip: border-box;
    background-clip: border-box;
  }
  .footer__word--side[data-wm="left"] {
    order: 0;
    justify-self: end;
    text-align: right;
  }
  .footer__word--side[data-wm="right"] {
    order: 0;
    justify-self: start;
    text-align: left;
    margin-bottom: 0;
  }
  .js .footer__word--side[data-wm="left"],
  .js .footer__word--side[data-wm="right"] {
    transform: translate3d(0, 0.35em, 0);
  }
  .js .footer__word--core,
  .js .footer__wordwrap.is-in .footer__word--core,
  .js .footer__wordwrap.is-static .footer__word--core,
  .no-js .footer__word--core {
    transform: none;
  }
}

/* ============================================================
   Reveal / motion helpers (JS-gated, visible without JS)
   ============================================================ */
.js [data-reveal] { opacity: 0; transform: translateY(26px); will-change: transform, opacity; }
.js [data-reveal].is-in { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1040px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .faq__grid { grid-template-columns: minmax(0, 1fr); }
  .faq__aside { position: static; }
  .contacto__grid { grid-template-columns: minmax(0, 1fr); }
  .contacto__left, .contacto__info, .form, .footer__brand, .footer__col { min-width: 0; }
  .footer__main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer__brand { grid-column: 1 / -1; }
  .footer__col a, .footer__addr, .info__v, .info__v a { overflow-wrap: anywhere; }
  /* La barra de escritorio no cabe: menú y CTA sin solaparse con la marca */
  .nav__links { display: none; }
  .burger { display: block; }
  .nav__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    column-gap: 0.6rem;
    padding-inline: clamp(12px, 2vw, 22px);
    min-width: 0;
  }
  .brand, .nav__actions { grid-column: auto; justify-self: unset; }
  .brand { flex: 1 1 auto; min-width: 0; max-width: none; overflow: hidden; }
  .nav__actions { flex: 0 0 auto; }
  .brand__lockup { min-width: 0; overflow: hidden; }
  .brand__name, .brand__sub {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav__cta .btn__arrow { display: none; }
}
/* La timeline cae a lista vertical por debajo de 900px (robusto sin depender del JS) */
@media (max-width: 900px) {
  .areas { height: auto; }
  .areas__pin { position: static; height: auto; overflow: visible; display: block; }
  .areas__rail { flex-direction: column; align-items: stretch; gap: clamp(36px,6vw,64px); transform: none !important; padding: clamp(70px,11vw,120px) var(--side); }
  .rail__intro { width: 100%; max-width: none; }
  .rail__hint { display: none; }
  .rail__media { width: 100%; height: clamp(220px,45vw,360px); }
  .rail__axis { flex-direction: column; height: auto; gap: 0; }
  .axis__line { display: none; }
  .tl { width: 100%; max-width: none; padding: clamp(24px,5vw,34px) 0; border-top: 1px solid var(--line); }
  .tl__dot, .tl__stem { display: none; }
  .tl__body { position: static; padding-left: 0; padding-right: 4.2rem; }
  .js .tl__t > span { transform: none; }
  .js .tl__n, .js .tl__d { opacity: 1; }
  .tl__t { overflow: visible; }
  .tl__d { max-width: 48ch; }
  .bigtext, .caceres__title, .caceres__text { padding-right: 4.2rem; }
  .step { padding-right: 4.2rem; }
  .faq__list { padding-right: 4.2rem; }
}

@media (max-width: 760px) {
  .nav__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    column-gap: 0.55rem;
    padding-inline: 12px;
    min-width: 0;
  }
  .nav__links { display: none; }
  .brand,
  .nav__actions {
    grid-column: auto;
    justify-self: unset;
  }
  .brand {
    flex: 1 1 auto;
    gap: 0.5rem;
    min-width: 0;
    max-width: none;
    overflow: hidden;
  }
  .nav__actions { flex: 0 0 auto; gap: 0.35rem; }
  .brand__logo { height: 26px; }
  .brand__lockup {
    padding-left: 0.5rem;
    gap: 0.2rem;
    min-width: 0;
    overflow: hidden;
  }
  .brand__name {
    display: block;
    font-size: 0.84rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand__sub {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.5rem;
    letter-spacing: 0.1em;
  }
  .burger { display: block; }
  .nav__cta {
    padding: 0.8em 1.15em;
    font-size: 0.74rem;
  }
  .nav__cta .btn__arrow { display: none; }
  .footer__wordmark {
    height: 30px;
    max-width: min(78vw, 280px);
  }
  .steps { grid-template-columns: 1fr; gap: 2.4rem; }
  .equipo__grid { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
  .gallery__row { grid-template-columns: 1fr; }
  .gallery__item, .gallery__item--wide { aspect-ratio: 16/11; }
  .form__row { grid-template-columns: 1fr; }
  .footer__main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.2rem 1.5rem; }
  .footer__meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .caceres__overlay { background: linear-gradient(180deg, rgba(23,20,17,0.82) 0%, rgba(23,20,17,0.6) 60%, rgba(23,20,17,0.72) 100%); }
}

@media (max-width: 460px) {
  .footer__main { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; }
}

@media (max-width: 380px) {
  .nav__inner { padding-inline: 10px; column-gap: 0.35rem; }
  .brand__logo { height: 22px; }
  .brand__name { font-size: 0.78rem; }
  .nav__cta { padding: 0.68em 0.72em; font-size: 0.7rem; }
  .burger { width: 40px; height: 40px; }
  .burger span:nth-child(1) { top: 16px; }
  .burger span:nth-child(2) { bottom: 16px; }
}

/* ============================================================
   Páginas legales
   ============================================================ */
.page-legal .nav--static {
  position: sticky; top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.page-legal .nav--static.is-scrolled { box-shadow: none; }
.legal {
  padding: clamp(100px, 14vw, 160px) 0 clamp(64px, 8vw, 110px);
}
.legal__wrap { max-width: 760px; }
.legal__title {
  font-size: clamp(2.6rem, 1.2rem + 5vw, 4.6rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
  text-wrap: balance;
}
.legal__lead {
  font-size: clamp(1.15rem, 1rem + 0.55vw, 1.45rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 42ch;
  margin-bottom: 2.4rem;
}
.legal__toc {
  display: flex; flex-wrap: wrap; gap: 0.65rem 1.1rem;
  padding: 1rem 0 2.2rem;
  margin-bottom: 1.4rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--step-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.legal__toc a { color: var(--muted); transition: color .3s var(--ease); }
.legal__toc a:hover,
.legal__toc a[aria-current="page"] { color: var(--ink); }
.legal__body { display: grid; gap: 2.4rem; }
.legal__body section { display: grid; gap: 0.85rem; }
.legal__body h2 {
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.legal__body p,
.legal__body li {
  font-size: var(--step-body);
  color: var(--ink-soft);
  line-height: 1.65;
}
.legal__body ul { display: grid; gap: 0.55rem; padding-left: 1.1rem; }
.legal__body li { list-style: disc; }
.legal__body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal__body strong { color: var(--ink); font-weight: 500; }
.legal__updated {
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: var(--step-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.legal__table-wrap { overflow-x: auto; }
.legal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-sm);
}
.legal__table th,
.legal__table td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}
.legal__table th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.legal__table code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--ink);
}
.footer__legal { font-size: var(--step-sm); }
.footer__legal a:hover { color: var(--on-dark); }

/* ============================================================
   Banner de cookies
   ============================================================ */
.cookie {
  position: fixed;
  z-index: 300;
  left: var(--side);
  right: var(--side);
  bottom: clamp(16px, 3vw, 28px);
  max-width: 720px;
  margin-inline: auto;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  pointer-events: none;
}
.cookie.is-in { opacity: 1; transform: translateY(0); pointer-events: auto; }
.cookie.is-out { opacity: 0; transform: translateY(12px); pointer-events: none; }
.cookie__panel {
  display: grid;
  gap: 1.25rem;
  padding: clamp(18px, 2.5vw, 26px);
  background: var(--dark-2);
  color: var(--on-dark);
  border: 1px solid var(--line-dark);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(23, 20, 17, 0.35);
}
.cookie__kicker {
  font-family: var(--mono);
  font-size: var(--step-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
  margin-bottom: 0.45rem;
}
.cookie__title {
  font-size: clamp(1.2rem, 1rem + 0.7vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.55rem;
}
.cookie__text {
  font-size: var(--step-sm);
  font-weight: 300;
  line-height: 1.55;
  color: var(--on-dark-soft);
  max-width: 54ch;
}
.cookie__text a {
  color: var(--on-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
}
.cookie__btn { border-radius: 100px; }
.cookie__btn--ghost {
  padding: 0.95em 1.5em;
  font-size: 0.82rem;
  color: var(--on-dark);
  border: 1px solid var(--line-dark);
  border-radius: 100px;
}
.cookie__btn--ghost:hover { background: rgba(243,241,236,0.08); }
.cookie__link {
  font-size: var(--step-sm);
  color: var(--on-dark-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie__link:hover { color: var(--on-dark); }

@media (max-width: 640px) {
  .cookie { left: 12px; right: 12px; bottom: 12px; }
  .cookie__actions { flex-direction: column; align-items: stretch; }
  .cookie__actions .btn,
  .cookie__link { text-align: center; justify-content: center; }
}

/* ============================================================
   404
   ============================================================ */
.page-404 {
  min-height: 100vh;
  background: var(--dark-2);
  color: var(--on-dark);
}
.err404 {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(48px, 10vw, 120px) var(--side);
  max-width: 920px;
  overflow: hidden;
}
.err404__glow {
  position: absolute;
  inset: auto -10% -20% 20%;
  width: min(70vw, 640px);
  height: min(70vw, 640px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243,241,236,0.12), transparent 68%);
  filter: blur(28px);
  pointer-events: none;
  animation: wordglow 8s ease-in-out infinite;
}
.err404__code {
  font-family: var(--num);
  font-weight: 300;
  font-size: clamp(5rem, 22vw, 12rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: color-mix(in srgb, var(--on-dark) 18%, transparent);
  margin-bottom: clamp(1.2rem, 3vw, 2rem);
}
.err404 .eyebrow { margin-bottom: 1rem; }
.err404__title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
  margin-bottom: 1rem;
}
.err404__lead {
  max-width: 42ch;
  font-weight: 300;
  font-size: var(--step-lead);
  color: var(--on-dark-soft);
  margin-bottom: 2rem;
  text-wrap: pretty;
}
.err404__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  margin-bottom: 2.4rem;
}
.btn--ghost-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.05em 2.3em;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--on-dark) 28%, transparent);
  color: var(--on-dark);
  font-weight: 500;
  font-size: 0.92rem;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.btn--ghost-light:hover {
  background: color-mix(in srgb, var(--on-dark) 8%, transparent);
  border-color: color-mix(in srgb, var(--on-dark) 55%, transparent);
  transform: translateY(-2px);
}
.err404__meta {
  font-size: var(--step-sm);
  color: color-mix(in srgb, var(--on-dark-soft) 80%, transparent);
}
.err404__meta a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.err404__meta a:hover { color: var(--on-dark); }

@media (max-width: 560px) {
  .err404__actions { width: 100%; }
  .err404__actions .btn,
  .err404__actions .btn--ghost-light { width: 100%; justify-content: center; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .js .footer__word--side { opacity: 1; filter: none; transform: none; }
  .footer__word, .footer__wordwrap::before { animation: none !important; }
  .intro { display: none; }
  .cookie { transition: none; }
  .err404__glow { animation: none !important; }
  .btn--ghost-light:hover { transform: none; }
}
