/* ==========================================================================
   IBD · V2 "Garage" — hoja de estilos
   Capas: reset → tokens → base → components → sections → utilities
   Todo valor de diseño sale de los tokens: si querés cambiar algo, empezá ahí.
   ========================================================================== */
@layer reset, tokens, base, components, sections, utilities;

@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-var-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("../assets/fonts/exo2-var-italic-latin.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

/* ============================== RESET ============================== */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  button, input { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  ul, ol { list-style: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
}

/* ============================== TOKENS ============================== */
@layer tokens {
  :root {
    color-scheme: dark;

    /* Color */
    --c-bg: #08080a;
    --c-surface: #111114;
    --c-glass: rgba(8, 8, 10, .62);          /* paneles flotantes con blur */
    --c-line: rgba(255, 255, 255, .1);
    --c-line-2: rgba(255, 255, 255, .2);
    --c-text: #f4f2ee;
    --c-text-2: #a3a7b0;                      /* 8,1:1 sobre el fondo */
    --c-gold: #eab44a;                        /* único acento */
    --c-gold-2: #ffd27a;
    --c-gold-a10: rgba(234, 180, 74, .1);
    --c-gold-a35: rgba(234, 180, 74, .35);
    --c-gold-a50: rgba(234, 180, 74, .5);

    /* Tipografía */
    --f-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --f-accent: "Exo 2", "Inter", system-ui, sans-serif;
    --fs-xs: .75rem; --fs-sm: .875rem; --fs-base: 1rem;
    --fs-md: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
    --fs-lg: clamp(1.5rem, 1.1rem + 1.5vw, 2.25rem);
    --fs-xl: clamp(2.5rem, 1.4rem + 4.6vw, 5.5rem);
    --fs-2xl: clamp(3rem, 1.2rem + 7.4vw, 8.5rem);
    --lh-display: .92;
    --lh-tight: 1.1;
    --lh-body: 1.6;
    --tr-display: -.035em;
    --tr-tight: -.02em;
    --tr-caps: .22em;

    /* Espaciado (4/8/16/24/32/48/64/96/128) */
    --s-1: 4px; --s-2: 8px; --s-3: 16px; --s-4: 24px; --s-5: 32px; --s-6: 48px; --s-7: 64px; --s-8: 96px; --s-9: 128px;
    --gutter: clamp(16px, 4.5vw, 72px);
    --maxw: 1520px;

    /* Formas y tamaños */
    --r-sm: 6px; --r-md: 10px; --r-lg: 18px; --r-pill: 999px;
    --tap: 44px;              /* área táctil mínima */
    --ctl-h: 44px;            /* alto de botones */
    --ctl-h-sm: 36px;

    /* Profundidad */
    --sh-card: 0 30px 60px -20px rgba(0, 0, 0, .8);
    --sh-glow: 0 0 32px rgba(234, 180, 74, .45);
    --blur: blur(12px);
    --z-content: 1; --z-overlay: 2; --z-ui: 3; --z-header: 100; --z-menu: 400; --z-viewer: 500; --z-skip: 1000;

    /* Movimiento */
    --d-fast: 200ms; --d-base: 450ms; --d-slow: 800ms;
    --ease: cubic-bezier(.16, 1, .3, 1);
  }
}

/* ============================== BASE ============================== */
@layer base {
  /* Sin scroll-behavior: smooth global: los saltos entre secciones los maneja js/modules/nav.js
     (con smooth, un link a #trabajos recorría lentamente todo el garage) */
  html { scrollbar-color: var(--c-gold-a50) var(--c-bg); scrollbar-width: thin; }
  body { background: var(--c-bg); color: var(--c-text); font-family: var(--f-sans); font-size: var(--fs-base); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
  body.is-locked { overflow: hidden; }
  h1, h2, h3 { font-weight: 800; line-height: var(--lh-display); letter-spacing: var(--tr-display); text-wrap: balance; }
  p { text-wrap: pretty; }
  em { font-family: var(--f-accent); font-style: italic; font-weight: 800; color: var(--c-gold); letter-spacing: -.01em; }
  ::selection { background: var(--c-gold); color: var(--c-bg); }
  :focus-visible { outline: 2px solid var(--c-gold); outline-offset: 3px; border-radius: 2px; }
}

/* ============================== COMPONENTS ============================== */
@layer components {
  .wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
  .skip-link { position: fixed; top: var(--s-2); left: var(--s-2); z-index: var(--z-skip); padding: var(--s-2) var(--s-3); background: var(--c-gold); color: var(--c-bg); font-weight: 600; transform: translateY(-160%); transition: transform var(--d-fast) var(--ease); }
  .skip-link:focus { transform: none; }
  .eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--c-gold); }
  .block-sub { color: var(--c-text-2); font-size: var(--fs-md); max-width: 52ch; }

  /* Botón (pill): base, dorado, en vidrio; estados hover / activo / foco / deshabilitado / presionado */
  .pill {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    min-height: var(--ctl-h); min-width: var(--tap); padding: 0 var(--s-4); border-radius: var(--r-pill);
    box-shadow: inset 0 0 0 1px var(--c-line-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
    transition: box-shadow var(--d-fast) var(--ease), color var(--d-fast) var(--ease), background var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
  }
  .pill:hover { box-shadow: inset 0 0 0 1px var(--c-gold); color: var(--c-gold); }
  .pill:active { transform: translateY(1px); }
  .pill:disabled, .pill[aria-disabled="true"] { opacity: .4; cursor: not-allowed; box-shadow: inset 0 0 0 1px var(--c-line); color: var(--c-text-2); }
  .pill svg { width: 16px; height: 16px; flex: none; }
  .pill--gold { background: var(--c-gold); color: var(--c-bg); box-shadow: none; }
  .pill--gold:hover { background: var(--c-gold-2); color: var(--c-bg); box-shadow: none; }
  .pill--glass { background: var(--c-glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
  .pill .when-on, .pill[aria-pressed="true"] .when-off { display: none; }
  .pill[aria-pressed="true"] .when-on { display: block; }
  .pill[aria-pressed="true"] { color: var(--c-gold); }

  /* Botón de ícono redondo: claro (menú) o en vidrio (visor) */
  .icon-btn { display: grid; place-items: center; width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; background: var(--c-glass); box-shadow: inset 0 0 0 1px var(--c-line-2); transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease); }
  .icon-btn:hover { background: var(--c-gold); color: var(--c-bg); }
  .icon-btn:disabled { opacity: .3; cursor: default; background: var(--c-glass); color: inherit; }
  .icon-btn svg { width: 18px; height: 18px; }
  .icon-btn--light { background: var(--c-text); color: var(--c-bg); box-shadow: none; }

  /* Pestañas de filtro */
  .tabs { display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; display: inline-flex; align-items: center; gap: var(--s-1); min-height: var(--ctl-h); padding: 0 var(--s-3); border-radius: var(--r-pill); font-size: var(--fs-sm); color: var(--c-text-2); transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease); }
  .tab small { opacity: .6; font-variant-numeric: tabular-nums; font-size: var(--fs-xs); }
  .tab:hover { color: var(--c-text); background: rgba(255, 255, 255, .06); }
  .tab[aria-pressed="true"] { background: var(--c-text); color: var(--c-bg); font-weight: 600; }

  .ph { display: grid; place-items: center; width: 100%; height: 100%; padding: var(--s-4); text-align: center; background: radial-gradient(60% 60% at 30% 25%, rgba(255, 210, 122, .35), transparent 60%), linear-gradient(135deg, rgba(234, 180, 74, .8), #3a2a0c 55%, #121214); }
  .ph span { font-family: var(--f-accent); font-style: italic; font-weight: 900; text-transform: uppercase; color: rgba(8, 8, 10, .85); font-size: var(--fs-lg); line-height: 1; }

  /* Magnético (js/modules/cursor.js): usa "translate", así no pisa los transform propios */
  .motion-on .pill, .motion-on .icon-btn { translate: var(--mx, 0) var(--my, 0); transition-property: box-shadow, color, background, transform, translate; transition-duration: var(--d-fast), var(--d-fast), var(--d-fast), var(--d-fast), var(--d-base); }

  .js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity var(--d-slow) var(--ease), transform var(--d-slow) var(--ease); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  @keyframes fade { from { opacity: 0; } }
}

/* ============================== SECTIONS ============================== */
@layer sections {
  /* ---------- Header ---------- */
  .top { position: fixed; inset: 0 0 auto 0; z-index: var(--z-header); display: flex; align-items: center; justify-content: space-between; padding: var(--s-3) var(--gutter); pointer-events: none; }
  .top > * { pointer-events: auto; }
  .top-brand { display: inline-flex; min-height: var(--tap); align-items: center; }
  .top-brand img { width: 92px; height: auto; filter: drop-shadow(0 0 18px rgba(234, 180, 74, .3)); }
  .top-actions { display: flex; align-items: center; gap: var(--s-2); }
  .pill-label { display: none; }
  .menu-lines { display: grid; gap: 5px; }
  .menu-lines i { display: block; width: 18px; height: 2px; background: currentColor; transition: transform var(--d-fast) var(--ease); }
  .menu-btn:hover .menu-lines i:first-child { transform: translateX(3px); }
  @media (max-width: 479px) { .top-actions .pill--gold { display: none; } }
  @media (min-width: 1024px) { .pill-label { display: inline; } .top-brand img { width: 104px; } }

  /* ---------- Garage (secuencia) ---------- */
  .garage { position: relative; height: 560vh; }
  .garage-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
  .garage-poster, .garage-poster img, .garage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .garage-poster img { object-fit: cover; }
  .garage-canvas { opacity: 0; transition: opacity var(--d-base) var(--ease); }
  .garage-canvas.is-ready { opacity: 1; }
  .garage-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(8, 8, 10, .85), transparent 45%), linear-gradient(to right, rgba(8, 8, 10, .7), transparent 55%); opacity: var(--shade, 1); }

  .chapter { position: absolute; z-index: var(--z-overlay); opacity: 0; visibility: hidden; transform: translateY(24px); transition: opacity var(--d-base) var(--ease), transform var(--d-base) var(--ease), visibility var(--d-base); }
  .chapter.is-on { opacity: 1; visibility: visible; transform: none; }
  .chapter--intro { left: var(--gutter); right: var(--gutter); bottom: clamp(var(--s-6), 10vh, var(--s-8)); display: grid; gap: var(--s-4); max-width: 44rem; }
  .chapter--intro h1 { font-size: var(--fs-2xl); text-transform: uppercase; }
  .chapter--intro .lead { color: var(--c-text-2); font-size: var(--fs-md); max-width: 52ch; }
  .scroll-hint { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-xs); letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--c-text-2); }
  .scroll-hint svg { width: 16px; height: 16px; color: var(--c-gold); }
  .motion-on .scroll-hint svg { animation: nudge 1.6s var(--ease) infinite; }
  @keyframes nudge { 50% { transform: translateY(6px); } }
  .chapter-num { font-family: var(--f-accent); font-style: italic; font-weight: 900; font-size: var(--fs-lg); color: var(--c-gold); margin-bottom: var(--s-3); }
  .chapter--side { left: var(--gutter); top: 50%; translate: 0 -50%; }
  .big-list li { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.04em; line-height: .95; text-transform: uppercase; }
  .big-list li:nth-child(even) { color: transparent; -webkit-text-stroke: 1px var(--c-text); }
  .chapter--quote { right: var(--gutter); bottom: clamp(var(--s-6), 12vh, var(--s-8)); max-width: 30rem; text-align: right; }
  .quote { font-size: var(--fs-lg); font-weight: 700; letter-spacing: var(--tr-tight); line-height: var(--lh-tight); }

  /* Pantalla del volante (posición calculada en JS sobre el último cuadro) */
  .screen { position: absolute; z-index: var(--z-ui); display: grid; align-content: center; justify-items: center; gap: clamp(8px, 2vh, 24px); padding: clamp(8px, 2vw, 24px); opacity: 0; visibility: hidden; transition: opacity var(--d-base) var(--ease), visibility var(--d-base); }
  .screen.is-on { opacity: 1; visibility: visible; }
  .screen-title { font-size: clamp(.65rem, .5rem + .5vw, .875rem); letter-spacing: .3em; text-transform: uppercase; color: var(--c-gold); }
  .screen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(6px, 1vw, 14px); width: min(100%, 1120px); }
  .screen-grid a {
    display: flex; align-items: baseline; gap: var(--s-2); min-height: var(--tap); padding: clamp(8px, 1.4vw, 18px) clamp(10px, 1.6vw, 22px);
    border-radius: var(--r-md); background: rgba(234, 180, 74, .06); box-shadow: inset 0 0 0 1px var(--c-gold-a35);
    font-size: clamp(.95rem, .55rem + 1.2vw, 1.75rem); font-weight: 800; letter-spacing: var(--tr-tight); text-transform: uppercase; white-space: nowrap;
    transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
  }
  .screen-grid a span { font-family: var(--f-accent); font-style: italic; font-size: .6em; color: var(--c-gold); }
  .screen-grid a:hover, .screen-grid a:focus-visible { background: var(--c-gold); color: var(--c-bg); box-shadow: var(--sh-glow); }
  .screen-grid a:hover span, .screen-grid a:focus-visible span { color: var(--c-bg); }
  @media (min-width: 1024px) { .screen-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

  .garage-progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--s-4); height: 2px; background: var(--c-line); z-index: var(--z-overlay); }
  .garage-progress i { position: absolute; inset: 0; background: var(--c-gold); transform-origin: left; transform: scaleX(var(--p, 0)); }
  .skip { position: absolute; right: var(--gutter); bottom: var(--s-6); z-index: var(--z-ui); }
  .skip:not([hidden]) { animation: fade var(--d-base) var(--ease); }

  /* ---------- Trabajos: muro infinito curvado ---------- */
  .wall { position: relative; height: 260vh; background: var(--c-bg); }
  .wall-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
  .wall-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
  .wall-canvas.is-dragging { cursor: grabbing; }
  .wall-head { position: absolute; z-index: var(--z-overlay); left: var(--gutter); top: calc(var(--s-3) + var(--tap) + var(--s-5)); display: grid; gap: var(--s-2); pointer-events: none; padding: var(--s-3) var(--s-4) var(--s-3) 0; }
  .wall-head::before { /* fondo difuminado para que el título se lea sobre las tarjetas */
    content: ""; position: absolute; z-index: -1; inset: -60% -45% -70% calc(-1 * var(--gutter) - 40px);
    background: radial-gradient(closest-side, rgba(8, 8, 10, .92), rgba(8, 8, 10, .7) 55%, transparent);
  }
  .wall-head h2 { font-size: var(--fs-xl); text-transform: uppercase; text-shadow: 0 6px 40px rgba(0, 0, 0, .8); }
  .wall-sub { font-size: var(--fs-sm); color: var(--c-text-2); text-shadow: 0 2px 16px rgba(0, 0, 0, .9); }
  .wall-dock { position: absolute; z-index: var(--z-ui); left: 50%; bottom: max(var(--s-4), env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 2 * var(--gutter)); padding: var(--s-1); border-radius: var(--r-pill); background: var(--c-glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: inset 0 0 0 1px var(--c-line-2), var(--sh-card); }
  /* Lista accesible: invisible hasta que recibe foco con el teclado */
  .wall-list { position: absolute; left: 50%; bottom: calc(var(--s-4) + var(--ctl-h) + var(--s-5)); transform: translateX(-50%); z-index: var(--z-ui); }
  .wall-item { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wall-item:focus-visible { position: static; width: auto; height: auto; clip: auto; display: inline-flex; align-items: center; min-height: var(--ctl-h); padding: 0 var(--s-4); border-radius: var(--r-pill); background: var(--c-gold); color: var(--c-bg); font-weight: 600; font-size: var(--fs-sm); outline-offset: 4px; }

  /* ---------- Luces de largada (js/modules/lights.js) ---------- */
  .lights { display: none; }
  .js:not(.no-lights) .lights {
    position: fixed; inset: 0; z-index: calc(var(--z-skip) + 1); display: grid; place-content: center; justify-items: center; gap: var(--s-5);
    background: radial-gradient(60% 50% at 50% 45%, #141416, var(--c-bg) 70%); cursor: pointer;
    transition: opacity 600ms var(--ease), visibility 600ms;
    animation: lights-fallback 0s 4.5s forwards; /* si el JS no carga, el velo se va solo */
  }
  .lights.is-out { opacity: 0; visibility: hidden; }
  @keyframes lights-fallback { to { opacity: 0; visibility: hidden; } }
  .lights-gantry { display: flex; gap: clamp(10px, 2.4vw, 22px); padding: clamp(10px, 2vw, 18px); border-radius: var(--r-md); background: #050506; box-shadow: inset 0 0 0 1px var(--c-line), 0 30px 80px rgba(0, 0, 0, .6); }
  .lights-gantry > i { display: grid; gap: clamp(6px, 1.2vw, 12px); padding: clamp(6px, 1.2vw, 10px); border-radius: 999px; background: #0d0d0f; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
  .lights-gantry b { display: block; width: clamp(22px, 5vw, 46px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #2a1214, #140708 70%); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .8); transition: background 60ms linear, box-shadow 60ms linear; }
  .lights-gantry > i.on b { background: radial-gradient(circle at 35% 30%, #ff8a80, #ff1f1f 45%, #b00000 80%); box-shadow: 0 0 24px 4px rgba(255, 30, 30, .55), 0 0 70px 10px rgba(255, 0, 0, .25); }
  .lights.is-out .lights-gantry > i b { background: radial-gradient(circle at 35% 30%, #2a1214, #140708 70%); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .8); }
  .lights-label { font-family: var(--f-accent); font-style: italic; font-weight: 900; font-size: var(--fs-xs); letter-spacing: .3em; text-transform: uppercase; color: var(--c-text-2); }

  /* ---------- Partículas (js/modules/fx.js) ---------- */
  .fx-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }
  .fx-sparks { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: calc(var(--z-header) - 10); pointer-events: none; }
  .fx-trails { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .75;
    -webkit-mask-image: linear-gradient(to bottom, transparent 25%, #000 60%); mask-image: linear-gradient(to bottom, transparent 25%, #000 60%); }
  .contact { overflow: clip; }
  .contact > .wrap { position: relative; z-index: 1; }

  /* ---------- Tablero del volante (js/modules/sequence.js) ---------- */
  .dash { position: absolute; z-index: var(--z-overlay); container-type: size; opacity: 0; visibility: hidden; transition: opacity var(--d-base) var(--ease), visibility var(--d-base); pointer-events: none; }
  .dash.is-on { opacity: 1; visibility: visible; }
  .dash-leds { position: absolute; left: 4%; right: 4%; top: 0; height: 9.5%; display: flex; justify-content: space-between; align-items: center; padding: 0 3%; border-radius: 99px; background: #0b0b0c; }
  .dash-leds i { width: 4.2cqw; aspect-ratio: 1; border-radius: 50%; background: #1b1b1d; transition: background 50ms linear, box-shadow 50ms linear; }
  .dash-leds i.on:nth-child(-n + 4) { background: #2bff6a; box-shadow: 0 0 6px #2bff6a; }
  .dash-leds i.on:nth-child(n + 5):nth-child(-n + 8) { background: #ff2a2a; box-shadow: 0 0 6px #ff2a2a; }
  .dash-leds i.on:nth-child(n + 9) { background: #4a7dff; box-shadow: 0 0 6px #4a7dff; }
  .dash.is-limit .dash-leds i { animation: limiter 120ms steps(2) infinite; }
  @keyframes limiter { 50% { opacity: .15; } }
  .dash-screen { position: absolute; left: -2%; right: -2%; top: 17%; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto 1fr; align-items: center; padding: 3% 6%; border-radius: 3cqw; background: #0a0b0d; color: #e9e9ea; font-family: var(--f-sans); }
  .dash-speed { grid-column: 1 / -1; justify-self: center; font-size: 8cqw; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
  .dash-speed b { font-weight: 700; color: #fff; }
  .dash-gear { grid-column: 2; font-size: 30cqw; font-weight: 800; line-height: 1; color: #f2f2f2; font-variant-numeric: tabular-nums; }
  .dash-tag { grid-column: 3; justify-self: center; font-size: 7cqw; font-weight: 600; color: #cfcfd1; }
  .dash.is-limit .dash-gear { color: var(--c-gold); }

  /* ---------- Apilado cinematográfico (js/modules/stack.js) ---------- */
  /* Las secciones pegadas reciben su "top" desde JS (se pegan cuando su final toca el borde inferior) */
  section.is-stuck { position: sticky; } /* "section." gana a .reel/.wall/.is-card { position: relative } */
  /* Las que suben por encima: fondo sólido, esquinas redondeadas y sombra hacia arriba */
  .is-card { position: relative; background: var(--c-bg); border-radius: 28px 28px 0 0; box-shadow: 0 -24px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06); }
  .is-card.wall, .garage, .reel { overflow: clip; } /* el zoom/escala no debe ensanchar la página (clip no rompe el sticky) */
  .about, .contact { background: var(--c-bg); }
  .contact { position: relative; }
  .stack-shade { position: absolute; inset: 0; z-index: var(--z-ui); background: #000; opacity: 0; pointer-events: none; }
  .garage-sticky, .wall-sticky, .reel-sticky { transform-origin: 50% 50%; }
  @media (max-width: 767px) { .is-card { border-radius: 20px 20px 0 0; } }

  /* ---------- Sectores (escritorio) ---------- */
  .sectors { display: none; }
  @media (min-width: 1024px) and (hover: hover) {
    .sectors { display: block; position: fixed; right: var(--s-4); top: 50%; translate: 0 -50%; z-index: var(--z-header); transition: opacity var(--d-base) var(--ease), visibility var(--d-base); }
    .sectors.is-garage:not(:focus-within) { opacity: 0; visibility: hidden; }
    .sectors ol { display: grid; gap: var(--s-1); }
    .sectors a { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); min-height: 32px; padding: 0 var(--s-2); border-radius: var(--r-pill); color: var(--c-text-2); }
    .sec-n { font-family: var(--f-accent); font-style: italic; font-weight: 900; font-size: var(--fs-xs); letter-spacing: .04em; }
    .sec-l { font-size: var(--fs-xs); letter-spacing: var(--tr-caps); text-transform: uppercase; opacity: 0; translate: 6px 0; transition: opacity var(--d-fast) var(--ease), translate var(--d-fast) var(--ease); white-space: nowrap; }
    .sec-bar { position: relative; display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--c-line-2); overflow: hidden; transition: width var(--d-base) var(--ease); }
    .sec-bar i { position: absolute; inset: 0; background: var(--c-gold); transform-origin: left; transform: scaleX(var(--sp, 0)); }
    .sectors a[aria-current="true"] { color: var(--c-gold); }
    .sectors a[aria-current="true"] .sec-bar { width: 40px; }
    .sectors:hover .sec-l, .sectors a:focus-visible .sec-l, .sectors a[aria-current="true"] .sec-l { opacity: 1; translate: 0 0; }
    .sectors:hover a, .sectors a[aria-current="true"] { background: rgba(8, 8, 10, .55); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
    .sectors a:hover { color: var(--c-text); }
  }

  /* ---------- Velo de transición entre secciones (js/modules/nav.js) ---------- */
  .page-veil { position: fixed; inset: 0; z-index: calc(var(--z-viewer) - 50); background: var(--c-bg); pointer-events: none; opacity: 0; transition: opacity 380ms var(--ease); }
  .page-veil.is-on { opacity: 1; transition-duration: 220ms; }

  /* ---------- Cursor (solo mouse) ---------- */
  .cursor { position: fixed; left: 0; top: 0; z-index: var(--z-skip); pointer-events: none; opacity: 0; transition: opacity var(--d-fast) var(--ease); }
  .cursor.is-on { opacity: 1; }
  .cursor::before { content: ""; position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--c-gold); transition: transform var(--d-base) var(--ease), background var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease); }
  .cursor.is-link::before { transform: scale(1.5); background: var(--c-gold-a12, rgba(234, 180, 74, .12)); }
  .cursor.has-label::before { transform: scale(2.4); background: var(--c-gold); box-shadow: none; }
  .cursor.is-down::before { transform: scale(.8); }
  .cursor.has-label.is-down::before { transform: scale(2.1); }
  .cursor-label { position: absolute; left: 0; top: 0; translate: -50% -50%; font-family: var(--f-accent); font-style: italic; font-weight: 900; font-size: var(--fs-xs); letter-spacing: .04em; text-transform: uppercase; color: var(--c-bg); white-space: nowrap; opacity: 0; transition: opacity var(--d-fast) var(--ease); }
  .cursor.has-label .cursor-label { opacity: 1; }

  /* ---------- Pilotos y equipos (marquee) ---------- */
  .clients { padding-block: var(--s-7); border-block: 1px solid var(--c-line); background: var(--c-bg); overflow: hidden; }
  .clients-title { padding-inline: var(--gutter); margin-bottom: var(--s-5); }
  .marquee { -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent); }
  .marquee-track { display: flex; width: max-content; }
  .motion-on .marquee-track { animation: marquee var(--marquee-s, 40s) linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
  .marquee-row { display: flex; flex: none; }
  .marquee-row li { display: flex; align-items: center; gap: var(--s-6); padding-right: var(--s-6); font-family: var(--f-accent); font-style: italic; font-weight: 900; font-size: var(--fs-lg); text-transform: uppercase; white-space: nowrap; color: var(--c-text); transition: color var(--d-fast) var(--ease); }
  .marquee-row li:nth-child(even) { color: transparent; -webkit-text-stroke: 1px var(--c-text-2); }
  .marquee-row li::after { content: ""; width: 10px; height: 10px; flex: none; rotate: 45deg; background: var(--c-gold); }
  .marquee-row li:hover { color: var(--c-gold); -webkit-text-stroke: 0; }
  @keyframes marquee { to { transform: translateX(-50%); } }
  /* Sin animación: los nombres se acomodan en varias líneas y se ve una sola copia */
  html:not(.motion-on) .marquee { -webkit-mask-image: none; mask-image: none; padding-inline: var(--gutter); }
  html:not(.motion-on) .marquee-track, html:not(.motion-on) .marquee-row { width: auto; flex-wrap: wrap; }
  html:not(.motion-on) .marquee-row[aria-hidden] { display: none; }

  /* ---------- Tablero LCD ---------- */
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin-bottom: var(--s-7); }
  .stats > div { display: flex; flex-direction: column-reverse; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-md); background: radial-gradient(120% 90% at 50% 0%, rgba(234, 180, 74, .07), transparent 70%), #0b0b0d; box-shadow: inset 0 0 0 1px var(--c-line), inset 0 -20px 40px rgba(0, 0, 0, .5); }
  .stats dt { font-size: var(--fs-xs); letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--c-text-2); }
  .lcd { --dw: clamp(22px, 4.2vw, 44px); --sw: calc(var(--dw) * .16); display: flex; gap: calc(var(--dw) * .28); }
  .lcd-d { position: relative; width: var(--dw); height: calc(var(--dw) * 1.8); transform: skewX(-8deg); }
  .lcd-d i { position: absolute; border-radius: calc(var(--sw) / 2); background: rgba(234, 180, 74, .07); transition: background var(--d-fast) linear, box-shadow var(--d-fast) linear; }
  .lcd-d i.on { background: var(--c-gold); box-shadow: 0 0 10px rgba(234, 180, 74, .55); }
  .lcd-d .s-a, .lcd-d .s-d, .lcd-d .s-g { left: var(--sw); right: var(--sw); height: var(--sw); }
  .lcd-d .s-a { top: 0; } .lcd-d .s-g { top: calc(50% - var(--sw) / 2); } .lcd-d .s-d { bottom: 0; }
  .lcd-d .s-b, .lcd-d .s-c, .lcd-d .s-e, .lcd-d .s-f { width: var(--sw); height: calc(50% - var(--sw)); }
  .lcd-d .s-f { left: 0; top: calc(var(--sw) / 2); } .lcd-d .s-b { right: 0; top: calc(var(--sw) / 2); }
  .lcd-d .s-e { left: 0; bottom: calc(var(--sw) / 2); } .lcd-d .s-c { right: 0; bottom: calc(var(--sw) / 2); }
  @media (max-width: 599px) {
    .stats { grid-template-columns: 1fr; gap: var(--s-2); }
    .stats > div { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: var(--s-4); padding: var(--s-3) var(--s-4); }
    .lcd { --dw: 22px; }
  }

  /* Scramble: mientras se decodifica, el ancho de las letras no debe mover el resto */
  .is-scrambling { font-variant-numeric: tabular-nums; }

  /* ---------- Bloques ---------- */
  .block { padding-block: clamp(var(--s-8), 12vw, 160px); }
  .block-head { display: grid; gap: var(--s-3); margin-bottom: var(--s-7); }
  .block-head h2 { font-size: var(--fs-xl); text-transform: uppercase; }

  /* Reel */
  /* Reel: 2 pantallas de alto; adentro, un marco fijo que arranca como tarjeta y se expande (--e de 0 a 1) */
  .reel { --e: 1; position: relative; height: 200vh; height: 200svh; background: var(--c-bg); }
  .reel-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
  .reel-frame { position: absolute; inset: 0; overflow: hidden; background: #000;
    clip-path: inset(calc(16% * (1 - var(--e))) calc(var(--reel-x, 22%) * (1 - var(--e))) round calc(28px * (1 - var(--e)))); }
  .reel-frame video { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.12 - .12 * var(--e))); }
  @media (max-width: 767px) { .reel { --reel-x: 5%; } }
  .reel-ui { position: absolute; inset: auto var(--gutter) var(--s-6) var(--gutter); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4);
    opacity: clamp(0, calc((var(--e) - .6) * 2.5), 1); translate: 0 calc(24px * (1 - var(--e))); }
  .reel-ui h2 { font-size: var(--fs-xl); text-transform: uppercase; text-shadow: 0 4px 40px rgba(0, 0, 0, .6); }
  .reel-actions { display: flex; gap: var(--s-2); }

  /* Sobre IBD */
  .about-grid { display: grid; gap: var(--s-7); }
  .pull p { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.04em; line-height: .95; text-transform: uppercase; }
  .pull p::first-line { color: var(--c-gold); }
  .about-texts { display: grid; gap: var(--s-6); }
  .about-texts h3 { font-size: var(--fs-sm); letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--c-gold); margin-bottom: var(--s-3); font-weight: 600; line-height: var(--lh-tight); }
  .about-texts p { color: var(--c-text-2); max-width: 62ch; }
  .about-texts p.signature { margin-top: var(--s-4); font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 2.5rem; line-height: 1; color: var(--c-gold); }
  .services { margin-top: var(--s-9); display: grid; gap: var(--s-4); }
  .service-rows > div { display: grid; gap: var(--s-2); padding: var(--s-5) 0; border-top: 1px solid var(--c-line-2); }
  .service-rows dt { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.03em; text-transform: uppercase; line-height: var(--lh-tight); }
  .service-rows dd { color: var(--c-text-2); font-size: var(--fs-md); }
  @media (min-width: 1024px) {
    .about-grid { grid-template-columns: 5fr 7fr; align-items: start; }
    .pull { position: sticky; top: 120px; }
    .service-rows > div { grid-template-columns: 5fr 7fr; align-items: baseline; }
  }

  /* Contacto */
  .contact .wrap { display: grid; gap: var(--s-4); }
  .contact h2 { font-size: var(--fs-2xl); text-transform: uppercase; }
  .mail { justify-self: start; font-size: clamp(1.05rem, .3rem + 3.6vw, 4rem); font-weight: 800; letter-spacing: -.03em; overflow-wrap: anywhere; padding-bottom: var(--s-1); background: linear-gradient(var(--c-gold), var(--c-gold)) 0 100% / 0 3px no-repeat; transition: background-size var(--d-base) var(--ease), color var(--d-fast) var(--ease); }
  .mail:hover { background-size: 100% 3px; color: var(--c-gold); }
  .contact-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .copy-status { min-height: 1.5em; color: var(--c-gold); font-size: var(--fs-sm); }

  .foot { border-top: 1px solid var(--c-line); padding-block: var(--s-5); }
  .foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-3); font-size: var(--fs-xs); color: var(--c-text-2); }
  .foot a { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: underline; text-underline-offset: 3px; }
  .foot a:hover { color: var(--c-gold); }

  /* Menú */
  .menu { position: fixed; inset: 0; z-index: var(--z-menu); display: grid; grid-template-rows: 1fr auto; padding: var(--s-8) var(--gutter) var(--s-6); background: rgba(8, 8, 10, .97); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
  .menu:not([hidden]) { animation: fade var(--d-base) var(--ease); }
  .menu-close { position: absolute; top: var(--s-3); right: var(--gutter); }
  .menu-list { display: grid; align-content: center; height: 100%; }
  .menu-list a { display: flex; align-items: baseline; gap: var(--s-3); padding: var(--s-2) 0; font-size: clamp(2.25rem, 1rem + 6vw, 6rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; text-transform: uppercase; transition: color var(--d-fast) var(--ease), transform var(--d-base) var(--ease); }
  .menu-list a span { font-family: var(--f-accent); font-style: italic; font-size: .3em; color: var(--c-gold); }
  .menu-list a:hover, .menu-list a:focus-visible { color: var(--c-gold); transform: translateX(12px); }
  .menu-foot a { display: inline-flex; align-items: center; min-height: var(--tap); font-size: var(--fs-md); color: var(--c-text-2); }
  .menu-foot a:hover { color: var(--c-gold); }

  /* Visor */
  .viewer { position: fixed; inset: 0; z-index: var(--z-viewer); display: grid; grid-template-rows: minmax(0, 1fr) auto; background: rgba(5, 5, 6, .98); }
  .viewer:not([hidden]) { animation: fade var(--d-base) var(--ease); }
  .viewer-stage { position: relative; min-height: 0; touch-action: pan-y; }
  /* Caja de medidas fijas: las piezas verticales (flyers 4:5, 9:16) entran enteras sin recortarse */
  .viewer-media { position: absolute; inset: 64px var(--s-3) var(--s-3); display: flex; align-items: center; justify-content: center; }
  .viewer-media picture { display: contents; }
  .viewer-media img, .viewer-media video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--r-sm); }
  .viewer-media .ph { max-width: 720px; aspect-ratio: 4 / 5; height: auto; max-height: 100%; }
  .viewer-close { position: absolute; top: var(--s-3); right: var(--s-3); z-index: var(--z-overlay); }
  .viewer-prev, .viewer-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: var(--z-overlay); }
  .viewer-prev { left: var(--s-3); }
  .viewer-next { right: var(--s-3); }
  .viewer-info { display: grid; gap: var(--s-2); padding: var(--s-4) var(--gutter) calc(var(--s-4) + env(safe-area-inset-bottom)); background: var(--c-surface); border-top: 1px solid var(--c-line); max-height: 42vh; overflow-y: auto; }
  .viewer-info h2 { font-size: var(--fs-lg); text-transform: uppercase; }
  .viewer-meta { font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--c-text-2); }
  .viewer-tags { display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .viewer-tags li { padding: 2px var(--s-2); border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--c-gold-a50); color: var(--c-gold); font-size: var(--fs-xs); }
  .viewer-desc { color: var(--c-text-2); max-width: 70ch; }
  .viewer-thumbs { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
  .viewer-thumbs button { flex: none; width: 56px; height: 56px; border-radius: var(--r-sm); overflow: hidden; opacity: .55; transition: opacity var(--d-fast) var(--ease); }
  .viewer-thumbs button:hover { opacity: .85; }
  .viewer-thumbs button[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--c-gold); }
  .viewer-thumbs img, .viewer-thumbs picture { width: 100%; height: 100%; object-fit: cover; }
  .viewer-thumbs .vthumb { display: grid; place-items: center; width: 100%; height: 100%; background: var(--c-surface); color: var(--c-gold); }
  .viewer-thumbs .vthumb svg { width: 18px; height: 18px; }
  @media (min-width: 1024px) {
    .viewer { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) 400px; }
    .viewer-media { inset: var(--s-6) 96px; }
    .viewer-close { left: var(--s-4); right: auto; top: var(--s-4); }
    .viewer-prev { left: var(--s-4); }
    .viewer-next { right: var(--s-4); }
    .viewer-info { max-height: none; align-content: start; padding: var(--s-8) var(--s-5) var(--s-5); border-top: 0; border-left: 1px solid var(--c-line); }
  }
}

/* ============================== UTILITIES ============================== */
@layer utilities {
  [hidden] { display: 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; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .chapter, .screen, .garage-canvas { transition: none; }
}
