:root {
  --sky1: #1f5aa8;
  --sky2: #3a6c9e;
  --dusk: #3b4e5c;
  --ink: #0f1c2a;
  --glow: #f4dfa6;
  --glow2: #ffcf7a;
  --text: #f3f6fa;
  --muted: rgba(235, 242, 250, 0.62);
  --line: rgba(160, 205, 255, 0.28);
  --glass: rgba(28, 44, 62, 0.42);
  --glass-b: rgba(255, 255, 255, 0.12);
  --r: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 35%, var(--dusk) 100%) fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }

/* ---------- frame chrome (corner sparkles + guide lines) ---------- */
.frame { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.frame .spark { position: absolute; width: 22px; height: 22px; opacity: .9; }
.frame .spark svg { width: 100%; height: 100%; }
.frame .tl { top: 22px; left: 22px; } .frame .tr { top: 22px; right: 22px; }
.frame .bl { bottom: 22px; left: 22px; } .frame .br { bottom: 22px; right: 22px; }
.frame .gl { position: absolute; background: var(--line); opacity: .5; }
.frame .gl.h { height: 1px; left: 0; right: 0; } .frame .gl.v { width: 1px; top: 0; bottom: 0; }

.label { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.label b { display: block; color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: .08em; margin-top: 4px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-b);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 15px; transition: background .25s, transform .25s;
}
a.pill:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }

.glass {
  background: var(--glass); border: 1px solid var(--glass-b);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: var(--r);
}

/* ---------- topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(56px, 7vw, 110px);
  transition: background .3s;
}
.topbar.scrolled { background: linear-gradient(180deg, rgba(20,40,64,.55), transparent); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .1em; font-size: 14px; }
.brand svg { width: 22px; height: 22px; }
.progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--glow); z-index: 60; width: 0; box-shadow: 0 0 12px var(--glow); }

/* ---------- hero (shared) ---------- */
.hero { position: relative; height: 100vh; min-height: 560px; overflow: hidden; }
.hero .layer { position: absolute; inset: 0; will-change: transform; }
.hero .layer svg { width: 100%; height: 100%; display: block; }
.hero .content {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 0 24px;
}
.hero h1 {
  font-size: clamp(48px, 9vw, 120px); line-height: .92; font-weight: 700;
  letter-spacing: -.01em; text-transform: uppercase;
  text-shadow: 0 6px 40px rgba(255, 220, 150, .35);
}
.hero .sub { margin-top: 18px; font-size: clamp(17px, 2vw, 22px); color: var(--muted); max-width: 560px; }
.hero .meta { position: absolute; top: 96px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 clamp(56px, 7vw, 110px); }
.hero .meta > div:nth-child(2) { text-align: center; } .hero .meta > div:last-child { text-align: right; }
.cue { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.cue i { width: 1px; height: 44px; background: linear-gradient(var(--glow), transparent); animation: drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1 } 70% { transform: scaleY(1); opacity: 1 } 100% { transform: scaleY(1); opacity: 0 } }

/* ---------- scrollytelling ---------- */
.scrolly { position: relative; }
.stage {
  position: sticky; top: 0; height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.stage > svg, .stage > canvas { width: 100%; height: 100%; display: block; }
.stage > canvas { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 90%, transparent); }
.steps { position: relative; margin-top: -100vh; z-index: 2; pointer-events: none; }
.step { height: 120vh; display: flex; align-items: center; padding: 0 clamp(20px, 6vw, 110px); }
.step:first-child { height: 100vh; }
.card {
  pointer-events: auto; width: min(400px, 100%);
  padding: 24px 26px; opacity: .18; transform: translateY(16px) scale(.98);
  transition: opacity .5s, transform .5s;
}
.step.on .card { opacity: 1; transform: none; }
.card .n { font-size: 12px; letter-spacing: .18em; color: var(--glow); text-transform: uppercase; }
.card h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; margin: 8px 0 10px; font-weight: 600; }
.card p { color: rgba(240, 245, 252, .82); font-size: 17px; line-height: 1.5; }
.card p + p { margin-top: 10px; }
.card em { color: var(--glow); font-style: normal; }

