/*
  Fuentes alojadas en el sitio (Fontsource, licencia OFL; solo el subconjunto latino, que cubre
  FR/EN/ES). Se precargan desde index.html: llegan en paralelo con el JS, sin el doble salto de la
  hoja de Google, y no dependen de un tercero.
  - Bebas Neue (titulares): font-display block, para no enseñar los titulares gigantes con otra
    letra (su ancho está calibrado en em: con Arial se cortaban).
  - Roboto Condensed variable 100–900 (texto; sustituto libre de Helvetica 37 Thin Condensed).
  Las "Fallback" son Arial con el ancho ajustado (size-adjust aproximado): si la fuente tarda, el
  texto ocupa casi lo mismo y el cambio no mueve la maqueta.
*/

@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('/assets/bebas-neue-latin-400-normal-9mHNbWWO.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto Condensed';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/roboto-condensed-latin-wght-normal-Cxzi1x1i.woff2') format('woff2');
}

@font-face {
  font-family: 'Bebas Neue Fallback';
  src: local('Arial Narrow'), local('Arial');
  size-adjust: 62%;
  ascent-override: 140%;
  descent-override: 40%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Roboto Condensed Fallback';
  src: local('Arial');
  size-adjust: 88%;
  ascent-override: 105%;
  descent-override: 28%;
  line-gap-override: 0%;
}
/*
  Reveal de entrada y salida según la dirección del scroll (ver components/Motion).
  Cada elemento lleva data-reveal="<variante>" y data-reveal-state:
    below → oculto, desplazado hacia abajo (aún no ha llegado o ha salido por abajo)
    in    → visible
    above → oculto, desplazado hacia arriba (ha salido por arriba)
  La entrada es larga, suave y escalonada (--reveal-delay); la salida es corta y sin retardo.

  Si el elemento tiene transiciones propias (hover de botones, tarjetas…), las declara en
  --reveal-extra y se suman a las del reveal sin heredar su retardo.
*/

[data-reveal] {
  --reveal-x: 0px;
  --reveal-y: 28px;
  --reveal-y-above: -24px;
  --reveal-scale: 1;
  --reveal-duration: var(--dur-enter);
  --reveal-wait: calc(var(--reveal-delay, 0ms) * var(--reveal-delay-scale, 1));
}

[data-reveal][data-reveal-state] {
  transition:
    opacity var(--dur-exit) var(--ease-in),
    transform var(--dur-exit) var(--ease-in),
    var(--reveal-extra, visibility 0s);
}

[data-reveal-state='below'] {
  opacity: 0;
  transform: translate3d(var(--reveal-x), var(--reveal-y), 0) scale(var(--reveal-scale));
}

[data-reveal-state='above'] {
  opacity: 0;
  transform: translate3d(var(--reveal-x), var(--reveal-y-above), 0) scale(var(--reveal-scale));
}

[data-reveal][data-reveal-state='in'] {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--reveal-duration) var(--ease-out) var(--reveal-wait),
    transform var(--reveal-duration) var(--ease-out) var(--reveal-wait),
    var(--reveal-extra, visibility 0s);
}

/* Al volver a entrar el escalonado se acorta: ese contenido ya se vio una vez. */
[data-reveal-again] { --reveal-delay-scale: 0.4; }

[data-reveal='fade'] { --reveal-y: 0px; --reveal-y-above: 0px; }
[data-reveal='left'] { --reveal-x: -32px; --reveal-y: 0px; --reveal-y-above: 0px; }
[data-reveal='right'] { --reveal-x: 32px; --reveal-y: 0px; --reveal-y-above: 0px; }
[data-reveal='scale'] { --reveal-scale: 0.97; --reveal-y: 32px; --reveal-y-above: -20px; }
[data-reveal='cta'] { --reveal-duration: 650ms; --reveal-y: 18px; --reveal-y-above: -14px; }

/* none: solo expone el estado y el CSS de la sección decide qué se anima;
   mask: el elemento queda quieto y se mueven sus líneas. */
[data-reveal='none'][data-reveal-state],
[data-reveal='mask'][data-reveal-state] {
  opacity: 1;
  transform: none;
}

/* ---------- mask: cada línea sube desde detrás de su propia caja ----------
   El padding con margen negativo amplía la zona de recorte sin mover el layout, para que
   acentos (É) y remates de Bebas Neue no se corten con line-height < 1. */

.reveal-line {
  display: block;
  overflow: hidden;
  padding: 0.16em 0.08em;
  margin: -0.16em -0.08em;
}

.reveal-mask {
  display: block;
  transition: transform var(--dur-exit) var(--ease-in);
}

[data-reveal='mask'][data-reveal-state='below'] .reveal-mask {
  transform: translate3d(0, calc(100% + 0.2em), 0);
}

[data-reveal='mask'][data-reveal-state='above'] .reveal-mask {
  transform: translate3d(0, calc(-100% - 0.2em), 0);
}

[data-reveal='mask'][data-reveal-state='in'] .reveal-mask {
  transform: none;
  transition: transform 1150ms var(--ease-out) calc(var(--reveal-wait) + var(--line, 0) * 110ms * var(--reveal-delay-scale, 1));
}

/* Red de seguridad para el foco con teclado (además del focusin de useRevealPhase): lo que
   contiene el foco siempre se ve. */
[data-reveal]:focus-within {
  opacity: 1;
  transform: none;
}

[data-reveal='mask']:focus-within .reveal-mask { transform: none; }
/*
  Tokens. Todos los colores del sitio salen de aquí: [data-theme] en <html> elige la paleta
  (el script de index.html la fija antes del primer pintado; ver src/theme/).
  - El azul de marca (#1047FA) es el mismo en los dos temas; como texto sobre fondo oscuro
    se usa una versión más clara (--color-accent-text) para cumplir WCAG AA.
  - Texto sobre fotos: siempre claro, en los dos temas (.on-photo en base.css). Lo que cambia
    con el tema es la gradación de la foto y su velo (--*-veil).
*/

:root {
  --font-display: 'Bebas Neue', 'Bebas Neue Fallback', sans-serif;
  /* Texto: la marca usa Helvetica 37 Thin Condensed (licencia comercial); Roboto Condensed es su
     equivalente libre más cercano. */
  --font-body: 'Roboto Condensed', 'Roboto Condensed Fallback', 'Helvetica Neue', Arial, sans-serif;

  /* Movimiento: entradas largas y suaves, salidas cortas (quiet luxury). */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-enter: 900ms;
  --dur-exit: 450ms;
  --dur-photo: 900ms;

  /* Sobre fotos (iguales en los dos temas) */
  --photo-text: #F6F4F0;
  --photo-text-muted: #E7E3DC;
  --photo-line: rgb(246 244 240 / 0.3);
  --photo-accent: #9DB3FF;
  --photo-glass: rgb(10 11 13 / 0.42);
  --photo-glass-strong: rgb(10 11 13 / 0.6);
  --photo-glass-hover: rgb(40 42 48 / 0.62);
  --photo-card: #F4F2EE;
  --photo-card-text: #161618;
  --photo-edge: rgb(255 255 255 / 0.07);
  --photo-display-fade: rgb(255 255 255 / 0.32);
  --photo-btn-fg: #121314;
  --photo-btn-line: rgb(244 242 238 / 0.9);
  /* Brillo del cursor sobre la tarjeta azul de proyectos */
  --accent-card-glow: rgb(255 255 255 / 0.22);
}

/* Todo lo que va sobre una foto (portada, cifras, contacto y el header sobre la portada) lee
   estos valores: texto claro y botones claros en los dos temas. */
.on-photo {
  --color-text: var(--photo-text);
  --color-text-muted: var(--photo-text-muted);
  --color-text-subtle: var(--photo-text-muted);
  --color-line: var(--photo-line);
  --color-line-strong: var(--photo-line);
  --color-accent-text: var(--photo-accent);
  --focus-ring: var(--photo-accent);
  --display-fill: var(--photo-text);
  --display-fade: var(--photo-display-fade);
  --btn-solid-bg: var(--photo-card);
  --btn-solid-fg: var(--photo-btn-fg);
  --btn-outline-fg: var(--photo-card);
  --btn-outline-line: var(--photo-btn-line);
  --btn-outline-fill: var(--photo-card);
  --btn-outline-hover-fg: var(--photo-btn-fg);
}

/* ---------- Oscuro (también el valor por defecto) ---------- */

:root,
:root[data-theme='dark'] {
  color-scheme: dark;

  --color-bg: #191818;
  --color-bg-alt: #1F1E1E;
  --color-surface: #262525;
  --color-surface-strong: #312F2F;
  --color-text: #E8E6E6;
  --color-text-muted: #ABA8A8;
  --color-text-subtle: #959292;
  --color-line: rgb(232 230 230 / 0.12);
  --color-line-strong: rgb(232 230 230 / 0.3);

  --color-accent: #1047FA;
  --color-accent-text: #8AA4FF;
  --color-accent-contrast: #FFFFFF;
  --color-accent-soft: #D2DCFF;
  --color-accent-glow: rgb(16 71 250 / 0.34);
  --focus-ring: #9DB3FF;

  /* Velos de las fotos: noche y crepúsculo, con un toque del azul de marca en contacto */
  --hero-veil: linear-gradient(180deg, rgb(7 8 10 / 0.36) 0%, rgb(7 8 10 / 0.18) 42%, rgb(7 8 10 / 0.76) 100%);
  --hero-copy-scrim: transparent;
  --stats-veil: linear-gradient(180deg, rgb(7 8 10 / 0.62) 0%, rgb(7 8 10 / 0.42) 45%, rgb(7 8 10 / 0.8) 100%);
  --stats-veil-mobile: linear-gradient(180deg, rgb(7 8 10 / 0.9) 18%, rgb(7 8 10 / 0.4) 48%, rgb(7 8 10 / 0.82) 80%);
  --contact-veil:
    radial-gradient(60% 45% at 50% 0%, rgb(16 71 250 / 0.18), transparent 70%),
    linear-gradient(180deg, rgb(7 8 10 / 0.5) 0%, rgb(7 8 10 / 0.7) 45%, rgb(7 8 10 / 0.92) 100%);
  /* Fondo de las secciones con foto (se ve antes del telón y bajo la foto de contacto en móvil) */
  --photo-base: #141313;
  --contact-tint: rgb(7 8 10 / 0.34);

  /* Cristal: header al bajar */
  --glass-bg: rgb(25 24 24 / 0.76);
  --glass-line: rgb(232 230 230 / 0.08);
  --menu-bg: #141313;

  /* Botones */
  --btn-solid-bg: #E8E6E6;
  --btn-solid-fg: #191818;
  --btn-outline-fg: #E8E6E6;
  --btn-outline-line: rgb(232 230 230 / 0.85);
  --btn-outline-fill: #E8E6E6;
  --btn-outline-hover-fg: #191818;

  /* Sombras */
  --shadow-lift: 0 36px 70px -36px rgb(0 0 0 / 0.95), 0 0 0 1px rgb(255 255 255 / 0.06);
  --shadow-accent: 0 14px 34px -14px rgb(16 71 250 / 0.75);

  /* Tarjetas de proyecto sin foto (trama de plano) */
  --card-top: #32302F;
  --card-bottom: #1B1A1A;
  --card-grid: rgb(255 255 255 / 0.07);
  --card-fade: #E8E6E6;
  --card-title: #191818;
  --card-meta: rgb(25 24 24 / 0.74);
  --card-edge: rgb(255 255 255 / 0.05);
}

