:root {
      --bg: #04060B;
      --nebula: #0A1020;
      --ink: rgba(253, 253, 255, 0.92);
      --ink-dim: rgba(253, 253, 255, 0.55);
      --cyan: #6FE8FF;
      --mag: #FF5C8A;
      --warm: #FFCF9A;
      --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
      --ease-power3-in: cubic-bezier(0.7, 0, 0.84, 0);
      --ease-power2: cubic-bezier(0.65, 0, 0.35, 1);
    }
    *, *::before, *::after { box-sizing: border-box; }
    html, body {
      margin: 0;
      padding: 0;
      background: var(--bg);
      color: var(--ink);
      font-family: "Bricolage Grotesque", "Helvetica Neue", sans-serif;
      min-height: 100dvh;
      overflow-x: hidden;
    }
    html, body { height: auto; overflow-y: auto !important; }
    body { min-height: 900dvh; }
    html.lenis, html.lenis body { height: auto; }
    .lenis.lenis-smooth { scroll-behavior: auto !important; }
    .lenis.lenis-stopped { overflow: hidden; }
    body {
      cursor: auto;
    }
    html.has-cursor, html.has-cursor * { cursor: none !important; }
    #gl {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100dvh;
      display: block;
      z-index: 0;
    }
    .nebula {
      position: fixed;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      background: radial-gradient(ellipse 72% 54% at 30% 18%, rgba(10, 16, 32, 0.92), transparent 64%);
      mix-blend-mode: screen;
      opacity: 0.55;
    }
    .end-veil {
      position: fixed;
      inset: 0;
      z-index: 2;
      pointer-events: none;
      opacity: 0;
      background: radial-gradient(ellipse 80% 70% at 50% 62%, rgba(4, 6, 11, 0.72) 0%, rgba(4, 6, 11, 0.28) 55%, transparent 78%);
      transition: opacity 700ms var(--ease-expo);
    }
    body.is-finale .end-veil { opacity: 1; }
    #overlay {
      position: fixed;
      inset: 0;
      z-index: 3;
      pointer-events: none;
      height: 100dvh;
    }
    #overlay .hit { pointer-events: auto; }

    /* ——— Preloader ——— */
    #preloader {
      position: fixed;
      inset: 0;
      z-index: 30;
      display: grid;
      place-items: center;
      background: var(--bg);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.6s var(--ease-expo);
    }
    #preloader.show {
      opacity: 1;
      pointer-events: auto;
    }
    #preloader.done {
      opacity: 0;
      pointer-events: none;
    }
    .pre-inner { text-align: center; width: min(280px, 70vw); }
    .pre-brand {
      font-family: "IBM Plex Mono", ui-monospace, monospace;
      font-size: 0.62rem;
      letter-spacing: 0.42em;
      text-transform: lowercase;
      opacity: 0.45;
      margin-bottom: 14px;
    }
    .pre-count {
      font-family: "IBM Plex Mono", ui-monospace, monospace;
      font-size: 0.72rem;
      letter-spacing: 0.42em;
      font-variant-numeric: tabular-nums;
      opacity: 0.55;
      color: var(--ink);
      margin-bottom: 18px;
    }
    .pre-line {
      height: 1px;
      background: rgba(253, 253, 255, 0.12);
      position: relative;
    }
    .pre-line > i {
      position: absolute;
      left: 0; top: 0; bottom: 0;
      width: 0%;
      background: rgba(253, 253, 255, 0.55);
      box-shadow: none;
    }

    /* ——— Hero ——— */
    .hero {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 8dvh 6vw 14dvh;
      isolation: isolate;
    }
    .hero::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 46%;
      transform: translate(-50%, -50%);
      width: min(54rem, 94vw);
      height: min(46dvh, 30rem);
      background: radial-gradient(ellipse at center, rgba(4, 6, 11, 0.86) 0%, rgba(4, 6, 11, 0.48) 46%, transparent 74%);
      pointer-events: none;
      z-index: -1;
    }
    .hero-title {
      margin: 0;
      font-weight: 600;
      font-size: clamp(2.2rem, 5.6vw, 4.8rem);
      letter-spacing: -0.03em;
      line-height: 0.96;
      max-width: 14ch;
    }
    .hero-word {
      display: inline-block;
      opacity: 0;
      transform: translateY(24px);
      filter: blur(9px);
      transition:
        transform 1.1s var(--ease-expo),
        opacity 1.1s var(--ease-expo),
        filter 1.1s var(--ease-expo);
    }
    .hero.in .hero-word {
      opacity: 1;
      transform: translateY(0);
      filter: blur(0);
    }
    .hero.out .hero-word {
      opacity: 0;
      transform: translateY(-40px);
      filter: blur(14px);
      transition:
        transform 500ms var(--ease-power3-in),
        opacity 500ms var(--ease-power3-in),
        filter 500ms var(--ease-power3-in);
    }
    .hero-sub {
      margin: 1.4rem 0 0;
      max-width: 36ch;
      font-weight: 300;
      font-size: clamp(0.95rem, 1.25vw, 1.12rem);
      line-height: 1.65;
      opacity: 0;
      transform: translateY(14px);
      filter: blur(8px);
      transition:
        transform 1.1s var(--ease-expo) 0.55s,
        opacity 1.1s var(--ease-expo) 0.55s,
        filter 1.1s var(--ease-expo) 0.55s;
    }
    .hero.in .hero-sub { opacity: 0.82; transform: none; filter: blur(0); }
    .hero.out .hero-sub {
      opacity: 0;
      transform: translateY(-28px);
      filter: blur(14px);
      transition-delay: 0s;
      transition-duration: 500ms;
      transition-timing-function: var(--ease-power3-in);
    }

    .hint {
      position: absolute;
      bottom: 7dvh;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      opacity: 0;
      transition: opacity 0.8s var(--ease-expo) 1.2s;
    }
    .hero.in .hint { opacity: 1; }
    .hero.out .hint { opacity: 0; transition: opacity 280ms var(--ease-power3-in); }
    .hint-line {
      width: 1px;
      height: 42px;
      background: rgba(253, 253, 255, 0.22);
      position: relative;
      overflow: hidden;
    }
    .hint-dot {
      position: absolute;
      left: 50%;
      top: 0;
      width: 3px;
      height: 3px;
      margin-left: -1.5px;
      border-radius: 50%;
      background: var(--ink);
      animation: hint-run 1.8s var(--ease-power2) infinite;
    }
    @keyframes hint-run {
      0% { top: 0; opacity: 1; }
      75% { opacity: 1; }
      100% { top: 39px; opacity: 0; }
    }
    .hint-copy {
      font-size: 0.68rem;
      letter-spacing: 0.3em;
      text-transform: lowercase;
      opacity: 0.55;
      font-weight: 300;
    }

    /* ——— Capa copy (un solo bloque visible) ——— */
    .copy, .finale, .reveal-card {
      position: absolute;
      left: clamp(1.4rem, 5vw, 4.5rem);
      bottom: clamp(5.5rem, 12dvh, 8.5rem);
      max-width: min(40rem, 88vw);
      opacity: 0;
      transform: translateY(18px);
      filter: blur(6px);
      will-change: transform, opacity, filter;
      transition: none;
      isolation: isolate;
    }
    .copy::before, .finale::before, .reveal-card::before {
      content: "";
      position: absolute;
      inset: -22% -28% -28% -22%;
      background: radial-gradient(ellipse at 28% 58%, rgba(4, 6, 11, 0.9) 0%, rgba(4, 6, 11, 0.52) 44%, transparent 76%);
      pointer-events: none;
      z-index: -1;
    }
    .copy.is-on, .finale.is-on, .reveal-card.is-on {
      opacity: 1;
      transform: none;
      filter: blur(0);
    }
    .copy.is-leaving, .finale.is-leaving, .reveal-card.is-leaving {
      opacity: 0;
      transform: translateY(-18px);
      filter: blur(6px);
    }
    .eyebrow {
      font-family: "IBM Plex Mono", ui-monospace, monospace;
      font-size: 0.72rem;
      letter-spacing: 0.42em;
      font-variant-numeric: tabular-nums;
      opacity: 0.55;
      color: var(--ink);
      margin: 0 0 0.85rem;
      text-transform: lowercase;
    }
    .copy h2, .finale h2, .reveal-card h2 {
      margin: 0;
      font-weight: 600;
      font-size: clamp(2.2rem, 5.6vw, 4.8rem);
      letter-spacing: -0.03em;
      line-height: 0.96;
      overflow-wrap: anywhere;
      word-break: break-word;
    }
    .line {
      display: block;
      overflow: hidden;
      max-width: 100%;
    }
    .line > em {
      display: block;
      font-style: normal;
      transform: translateY(105%);
      overflow-wrap: anywhere;
      word-break: break-word;
    }
    .copy.is-on .line > em,
    .finale.is-on .line > em,
    .reveal-card.is-on .line > em {
      transform: translateY(0);
    }
    .body {
      margin: 1.05rem 0 0;
      font-weight: 300;
      font-size: clamp(0.95rem, 1.25vw, 1.12rem);
      line-height: 1.65;
      max-width: 36ch;
      opacity: 0.82;
    }
    .hook {
      display: block;
      margin-top: 0.55rem;
      opacity: 0.78;
      color: var(--cyan);
    }
    .cta-note {
      margin: 0.85rem 0 0;
      font-family: "IBM Plex Mono", ui-monospace, monospace;
      font-size: 0.68rem;
      letter-spacing: 0.22em;
      text-transform: lowercase;
      opacity: 0.55;
    }
    .finale-mods {
      margin: 1.15rem 0 0;
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      gap: 0.4rem 1.1rem;
      font-family: "IBM Plex Mono", ui-monospace, monospace;
      font-size: 0.62rem;
      letter-spacing: 0.22em;
      text-transform: lowercase;
    }
    .finale-mods a { color: inherit; text-decoration: none; opacity: 0.45; }
    .finale-mods a:hover { opacity: 0.88; color: var(--ink); }

    .reveal-card {
      left: 50%;
      right: auto;
      bottom: auto;
      top: 50%;
      transform: translate(-50%, calc(-50% + 18px));
      text-align: center;
      max-width: 22ch;
    }
    .reveal-card.is-on { transform: translate(-50%, -50%); }
    .reveal-card.is-leaving { transform: translate(-50%, calc(-50% - 18px)); }
    .reveal-card h2 {
      font-size: clamp(1.8rem, 4vw, 3.2rem);
    }
    .reveal-card .warm { color: var(--warm); }

    .finale {
      left: 50%;
      bottom: 14dvh;
      transform: translate(-50%, 18px);
      text-align: center;
      width: min(52rem, calc(100vw - 2rem));
      max-width: 52rem;
    }
    .finale h2,
    .finale .line > em { overflow-wrap: normal; word-break: normal; }
    .finale::before {
      inset: -28% -42% -32% -42%;
      background: radial-gradient(ellipse at 50% 42%, rgba(4, 6, 11, 0.92) 0%, rgba(4, 6, 11, 0.5) 48%, transparent 78%);
    }
    .reveal-card::before {
      inset: -36% -32%;
      background: radial-gradient(ellipse at 50% 50%, rgba(4, 6, 11, 0.88) 0%, transparent 72%);
    }
    .finale.is-on { transform: translate(-50%, 0); }
    .finale.is-leaving { transform: translate(-50%, -18px); }
    .finale .body { margin-left: auto; margin-right: auto; }

    .cta {
      position: relative;
      margin: 1.6rem auto 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 52px;
      min-width: 13.5rem;
      padding: 1rem 1.9rem;
      border: 1px solid rgba(111, 232, 255, 0.4);
      background: rgba(253, 253, 255, 0.08);
      color: var(--ink);
      font: 600 0.92rem/1 "Bricolage Grotesque", sans-serif;
      letter-spacing: 0.04em;
      overflow: hidden;
      isolation: isolate;
    }
    .cta > span { position: relative; z-index: 1; }
    .cta::before {
      content: "";
      position: absolute;
      inset: -40%;
      background: linear-gradient(115deg, transparent 30%, rgba(111, 232, 255, 0.92) 50%, transparent 70%);
      transform: translateX(-120%) rotate(18deg);
      transition: transform 240ms var(--ease-expo);
      z-index: 0;
    }
    .cta:hover::before, .cta:focus-visible::before {
      transform: translateX(20%) rotate(18deg);
    }
    .cta:hover, .cta:focus-visible {
      color: var(--bg);
      background: var(--cyan);
      border-color: var(--cyan);
    }
    .cta:focus-visible {
      outline: 2px solid var(--cyan);
      outline-offset: 3px;
    }

    /* ——— Rail ——— */
    .rail {
      position: absolute;
      right: 18px;
      top: 50%;
      transform: translateY(-50%);
      height: 38dvh;
      width: 44px;
      display: flex;
      justify-content: center;
    }
    .rail-line {
      position: absolute;
      top: 0; bottom: 0;
      width: 1px;
      background: rgba(253, 253, 255, 0.16);
    }
    .rail-marks {
      position: relative;
      height: 100%;
      width: 100%;
    }
    .mark {
      position: absolute;
      left: 50%;
      width: 44px;
      height: 44px;
      transform: translate(-50%, -50%);
      background: none;
      border: 0;
      padding: 0;
      color: inherit;
    }
    .mark i {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 1px;
      height: 8px;
      transform: translate(-50%, -50%);
      background: rgba(253, 253, 255, 0.45);
      transition: width 280ms var(--ease-expo), height 280ms var(--ease-expo), background 280ms var(--ease-expo), box-shadow 280ms var(--ease-expo);
    }
    .mark.is-on i {
      width: 6px;
      height: 6px;
      background: var(--cyan);
      box-shadow: 0 0 10px rgba(111, 232, 255, 0.7);
    }
    .mark:focus-visible {
      outline: 2px solid var(--cyan);
      outline-offset: 2px;
    }
    .mark-tip {
      position: absolute;
      right: 36px;
      top: 50%;
      transform: translateY(-50%);
      white-space: nowrap;
      font-size: 0.72rem;
      letter-spacing: 0.08em;
      opacity: 0;
      pointer-events: none;
      transition: opacity 200ms var(--ease-expo);
      font-family: "IBM Plex Mono", ui-monospace, monospace;
    }
    .mark:hover .mark-tip, .mark:focus-visible .mark-tip { opacity: 0.82; }

    /* ——— Sound + cursor ——— */
    .sound {
      position: absolute;
      top: 58px;
      right: 22px;
      min-width: 44px;
      min-height: 44px;
      border: 1px solid rgba(253, 253, 255, 0.18);
      background: transparent;
      color: var(--ink);
      font-family: "IBM Plex Mono", ui-monospace, monospace;
      font-size: 0.62rem;
      letter-spacing: 0.28em;
      opacity: 0.7;
    }
    .sound:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
    .sound { opacity: 0; pointer-events: none; }
    .sound[aria-pressed="true"] { color: var(--ink); border-color: rgba(253, 253, 255, 0.28); opacity: 0; }

    .site-nav {
      position: absolute;
      top: 0; left: 0; right: 0;
      z-index: 8;
      display: flex;
      flex-wrap: wrap;
      gap: 0.15rem 1.05rem;
      align-items: center;
      padding: 1.05rem 1.4rem;
      font-family: "IBM Plex Mono", ui-monospace, monospace;
      font-size: 0.62rem;
      letter-spacing: 0.22em;
      text-transform: lowercase;
    }
    .site-nav a {
      color: inherit;
      text-decoration: none;
      opacity: 0.48;
      min-height: 44px;
      display: inline-flex;
      align-items: center;
    }
    .site-nav a:hover { opacity: 0.88; color: var(--ink); }
    .site-nav a[aria-current="page"] { opacity: 0.95; color: var(--ink); }
    .site-nav a[aria-current="page"]::before {
      content: "";
      width: 5px;
      height: 5px;
      margin-right: 0.45rem;
      border-radius: 50%;
      background: var(--cyan);
      box-shadow: 0 0 8px rgba(111, 232, 255, 0.65);
    }
    .site-nav .ext { margin-left: auto; opacity: 0.7; color: var(--ink); }

    #cursor {
      position: fixed;
      left: 0; top: 0;
      width: 26px; height: 26px;
      margin: -13px 0 0 -13px;
      border: 1px solid rgba(253, 253, 255, 0.85);
      border-radius: 50%;
      pointer-events: none;
      z-index: 40;
      mix-blend-mode: difference;
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
      opacity: 0;
      display: none;
    }
    html.has-cursor #cursor { display: block; }
    #cursor.hot { /* sobre interactivos */ }
    #cursor .ver {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      font-family: "IBM Plex Mono", ui-monospace, monospace;
      font-size: 0.58rem;
      letter-spacing: 0.18em;
      opacity: 0;
    }
    #cursor.show-ver .ver { opacity: 1; }

    .live {
      position: absolute;
      width: 1px; height: 1px;
      overflow: hidden;
      clip: rect(0 0 0 0);
    }

    /* Semántico paralelo: visible para AT, no para vista */
    .sr-story {
      position: absolute;
      width: 1px;
      height: 1px;
      clip-path: inset(50%);
      overflow: hidden;
      white-space: nowrap;
    }

    .track { height: 900dvh; min-height: 900dvh; position: relative; z-index: 2; pointer-events: none; }

    .debug {
      position: fixed;
      left: 10px; top: 10px;
      z-index: 50;
      font: 11px/1.4 "IBM Plex Mono", monospace;
      color: rgba(253,253,255,0.55);
      pointer-events: none;
      display: none;
    }
    body.debug .debug { display: block; }

    @media (max-width: 720px) {
      .site-nav {
        gap: 0 0.7rem;
        padding: 0.65rem 0.85rem;
        font-size: 0.56rem;
      }
      .site-nav .ext { display: none; }
      html:not(.panel) .site-nav a[href="login.html"] { margin-left: auto; }
      .hint { bottom: 5.2dvh; }
      .hint-copy { font-size: 0.78rem; letter-spacing: 0.22em; }
      .hint-line { height: 36px; }
      .copy, .finale, .reveal-card {
        left: 1.1rem;
        right: 1.1rem;
        max-width: none;
        bottom: clamp(4.5rem, 11dvh, 7rem);
      }
      .finale { left: 1.1rem; right: 1.1rem; width: auto; max-width: none; transform: none; }
      .finale h2 { font-size: clamp(1.8rem, 7.5vw, 2.1rem); }
      .finale.is-on { transform: none; }
      .rail { right: 4px; }
    }
    @media (hover: none), (pointer: coarse) {
      html.has-cursor, html.has-cursor * { cursor: auto !important; }
      #cursor { display: none !important; }
    }
    @media (prefers-reduced-motion: reduce) {
      .hero-word, .hero-sub, .hint, .copy, .finale, .reveal-card, .line > em {
        transition: opacity 0.4s ease !important;
        filter: none !important;
        transform: none !important;
      }
      .hint-dot { animation: none; opacity: 0.7; top: 16px; }
    }