@media (min-width: 900px) {
  .stage.right { padding-left: min(460px, 38vw); }
}
@media (max-width: 899px) {
  .stage { align-items: flex-start; }
  .stage > svg, .stage > canvas { height: 62vh; margin-top: 8vh; }
  .step { align-items: flex-end; padding-bottom: 6vh; }
  .card { padding: 18px 20px; }
  .card p { font-size: 15.5px; }
}

/* ---------- sections ---------- */
.section { padding: 120px clamp(20px, 7vw, 110px); position: relative; }
.section h3 { font-size: clamp(30px, 4vw, 48px); font-weight: 600; line-height: 1.05; margin-bottom: 12px; }
.section .lead { color: var(--muted); font-size: 18px; max-width: 620px; margin-bottom: 36px; }
.kicker { font-size: 12px; letter-spacing: .2em; color: var(--glow); text-transform: uppercase; margin-bottom: 10px; }

.play { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: stretch; }
.play .viz { min-height: 540px; overflow: hidden; position: relative; touch-action: none; }
.play .viz svg, .play .viz canvas { width: 100%; height: 100%; display: block; position: absolute; inset: 0; }
.play .controls { padding: 24px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 899px) { .play { grid-template-columns: 1fr; } .play .viz { min-height: 360px; } }

.ctl label { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.ctl label b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 9px; background: rgba(255,255,255,.16); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px rgba(255,255,255,.12), 0 4px 14px rgba(0,0,0,.3); cursor: grab; }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; cursor: grab; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--glass-b); background: rgba(255,255,255,.06); padding: 7px 12px; border-radius: 999px; font-size: 13.5px; cursor: pointer; transition: background .2s; }
.seg button.on, .seg button:hover { background: rgba(255,255,255,.9); color: var(--ink); }