/* ---------- Claro: blanco roto y gris de marca (#E8E6E6), carbón (#191818) y el mismo azul ---------- */

:root[data-theme='light'] {
  color-scheme: light;

  --color-bg: #F4F3F3;
  --color-bg-alt: #E8E6E6;
  --color-surface: #DEDBDB;
  --color-surface-strong: #D1CDCD;
  --color-text: #191818;
  --color-text-muted: #545151;
  --color-text-subtle: #5E5B5B;
  --color-line: rgb(25 24 24 / 0.12);
  --color-line-strong: rgb(25 24 24 / 0.3);

  --color-accent: #1047FA;
  --color-accent-text: #0E3EDB;
  --color-accent-contrast: #FFFFFF;
  --color-accent-soft: #D2DCFF;
  --color-accent-glow: rgb(16 71 250 / 0.2);
  --focus-ring: #1047FA;

  /* Velos cálidos (carbón tostado) sobre las fotos de día: más ligeros que de noche, pero con
     el contraste suficiente para el texto claro. */
  --hero-veil:
    radial-gradient(90% 70% at 0% 100%, rgb(18 14 10 / 0.56), transparent 72%),
    linear-gradient(180deg, rgb(20 17 14 / 0.46) 0%, rgb(20 17 14 / 0.42) 52%, rgb(18 14 10 / 0.64) 100%);
  /* Sombra suave detrás del texto de la portada: en claro la fachada soleada queda detrás. */
  --hero-copy-scrim: rgb(18 14 10 / 0.5);
  --stats-veil: linear-gradient(180deg, rgb(20 17 14 / 0.72) 0%, rgb(20 17 14 / 0.38) 45%, rgb(18 14 10 / 0.72) 100%);
  --stats-veil-mobile: linear-gradient(180deg, rgb(24 19 14 / 0.86) 18%, rgb(24 19 14 / 0.4) 48%, rgb(24 19 14 / 0.82) 80%);
  --contact-veil:
    radial-gradient(60% 45% at 50% 0%, rgb(16 71 250 / 0.12), transparent 70%),
    linear-gradient(180deg, rgb(28 22 16 / 0.46) 0%, rgb(28 22 16 / 0.62) 45%, rgb(20 16 12 / 0.9) 100%);
  --photo-base: #221D18;
  --contact-tint: rgb(28 22 16 / 0.36);

  --glass-bg: rgb(244 243 243 / 0.84);
  --glass-line: rgb(25 24 24 / 0.08);
  --menu-bg: #F1F0F0;

  --btn-solid-bg: #191818;
  --btn-solid-fg: #F4F3F3;
  --btn-outline-fg: #191818;
  --btn-outline-line: rgb(25 24 24 / 0.8);
  --btn-outline-fill: #191818;
  --btn-outline-hover-fg: #F4F3F3;

  --shadow-lift: 0 30px 60px -32px rgb(40 36 36 / 0.4), 0 0 0 1px rgb(25 24 24 / 0.06);
  --shadow-accent: 0 14px 34px -14px rgb(16 71 250 / 0.55);

  --card-top: #DCD9D9;
  --card-bottom: #F1F0F0;
  --card-grid: rgb(25 24 24 / 0.07);
  --card-fade: #FFFFFF;
  --card-title: #191818;
  --card-meta: rgb(25 24 24 / 0.72);
  --card-edge: rgb(25 24 24 / 0.1);
}
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
}

a { text-decoration: none; }

/* Secciones sobre foto: los tokens se redefinen en tokens.css (.on-photo). */
.on-photo { color: var(--color-text); }

/* Al desplazar por foco: que el anillo no quede bajo el header ni pegado al borde inferior. */
:where(a[href], button, input, select, textarea) {
  scroll-margin-top: 16px;
  scroll-margin-bottom: 15vh;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Destino del enlace "Aller au contenu": recibe el foco sin anillo (el contenido ya se ve). */
main:focus { outline: none; }

.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;
}

/* Relleno degradado (sólido → transparente hacia arriba) de los titulares gigantes (hero, contacto, FAQ).
   Con background-clip:text solo se pinta dentro de la caja, y con line-height < 1 la tilde de
   "RÉSIDENTIELLE" sobresale por arriba: la caja se amplía por arriba (sin mover el layout) y el
   tope del degradado se queda en un 30 %, así la É se lee y el desvanecido se mantiene. */
.text-gradient {
  padding-top: 0.2em;
  margin-top: -0.2em;
  background: linear-gradient(to top, var(--display-fill, var(--photo-text)) 0%, var(--display-fill, var(--photo-text)) 10%,
              var(--display-fade, var(--photo-display-fade)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Botones (compartidos: header, hero, contacto) ---------- */

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 16px 22px;
  /* También como <button> (desplegar proyectos): sin el borde ni el fondo del navegador. */
  border: 0;
  background-color: transparent;
  cursor: pointer;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
  /* Atracción magnética (useMagnetic): se suma al leve ascenso del hover. */
  translate: var(--magnet-x, 0px) var(--magnet-y, 0px);
  --reveal-extra: color 500ms var(--ease-out), background-color 500ms var(--ease-out),
                  box-shadow 500ms var(--ease-out), translate 500ms var(--ease-out),
                  scale 250ms var(--ease-out);
  transition: var(--reveal-extra);
}

/* Relleno en cúpula que sube desde abajo al pasar el cursor. */
.btn::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: -10%;
  top: 100%;
  width: 120%;
  height: 200%;
  border-radius: 50%;
  transition: translate 650ms var(--ease-out);
}

.btn--solid {
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
}

.btn--solid::before { background: var(--color-accent); }

.btn--outline {
  color: var(--btn-outline-fg);
  box-shadow: inset 0 0 0 1px var(--btn-outline-line);
}

.btn--outline::before { background: var(--btn-outline-fill); }

/* Sobre una foto, el botón con borde lleva un cristal oscuro: su texto se lee sobre cualquier zona. */
.on-photo .btn--outline {
  background-color: var(--photo-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover { translate: var(--magnet-x, 0px) calc(var(--magnet-y, 0px) - 2px); }
  .btn:hover::before { translate: 0 -75%; }
  .btn--solid:hover {
    color: var(--color-accent-contrast);
    box-shadow: var(--shadow-accent);
  }
  .btn--outline:hover { color: var(--btn-outline-hover-fg); }
}

.btn:active { scale: 0.97; }

/* ---------- Cambio de tema (src/theme/switchTheme.ts) ---------- */

/* Círculo desde el botón: la vista nueva se recorta con clip-path (animado por JS) sobre la vieja. */
:root[data-theme-switch='reveal']::view-transition-old(root),
:root[data-theme-switch='reveal']::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* Cambio del sistema (sin botón de origen): fundido de toda la página. */
:root[data-theme-switch='fade']::view-transition-group(root) {
  animation-duration: 500ms;
  animation-timing-function: var(--ease-in-out);
}

/* Durante la captura las fotos cambian de variante sin su propio fundido. */
:root[data-theme-switch] .photo-img { transition: none !important; }

/* Sin View Transitions: fundido corto de colores (las fotos conservan su propio fundido). */
:root.theme-fading *:not(.photo-img),
:root.theme-fading *::before,
:root.theme-fading *::after {
  transition: background-color 400ms var(--ease-in-out), color 400ms var(--ease-in-out),
              border-color 400ms var(--ease-in-out), box-shadow 400ms var(--ease-in-out),
              fill 400ms var(--ease-in-out), stroke 400ms var(--ease-in-out) !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0s !important;
  }
}
/* ---------- À propos — Julie Lavoie ----------
   Sin foto (about-section--text): dos columnas editoriales, nombre gigante a la izquierda y
   biografía + ámbitos a la derecha. Con foto (about-section--photo): foto 4/5 a la izquierda y
   todo el texto a la derecha. En móvil, una columna. */

.about-section {
  background: var(--color-bg);
  padding: clamp(64px, 10vw, 112px) clamp(20px, 6vw, 80px);
}

.about-inner {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 5vw, 48px);
}

/* Con foto: zonas de la rejilla (en una columna, display:flex las ignora). */
.about-section--photo .about-photo { grid-area: photo; }
.about-section--photo .about-intro { grid-area: intro; }
.about-section--photo .about-body { grid-area: body; }

/* Tableta con foto: foto y presentación lado a lado, biografía debajo a todo el ancho. */
@media (min-width: 768px) and (max-width: 899px) {
  .about-section--photo .about-inner {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-areas:
      'photo intro'
      'body body';
    gap: 40px;
    align-items: end;
  }
}

@media (min-width: 900px) {
  .about-inner {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(48px, 7vw, 120px);
    align-items: start;
  }

  .about-section--photo .about-inner {
    grid-template-areas:
      'photo intro'
      'photo body';
    grid-template-rows: auto 1fr;
    column-gap: clamp(48px, 6vw, 96px);
    row-gap: clamp(28px, 3vw, 40px);
  }


  /* Sin foto: la primera línea de la biografía se alinea con la parte alta del nombre. */
  .about-section--text .about-body {
    padding-top: calc(0.8125rem * 1.4 + clamp(16px, 2vw, 24px) + 0.12em);
  }
}

/* ---------- Foto ---------- */

.about-photo {
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-surface);
}

.about-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Presentación ---------- */

