/* "3D scroll" layout shared by the demo sites: fixed WebGL canvas, huge words behind the object, info bar on top. */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1; pointer-events: none; display: block; }
.no-gl #gl { display: none; }
.fallback { display: none; }
.no-gl .fallback { display: block; }
.bar3d { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: grid; grid-template-columns: auto 1fr auto auto auto auto; align-items: stretch; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 13px; }
.bar3d > * { padding: 14px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.bar3d > *:last-child { border-right: 0; }
.bar3d small { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.bar3d .brand { font-weight: 700; font-size: 17px; letter-spacing: -.02em; flex-direction: row; align-items: center; gap: 10px; text-decoration: none; }
.bar3d .links { flex-direction: row; gap: 18px; align-items: center; }
.bar3d .links a { text-decoration: none; color: var(--muted); } .bar3d .links a:hover { color: var(--ink); }
.bar3d .cta3d { background: var(--acc); color: #fff; font-weight: 700; text-decoration: none; justify-content: center; padding: 0 22px; }
@media (max-width: 980px) { .bar3d { grid-template-columns: auto 1fr auto auto; } .bar3d .info { display: none; } .bar3d .links { display: none; } }
@media (max-width: 560px) { .bar3d > * { padding: 12px 12px; } .bar3d .cta3d { padding: 0 14px; font-size: 12px; } }
.demo-bar { position: fixed; bottom: 0; left: 0; right: 0; top: auto; z-index: 90; background: rgba(0,0,0,.78); backdrop-filter: blur(6px); }

main.s3d { position: relative; overflow-x: clip; }
.scene { position: relative; min-height: 100vh; display: grid; align-items: center; padding: 90px 0 60px; }
.scene.tall { min-height: 160vh; align-items: start; }
.scene .wrap { position: relative; width: 100%; }
.huge { position: absolute; z-index: 0; font-weight: 300; letter-spacing: -.06em; line-height: .8; font-size: clamp(90px, 19vw, 330px); color: var(--huge, rgba(255,255,255,.9)); white-space: nowrap; pointer-events: none; user-select: none; }
.huge.out { color: transparent; -webkit-text-stroke: 1px var(--huge-line, rgba(255,255,255,.35)); }
.copy3d { position: relative; z-index: 2; max-width: 460px; }
.copy3d.right { margin-left: auto; }
.copy3d h1, .copy3d h2 { font-weight: 400; letter-spacing: -.035em; line-height: 1.02; margin: 12px 0 16px; }
.copy3d h1 { font-size: clamp(40px, 5vw, 76px); }
.copy3d h2 { font-size: clamp(32px, 3.6vw, 54px); }
.copy3d p { color: var(--muted); font-size: 18px; margin: 0 0 22px; }
.btn3d { display: inline-flex; align-items: center; gap: 10px; padding: 15px 24px; background: var(--acc); color: #fff; border: 0; border-radius: 4px; font-weight: 700; text-decoration: none; cursor: pointer; font-size: 15px; }
.btn3d.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.stats3d { position: relative; z-index: 2; display: grid; gap: 22px; }
.stats3d b { display: block; font-weight: 300; font-size: clamp(34px, 3.6vw, 52px); letter-spacing: -.03em; line-height: 1; }
.stats3d small { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.flap { display: inline-flex; gap: 3px; vertical-align: middle; }
.flap i { font-style: normal; font-family: var(--mono); font-size: 13px; width: 20px; height: 26px; display: grid; place-items: center; background: #1a1d24; color: #e9ecf1; border-radius: 3px; box-shadow: inset 0 -13px 0 rgba(255,255,255,.04); }
.ticket { position: relative; z-index: 2; background: #f4f3ef; color: #121417; border-radius: 10px; padding: 22px; width: min(320px, 100%); box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.ticket .route { padding-right: 44px; font-weight: 300; font-size: 40px; letter-spacing: -.03em; }
.ticket dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 16px 0; font-size: 14px; }
.ticket dt { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: #8a8d93; } .ticket dd { margin: 0; }
.ticket .bc { position: absolute; top: 22px; right: 22px; width: 34px; height: 46px; background: repeating-linear-gradient(0deg, #121417 0 2px, transparent 2px 4px, #121417 4px 5px, transparent 5px 8px); }
.ticket button { width: 100%; background: var(--acc); color: #fff; border: 0; border-radius: 6px; padding: 12px; font-weight: 700; cursor: pointer; }
.chips3d { display: flex; gap: 8px; flex-wrap: wrap; }
.chips3d button { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 8px 14px; cursor: pointer; font: 14px "Geist", sans-serif; display: inline-flex; gap: 8px; align-items: center; }
.chips3d button i { width: 16px; height: 16px; border-radius: 50%; }
.chips3d button[aria-pressed="true"] { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 18%, transparent); }
.form3d { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 14px; padding: 22px; max-width: 520px; }
.form3d .full { grid-column: 1 / -1; }
.form3d input, .form3d select { width: 100%; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 13px; color: var(--ink); font: 15px "Geist", sans-serif; color-scheme: light dark; }
.form3d select option { color: #111; }
.progress3d { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 40; display: grid; gap: 10px; }
.progress3d a { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--muted); display: block; }
.progress3d a.on { background: var(--acc); border-color: var(--acc); }
@media (max-width: 700px) { .progress3d { display: none; } .huge { font-size: 26vw; } .copy3d { max-width: none; background: color-mix(in srgb, var(--bg) 70%, transparent); padding: 14px; border-radius: 12px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); } }

/* ---- Immersive layer (v2): word reveals, chapter HUD, intro curtain ---- */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.w > span { display: inline-block; transform: translateY(105%); transition: transform 1s var(--ease); }
.words-in .w > span { transform: none; }
.copy3d p, .copy3d .kick, .copy3d form, .copy3d .stats3d, .copy3d .chips3d { transition: opacity 1s var(--ease) .25s, transform 1s var(--ease) .25s; }
.scene:not(.seen) .copy3d > :not(h1):not(h2) { opacity: 0; transform: translateY(18px); }
.hud { position: fixed; left: 22px; bottom: 54px; z-index: 45; display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
.hud b { color: var(--ink); font-weight: 500; font-size: 13px; }
.hud .track { width: 120px; height: 1px; background: var(--line); position: relative; } .hud .track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--acc); }
@media (max-width: 700px) { .hud { display: none; } }
.curtain { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; transition: transform 1.2s var(--ease) .2s, opacity .6s .9s; }
.curtain .c-in { text-align: center; } .curtain b { display: block; font-size: clamp(30px, 5vw, 64px); font-weight: 300; letter-spacing: .02em; color: var(--ink); }
.curtain span { font-family: var(--mono); font-size: 12px; letter-spacing: .3em; color: var(--muted); }
.curtain .bar { width: 180px; height: 1px; background: var(--line); margin: 18px auto 0; overflow: hidden; } .curtain .bar i { display: block; height: 100%; background: var(--acc); width: 0; animation: load 1.4s var(--ease) forwards; }
@keyframes load { to { width: 100%; } }
.gl-ready .curtain, .no-gl .curtain { transform: translateY(-100%); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .w > span { transform: none; } .scene:not(.seen) .copy3d > * { opacity: 1; transform: none; } .curtain { display: none; } }

/* ---- Phones: object on top, one clear text card below ---- */
@media (max-width: 700px) {
  .huge { display: none !important; }
  .copy3d[style*="margin-top"] { margin-top: 0 !important; }
  .scene { min-height: 100svh; align-items: end; padding: 46svh 0 64px; }
  .scene .wrap[style*="sticky"] { position: relative !important; top: auto !important; }
  .scene.tall, main.s3d > .scene:first-of-type { align-items: start; }
  .copy3d, .copy3d.right { margin: 0; max-width: none; background: color-mix(in srgb, var(--bg) 94%, transparent); border: 1px solid var(--line); padding: 18px; border-radius: 14px; box-shadow: 0 20px 40px -24px rgba(0,0,0,.5); }
  .copy3d h1 { font-size: 30px; } .copy3d h2 { font-size: 28px; } .copy3d p { font-size: 15px; margin-bottom: 14px; }
  .hud { display: flex; left: 14px; right: 14px; top: 64px; bottom: auto; font-size: 9px; gap: 10px; }
  .hud .track { flex: 1; width: auto; }
  .form3d { grid-template-columns: 1fr; }
}
