/* AWAKE. Warm paper, black ink, one serif for display (Instrument Serif) and one colour: dawn, from vermilion to amber.
   Light by default (the toggle still offers a warm night). Loaded last, so these tokens win over app.css/motion.css. */
:root:not([data-theme="dark"]) {
  --bg: #faf8f4; --bg2: #f5f2ec; --bg3: #efeae2; --line: #e9e3d9; --line2: #ddd5c9; --ink: #16130f; --ink2: #3d3832; --mute: #7a7268; --mute2: #a69d92;
  --card: #ffffff; --shadow: 0 1px 2px rgba(40,30,20,.05), 0 1px 1px rgba(40,30,20,.03); --shadow2: 0 16px 44px -16px rgba(60,40,20,.2), 0 2px 6px rgba(60,40,20,.05);
  --accent: #ea5a2a; --accent2: #ff9f43; --accent-bg: #fff0e7; --glow: rgba(234, 90, 42, .16);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #100e0c; --bg2: #151210; --bg3: #1e1a17; --line: #27221e; --line2: #332c27; --ink: #f7f3ee; --ink2: #d8d0c7; --mute: #a39a90; --mute2: #786f66;
  --card: #151210; --accent: #ff7a45; --accent2: #ffb35c; --accent-bg: rgba(255, 122, 69, .12); --glow: rgba(255, 122, 69, .18);
  color-scheme: dark;
}
:root { --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif; --dawn: linear-gradient(100deg, #e2366b 0%, #ff6a3d 45%, #ffb347 100%); }
.wm { font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: -.01em; line-height: 1; }
canvas.awake3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
em { font-style: italic; }

/* serif display everywhere that speaks in headlines */
.shead h2, .phead h1, .cta2 h2, .ch h2, .ch0 h1, .gate .g-h, .doc h2, .fhead h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; }
.shead h2 { font-size: 46px; line-height: 1.02; } .phead h1 { font-size: 52px; line-height: 1; }
.shead h2 em, .phead h1 em, .ch h2 em, .ch0 h1 em, .g-h em { background: var(--dawn); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.kicker { color: var(--accent); letter-spacing: .14em; }
.cta2 { background: #16130f; }
.cta2::before { background: radial-gradient(640px 320px at 50% 115%, rgba(255,106,61,.5), transparent 70%); }
.cta2 .neural { --accent: #ff7a45; }
::selection { background: #ffd9c4; color: #16130f; }

/* ---------------- gate: the screen opens like eyelids ---------------- */
html.gating, html.gating body { overflow: hidden; }
html.entered .gate { display: none; }
.gate { position: fixed; inset: 0; z-index: 1000; color: #f3e9de; font-family: var(--sans); pointer-events: auto; }
.g-lid { position: absolute; left: -10%; right: -10%; height: 51vh; background: radial-gradient(120% 140% at 50% 100%, #1c1622 0%, #0d0a0e 70%); will-change: transform; }
.g-lid.top { top: 0; border-radius: 0 0 50% 50% / 0 0 18% 18%; }
.g-lid.bot { bottom: 0; border-radius: 50% 50% 0 0 / 18% 18% 0 0; background: radial-gradient(120% 140% at 50% 0%, #1c1622 0%, #0d0a0e 70%); }
.g-in { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-rows: auto 1fr; padding: max(22px, env(safe-area-inset-top)) 28px max(30px, env(safe-area-inset-bottom)); }
.g-top { display: flex; align-items: center; gap: 10px; opacity: 0; transition: opacity 1.2s .2s; }
.g-top img { border-radius: 8px; }
.g-mid { align-self: center; display: flex; flex-direction: column; align-items: center; text-align: center; }
.g-shut { width: 150px; margin-bottom: 34px; fill: none; stroke: #f3e9de; stroke-width: 3.4; stroke-linecap: round; opacity: 0; transition: opacity 1.4s .3s; animation: sleep 5s ease-in-out infinite; }
@keyframes sleep { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
.g-h { margin: 0; font-size: clamp(56px, 9vw, 132px); line-height: .95; padding-bottom: .08em; color: #f7efe6; }
.g-h em { background: linear-gradient(100deg, #ff8fb1, #ffb27a 60%, #ffd78f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.g-h, .g-sub { opacity: 0; transform: translateY(20px); filter: blur(6px); transition: opacity 1.4s cubic-bezier(.16,1,.3,1) .5s, transform 1.4s cubic-bezier(.16,1,.3,1) .5s, filter 1.4s .5s; }
.g-sub { margin: 14px 0 36px; font-size: 18px; color: #a99c92; transition-delay: .75s; }
.g-act { display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0; transition: opacity 1.2s 1.3s; }
.g-go { display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 30px; border-radius: 999px; background: #f7efe6; color: #16130f; font-size: 16px; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 18px 60px -12px rgba(255, 140, 90, .45); transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s; }
.g-go:hover { transform: translateY(-1px) scale(1.03); box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 22px 80px -10px rgba(255, 140, 90, .7); }
.g-go svg { transition: transform .25s; } .g-go:hover svg { transform: translateX(3px); }
.g-hint { font-size: 12px; color: #6f645c; letter-spacing: .04em; }
.gate.in .g-top, .gate.in .g-act, .gate.in .g-shut { opacity: 1; } .gate.in .g-h, .gate.in .g-sub { opacity: 1; transform: none; filter: none; }
.gate.waking .g-in > * { opacity: 0 !important; filter: blur(8px); transition: opacity .45s, filter .45s; }
/* the lids part: a sleepy flutter, a half-open moment, then wide open */
.gate.opening .g-lid.top { animation: lidTop 2.1s cubic-bezier(.65,0,.25,1) forwards; }
.gate.opening .g-lid.bot { animation: lidBot 2.1s cubic-bezier(.65,0,.25,1) forwards; }
@keyframes lidTop { 0% { transform: translateY(0); } 18% { transform: translateY(-14%); } 30% { transform: translateY(-2%); } 52% { transform: translateY(-38%); } 62% { transform: translateY(-30%); } 100% { transform: translateY(-112%); } }
@keyframes lidBot { 0% { transform: translateY(0); } 18% { transform: translateY(12%); } 30% { transform: translateY(2%); } 52% { transform: translateY(34%); } 62% { transform: translateY(27%); } 100% { transform: translateY(112%); } }
/* the page behind starts out of focus and clears as the lids open */
html.waking main, html.waking header.top, html.waking .official { filter: blur(14px) saturate(.7); transform: scale(1.02); }
html.focusing main, html.focusing header.top, html.focusing .official { filter: blur(0) saturate(1); transform: none; transition: filter 1.8s cubic-bezier(.2,.8,.2,1), transform 2s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .gate *, .gate { transition-duration: .01s !important; animation-duration: .01s !important; } html.waking main { filter: none; } }

/* ---------------- the story: night becomes morning as you scroll ---------------- */
.story { position: relative; margin-top: -64px; isolation: isolate; --day: 0; --dw: 0;
  --tx: color-mix(in srgb, #16130f calc(var(--day) * 100%), #f7efe6); --tx2: color-mix(in srgb, #3d3832 calc(var(--day) * 100%), #cbbdb1); }
.st-pin { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.st-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.sky { position: absolute; inset: 0; }
.sky.day { background: radial-gradient(1200px 760px at 50% 30%, #fffaf2, #faf8f4 70%); }
.sky.dawn { opacity: var(--dw); background: linear-gradient(180deg, #5b4a78 0%, #c9708a 38%, #ff9f7a 62%, #ffd2a1 82%, #fff1dd 100%); }
.sky.night { opacity: calc(1 - var(--day) * 1.9); background: radial-gradient(1100px 600px at 50% 112%, #4a2c45 0%, rgba(74,44,69,0) 70%), linear-gradient(180deg, #08070d 0%, #141024 52%, #2a1b33 100%); }
.stars { position: absolute; inset: 0; opacity: calc(1 - var(--day) * 2.6); }
.stars i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #fff; opacity: .7; animation: twinkle 3.8s ease-in-out infinite; animation-delay: var(--d); }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: .9; } }
.sun { position: absolute; left: 50%; width: 1100px; height: 1100px; margin-left: -550px; border-radius: 50%; pointer-events: none;
  top: calc(84% - var(--day) * 62%); opacity: calc(.25 + var(--day) * .75);
  background: radial-gradient(closest-side, rgba(255,224,170,.9), rgba(255,170,110,.42) 32%, rgba(255,120,110,.14) 56%, rgba(255,120,110,0) 72%); transform: translateY(-50%); }
.st-flat { position: absolute; left: 50%; top: 34%; width: min(420px, 70vw); transform: translate(-50%, -50%); opacity: 0; transition: opacity .8s; }
html.no3d .st-flat { opacity: 1; }
.st-stage canvas.awake3d { z-index: 1; }

.ch { position: relative; z-index: 2; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; padding-bottom: 9vh; opacity: var(--o, 0); filter: blur(var(--b, 0)); pointer-events: none; color: var(--tx); }
.ch.on { pointer-events: auto; }
.ch > .wrap { width: 100%; }
.ch .chx { max-width: 720px; margin: 0 auto; text-align: center; }
.ch h2 { font-size: clamp(46px, 6vw, 86px); line-height: .98; margin: 12px 0 16px; color: var(--tx); }
.ch p { color: var(--tx2); font-size: 17.5px; line-height: 1.6; margin: 0 auto 22px; max-width: 600px; }
.st-k { display: inline-block; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: color-mix(in srgb, #ea5a2a calc(var(--day) * 100%), #ffb27a); }
.ch .ctas { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ch .btn:not(.ghost) { box-shadow: 0 16px 44px -14px rgba(234, 90, 42, .55); }
.ch .btn.ghost { color: var(--tx); border-color: color-mix(in srgb, var(--tx) 25%, transparent); background: transparent; }
.st-split { display: flex; gap: 4px; height: 46px; margin: 4px auto 0; max-width: 520px; }
.st-split i { font-style: normal; display: flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 12px; font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.st-split i:first-child { background: var(--dawn); color: rgba(255,255,255,.88); }
.st-split i:last-child { background: var(--card); border: 1px solid var(--line); color: var(--mute); padding: 0 10px; }
.st-split i:first-child b { color: #fff; } .st-split b { color: var(--ink); font-weight: 600; }
.ch.on .st-split i:first-child { animation: grow 1.1s cubic-bezier(.16,1,.3,1) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(.2); } }
.ch0 h1 { font-size: clamp(64px, 8.6vw, 132px); line-height: .9; margin: 18px 0 16px; color: var(--tx); }
.ch0 .lede { color: var(--tx2); font-size: 17px; margin: 0 auto 24px; max-width: 560px; }
.ch0 .pill { background: color-mix(in srgb, #fff calc(8% + var(--day) * 62%), transparent); border-color: color-mix(in srgb, var(--tx) 18%, transparent); color: var(--tx); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ch0 .pill .psep { background: color-mix(in srgb, var(--tx) 25%, transparent); }
.st-cue { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--tx2); opacity: .8; }
.st-cue i { width: 1px; height: 30px; background: linear-gradient(currentColor, transparent); animation: cue 2.2s cubic-bezier(.65,0,.35,1) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
/* the header is light text while it sits over the night sky */
html.night header.top { --ink: #f7efe6; --mute: rgba(247,239,230,.62); --bg3: rgba(255,255,255,.1); --line: rgba(255,255,255,.12); --line2: rgba(255,255,255,.2); --card: rgba(255,255,255,.06); background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; color: #f7efe6; }
html.night header.top.scrolled { border-bottom-color: transparent; }
html.night header.top .launchbtn { background: #f7efe6; color: #16130f; border-color: #f7efe6; }

@media (max-width: 760px) {
  .ch { padding-bottom: 7vh; }
  .ch0 h1 { font-size: 60px; }
  .ch h2 { font-size: 46px; }
  .ch p, .ch0 .lede { font-size: 15.5px; }
  .st-cue { display: none; }
}

/* ---------------- header: logo · centred capsule · actions ---------------- */
header.top .bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; height: 68px; }
header.top .logo { justify-self: start; gap: 9px; }
header.top .bar .right { margin-left: 0; justify-self: end; gap: 6px; }
.logo .mark { border-radius: 8px; box-shadow: 0 0 0 1px rgba(22,19,15,.08), 0 3px 10px -3px rgba(234, 90, 42, .35); }
.nav { position: relative; gap: 0; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(40,30,20,.04); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); }
.nav a { position: relative; z-index: 1; padding: 7px 16px; font-size: 13.5px; font-weight: 500; color: var(--mute); background: none !important; transition: color .2s; }
.nav a:hover, .nav a.on { color: var(--ink); }
.nav a::after { display: none; }
.nav-ind { position: absolute; z-index: 0; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 999px; opacity: 0; pointer-events: none; background: var(--bg3);
  transition: transform .45s cubic-bezier(.16,1,.3,1), width .45s cubic-bezier(.16,1,.3,1), opacity .25s; }
.nav-only-s { display: none; }
header.top .btn { height: 36px; padding: 0 16px; font-size: 13.5px; }
header.top .btn.ghost { background: transparent; border-color: var(--line2); color: var(--ink); }
header.top .btn.ghost:hover { border-color: var(--ink); }
header.top .launchbtn { gap: 6px; box-shadow: 0 8px 24px -10px rgba(234, 90, 42, .7); }
header.top .launchbtn svg { transition: transform .2s; } header.top .launchbtn:hover svg { transform: translateX(2px); }
header.top .iconbtn { width: 34px; height: 34px; }
header.top .xlink svg { width: 16px; height: 16px; }
.official { background: #16130f; color: #ffcf9e; }
@media (max-width: 900px) {
  header.top .bar { display: flex; height: 62px; }
  header.top .bar .right { margin-left: auto; }
  .nav { display: none; }
  .nav.open { display: grid; position: absolute; top: 62px; left: 12px; right: 12px; padding: 8px; border-radius: 18px; gap: 2px;
    background: color-mix(in srgb, var(--bg) 96%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow2); }
  .nav.open a { padding: 13px 14px; font-size: 16px; border-radius: 12px; }
  .nav.open a.on { background: var(--bg3) !important; }
  .nav.open .nav-only-s { display: block; }
  .nav.open .nav-cta { margin-top: 6px; text-align: center; background: var(--ink) !important; color: var(--bg); }
  .nav-ind { display: none; }
  .burger { display: grid; }
}

/* ---------------- story text: a clean column beside the eye, popping in chapter by chapter ---------------- */
.story { --tx: #f7efe6; --tx2: #d9cdc2; --panel: rgba(13, 10, 16, .78); }
.story.lit { --tx: #16130f; --tx2: #4a433c; --panel: rgba(250, 248, 244, .9); }
.ch { opacity: 1; filter: none; align-items: center; padding: 0; transition: color .6s; }
.ch .chx { max-width: 520px; margin: 0; text-align: left; }
.ch h2, .ch0 h1, .ch p, .ch0 .lede, .st-k { transition: color .6s; }
.ch h2 { font-size: clamp(46px, 5.2vw, 78px); }
.ch0 h1 { font-size: clamp(64px, 7.4vw, 116px); }
.ch p, .ch0 .lede { margin-left: 0; margin-right: 0; }
.ch .ctas { justify-content: flex-start; }
.st-split { margin: 4px 0 0; }
/* each chapter's lines rise into place in turn, then stay perfectly still and sharp */
.ch .chx > * { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1), color .6s; }
.ch.on .chx > * { opacity: 1; transform: none; }
.ch.on .chx > :nth-child(2) { transition-delay: .08s; } .ch.on .chx > :nth-child(3) { transition-delay: .16s; }
.ch.on .chx > :nth-child(4) { transition-delay: .24s; } .ch.on .chx > :nth-child(5) { transition-delay: .32s; }
.st-cue { left: 24px; transform: none; align-items: flex-start; }
@media (min-width: 761px) { .st-cue { left: max(24px, calc((100vw - 1200px) / 2 + 24px)); } }
@media (max-width: 760px) {
  .ch, .ch.at-bottom, .ch.at-top { align-items: flex-end; padding: 0 0 5vh; }
  .ch .chx { max-width: none; background: var(--panel); border-radius: 22px; padding: 22px 20px 24px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: background .6s; }
  .ch0 h1 { font-size: 54px; } .ch h2 { font-size: 42px; }
  .st-split i { font-size: 12px; padding: 0 9px; } .st-split i:last-child { flex: 0 0 auto !important; }
}