.about-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.about-eyebrow {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-accent-text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.about-eyebrow::before {
  content: '';
  flex: 0 0 auto;
  width: 28px;
  height: 1px;
  background: currentColor;
}

.about-name {
  margin: clamp(16px, 2vw, 24px) 0 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(4.5rem, 11.5vw, 10.5rem);
  line-height: 0.86;
}

.about-section--photo .about-name {
  font-size: clamp(3rem, 6.2vw, 6rem);
  line-height: 0.95;
}

.about-role {
  align-self: stretch;
  margin: clamp(20px, 2.4vw, 28px) 0 0;
  padding-top: clamp(14px, 1.6vw, 18px);
  border-top: 1px solid var(--color-line-strong);
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.5;
  text-wrap: balance;
}

/* ---------- Biografía y ámbitos ---------- */

.about-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-bio {
  margin: 0;
  max-width: 38rem;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.about-bio--lead {
  color: var(--color-text);
  font-size: clamp(1.25rem, 1.75vw, 1.5rem);
  line-height: 1.5;
}

.about-scope {
  margin-top: clamp(12px, 2vw, 24px);
  padding-top: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--color-line);
}

.about-list-title {
  margin: 0 0 16px;
  color: var(--color-text-subtle);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.about-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-tag {
  max-width: 100%;
  padding: 9px 16px;
  border: 1px solid var(--color-line-strong);
  border-radius: 999px;
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
}

/* Las etiquetas son pequeñas: suben poco. */
.about-tag[data-reveal] {
  --reveal-y: 12px;
  --reveal-y-above: -8px;
}

/* Tableta (una columna): el nombre sigue siendo protagonista. */
@media (min-width: 768px) and (max-width: 899px) {
  .about-name { font-size: 15vw; }
  .about-section--photo .about-name { font-size: 9vw; }
}

/* ---------- Móvil ---------- */

@media (max-width: 767px) {
  .about-section { padding: 56px 24px; }

  .about-inner { gap: 28px; }

  .about-name {
    margin-top: 14px;
    font-size: clamp(72px, 24vw, 112px);
  }

  .about-section--photo .about-name { font-size: clamp(44px, 13vw, 60px); }

  .about-role { font-size: 15px; }

  .about-body { gap: 16px; }

  .about-bio {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.75;
  }

  .about-bio--lead {
    font-size: 1.1875rem;
    font-weight: 400;
    line-height: 1.55;
  }

  .about-tags { gap: 8px; }

  .about-tag {
    padding: 8px 14px;
    font-size: 13px;
  }
}
/* ---------- Sección 4 — Une approche pensée pour durer ---------- */

.approach-section {
  background: var(--color-bg-alt);
  padding: clamp(64px, 10vw, 112px) clamp(20px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(32px, 6vw, 56px);
}

.approach-title {
  margin: 0;
  text-align: center;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.25rem, 7.5vw, 5.625rem);
  line-height: 0.98;
}

.approach-list {
  position: relative;
  align-self: stretch;
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-left: clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
}

/* Línea de progreso: pista tenue, relleno de acento (scaleY) y un punto en el extremo que baja. */
.approach-rail {
  position: absolute;
  left: 0;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: var(--color-line);
}

.approach-rail-fill {
  position: absolute;
  inset: 0;
  background: var(--color-accent-text);
  transform-origin: 50% 0;
  transform: scaleY(var(--parallax-scrub, 0));
}

.approach-rail-head {
  position: absolute;
  top: 0;
  left: -4px;
  width: 9px;
  height: 100%;
  transform: translateY(calc((var(--parallax-scrub, 0) - 1) * 100%));
}

.approach-rail-head::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4.5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent-text);
  box-shadow: 0 0 0 5px var(--color-accent-glow);
}

.approach-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 0;
}

/* Filete inferior que se dibuja de izquierda a derecha cuando entra la fila. */
.approach-item::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--color-line-strong);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-exit) var(--ease-in);
}

.approach-item:last-child::after { display: none; }

.approach-item[data-reveal-state='in']::after {
  transform: none;
  transition: transform 1400ms var(--ease-out) calc(150ms * var(--reveal-delay-scale, 1));
}

/* Número y título suben tras su máscara; el texto aparece. Entran escalonados y salen juntos. */
.approach-num,
.approach-heading {
  overflow: hidden;
  padding-block: 0.14em;
  margin-block: -0.14em;
}

.approach-num > span,
.approach-heading > span {
  display: block;
  transform: translate3d(0, 110%, 0);
  transition: transform 400ms var(--ease-in);
}

.approach-desc {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 400ms var(--ease-in), transform 400ms var(--ease-in);
}

.approach-item[data-reveal-state='above'] > * > span { transform: translate3d(0, -110%, 0); }
.approach-item[data-reveal-state='above'] .approach-desc { transform: translate3d(0, -12px, 0); }

.approach-item[data-reveal-state='in'] > * > span,
.approach-item[data-reveal-state='in'] .approach-desc {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-enter) var(--ease-out), transform 1100ms var(--ease-out);
}

.approach-item[data-reveal-state='in'] .approach-heading > span { transition-delay: calc(90ms * var(--reveal-delay-scale, 1)); }
.approach-item[data-reveal-state='in'] .approach-desc { transition-delay: calc(180ms * var(--reveal-delay-scale, 1)); }

.approach-num {
  margin: 0;
  color: var(--color-accent-text);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.approach-heading {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(1.5rem, 3.2vw, 2.375rem);
  line-height: 1.08;
  text-wrap: balance;
}

.approach-desc {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
  max-width: 36ch;
  text-wrap: pretty;
}

@media (min-width: 900px) {
  .approach-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: clamp(24px, 4vw, 48px);
    padding: 36px 0;
  }

  .approach-num { flex: 0 0 48px; }
  .approach-heading { flex: 0 1 360px; }
  .approach-desc { flex: 1 1 560px; max-width: 560px; }
}

/* ---------- Sección 4 — móvil (Figma "Frame 65", 430 de ancho) ---------- */

@media (max-width: 767px) {
  .approach-section {
    padding: 56px 24px;
    gap: 20px;
  }

  .approach-title {
    font-size: clamp(38px, 11.5vw, 46px);
    line-height: 0.96;
  }

  .approach-list { padding-left: 22px; }

  .approach-item {
    gap: 6px;
    padding: 22px 0;
  }

  .approach-heading {
    font-size: 24px;
    line-height: 1.1;
  }

  .approach-desc {
    max-width: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.75;
  }
}

@media (prefers-reduced-motion: reduce) {
  .approach-rail-fill { transform: none; }
  .approach-rail-head { display: none; }
}
/* ---------- FAQ (dentro de Contacto, sobre la foto) ---------- */

.faq-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 5vw, 48px);
}

.faq-list {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item { width: 100%; }

.faq-question {
  all: unset;
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 18px 18px 32px;
  border-radius: 999px;
  background: var(--photo-glass);
  box-shadow: inset 0 0 0 1px var(--photo-edge);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 450ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .faq-item:not(.is-open) .faq-question:hover { background: var(--photo-glass-hover); }
  .faq-question:hover .faq-icon-circle { scale: 1.08; }
}

.faq-question:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.faq-question-text {
  color: var(--color-text);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.5;
  text-wrap: pretty;
  transition: color 450ms var(--ease-out);
}

.faq-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--photo-card);
  color: var(--photo-card-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 450ms var(--ease-out), color 450ms var(--ease-out), scale 400ms var(--ease-out);
}

.faq-icon-circle svg {
  width: 16px;
  height: 16px;
  transition: transform 600ms var(--ease-out);
}

.faq-item.is-open .faq-question { background: var(--photo-card); }
.faq-item.is-open .faq-question-text { color: var(--photo-card-text); }

.faq-item.is-open .faq-icon-circle {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}

.faq-item.is-open .faq-icon-circle svg { transform: rotate(135deg); }

/* Altura animada al abrir y al cerrar: grid 0fr ↔ 1fr sobre un recorte sin padding.
   La tarjeta de respuesta además aparece (fundido + leve descenso) y se va antes de cerrar. */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 500ms var(--ease-in-out);
}

.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
  transition: grid-template-rows 650ms var(--ease-out);
}

.faq-answer-clip {
  min-height: 0;
  overflow: hidden;
}

.faq-answer-inner {
  background: var(--photo-card);
  border-radius: 28px;
  padding: 24px 32px;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(-10px) scale(0.985);
  transform-origin: top center;
  visibility: hidden;
  transition: opacity 250ms var(--ease-in), transform 350ms var(--ease-in), visibility 0s linear 500ms;
}

.faq-item.is-open .faq-answer-inner {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 500ms var(--ease-out) 120ms, transform 700ms var(--ease-out) 60ms, visibility 0s;
}

.faq-answer-inner p {
  margin: 0;
  color: var(--photo-card-text);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.6;
  max-width: 60ch;
  text-wrap: pretty;
}

/* Teléfono y correo dentro de una respuesta (Faq.tsx): subrayados en el color del texto de la
   tarjeta; al pasar el cursor, azul de marca. El anillo de foco va en azul de marca: el claro de
   .on-photo apenas se vería sobre la tarjeta clara. */
.faq-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  border-radius: 2px;
  transition: color 300ms var(--ease-out);
}

.faq-link--phone { white-space: nowrap; }

.faq-link:hover { color: var(--color-accent); }

.faq-link:focus-visible {
  outline-color: var(--color-accent);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .faq-block {
    margin-top: 120px;
    gap: 24px;
  }

  .faq-list { gap: 12px; }

  .faq-question {
    gap: 16px;
    padding: 12px 12px 12px 24px;
    border-radius: 32px;
    min-height: 60px;
    background: var(--photo-glass-strong);
  }

  .faq-question-text {
    font-size: 16px;
    line-height: 24px;
    text-align: left;
  }

  .faq-icon-circle {
    width: 36px;
    height: 36px;
  }

  .faq-answer-inner {
    padding: 20px 24px;
    border-radius: 24px;
    margin-top: 8px;
  }

  .faq-answer-inner p {
    font-size: 16px;
    line-height: 24px;
  }
}
/* ---------- Formulario de solicitud (dentro de Contacto, sobre la foto) ----------
   Cristal oscuro como el FAQ: se lee sobre cualquier zona de la foto en los dos temas. */

.contact-form-block {
  width: 100%;
  max-width: 880px;
  scroll-margin-top: 96px;
}

.cf,
.cf-success {
  padding: clamp(24px, 4vw, 48px);
  border-radius: 6px;
  background: var(--photo-glass-strong);
  box-shadow: inset 0 0 0 1px var(--photo-edge);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.cf { display: flex; flex-direction: column; gap: clamp(20px, 3vw, 28px); }

.cf-head { display: flex; flex-direction: column; gap: 8px; }

.cf-title {
  margin: 0;
  color: var(--photo-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.98;
}

.cf-title:focus { outline: none; }

.cf-intro {
  margin: 0;
  color: var(--photo-text-muted);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.cf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px 20px;
}

@media (min-width: 680px) {
  .cf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cf-field--full { grid-column: 1 / -1; }
}

.cf-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.cf-label {
  color: var(--photo-text);
  font-size: 15px;
  font-weight: 500;
}

.cf-optional { color: var(--photo-text-muted); font-weight: 400; }

.cf-field :is(input, select, textarea) {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: 4px;
  background: rgb(246 244 240 / 0.08);
  box-shadow: inset 0 0 0 1px var(--photo-line);
  color: var(--photo-text);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  transition: box-shadow 300ms var(--ease-out), background-color 300ms var(--ease-out);
}

.cf-field textarea { resize: vertical; min-height: 132px; }
.cf-field ::placeholder { color: var(--photo-text-muted); opacity: 0.8; }

/* Flecha propia del select (la del sistema no respeta el color sobre cristal). */
.cf-field select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--photo-text) 50%),
    linear-gradient(135deg, var(--photo-text) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.cf-field option { color: #191818; background: #F4F3F3; }

.cf-field :is(input, select, textarea):hover { background-color: rgb(246 244 240 / 0.12); }

.cf-field :is(input, select, textarea):focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--photo-accent);
}

