:root {
  --pearl: #f4f3f8;
  --ink: #17143a;
  --ink-2: rgba(23, 20, 58, 0.66);
  --ink-3: rgba(23, 20, 58, 0.42);
  --indigo: #5850ec;
  --indigo-deep: #4b38d8;
  --lav: #909cf7;
  --glass: rgba(255, 255, 255, 0.46);
  --glass-line: rgba(255, 255, 255, 0.75);
  --hair: rgba(23, 20, 58, 0.1);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(18px, 3.4vw, 48px);
}

* { box-sizing: border-box; }
html { background: var(--pearl); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--pearl); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.is-gated { overflow: hidden; }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

#world { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; touch-action: pan-y; }
.whiteout { position: fixed; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(120% 90% at 50% 40%, #fff, var(--pearl) 70%); opacity: 0; }

/* ---------- gate ---------- */
.gate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; align-content: center; gap: 18px; background: radial-gradient(70% 60% at 50% 45%, #fff 0%, var(--pearl) 70%); transition: opacity 0.9s ease, visibility 0.9s; }
.gate.is-out { opacity: 0; visibility: hidden; }
.gate-mark { width: 46px; height: 60px; animation: mark-in 1.2s cubic-bezier(.2,.8,.2,1) both; filter: drop-shadow(0 14px 30px rgba(75, 56, 216, 0.35)); }
@keyframes mark-in { from { opacity: 0; transform: translateY(10px) scale(.92); filter: blur(8px); } to { opacity: 1; transform: none; filter: drop-shadow(0 14px 30px rgba(75, 56, 216, 0.35)); } }
.gate p { margin: 0; color: var(--ink-3); }

/* ---------- ribbon ---------- */
.ribbon { position: fixed; z-index: 60; left: 50%; bottom: 14px; transform: translateX(-50%); font: 500 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 99px; background: rgba(255,255,255,0.55); border: 1px solid var(--glass-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 24px; border-radius: 14px; font: 500 16px/1 var(--sans); letter-spacing: -0.01em; text-decoration: none; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, background .3s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn-ink { background: var(--ink); color: #fff; box-shadow: 0 10px 30px -12px rgba(23,20,58,.55), inset 0 1px 0 rgba(255,255,255,.14); }
.btn-ink:hover { box-shadow: 0 16px 40px -14px rgba(75,56,216,.7), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-glass { background: var(--glass); color: var(--ink); border: 1px solid var(--glass-line); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 10px 30px -18px rgba(23,20,58,.35); }
.btn-line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; border-radius: 11px; }

/* ---------- header ---------- */
.top { position: fixed; z-index: 50; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 18px var(--gutter); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand img { display: block; height: 30px; width: auto; }
.top-links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.top-links a:not(.btn) { text-decoration: none; color: var(--ink-2); }
.top-links a:not(.btn):hover { color: var(--ink); }

/* ---------- chapters ---------- */
.chapters { position: fixed; z-index: 40; right: var(--gutter); top: 50%; transform: translateY(-50%); display: grid; gap: 4px; }
.chapters button { background: none; border: 0; padding: 7px 0 7px 18px; cursor: pointer; position: relative; display: flex; justify-content: flex-end; color: var(--ink-3); font: 500 12px/1 var(--sans); }
.chapters button::before { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: rgba(23,20,58,.18); transition: background .3s, transform .3s; }
.chapters button span { opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .3s; padding-right: 10px; }
.chapters:hover button span, .chapters button.on span { opacity: 1; transform: none; }
.chapters button.on { color: var(--ink); }
.chapters button.on::before { background: var(--indigo); transform: scale(1.35); }
body.on-light .chapters { opacity: 0; pointer-events: none; }

/* ---------- copy blocks ---------- */
.stage { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.blk { position: absolute; left: var(--gutter); top: 50%; width: min(560px, calc(100vw - 2 * var(--gutter))); transform: translate(0, calc(-50% + var(--dy, 0px))); filter: blur(var(--bl, 0px)); opacity: 0; visibility: hidden; will-change: opacity, transform, filter; }
.blk a, .blk button { pointer-events: auto; }
.blk-hero { width: min(620px, calc(100vw - 2 * var(--gutter))); top: 52%; }
.blk-right { left: auto; right: calc(var(--gutter) + 60px); width: min(430px, calc(100vw - 2 * var(--gutter))); }
.blk-features { width: min(700px, calc(100vw - 2 * var(--gutter))); }
.blk-proof { left: 50%; top: 66%; width: min(1080px, calc(100vw - 2 * var(--gutter))); transform: translate(-50%, calc(-50% + var(--dy, 0px))); text-align: center; }
.blk-final { left: 50%; top: 15%; width: min(880px, calc(100vw - 2 * var(--gutter))); transform: translate(-50%, var(--dy, 0px)); text-align: center; }
.blk-final .ctas { justify-content: center; }

.kicker { color: var(--indigo-deep); margin: 0 0 16px; }
.display { margin: 0; font-weight: 500; font-size: clamp(42px, 5.6vw, 82px); line-height: 1; letter-spacing: -0.045em; text-wrap: balance; }
.display em { color: var(--indigo-deep); }
.display.md { font-size: clamp(34px, 4.2vw, 60px); line-height: 1.02; letter-spacing: -0.04em; }
.lede { margin: 20px 0 0; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; color: var(--ink-2); letter-spacing: -0.005em; text-wrap: pretty; }
.lede b { color: var(--ink); font-weight: 600; }
.fine { margin: 14px 0 0; font-size: 13px; color: var(--ink-3); }
.ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.cue { margin-top: 44px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 12px; }
.cue i { width: 34px; height: 1px; background: linear-gradient(90deg, var(--indigo), transparent); animation: cue 2.4s ease-in-out infinite; transform-origin: left; }
@keyframes cue { 0% { transform: scaleX(0); } 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

/* text that sits over bright glass keeps a soft halo */
.blk .display, .blk .lede { text-shadow: 0 0 22px rgba(244,243,248,.85), 0 0 2px rgba(244,243,248,.6); }


.feats { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feats li { display: grid; gap: 4px; padding: 15px 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); box-shadow: 0 18px 40px -30px rgba(23,20,58,.45); }
.feats b { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.feats span { font-size: 13.5px; color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stats div { padding: 22px 18px 20px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); display: grid; gap: 8px; }
.stats b { font-weight: 500; font-size: clamp(30px, 3.6vw, 52px); letter-spacing: -0.045em; line-height: 1; }
.stats span { font-size: 14px; color: var(--ink-2); }
.quotes { margin-top: 26px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: left; }
.quotes figure { margin: 0; padding: 18px; border-radius: 18px; background: rgba(255,255,255,.62); border: 1px solid var(--glass-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: grid; gap: 14px; align-content: space-between; }
.quotes blockquote { margin: 0; font-family: var(--serif); font-size: 21px; line-height: 1.2; letter-spacing: -0.01em; }
.quotes figcaption { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.quotes figcaption img { width: 34px; height: 34px; border-radius: 50%; }
.quotes figcaption b { display: block; color: var(--ink); font-weight: 600; font-size: 13px; }

/* ---------- 3D-anchored tags ---------- */
.tags { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
.tag { position: absolute; left: 0; top: 0; opacity: 0; display: grid; gap: 3px; padding: 10px 13px 10px 16px; border-radius: 12px; font-size: 12.5px; color: var(--ink-2); background: rgba(255,255,255,.6); border: 1px solid var(--glass-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap; will-change: transform, opacity; }
.tag b { color: var(--ink); font-weight: 600; font-size: 14px; }
.tag::before { content: ""; position: absolute; left: -26px; top: 50%; width: 22px; height: 1px; background: var(--indigo); }
.tag-up::before { left: 50%; top: auto; bottom: -20px; width: 1px; height: 16px; margin-left: -0.5px; }

/* ---------- track + light end ---------- */
main { position: relative; z-index: 20; }
.track { height: 950vh; pointer-events: none; }
.light { position: relative; background: var(--pearl); padding: 24vh var(--gutter) 90px; }
.light-in { width: min(980px, 100%); margin: 0 auto; display: grid; justify-items: center; text-align: center; gap: 26px; }
.light-logo { height: 46px; width: auto; }
.light-line { margin: 0; font-size: 18px; color: var(--ink-2); }
.credits { margin-top: 50px; border-top: 1px solid var(--hair); padding-top: 24px; display: grid; gap: 10px; font-size: 13px; line-height: 1.6; color: var(--ink-3); text-align: left; }
.credits p { margin: 0; }
.credits b { color: var(--ink); font-weight: 600; }

/* ---------- fallback (no WebGL) ---------- */
.fallback { display: none; }
.no-webgl #world, .no-webgl .stage, .no-webgl .tags, .no-webgl .chapters, .no-webgl .whiteout, .no-webgl .track { display: none; }
.no-webgl .fallback { display: grid; position: relative; min-height: 100vh; place-items: end start; overflow: hidden; order: -1; }
.no-webgl main { display: flex; flex-direction: column; }
.fallback img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fallback::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(244,243,248,0), rgba(244,243,248,.94)); }
.fallback-in { position: relative; z-index: 1; padding: 0 var(--gutter) 14vh; max-width: 720px; display: grid; gap: 14px; }
.fallback-in h1 { margin: 0; font-weight: 500; letter-spacing: -0.045em; font-size: clamp(42px, 7vw, 84px); line-height: 1; }
.fallback-in p:last-child { margin: 0; color: var(--ink-2); font-size: 17px; line-height: 1.55; }

/* portfolio recording (?debug=rec): copy kept clear of the card caption */
body.rec .stage { inset: -12vh 0 12vh 0; }
body.rec .blk-final { top: calc(11% + 14vh); }
body.rec .chapters, body.rec .cue { display: none; }
body.clean .stage, body.clean .tags, body.clean .top, body.clean .chapters, body.clean .ribbon { display: none; }

/* ---------- near-square windows: copy stacks under the subject ---------- */
@media (max-aspect-ratio: 5/4) and (min-width: 761px) {
  .blk, .blk-right { left: var(--gutter); right: auto; top: auto; bottom: 8vh; transform: translate(0, var(--dy, 0px)); width: min(760px, calc(100vw - 2 * var(--gutter))); }
  .blk-features { bottom: 5vh; }
  .blk-proof { left: 50%; top: auto; bottom: 6vh; transform: translate(-50%, var(--dy, 0px)); }
  .blk-final { left: 50%; top: 11%; bottom: auto; transform: translate(-50%, var(--dy, 0px)); }
  .display { font-size: clamp(40px, 5.4vw, 64px); } .display.md { font-size: clamp(32px, 4.4vw, 50px); }
  .quotes figure:nth-child(n+3) { display: none; } .quotes { grid-template-columns: 1fr 1fr; }
}

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .top-links a:not(.btn) { display: none; }
  .brand img { height: 26px; }
  .chapters { display: none; }
  .blk, .blk-right { left: var(--gutter); right: auto; top: auto; bottom: 12vh; transform: translate(0, var(--dy, 0px)); width: calc(100vw - 2 * var(--gutter)); }
  .blk-hero { bottom: 9vh; }
    .blk-features { bottom: 6vh; }
  .feats { grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 18px; }
  .feats li { padding: 10px 11px; border-radius: 12px; }
  .feats b { font-size: 13px; } .feats span { font-size: 11.5px; }
  .blk-proof { top: 50%; bottom: auto; left: 50%; transform: translate(-50%, calc(-50% + var(--dy, 0px))); }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stats div { padding: 14px 12px; }
  .quotes { grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
  .quotes figure:nth-child(n+3) { display: none; }
  .quotes figure { padding: 13px; gap: 10px; }
  .quotes blockquote { font-size: 17px; }
  .blk-final { top: 14%; bottom: auto; left: 50%; transform: translate(-50%, var(--dy, 0px)); }
  .display { font-size: 40px; } .display.md { font-size: 32px; }
  .lede { font-size: 15.5px; margin-top: 14px; }
  .ctas { margin-top: 20px; }
  .tag { font-size: 11px; } .tag b { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) { .cue i, 