.readout { font-size: 44px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.readout small { font-size: 15px; color: var(--muted); font-weight: 400; display: block; margin-top: 6px; }
.meter { height: 10px; border-radius: 9px; background: rgba(255,255,255,.12); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8fd3ff, var(--glow)); border-radius: 9px; transition: width .15s; }
.hint { font-size: 13.5px; color: var(--muted); line-height: 1.45; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.fact { padding: 22px; }
.fact .big { font-size: 40px; font-weight: 700; color: var(--glow); line-height: 1; }
.fact p { margin-top: 10px; color: rgba(240,245,252,.8); line-height: 1.45; }

.myth { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.myth > div { padding: 24px; }
.myth .tag { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 10px; }
.myth .no .tag { color: #ff9a8a; } .myth .yes .tag { color: #9ff0c0; }
.myth p { line-height: 1.5; color: rgba(240,245,252,.85); }
@media (max-width: 700px) { .myth { grid-template-columns: 1fr; } }

.next { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 28px 30px; transition: transform .3s; }
.next:hover { transform: translateY(-3px); }
.next .t { font-size: clamp(26px, 3.4vw, 40px); font-weight: 600; }
.next .arrow { width: 60px; height: 60px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-size: 26px; flex: none; }

.note { margin-top: 40px; font-size: 13.5px; color: var(--muted); line-height: 1.5; max-width: 760px; }
.note p + p { margin-top: 6px; }
sup.ast { color: var(--glow); font-weight: 600; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- home ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tcard { padding: 10px 10px 18px; display: block; transition: transform .35s cubic-bezier(.2,.7,.2,1), background .3s; }
.tcard:hover { transform: translateY(-6px); background: rgba(40, 62, 86, .55); }
.tcard .thumb { aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; position: relative; background: linear-gradient(180deg, #2c67b0, #3e5868); }
.tcard .thumb svg { width: 100%; height: 100%; display: block; }
.tcard .row { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 10px 0; }
.tcard .row b { font-weight: 500; font-size: 17px; }
.tcard .row span { font-size: 12px; color: var(--muted); }
.tcard .cat { padding: 4px 10px 0; font-size: 13px; color: var(--muted); }
.tcard.soon { opacity: .45; pointer-events: none; }
.search { width: min(420px, 100%); padding: 14px 20px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-b); outline: none; font-size: 16px; margin-bottom: 30px; }
.search::placeholder { color: var(--muted); }

footer { padding: 60px clamp(20px, 7vw, 110px) 80px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
footer .tag { font-weight: 700; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; text-align: right; line-height: 1.25; }

@media (max-width: 700px) {
  .hero .meta { top: 84px; padding: 0 24px; font-size: 11px; }
  .hero .meta > div:nth-child(2) { display: none; }
  .topbar { padding: 16px 24px; }
  .frame .spark { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.tb-right { display: flex; gap: 10px; }
.topbar button.pill { cursor: pointer; }
.pill kbd { font: inherit; font-size: 11px; opacity: .6; border: 1px solid var(--glass-b); border-radius: 5px; padding: 0 5px; }
@media (max-width: 600px) { .pill kbd { display: none; } }
.search-ov { position: fixed; inset: 0; z-index: 80; background: rgba(10,22,36,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; justify-content: center; padding: 12vh 20px 20px; }
.search-ov[hidden] { display: none; }
.search-box { width: min(560px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; background: rgba(28,44,62,.85); }
.search-box input { padding: 20px 22px; background: none; border: 0; border-bottom: 1px solid var(--glass-b); outline: none; font-size: 19px; }
.search-res { overflow-y: auto; padding: 8px; }
.search-res > * { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 12px; }
.search-res a:hover, .search-res a:focus { background: rgba(255,255,255,.1); }
.search-res span { color: var(--muted); font-size: 13px; }
.search-res .off { opacity: .45; }
.search-res b { font-weight: 500; }
.tcard.soon .thumb { display: none; } .tcard.soon { padding-top: 6px; }

/* ---------- small phones & folding covers (Galaxy Fold ~280px) ---------- */
@media (max-width: 420px) {
  .hero h1 { font-size: clamp(26px, 10.5vw, 64px); hyphens: auto; -webkit-hyphens: auto; }
  .hero .meta > div:last-child { display: none; }
  .topbar { padding: 14px 16px; gap: 8px; }
  .tb-right { gap: 6px; }
  .topbar .pill { padding: 8px 12px; font-size: 13.5px; }
  .section { padding: 80px 18px; }
  .play .controls { padding: 18px; }
  .readout { font-size: 36px; }
  .card h2 { font-size: 22px; }
}
@media (max-width: 340px) {
  .brand span, .brand { font-size: 12px; letter-spacing: .06em; }
  .tb-right > a.pill { display: none; }          /* keep Search; logo already links home */
  .topbar button.pill { padding: 8px 10px; }
  .hero .sub { font-size: 15px; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- phones held sideways: text left, animation right ---------- */
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 520px) {
  .hero .meta { display: none; }
  .hero h1 { font-size: 15vh; }
  .stage { align-items: center; padding-left: 44vw; }
  .stage > svg, .stage > canvas { height: 100%; margin-top: 0; }
  .step { align-items: center; padding: 0 0 0 20px; }
  .card { width: 40vw; padding: 14px 16px; }
  .card h2 { font-size: 19px; margin: 4px 0 6px; }
  .card p { font-size: 13.5px; line-height: 1.4; }
  .play { grid-template-columns: 1fr 1fr; }
  .play .viz { min-height: 300px; }
}

/* ---------- dual-screen (Surface Duo spanned): keep content off the hinge ---------- */
@media (horizontal-viewport-segments: 2) {
  .stage.right { padding-left: env(viewport-segment-right 0 0); }
  .step { padding-left: 24px; padding-right: 0; }
  .card { width: calc(env(viewport-segment-width 0 0) - 48px); }
  .play { grid-template-columns: calc(env(viewport-segment-width 0 0) - 40px) 1fr; column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0) + 40px); }
  .hero .content { padding-right: calc(100vw - env(viewport-segment-right 0 0)); }
}