.cf-field [aria-invalid='true'] { box-shadow: inset 0 0 0 2px #FF9B8A; }

.cf-error { color: #FFB4A8; font-size: 14px; }

.cf-alert {
  margin: 0;
  padding: 12px 14px;
  border-radius: 4px;
  background: rgb(255 120 100 / 0.14);
  box-shadow: inset 0 0 0 1px rgb(255 155 138 / 0.5);
  color: var(--photo-text);
  font-size: 15px;
}

.cf-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.cf-privacy { margin: 0; max-width: 40ch; color: var(--photo-text-muted); font-size: 14px; line-height: 1.5; }

.cf .btn[disabled] { opacity: 0.7; cursor: progress; }

/* Trampa para bots: fuera de la vista sin display:none (algunos bots lo detectan). */
.cf-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cf-success { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 767px) {
  .cf-foot .btn { width: 100%; }
}
/* ---------- Foto con variante por tema (ThemedPhoto.tsx) ---------- */

.photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Las variantes se apilan. La del tema activo entra con un fundido por encima; la anterior
   se oculta cuando termina ese fundido (retardo = --dur-photo), así nunca asoma el fondo. */
.photo-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0s linear var(--dur-photo);
}

.photo-img[data-current][data-loaded] {
  z-index: 1;
  opacity: 1;
  transition: opacity var(--dur-photo) var(--ease-out);
}

/* Mientras la variante del tema activo no ha cargado, sigue visible la que ya estaba. */
.photo:not(:has(> .photo-img[data-current][data-loaded])) > .photo-img[data-loaded] {
  opacity: 1;
  transition: none;
}
/* ---------- Telón de las fotos de sección (useCurtain) ----------
   La capa se descubre de arriba abajo con clip-path la primera vez que la sección entra, y la
   foto se asienta (1.12 → 1) a la vez. Compatible con el parallax de la misma capa (translate/scale). */

.photo-curtain {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1700ms var(--ease-in-out);
}

.photo-curtain.is-open { clip-path: inset(0 0 0 0); }

.photo-curtain > * {
  transform: scale(1.12);
  transform-origin: 50% 30%;
  transition: transform 2400ms var(--ease-out);
}

.photo-curtain.is-open > * { transform: none; }
/* ---------- Sección 6 — Contacto + FAQ (sobre foto: texto claro en los dos temas) ---------- */

.contact-section {
  position: relative;
  background: var(--photo-base);
  padding: clamp(64px, 12vw, 140px) clamp(20px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(64px, 14vw, 168px);
  overflow: hidden;
}

/* Fondo en su propia capa con parallax; sobresale lo que puede llegar a desplazarse (speed 0.15). */
.contact-section > .contact-bg {
  position: absolute;
  inset: -16vh 0;
  z-index: 0;
  will-change: translate;
}

.contact-photo .photo-img { object-position: center 65%; }

/* Velo por tema (tokens.css): crepúsculo en oscuro, carbón cálido sobre la foto de día en claro. */
.contact-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--contact-veil);
}

.contact-section > :not(.contact-bg) {
  position: relative;
  z-index: 1;
}

/* Titular gigante (también el "FAQ"): el degradado va en cada línea animada (.text-gradient).
   --mega-em: ancho del texto en em; en móvil fija el tamaño que llena el ancho (por idioma, abajo). */
.contact-mega {
  --mega-em: 5.4;
  margin: 0;
  text-align: center;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(3rem, 13vw, 9.5rem);
  line-height: 0.86;
  letter-spacing: 0.01em;
  white-space: nowrap;
  width: max-content;
  max-width: 100%;
}

/* Ancho del titular en em + 3 % de aire: en móvil cada idioma llena el ancho igual que el francés. */
:lang(en) .contact-mega { --mega-em: 3.72; }
:lang(es) .contact-mega { --mega-em: 4.36; }

.contact-row {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vw, 40px);
}

@media (min-width: 900px) {
  .contact-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.contact-title {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2rem, 5.5vw, 4.5rem);
  line-height: 0.96;
}

.contact-cta-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  max-width: min(22rem, 100%);
}

.contact-subtitle {
  margin: 0;
  color: var(--color-text);
  font-size: 1.125rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.contact-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

@media (max-width: 420px) {
  .contact-ctas { flex-direction: column; }
  .contact-ctas .btn { width: 100%; }
}

/* ---------- Sección 6 — móvil (≤767px) ----------
   Del diseño móvil (430px): foto de 870px arriba que se funde con el fondo, 203px entre el
   titular gigante y el bloque de contacto (centrado). El FAQ sigue debajo sobre el fondo liso. */

@media (max-width: 767px) {
  .contact-section {
    padding: 80px 24px;
    gap: 0;
  }

  /* Media amplitud de parallax en móvil → 8vh de margen, compensado en las posiciones. */
  .contact-section > .contact-bg { inset: -8vh 0; }

  .contact-photo {
    top: 8vh;
    bottom: auto;
    height: 870px;
  }

  .contact-bg::after {
    background: linear-gradient(180deg, var(--contact-tint) 8vh, var(--photo-base) calc(870px + 8vh));
  }

  .contact-mega {
    font-size: min(110px, calc((100vw - 48px) / var(--mega-em)));
    line-height: 1.2;
    letter-spacing: 0;
  }

  .contact-mega.faq-title { font-size: min(110px, 25.58vw); }

  .contact-row {
    margin-top: 203px;
    align-items: center;
    gap: 24px;
  }

  .contact-title {
    align-self: stretch;
    text-align: center;
    font-size: min(56px, 13.02vw);
    line-height: min(60px, 13.95vw);
  }

  .contact-cta-block {
    max-width: none;
    align-items: center;
    gap: 24px;
  }

  .contact-subtitle {
    width: 300px;
    max-width: 100%;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    line-height: 27px;
  }

  .contact-ctas {
    flex-direction: column;
    gap: 12px;
  }

  .contact-ctas .btn { width: 100%; }
}
/* ---------- Sección 5 — Repères ---------- */

.credentials-section {
  background: var(--color-bg-alt);
  /* Va después de À propos (fondo distinto): aire arriba y abajo. */
  padding: clamp(64px, 10vw, 112px) clamp(20px, 6vw, 80px);
}

.credentials-panel {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  background: var(--color-surface);
  border-radius: 4px;
  padding: clamp(28px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vw, 44px);
}

.credentials-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
}

@media (min-width: 680px) {
  .credentials-top {
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 40px;
  }
}

.credentials-founding {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

@media (min-width: 480px) {
  .credentials-founding { flex-direction: row; align-items: flex-end; gap: 24px; }
}

.founding-year {
  color: var(--color-accent-text);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 9vw, 10rem);
  line-height: 0.86;
}

.founding-text {
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(1.75rem, 4.2vw, 3.5rem);
  line-height: 1;
  text-wrap: balance;
}

.credentials-divider--v {
  width: 100%;
  height: 1px;
  background: var(--color-line-strong);
}

@media (min-width: 680px) {
  .credentials-divider--v { width: 1px; height: 96px; align-self: center; }
}

.credentials-highlight {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

@media (min-width: 680px) {
  .credentials-highlight { width: 200px; }
}

.credentials-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  width: 100%;
}

@media (min-width: 680px) {
  /* flex-start: si una etiqueta pasa a 2 líneas, filetes y cifras siguen en línea. */
  .credentials-row { flex-direction: row; align-items: flex-start; gap: 32px; }
}

.credentials-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.credentials-rule {
  width: 100%;
  height: 1px;
  background: var(--color-line-strong);
  margin-bottom: 6px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-exit) var(--ease-in);
}

.credentials-item[data-reveal-state='in'] .credentials-rule {
  transform: none;
  transition: transform 1300ms var(--ease-out) calc((var(--reveal-delay, 0ms) + 120ms) * var(--reveal-delay-scale, 1));
}

.credentials-row-divider {
  width: 100%;
  height: 1px;
  background: var(--color-line-strong);
}

@media (min-width: 680px) {
  .credentials-row-divider { width: 1px; height: 72px; }
}

.credentials-number {
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  line-height: 1.1;
}

.credentials-label {
  margin: 0;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
}

/* ---------- Sección 5 — móvil (Figma "Frame 31 mobile", 430 de ancho) ----------
   Una columna: 2016 → 13 → 10+ → 3-6 → 6-12, separados por filetes con 24px arriba y abajo. */

@media (max-width: 767px) {
  .credentials-section { padding: 56px 0; }

  .credentials-panel {
    padding: 36px 24px;
    gap: 24px;
    border-radius: 0;
  }

  .credentials-top,
  .credentials-row {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 24px;
  }

  .credentials-founding {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .founding-year {
    font-size: 80px;
    line-height: 76px;
  }

  .founding-text {
    font-size: 32px;
    line-height: 36px;
  }

  .credentials-divider--v,
  .credentials-row-divider {
    width: 100%;
    height: 1px;
    align-self: stretch;
    background: var(--color-line);
  }

  .credentials-row {
    padding-top: 24px;
    border-top: 1px solid var(--color-line);
  }

  /* Los filetes de cada cifra duplicarían los separadores. */
  .credentials-rule { display: none; }

  .credentials-highlight,
  .credentials-item {
    width: 100%;
    gap: 4px;
  }

  .credentials-number {
    font-size: 48px;
    line-height: 52px;
  }

  .credentials-label {
    font-size: 15px;
    line-height: 22px;
  }
}
/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(40px, 6vw, 90px);
  min-height: 100dvh;
  width: 100%;
  padding: max(clamp(24px, 6vw, 60px), 96px) clamp(24px, 6vw, 60px) clamp(24px, 6vw, 60px);
  overflow: hidden;
  /* Mientras la foto carga, fondo oscuro: el texto claro se lee desde el primer pintado. */
  background: var(--photo-base);
}

/* Foto en tres capas, cada una con su propio transform: parallax del scroll (.hero-bg),
   deriva lenta continua (.hero-drift) y asentamiento al cargar (la imagen, 1.08 → 1). */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  will-change: translate, scale;
}

.hero-drift {
  position: absolute;
  inset: 0;
  animation: hero-drift 34s var(--ease-in-out) 1.8s infinite alternate both;
}

@keyframes hero-drift {
  from { transform: none; }
  to { transform: translate3d(-1.4%, -0.9%, 0) scale(1.045); }
}

.hero-photo .photo-img {
  transition: opacity 0s linear var(--dur-photo), transform 1800ms var(--ease-out);
}

.hero-photo .photo-img:not([data-loaded]) { transform: scale(1.08); }

.hero-photo .photo-img[data-current][data-loaded] {
  transition: opacity 1200ms var(--ease-out), transform 1800ms var(--ease-out);
}

/* Velo por tema (tokens.css): noche en oscuro, carbón cálido sobre la foto de día en claro. */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--hero-veil);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 6vw, 45px);
}

/* Cada bloque se desvanece y se adelanta un poco al cruzar la franja superior del viewport. */
.hero-title,
.hero-copy,
.hero-tags {
  position: relative;
  z-index: 2;
  opacity: calc(1 - var(--parallax-exit, 0));
  translate: 0 calc(var(--parallax-exit, 0) * -40px);
}

/* ---------- Titular ----------
   --hero-em: ancho de la línea más larga en em (Bebas Neue, con su interletraje); fija el
   tamaño que llena el ancho en móvil. Si cambia el titular de un idioma, ajústalo abajo. */
.hero-title {
  --hero-em: 4.78;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(2px, 0.6vw, 8px);
}

.hero-title-line {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.75rem, -0.52rem + 14.52vw, 11.1rem);
  line-height: 0.86;
  letter-spacing: 0.02em;
  width: max-content;
  max-width: 100%;
}

.hero-letters { display: block; white-space: nowrap; }

/* Degradado por letra (cada caja tiene el alto de la línea: se ve como uno solo). */
.hero-letter {
  display: inline-block;
  padding-top: 0.2em;
  margin-top: -0.2em;
  background: linear-gradient(to top, var(--display-fill) 0%, var(--display-fill) 12%, var(--display-fade) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Entrada: además de subir tras su máscara, la línea llega desenfocada y con las letras
   abiertas desde el centro, y se asienta. Solo la primera vez (estado "below"). */
.hero-title-line[data-reveal-state='below'] .hero-mask { filter: blur(10px); }
.hero-title-line[data-reveal-state='below'] .hero-letter { transform: translateX(calc(var(--o) * 0.075em)); }

.hero-title-line[data-reveal-state='in'] .hero-mask {
  filter: none;
  transition:
    transform 1150ms var(--ease-out) var(--reveal-wait),
    filter 1300ms var(--ease-out) var(--reveal-wait);
}

.hero-title-line[data-reveal-state='in'] .hero-letter {
  transform: none;
  transition: transform 1900ms var(--ease-out) var(--reveal-wait);
}

/* --hero-em: línea más larga + 6 % de aire, con letter-spacing 0 (móvil).
   --line2-em: segunda línea con el interletraje de escritorio; limita su desplazamiento para
   que nunca pase del borde (en 1024 px el francés se salía). */
.hero-title { --line2-em: 4.8; }
:lang(en) .hero-title { --hero-em: 4.72; --line2-em: 4.72; }
:lang(es) .hero-title { --hero-em: 4.76; --line2-em: 4.1; }

@media (min-width: 1024px) {
  .hero-title-line--offset {
    margin-left: max(0px, min(32vw, 29.4rem, calc(100% - var(--line2-em) * 1em)));
  }
}

/* ---------- Texto, botones y etiquetas ---------- */

.hero-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(28px, 4vw, 40px);
  width: 100%;
}

@media (min-width: 900px) {
  .hero-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  max-width: min(29rem, 100%);
  isolation: isolate;
}

/* Sombra local detrás del texto (solo en claro, --hero-copy-scrim; en oscuro es transparente). */
.hero-copy::before {
  content: '';
  position: absolute;
  inset: -48px -72px -40px -64px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--hero-copy-scrim), transparent);
}

.hero-subtitle {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(0.95rem, 1.4vw, 1.125rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 14px;
  width: 100%;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

@media (min-width: 900px) {
  .hero-tags {
    justify-content: flex-end;
    width: auto;
    max-width: 25rem;
    flex-shrink: 0;
  }
}

.tag {
  --reveal-delay: calc(950ms + var(--i, 0) * 80ms);
  padding: 13px 22px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--color-line-strong);
  background: var(--photo-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

/* ---------- Hero — móvil (Figma "Frame 39", 430×932) ----------
   Orden: título → etiquetas → (al fondo) subtítulo + CTA. .hero-inner / .hero-footer pasan a
   `display: contents` para que sus hijos se ordenen como hijos directos de .hero. */

@media (max-width: 767px) {
  .hero {
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: 132px 24px 24px;
  }

  .hero-inner,
  .hero-footer { display: contents; }

  .hero-title {
    order: 1;
    gap: 0;
  }

  .hero-title-line {
    font-size: min(80px, calc((100vw - 48px) / var(--hero-em)));
    line-height: 1.2;
    letter-spacing: 0;
    width: auto;
    align-self: flex-start;
  }

  .hero-title-line--offset { align-self: flex-end; }

  .hero-tags {
    order: 2;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 64px; /* respiro mínimo en pantallas bajas */
  }

  .tag {
    --reveal-delay: calc(500ms + var(--i, 0) * 80ms);
    padding: 11px 16px;
    font-size: 12px;
  }

  .hero-copy {
    order: 3;
    margin-top: auto;
    max-width: none;
    width: 100%;
    gap: 24px;
  }

  .hero-subtitle {
    font-size: 17px;
    line-height: 1.5;
  }

  .hero-ctas {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
  }

  .hero-ctas .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-drift { animation: none; }
}
/* ---------- Sección 3 — Proyectos recientes ---------- */

.projects-section {
  background: var(--color-bg);
  padding: clamp(56px, 8vw, 96px) clamp(20px, 6vw, 80px);
}

.projects-grid {
  /* Mismo ancho máximo que las demás secciones (1280): a 1920 no se estira de borde a borde. */
  max-width: 1280px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* .projects-grid delante: estas reglas van antes que la regla base de .project-title-card (aspect-ratio)
   y sin ese extra de especificidad no la vencían (la tarjeta del título medía ~900 px en 2 columnas). */
@media (min-width: 680px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .project-cell--title { grid-column: 1 / -1; }
  .projects-grid .project-title-card { aspect-ratio: auto; min-height: 220px; }
}

/* 3 columnas desde 1200: a 1024 las tarjetas medían 323 px de alto y el N° tocaba el año. */
@media (min-width: 1200px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
  .project-cell--title { grid-column: auto; }
  .projects-grid .project-title-card { aspect-ratio: 410 / 465; min-height: 0; }
}

/* Inclinación con el cursor (usePointerTilt escribe --tilt-x/-y). Al salir vuelve despacio. */
.project-tilt {
  transform: perspective(1100px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  transition: transform 900ms var(--ease-out);
}

.project-tilt[data-tilting] { transition-duration: 300ms; }

.project-title-card,
.project-card {
  position: relative;
  aspect-ratio: 410 / 465;
  border-radius: 4px;
  overflow: hidden;
  /* Hover: elevación con `translate`, independiente del transform del reveal. */
  --reveal-extra: translate 700ms var(--ease-out), box-shadow 700ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .project-title-card:hover,
  .project-card:hover,
  .project-card:focus-within {
    translate: 0 -8px;
    box-shadow: var(--shadow-lift);
  }
}

/* Brillo que sigue al cursor: un círculo difuso movido con transform (--glow-x/-y). */
.project-glow {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--color-accent-glow), transparent);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(calc(var(--glow-x, 100%) - 50%), calc(var(--glow-y, 0%) - 50%), 0);
  transition: opacity 700ms var(--ease-out);
}

[data-tilting] .project-glow { opacity: 1; }

.project-title-card {
  background: var(--color-accent);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}

.project-title-card .project-glow { background: radial-gradient(closest-side, var(--accent-card-glow), transparent); }

.project-title-card h2 {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 11ch;
  color: var(--color-accent-soft);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.1rem, 3.6vw, 3.5rem);
  line-height: 0.94;
  text-wrap: balance;
}

.project-title-intro {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 30ch;
  color: var(--color-accent-soft);
  font-size: 1.0625rem;
  line-height: 1.5;
  text-wrap: pretty;
}

/* Tarjetas aún sin foto: trama de plano sobre un degradado del tema, para que se lean como recurso de diseño. */
.project-card {
  --focus-ring: var(--color-accent);
  background: linear-gradient(155deg, var(--card-top) 0%, var(--card-bottom) 100%);
  box-shadow: inset 0 0 0 1px var(--card-edge);
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--card-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--card-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 65%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 65%);
  transition: translate 1200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover::before,
  .project-card:focus-within::before { translate: 0 12px; }
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 24px 23px;
  background: linear-gradient(180deg, transparent 0%, var(--card-fade) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 12px;
}

.project-year {
  padding: 10px 20px;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  font-variant-numeric: tabular-nums;
}

.project-card-title {
  margin: 0;
  align-self: stretch;
  color: var(--card-title);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 0.98;
  text-wrap: balance;
}

/* Número de catálogo arriba a la izquierda (N° 01…): da ritmo a las tarjetas que aún no tienen foto. */
.project-index {
  position: absolute;
  /* Por encima del velo de la tarjeta (.project-card-overlay, z-index 2). */
  z-index: 3;
  top: 20px;
  left: 23px;
  color: var(--card-index, var(--color-text-subtle));
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.project-index small {
  margin-right: 0.2em;
  font-size: 0.42em;
  vertical-align: 0.95em;
  letter-spacing: 0.08em;
}

.project-card-meta {
  margin: -4px 0 4px;
  color: var(--card-meta);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 2px 2px 2px 20px;
  border: 0;
  background: var(--btn-solid-bg);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

/* Con portada (images[0] en site.ts): la foto llena la tarjeta, sin trama, y el texto pasa a claro. */
.project-card.has-cover {
  --card-title: var(--photo-text);
  --card-meta: var(--photo-text-muted);
  --card-index: var(--photo-text);
}

.project-card.has-cover::before { display: none; }

.project-card.has-cover .project-index { text-shadow: 0 2px 18px rgb(0 0 0 / 0.55); }

.project-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 1400ms var(--ease-out);
}

/* Velo arriba (para el N°) y abajo (para el texto): los renders de la clienta son claros. */
.project-card.has-cover .project-card-overlay {
  background:
    linear-gradient(180deg, rgb(12 11 11 / 0.5) 0%, transparent 24%),
    linear-gradient(180deg, transparent 32%, rgb(12 11 11 / 0.6) 58%, rgb(12 11 11 / 0.9) 100%);
}

@media (hover: hover) and (pointer: fine) {
  .project-card.has-cover:hover .project-cover { scale: 1.04; }
}

.project-cta-label {
  color: var(--btn-solid-fg);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.project-cta-icon {
  width: 53px;
  height: 53px;
  border-radius: 999px;
  background: var(--btn-solid-fg);
  color: var(--btn-solid-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 500ms var(--ease-out), color 500ms var(--ease-out);
}

.project-cta-icon .arrow-swap { width: 38%; height: 38%; }

@media (hover: hover) and (pointer: fine) {
  .project-card:hover .project-cta-icon {
    background: var(--color-accent);
    color: var(--color-accent-contrast);
  }
}

.project-cta:focus-visible .project-cta-icon {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}

/* Flecha que sale en diagonal mientras entra su gemela desde abajo a la izquierda. */
.arrow-swap {
  position: relative;
  display: block;
  overflow: hidden;
}

.arrow-swap svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: translate 600ms var(--ease-out);
}

.arrow-swap svg + svg { translate: -120% 120%; }

@media (hover: hover) and (pointer: fine) {
  .project-card:hover .arrow-swap svg,
  .project-title-card:hover .arrow-swap svg { translate: 120% -120%; }

  .project-card:hover .arrow-swap svg + svg,
  .project-title-card:hover .arrow-swap svg + svg { translate: 0 0; }
}

.project-cta:focus-visible .arrow-swap svg { translate: 120% -120%; }

.project-cta:focus-visible .arrow-swap svg + svg { translate: 0 0; }

/* ---------- Sección 3 — móvil (Figma "Frame 14", 430×663) ----------
   Carrusel horizontal (382×465, gap 24px) con snap y sin barra. */

@media (max-width: 767px) {
  .projects-section { padding: 96px 0; }

  .projects-grid {
    display: flex;
    gap: 16px;
    padding-inline: 24px;
    /* Holgura vertical para que la entrada (sube 32px) no se recorte contra el carrusel. */
    padding-block: 40px;
    margin-block: -40px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 24px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .projects-grid::-webkit-scrollbar { display: none; }

  .project-cell {
    flex: 0 0 auto;
    /* 382px como máximo; la siguiente tarjeta asoma ~48 px para que se vea que hay más. */
    width: min(382px, calc(100vw - 88px));
    scroll-snap-align: start;
  }

  /* La tarjeta azul del título, estrecha: el primer proyecto se ve desde el principio. */
  .project-cell--title { width: min(250px, 62vw); }

  .project-title-card,
  .project-card {
    aspect-ratio: 382 / 465;
    min-height: 0;
  }

  .project-title-card h2 {
    font-size: clamp(44px, 14vw, 56px);
    line-height: 0.98;
  }

  .project-card-title {
    font-size: clamp(32px, 9.5vw, 40px);
    line-height: 0.96;
  }
}

/* ---------- Tarjeta de cierre (solo con la rejilla desplegada; en móvil, al final del carrusel) ---------- */

.project-next-card {
  position: relative;
  aspect-ratio: 410 / 465;
  border-radius: 4px;
  overflow: hidden;
  padding: clamp(24px, 3vw, 40px);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  --reveal-extra: translate 700ms var(--ease-out), box-shadow 700ms var(--ease-out);
}

.project-next-title {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 14ch;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.25rem, 4vw, 4rem);
  line-height: 0.94;
  text-wrap: balance;
}

.project-next-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.project-next-text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  line-height: 1.5;
}

@media (hover: hover) and (pointer: fine) {
  .project-next-card:hover { translate: 0 -8px; box-shadow: inset 0 0 0 1px var(--color-line-strong), var(--shadow-lift); }
}

/* ---------- Rejilla plegada (desde 768 px) ----------
   Plegada: título + PROJECTS_PREVIEW tarjetas (2 filas de 3); en 2 columnas, una menos (2 filas de 2).
   Desplegada: todas + la tarjeta de cierre, que llena el hueco de la última fila. */

@media (min-width: 768px) {
  .projects-grid:not(.is-expanded) .project-cell--extra,
  .projects-grid:not(.is-expanded) .project-cell--next { display: none; }

  /* Las que aparecen al desplegar entran escalonadas (la animación arranca al pasar de display:none). */
  .projects-grid.is-expanded :is(.project-cell--extra, .project-cell--next) .project-tilt {
    animation: project-extra-in 900ms var(--ease-out) both;
    animation-delay: calc(var(--extra-rank, 0) * 70ms);
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .projects-grid:not(.is-expanded) .project-cell--extra-md { display: none; }

  .projects-grid.is-expanded .project-cell--extra-md .project-tilt {
    animation: project-extra-in 900ms var(--ease-out) both;
  }

  .project-cell--next { grid-column: 1 / -1; }
  .project-next-card { aspect-ratio: auto; min-height: 240px; }
}

@media (min-width: 1200px) {
  .project-cell--next { grid-column: span 2; }

  .project-cell--next,
  .project-cell--next .project-tilt,
  .project-next-card { height: 100%; }

  .project-next-card { aspect-ratio: auto; }
}

@keyframes project-extra-in {
  from { opacity: 0; translate: 0 40px; }
}

/* Indicador del carrusel móvil (la barra del sistema va oculta): parte visible + posición
   (left / width, que escribe Projects.tsx al desplazar). */
.projects-scrollbar { display: none; }

@media (max-width: 767px) {
  .projects-scrollbar {
    display: block;
    position: relative;
    height: 2px;
    margin: 32px 24px 0;
    border-radius: 2px;
    background: var(--color-line-strong);
    overflow: hidden;
  }

  .projects-scrollbar-thumb {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 10%;
    border-radius: 2px;
    background: var(--color-accent-text);
  }
}

.projects-more {
  display: flex;
  justify-content: center;
  margin-top: clamp(32px, 4vw, 48px);
}

/* ---------- Ficha del proyecto (<dialog>) ---------- */

/* scrollbar-gutter: sin él, la página salta 15 px a la derecha detrás del velo (Windows). */
html.has-dialog { overflow: hidden; scrollbar-gutter: stable; }

.project-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  max-height: min(88vh, 920px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-lift);
  overflow: auto;
  overscroll-behavior: contain;
}

.project-dialog::backdrop {
  background: rgb(10 9 9 / 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.project-dialog-inner {
  --dlg-pad: clamp(28px, 5vw, 56px);
  position: relative;
  padding: var(--dlg-pad);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

/* Fundido pegado al borde inferior: indica que la ficha sigue (al final cae sobre el relleno). */
.project-dialog-inner::after {
  content: '';
  position: sticky;
  bottom: 0;
  flex: none;
  align-self: stretch;
  height: 40px;
  margin: 0 calc(-1 * var(--dlg-pad)) calc(-1 * var(--dlg-pad));
  background: linear-gradient(to bottom, transparent, var(--color-surface));
  pointer-events: none;
}

/* Cerrar: pegado arriba a la derecha mientras se recorre la galería (primer hijo, sticky). Los
   márgenes negativos lo llevan a la esquina y le quitan su hueco en el flujo (44 px + 14 de gap). */
.project-dialog-close {
  position: sticky;
  top: 16px;
  z-index: 3;
  align-self: flex-end;
  flex: none;
  margin: calc(16px - var(--dlg-pad)) calc(16px - var(--dlg-pad)) -58px 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--color-surface-strong);
  color: var(--color-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 400ms var(--ease-out), color 400ms var(--ease-out);
}

.project-dialog-close svg { width: 16px; height: 16px; }

@media (hover: hover) and (pointer: fine) {
  .project-dialog-close:hover {
    background: var(--color-accent);
    color: var(--color-accent-contrast);
  }
}

.project-dialog-eyebrow {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding-right: 52px;
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 500;
}

.project-dialog-title {
  margin: 8px 0 0;
  max-width: 18ch;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 0.95;
  text-wrap: balance;
}

.project-dialog-type {
  margin: 0;
  color: var(--color-accent-text);
  font-size: 1.0625rem;
  font-weight: 600;
}

/* Imágenes enteras, sin recortar: la principal a todo el ancho y el resto en dos columnas
   (verticales y apaisadas conviven sin huecos). Los planos van sobre su blanco, con filete. */
.project-dialog-hero {
  width: 100%;
  margin-top: 10px;
}

.project-dialog-gallery {
  width: 100%;
  margin-bottom: 18px;
  columns: 2 240px;
  column-gap: 12px;
}

.project-dialog-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: var(--color-surface-strong);
}

.project-dialog-gallery .project-dialog-img {
  margin-bottom: 12px;
  break-inside: avoid;
}

.project-dialog-img--plan {
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.project-dialog-desc {
  margin: 10px 0 8px;
  max-width: 62ch;
  color: var(--color-text-muted);
  font-size: 1.125rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.project-dialog-cta { margin-top: 10px; }

@media (max-width: 767px) {
  .project-next-card { aspect-ratio: 382 / 465; }

  /* En el carrusel se ven todas: el botón de desplegar sobra. */
  .projects-more { display: none; }

  .project-dialog { max-height: 92vh; }
  .project-dialog-desc { font-size: 1.0625rem; }
}

@media (prefers-reduced-motion: reduce) {
  .projects-grid.is-expanded .project-tilt { animation: none !important; }
  .project-cover { transition: none; }
}
/* ---------- Servicios — Nos services ---------- */

.services-section {
  background: var(--color-bg-alt);
  padding: clamp(64px, 10vw, 112px) clamp(20px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(40px, 6vw, 72px);
}

.services-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2.4vw, 24px);
  text-align: center;
}

/* Mismo tamaño que los titulares de sección (.approach-title). */
.services-title {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.25rem, 7.5vw, 5.625rem);
  line-height: 0.98;
}

.services-intro {
  margin: 0;
  max-width: 60ch;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-wrap: balance;
}

/* ---------- Rejilla: 2 o 3 tarjetas (data-cols = grupos visibles) ---------- */

.services-grid {
  width: 100%;
  max-width: 1280px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2vw, 24px);
}

/* Dos columnas desde 900 px: por debajo, las tarjetas serían demasiado estrechas para la lista. */
@media (min-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Con tres grupos en tableta, el tercero ocupa toda la fila. */
  .services-grid[data-cols='3'] > :last-child { grid-column: 1 / -1; }
}

@media (min-width: 1100px) {
  .services-grid[data-cols='3'] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .services-grid[data-cols='3'] > :last-child { grid-column: auto; }
}

/* ---------- Tarjeta ---------- */

.services-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Relleno en variables: la foto de cabecera (.services-media) sangra hasta el borde. */
  --pad-top: clamp(28px, 4vw, 48px);
  --pad-x: clamp(28px, 4vw, 48px);
  padding: var(--pad-top) var(--pad-x) clamp(28px, 4vw, 48px);
  background: var(--color-surface);
  border-radius: 4px;
  /* Hover: elevación con `translate`, independiente del transform del reveal. */
  --reveal-extra: translate 700ms var(--ease-out), box-shadow 700ms var(--ease-out);
}

/* Filete de acento arriba: se dibuja de izquierda a derecha al pasar el cursor. */
.services-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 700ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .services-card:hover {
    translate: 0 -6px;
    box-shadow: var(--shadow-lift);
  }

  .services-card:hover::before { transform: none; }
}

/* Número + línea que llena el resto de la fila. */
.services-num {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 clamp(20px, 3vw, 32px);
  color: var(--color-accent-text);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 4vw, 3.25rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.services-num::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--color-line-strong);
}

.services-card-title {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  line-height: 1;
  text-wrap: balance;
}

.services-lead {
  margin: 14px 0 clamp(24px, 3vw, 36px);
  max-width: 46ch;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* ---------- Lista ---------- */

.services-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.services-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 0;
}

.services-item:last-child { padding-bottom: 0; }

/* Separador sobre cada fila. */
.services-item::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--color-line);
}

.services-item-name {
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.services-item-text {
  margin: 0;
  max-width: 62ch;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* Solo nombre (pige): fila más compacta con un pequeño cuadrado de acento. */
.services-item--name {
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
}

.services-item--name::after {
  content: '';
  order: -1;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 9px;
  border-radius: 1px;
  background: var(--color-accent-text);
}

/* ---------- Foto de cabecera (fotos de su sitio anterior, en B/N) ---------- */

.services-media {
  margin: calc(-1 * var(--pad-top)) calc(-1 * var(--pad-x)) clamp(24px, 3vw, 36px);
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: var(--color-surface-strong);
}

.services-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04);
  transition: scale 1400ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .services-card:hover .services-media img { scale: 1.04; }
}

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

/* ---------- Tarjetas lado a lado: filas compartidas (subgrid) ----------
   Cada tarjeta ocupa --rows filas de la rejilla (número, título, entradilla y --items servicios)
   y su lista otras --items: títulos, entradillas y separadores se alinean de una tarjeta a otra,
   y la tarjeta de pige (solo nombres) no deja un hueco al final. Sin subgrid, cada tarjeta
   conserva su propia altura de contenido. */

@supports (grid-template-rows: subgrid) {
  @media (min-width: 900px) {
    .services-grid { row-gap: 0; }

    .services-card {
      display: grid;
      grid-row: span var(--rows);
      grid-template-rows: subgrid;
      row-gap: 0;
      align-content: start;
    }

    /* Si un título ocupa más líneas que el de al lado, el hueco queda bajo el número. */
    .services-card-title { align-self: end; }

    .services-items {
      display: grid;
      grid-row: span var(--items);
      grid-template-rows: subgrid;
      row-gap: 0;
    }

    /* Solo nombres: ocupa las mismas filas pero se apila arriba, sin heredar su altura. */
    .services-items--names {
      display: flex;
      flex-direction: column;
      align-self: start;
    }

    /* Tableta con tres grupos: el tercero baja a otra fila. */
    .services-grid[data-cols='3'] > :last-child { margin-top: clamp(16px, 2vw, 24px); }
  }

  @media (min-width: 1100px) {
    .services-grid[data-cols='3'] > :last-child { margin-top: 0; }
  }
}

/* ---------- Entrada: la línea del número y los separadores se dibujan tras la tarjeta ---------- */

.services-num::after,
.services-item::before {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-exit) var(--ease-in);
}

.services-card[data-reveal-state='in'] .services-num::after,
.services-card[data-reveal-state='in'] .services-item::before {
  transform: none;
  transition: transform 1300ms var(--ease-out)
    calc((var(--reveal-delay, 0ms) + 200ms + var(--i, -1) * 90ms + 90ms) * var(--reveal-delay-scale, 1));
}

/* ---------- Móvil ---------- */

@media (max-width: 767px) {
  .services-section {
    padding: 56px 24px;
    gap: 32px;
  }

  .services-title {
    font-size: clamp(38px, 11.5vw, 46px);
    line-height: 0.96;
  }

  .services-intro {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.75;
  }

  .services-card {
    --pad-top: 28px;
    --pad-x: 24px;
    padding: 28px 24px 32px;
  }

  .services-num {
    font-size: 40px;
    margin-bottom: 20px;
  }

  .services-card-title { font-size: 32px; }

  .services-lead {
    font-size: 15px;
    line-height: 1.7;
  }

  .services-item { padding: 18px 0; }
  .services-item--name { padding: 14px 0; }
  .services-item--name::after { margin-top: 8px; }
  .services-item-name { font-size: 16px; }
  .services-item-text { font-size: 15px; line-height: 1.65; }
}

@media (prefers-reduced-motion: reduce) {
  .services-card:hover { translate: none; }
}
/* ---------- Pie de página ---------- */

.footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-line);
  padding: clamp(56px, 8vw, 88px) clamp(20px, 6vw, 80px) clamp(24px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(40px, 6vw, 64px);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Logotipo completo (imagen de marca): el símbolo azul mide lo mismo que las dos líneas de texto.
   Todo en em sobre el tamaño del símbolo. Con line-height ≈ altura de las mayúsculas, el nombre
   queda a ras del borde superior del símbolo y la segunda línea, de su borde inferior. */
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.17em;
  font-size: clamp(48px, 5vw, 60px);
  line-height: 0;
  color: var(--color-text);
  border-radius: 2px;
}

.footer-logo-symbol {
  flex-shrink: 0;
  display: block;
  width: 1em;
  height: 1em;
  color: var(--color-accent);
}

.footer-logo-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  height: 1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.footer-logo-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.66em;
  line-height: 0.74;
  letter-spacing: 0.01em;
}

.footer-logo-descriptor {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.4em;
  line-height: 0.74;
}

.footer-tagline {
  margin: 0;
  max-width: 30rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  text-wrap: balance;
}

.footer-columns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(48px, 10vw, 140px);
  width: 100%;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 140px;
}

.footer-col-title {
  color: var(--color-text);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.footer-link,
.footer-item {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
}

.footer-link {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: color 400ms var(--ease-out), background-size 500ms var(--ease-out);
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--color-text);
  background-size: 100% 1px;
}

.footer-bottom {
  width: 100%;
  max-width: 1280px;
  padding-top: 24px;
  border-top: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

@media (min-width: 680px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-copy,
.footer-tags {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
}
/* ---------- Selector de idioma "FR · EN · ES" ---------- */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.lang-switch-btn {
  position: relative;
  appearance: none;
  margin: 0;
  border: 0;
  padding: 10px 7px;
  background: none;
  color: var(--color-text-muted);
  font: 600 13px/1 var(--font-body);
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 6px;
  transition: color 400ms var(--ease-out);
}

/* Subrayado del idioma activo: se dibuja desde la izquierda. */
.lang-switch-btn::after {
  content: '';
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 4px;
  height: 1.5px;
  background: var(--color-accent-text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 450ms var(--ease-out);
}

.lang-switch-btn:hover,
.lang-switch-btn[aria-pressed='true'] { color: var(--color-text); }

.lang-switch-btn[aria-pressed='true']::after { transform: none; }

.lang-switch-dot {
  color: var(--color-text-subtle);
  font-size: 13px;
  user-select: none;
}

/* ---------- Botón de tema: sol ↔ luna ---------- */

.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--color-line-strong);
  transition: box-shadow 400ms var(--ease-out), color 400ms var(--ease-out);
}

.theme-toggle:hover { box-shadow: inset 0 0 0 1px var(--color-text); }

.theme-toggle--labelled {
  width: auto;
  padding: 0 20px 0 14px;
  font: 600 15px/1 var(--font-body);
}

.theme-icon {
  width: 20px;
  height: 20px;
  overflow: visible;
}

.theme-icon-core {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 700ms var(--ease-out);
}

.theme-icon-cut { transition: transform 700ms var(--ease-out); }

.theme-icon-rays {
  transform-origin: 12px 12px;
  transition: transform 700ms var(--ease-out), opacity 450ms var(--ease-out);
}

/* Claro: sol (núcleo pequeño, sin mordida, rayos). Oscuro: luna (núcleo grande mordido, sin rayos). */
.theme-toggle[data-icon='light'] .theme-icon-core { transform: scale(0.55); }
.theme-toggle[data-icon='light'] .theme-icon-cut { transform: translate(9px, -9px); }
.theme-toggle[data-icon='dark'] .theme-icon-rays {
  transform: rotate(-70deg) scale(0.45);
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .theme-toggle[data-icon='light']:hover .theme-icon-rays { transform: rotate(22.5deg); }
}

/* Interruptor del botón con etiqueta: azul de marca y bolita a la derecha con el modo oscuro activo. */
.theme-switch {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 20px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--color-line-strong);
  transition: background-color 400ms var(--ease-out);
}

.theme-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-bg);
  transition: translate 400ms var(--ease-out);
}

.theme-toggle[aria-pressed='true'] .theme-switch { background: var(--color-accent); }
.theme-toggle[aria-pressed='true'] .theme-switch-knob { translate: 14px 0; background: var(--color-accent-contrast); }
/* ---------- Header (fixed: transparente arriba → cristal al bajar; se oculta al bajar) ---------- */

html { scroll-padding-top: 80px; }

/* Progreso de lectura: fuera del header, así sigue visible cuando este se oculta. */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 101;
  height: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms var(--ease-out);
}

.scroll-progress.is-visible { opacity: 1; }

.scroll-progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-text));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* Al bajar la barra se compacta: el contenido sube --header-shrink y el cristal (::before)
   se queda sin esa franja por abajo. Solo transform/opacidad; la caja no cambia de alto. */
.site-header {
  --header-pad: clamp(16px, 2.4vw, 28px);
  --header-shrink: calc(var(--header-pad) - clamp(12px, 1.4vw, 16px));
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-block: var(--header-pad);
  color: var(--color-text);
  pointer-events: none;
  transition: transform 700ms var(--ease-out);
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0 0 calc(2 * var(--header-shrink)) 0;
  z-index: -1;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 1px 0 var(--glass-line);
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
}

.site-header.is-scrolled::before { opacity: 1; }

.site-header.is-hidden {
  transform: translateY(-100%);
  transition: transform 500ms var(--ease-in-out);
}

/* Con el menú abierto el fondo lo pone la capa del menú (así su fundido no se corta). */
.site-header.is-menu-open::before { opacity: 0; }

.site-header-inner {
  width: 100%;
  /* Misma caja que las secciones (1280 + 80 a cada lado): logo y CTA alineados con el contenido. */
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(24px, 6vw, 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  pointer-events: auto;
  transition: transform 600ms var(--ease-out);
  animation: header-enter 1000ms var(--ease-out) 100ms backwards;
}

.site-header.is-scrolled:not(.is-menu-open) .site-header-inner {
  transform: translateY(calc(-1 * var(--header-shrink)));
}

@keyframes header-enter {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 400ms var(--ease-out);
}

.site-logo:hover { opacity: 0.8; }

/* Símbolo de la marca en SVG (BrandSymbol), en el azul de la imagen de marca. Desde 1200 px va
   con el nombre y el descriptor (logotipo completo); por debajo, solo (logo alternativo de la marca). */
.site-logo-symbol {
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: var(--color-accent);
}

.site-logo-text { display: none; }

@media (min-width: 1200px) {
  .site-logo { gap: 7px; font-size: 40px; }

  .site-logo-text {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    height: 1em;
    color: var(--color-text);
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 500ms var(--ease-out);
  }

  .site-logo-name {
    font-family: var(--font-display);
    font-size: 0.66em;
    line-height: 0.74;
    letter-spacing: 0.01em;
  }

  .site-logo-descriptor {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.4em;
    line-height: 0.74;
  }

  /* Con el logotipo ancho, el menú sigue centrado: logo y acciones reparten el espacio. */
  .site-logo,
  .site-header-actions { flex: 1 1 0; }
  .site-header-actions { justify-content: flex-end; }
}

/* ---------- Menú con indicador que se desliza (scroll-spy + hover) ---------- */

.site-nav {
  position: relative;
  display: none;
  align-items: center;
  gap: clamp(22px, 2.6vw, 39px);
}

.site-nav a {
  position: relative;
  color: var(--color-text-muted);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  transition: color 400ms var(--ease-out);
}

.site-nav a[aria-current],
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--color-text); }

.site-nav-indicator {
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 1px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-accent-text);
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: 0;
  pointer-events: none;
}

.site-nav-indicator[data-ready] {
  opacity: 1;
  transition: transform 550ms var(--ease-out), opacity 300ms var(--ease-out);
}

/* ---------- Acciones: idioma, tema, CTA y botón del menú ---------- */

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header-lang { display: none; }

.site-header .btn--solid { padding: 12px 20px; }

@media (min-width: 900px) {
  .site-nav { display: flex; }
  .site-header-lang { display: inline-flex; margin-right: 4px; }
  .site-header .btn--solid { padding: 16px 22px; }
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--color-line-strong);
  transition: box-shadow 400ms var(--ease-out), color 400ms var(--ease-out);
}

.menu-toggle:hover { box-shadow: inset 0 0 0 1px var(--color-text); }

.menu-toggle-bars,
.menu-toggle-bars::before {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform 500ms var(--ease-out);
}

.menu-toggle-bars { position: relative; transform: translateY(-3px); }
.menu-toggle-bars::before { content: ''; position: absolute; top: 6px; }

.site-header.is-menu-open .menu-toggle-bars { transform: translateY(0) rotate(45deg); }
.site-header.is-menu-open .menu-toggle-bars::before { transform: translateY(-6px) rotate(-90deg); }

@media (min-width: 900px) {
  .menu-toggle { display: none; }
}

@media (max-width: 380px) {
  .site-header .btn--solid { display: none; }
}

/* Con el menú abierto el tema se cambia desde el propio menú (no se duplica el botón). */
@media (max-width: 899px) {
  .site-header.is-menu-open .site-header-theme { display: none; }
}

/* ---------- Menú móvil: capa a pantalla completa bajo la barra del header ----------
   z-index −1 dentro del contexto del header: queda por debajo del logo y del botón. */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: flex;
  flex-direction: column;
  padding: 112px clamp(24px, 6vw, 60px) 32px;
  overflow-y: auto;
  pointer-events: auto;
  background:
    radial-gradient(90% 45% at 50% 105%, var(--color-accent-glow), transparent 70%),
    var(--menu-bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 350ms var(--ease-in) 150ms, visibility 0s linear 500ms;
}

.site-header.is-menu-open .mobile-menu {
  opacity: 1;
  visibility: visible;
  transition: opacity 450ms var(--ease-out), visibility 0s;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
}

.mobile-menu-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-block: 16px 12px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: clamp(40px, 12vw, 64px);
  line-height: 1;
  letter-spacing: 0.02em;
}

/* Filete que se dibuja de izquierda a derecha. */
.mobile-menu-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--color-line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms var(--ease-in);
}

.mobile-menu-clip {
  display: block;
  overflow: hidden;
  padding-block: 0.12em;
  margin-block: -0.12em;
}

.mobile-menu-label {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 250ms var(--ease-in), color 400ms var(--ease-out);
}

/* Sección actual: punto de acento que crece junto al texto. */
.mobile-menu-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent-text);
  transform: scale(0);
  transition: transform 500ms var(--ease-out);
}

.mobile-menu-link[aria-current] .mobile-menu-label { color: var(--color-accent-text); }
.site-header.is-menu-open .mobile-menu-link[aria-current] .mobile-menu-dot {
  transform: none;
  transition-delay: calc(450ms + var(--i, 0) * 70ms);
}

.site-header.is-menu-open .mobile-menu-label {
  transform: none;
  transition: transform 850ms var(--ease-out) calc(120ms + var(--i, 0) * 70ms), color 400ms var(--ease-out);
}

.site-header.is-menu-open .mobile-menu-link::after {
  transform: scaleX(1);
  transition: transform 1000ms var(--ease-out) calc(200ms + var(--i, 0) * 70ms);
}

.mobile-menu-link:hover .mobile-menu-label,
.mobile-menu-link:focus-visible .mobile-menu-label { color: var(--color-accent-text); }

.mobile-menu-link:focus-visible { outline-offset: -2px; }

/* Idioma y tema al pie del menú. */
.mobile-menu-settings {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 250ms var(--ease-in), transform 250ms var(--ease-in);
}

.site-header.is-menu-open .mobile-menu-settings {
  opacity: 1;
  transform: none;
  transition: opacity 700ms var(--ease-out) 420ms, transform 900ms var(--ease-out) 420ms;
}

@media (min-width: 900px) {
  .mobile-menu { display: none; }
}

/* Con movimiento reducido no hay nada que siga al scroll: ni barra de progreso ni header que se oculta. */
@media (prefers-reduced-motion: reduce) {
  .site-header-inner { animation: none; }
  .scroll-progress { display: none; }
}

/* Menú abierto: la raíz toma el color del menú (si no, la franja reservada para la barra de
   desplazamiento, scrollbar-gutter, muestra el fondo de la página y corta el resplandor). */
html:has(.site-header.is-menu-open) { background: var(--menu-bg); }

/* "Aller au contenu": invisible hasta recibir el foco con el teclado. */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font: 600 15px/1 var(--font-body);
  transform: translateY(calc(-100% - 24px));
  transition: transform 300ms var(--ease-out);
}

.skip-link:focus-visible { transform: none; outline-color: var(--color-accent-contrast); }
/* ---------- Sección 2 — Cifras (sobre foto: texto claro en los dos temas) ---------- */

.stats-section {
  position: relative;
  background: var(--photo-base);
  padding: clamp(56px, 10vw, 120px) clamp(24px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 10vw, 140px);
  overflow: hidden;
}

/* Capa de fondo con parallax: sobresale lo que puede llegar a desplazarse (speed 0.12 = 12vh). */
.stats-bg {
  position: absolute;
  inset: -13vh 0;
  z-index: 0;
  will-change: translate, scale;
}

.stats-bg-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
}

.stats-bg.is-playing .stats-bg-video { opacity: 1; }

/* Velo fijo sobre el fondo (no se mueve con el parallax); cambia con el tema. */
.stats-section::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--stats-veil);
}

.stats-headline,
.stats-row {
  position: relative;
  z-index: 1;
  /* Mismo ancho máximo que las demás secciones (1280): a 1920 no se estira de borde a borde. */
  max-width: 1280px;
  margin-inline: auto;
}

/* Un solo h2 con las dos frases (antes eran dos h2 seguidos, sin nada entre ellos). */
.stats-headline {
  margin-block: 0;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

@media (min-width: 900px) {
  .stats-headline {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: clamp(24px, 6vw, 60px);
  }
}

.stats-headline-line {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 7vw, 6.3rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
}

.stats-headline-line--muted { color: var(--color-text-muted); }
.stats-headline-line--bright { color: var(--color-text); }

/* 768–899: aún apiladas, pero con aire y la segunda a la derecha (contrapunto como en escritorio). */
@media (min-width: 768px) and (max-width: 899px) {
  .stats-headline { gap: 28px; }
  .stats-headline-line--bright { text-align: right; }
}

@media (min-width: 900px) {
  .stats-headline-line--bright { text-align: right; }
}

.stats-row {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

@media (min-width: 680px) {
  .stats-row {
    flex-direction: row;
    align-items: stretch;
    gap: 32px;
  }
}

.stat-divider {
  background: var(--color-line);
  width: 100%;
  height: 1px;
}

@media (min-width: 680px) {
  .stat-divider { width: 1px; height: auto; }
}

/* Cristal oscuro en los dos temas: el texto claro se lee sobre cualquier fotograma del vídeo. */
.stat-card {
  flex: 1 1 0;
  padding: 24px;
  border-radius: 4px;
  background: var(--photo-glass);
  box-shadow: inset 0 0 0 1px var(--photo-edge);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-number {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(1.75rem, 3vw, 2.375rem);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 28ch;
  text-wrap: pretty;
}

/* ---------- Sección 2 — móvil (Figma "Frame 41", 430×923) ----------
   Orden: tarjetas primero, 210px, titular. */

@media (max-width: 767px) {
  .stats-section {
    padding: 24px;
    gap: 210px;
  }

  /* En móvil el parallax va a la mitad: basta con la mitad de margen. */
  .stats-bg { inset: -7vh 0; }

  .stats-section::after { background: var(--stats-veil-mobile); }

  .stats-row {
    order: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .stats-headline {
    order: 2;
    flex-direction: column;
    gap: 24px;
  }

  .stat-card {
    padding: 22px 24px;
    gap: 2px;
    background: var(--photo-glass-strong);
  }

  .stat-number {
    font-size: 22px;
    line-height: 33px;
  }

  .stat-label {
    font-size: 14px;
    line-height: 21px;
    max-width: none;
  }

  .stat-divider {
    align-self: center;
    width: 291px;
    max-width: 100%;
    height: 1px;
  }

  .stats-headline-line {
    /* 68px a 430px de ancho (382px útiles); escala proporcional por debajo */
    font-size: min(68px, calc((100vw - 48px) * 0.178));
    line-height: 0.882;
    letter-spacing: 0;
  }

  .stats-headline-line--muted { color: var(--color-text-muted); }
  .stats-headline-line--bright { text-align: right; }
}
/* ---------- Témoignages ----------
   Va justo después de Repères, con el mismo fondo: las dos se leen como un solo bloque. El
   margen inferior de Repères ya separa, así que aquí no hay padding arriba (como Repères tras
   el Enfoque). */

.testimonials-section {
  background: var(--color-bg-alt);
  padding: 0 clamp(20px, 6vw, 80px) clamp(64px, 10vw, 112px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(32px, 6vw, 56px);
}

/* Mismo tamaño que los titulares de sección (.approach-title). */
.testimonials-title {
  margin: 0;
  text-align: center;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.25rem, 7.5vw, 5.625rem);
  line-height: 0.98;
}

.testimonials-grid {
  width: 100%;
  max-width: 1280px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2vw, 24px);
}

@media (min-width: 768px) {
  .testimonials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Tarjeta ---------- */

.testimonial {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(20px, 2.4vw, 28px);
  padding: clamp(28px, 4vw, 48px);
  background: var(--color-surface);
  border-radius: 4px;
  /* Hover: elevación con `translate`, independiente del transform del reveal. */
  --reveal-extra: translate 700ms var(--ease-out), box-shadow 700ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .testimonial:hover {
    translate: 0 -4px;
    box-shadow: var(--shadow-lift);
  }
}

.testimonial-mark {
  display: block;
  flex: 0 0 auto;
  width: clamp(30px, 3vw, 38px);
  height: auto;
  color: var(--color-accent-text);
}

.testimonial-quote {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(1.125rem, 1.45vw, 1.25rem);
  line-height: 1.6;
  text-wrap: pretty;
}

/* El pie va siempre abajo: los nombres quedan alineados en cada fila. */
.testimonial-caption {
  --name-size: 1.5rem;
  --name-lh: 1.05;
  margin-top: auto;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-top: 4px;
}

/* El filete se centra en la línea del nombre. */
.testimonial-rule {
  flex: 0 0 auto;
  width: 28px;
  height: 2px;
  margin-top: calc(var(--name-size) * var(--name-lh) / 2 - 1px);
  background: var(--color-accent-text);
}

.testimonial-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Lado a lado: alto reservado para nombre + lugar, así un nombre sin lugar queda a la altura
   del de la tarjeta vecina. */
@media (min-width: 768px) {
  .testimonial-who { min-height: calc(var(--name-size) * var(--name-lh) + 2px + 0.9375rem * 1.4); }
}

.testimonial-name {
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: var(--name-size);
  line-height: var(--name-lh);
  letter-spacing: 0.02em;
}

.testimonial-place {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

/* ---------- Móvil ---------- */

@media (max-width: 767px) {
  .testimonials-section {
    padding: 0 24px 56px;
    gap: 24px;
  }

  .testimonials-title {
    font-size: clamp(38px, 11.5vw, 46px);
    line-height: 0.96;
  }

  .testimonials-grid { gap: 16px; }

  .testimonial {
    gap: 20px;
    padding: 28px 24px;
  }

  .testimonial-quote {
    font-size: 1.0625rem;
    line-height: 1.65;
  }

  .testimonial-caption { --name-size: 1.375rem; }
}

@media (prefers-reduced-motion: reduce) {
  .testimonial:hover { translate: none; }
}
