/* One night, one grammar: a star is a row, a constellation is a concept, amber is an open
   question, green is an approved definition. The page floats on a single 3D world. */
:root {
  color-scheme: dark;
  --night: #05070d; --ink: #e6e9f5; --ink-2: #b9bfd3; --ink-3: #848aa0; --accent: #aec6ff; --arc: #3d7cff;
  --good: #85d8a2; --amber: #ffb874; --line: rgba(255,255,255,.12); --glass: rgba(12,15,24,.72);
  --display: "Archivo", system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--ink); font: 16px/1.6 var(--display); letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }
#labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
main, header, footer { position: relative; z-index: 2; }
.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* header */
.top { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 10; padding: 14px max(20px, env(safe-area-inset-left, 0px)); }
.top-bar { max-width: 76rem; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: 6px 6px 6px 16px; border-radius: 999px; background: rgba(8,10,18,.62); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand svg { height: 25px; width: auto; display: block; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: 14px; }
.nav a:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; border: 0; font: 600 14px var(--display); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--accent); color: #0b1a3d; }
.btn svg { width: 15px; height: 15px; }
@media (max-width: 760px) { .nav { display: none; } .top-bar .btn { margin-left: auto; } }

/* type */
h1, h2, h3 { margin: 0; font-family: var(--display); font-variation-settings: "wdth" 110; font-weight: 600; letter-spacing: -0.035em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 1.3rem + 3.6vw, 4.5rem); line-height: 1.02; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(2rem, 1.2rem + 2.2vw, 3.25rem); line-height: 1.06; }
h3 { font-size: clamp(1.5rem, 1.15rem + 0.75vw, 1.85rem); line-height: 1.12; letter-spacing: -0.03em; }
p { margin: 0; color: var(--ink-2); }
.eyebrow, .k { font: 500 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.contrast { color: var(--ink-3); font-size: 15px; padding-left: 14px; border-left: 1px solid rgba(174,198,255,.35); }
.center { text-align: center; margin-inline: auto; }

/* forms */
.signup { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; max-width: 30rem; border-radius: 999px; background: rgba(8,10,18,.7); border: 1px solid rgba(174,198,255,.35); box-shadow: 0 18px 60px rgba(61,124,255,.22); }
.signup input { flex: 1 1 12rem; min-width: 0; height: 44px; padding: 0 16px; background: none; border: 0; color: var(--ink); font: 16px var(--display); outline: none; }
.signup .note { flex: 1 1 100%; padding: 0 16px; font-size: 13px; color: var(--ink-3); }
.signup .note:empty { display: none; }
@media (max-width: 480px) { .signup { border-radius: 20px; } .signup .btn { flex: 1 1 100%; justify-content: center; } }

/* 0. hero */
@media (max-width: 899px) { .hero::before { background: linear-gradient(180deg, rgba(5,7,13,.85), rgba(5,7,13,.4) 70%, transparent); } }
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 7rem 0 4rem; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(5,7,13,.9) 0%, rgba(5,7,13,.55) 34%, transparent 58%); }
.hero-copy { display: grid; gap: 1.4rem; justify-items: start; }
.hero-copy > * { max-width: 34rem; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); background: rgba(8,10,18,.5); }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }

/* pinned beats */
.pinned { position: relative; }
.learn { height: 560vh; } .ask { height: 150vh; } .miss { height: 160vh; }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-items: center; overflow: hidden; }
.col { display: grid; gap: 1.1rem; align-content: start; max-width: 28rem; }
.two { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .two { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { grid-area: 1 / 1; display: grid; gap: .8rem; align-content: start; opacity: 0; transform: translateY(24px); transition: opacity .6s cubic-bezier(.05,.7,.1,1), transform .7s cubic-bezier(.05,.7,.1,1); }
.steps li[data-past] { transform: translateY(-24px); }
.steps li[data-on] { opacity: 1; transform: none; }
.steps .n { font: 500 12px var(--mono); color: var(--ink-3); letter-spacing: .1em; }
.steps b { font-family: var(--display); font-variation-settings: "wdth" 110; font-size: clamp(1.8rem, 1.1rem + 2vw, 2.9rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 600; text-wrap: balance; }
.bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-width: 16rem; margin-top: .6rem; }
.bars i { height: 2px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; } .bars b { display: block; height: 100%; width: 0; background: var(--accent); }
.handoff { position: absolute; left: 50%; bottom: 14vh; translate: -50% 0; width: min(36rem, 90vw); text-align: center; font: 600 clamp(1.3rem, 1rem + 1vw, 1.8rem)/1.3 var(--display); letter-spacing: -0.02em; color: var(--ink); opacity: 0; transition: opacity .5s; }
.learn .pin::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(5,7,13,.85), rgba(5,7,13,.35) 36%, transparent 55%); }
@media (max-width: 899px) { .learn .pin { align-items: end; } .learn .col { padding-bottom: 3rem; } .learn .pin::before { background: linear-gradient(0deg, rgba(5,7,13,.92) 35%, transparent 70%); } }

/* consoles: ask and plan */
.console { justify-self: end; width: min(32rem, 100%); display: grid; gap: 12px; padding: 18px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.ask-input { display: flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(174,198,255,.45); background: rgba(5,7,13,.6); font-size: 15px; }
.caret { width: 2px; height: 1.1em; background: var(--accent); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.answer { display: grid; gap: 12px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s; }
.answer[data-on] { opacity: 1; transform: none; }
.fig { font: 600 3.4rem/1 var(--display); font-variation-settings: "wdth" 110; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: 6px; } .hbars div { display: grid; grid-template-columns: 6rem 1fr 3rem; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.hbars em { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; } .hbars i { display: block; height: 100%; background: #3987e5; border-radius: 3px; }
.hbars b { text-align: right; font-weight: 500; color: var(--ink); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,.07); color: var(--ink-2); }
.pill.good { color: var(--good); background: rgba(133,216,162,.12); }
.pill.btnish { color: #0b1a3d; background: var(--accent); font-weight: 600; transition: box-shadow .3s; }
.pill.btnish[data-pressed] { box-shadow: 0 0 0 5px rgba(174,198,255,.25); }
.rows { width: 100%; border-collapse: collapse; font: 12px var(--mono); font-variant-numeric: tabular-nums; }
.rows th { text-align: left; font-weight: 400; color: var(--ink-3); padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); }
.rows td { padding: 6px 6px 6px 0; color: var(--ink-2); border-bottom: 1px solid rgba(255,255,255,.05); }
.rows th:nth-child(n+3), .rows td:nth-child(n+3) { text-align: right; }
.rows tr { opacity: 0; transition: opacity .35s; } .rows tr[data-on] { opacity: 1; }
.rows thead tr { opacity: 1; }
.rows[hidden] { display: none; }
.foot { font-size: 12px; color: var(--ink-3); }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.stepper span { display: grid; gap: 6px; font-size: 12px; color: var(--ink-3); }
.stepper span::before { content: ""; height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); transition: background .4s; }
.stepper span[data-done]::before { background: var(--good); } .stepper span[data-done] { color: var(--ink); }
.ask .pin::before, .miss .pin::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(5,7,13,.8), transparent 50%); }
@media (max-width: 899px) { .ask .pin, .miss .pin { align-items: end; padding-bottom: 2rem; } .console { justify-self: stretch; } .two .col h2 { font-size: 1.8rem; } .two .col p:not(.contrast) { display: none; } }

/* flow beats over a dimmed sky */
.flow { padding: clamp(5rem, 12vw, 9rem) 0; }
.flow h2 { max-width: 40rem; margin-bottom: 3rem; }
.cards { display: grid; gap: 16px; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { display: grid; gap: 12px; grid-template-rows: auto auto 1fr auto; padding: 26px; border-radius: 22px; background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.card p { font-size: 15px; }
.card q { quotes: none; display: block; padding: 12px 14px; border-radius: 12px; background: rgba(174,198,255,.1); color: var(--ink); font-size: 14px; }
.trust { display: grid; gap: 16px; }
@media (min-width: 760px) { .trust { grid-template-columns: repeat(4, 1fr); } }
.trust div { padding: 22px; border-radius: 18px; border: 1px solid var(--line); background: rgba(8,10,18,.55); }
.trust b { display: block; margin-bottom: 12px; font: 650 clamp(1.45rem, 1.1rem + 0.7vw, 1.75rem)/1.12 var(--display); font-variation-settings: "wdth" 110; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.trust p { font-size: 14px; }
.flow .eyebrow.center { margin-bottom: 1rem; }
.flow h2 + .sub { max-width: 40rem; margin: -1.6rem auto 3rem; color: var(--ink-2); }
@media (min-width: 760px) { .trust.included { grid-template-columns: repeat(3, 1fr); } }
.included .k { display: block; margin-bottom: 12px; font-size: 11px; color: var(--ink-3); }

/* 7. close */
/* one screen: the mark sits just above the heading (story.js), the form under it, nothing cut off */
.close { min-height: 100vh; min-height: 100svh; display: grid; align-items: center; padding: max(15rem, 30vh) 0 4rem; }
.close-copy { display: grid; gap: 1.2rem; justify-items: center; text-align: center; }
.close-copy p { max-width: 34rem; }
footer { padding: 2rem 0 3rem; border-top: 1px solid var(--line); } .foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); }

/* labels drawn over the world */
.lb { position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; }
.lb-name { font: 500 11px/1 var(--mono); letter-spacing: .28em; text-transform: uppercase; color: rgba(205,215,255,.8); }
.lb-name[data-hot] { color: #fff; }
.lb-name[data-ok]::before { content: "✓ "; color: var(--good); letter-spacing: 0; }
.lb-tool { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font: 500 12px var(--display); color: #eef1ff; background: rgba(10,12,20,.9); border: 1px solid rgba(255,255,255,.14); }
.lb-table { font: 400 10.5px var(--mono); color: rgba(220,226,245,.75); }
.lb-amber, .lb-def { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 12px; border-radius: 13px; font: 500 12px var(--display); background: rgba(10,12,20,.92); }
.lb-amber { color: #ffd9b3; border: 1px solid rgba(255,184,116,.6); }
.lb-amber b, .lb-def b { font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.lb-def { color: #d8f5e3; border: 1px solid rgba(133,216,162,.6); }
.lb-def::before { content: ""; width: 9px; height: 5px; border-left: 1.6px solid var(--good); border-bottom: 1.6px solid var(--good); transform: rotate(-45deg) translateY(-2px); }
.lb-tag { font: 400 10.5px var(--mono); color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .steps li { transform: none; transition: opacity .3s; } html { scroll-behavior: auto; } .caret { animation: none; } .spinner { animation: none; border-top-color: rgba(11,26,61,.6); } .answer, .reply, .rows tr, .learn .col { transition: none; } .chat .reply[data-on], .chat .answer[data-on] { animation: none; } }

/* overlays sit behind the copy, never on it */
/* the shade behind pinned copy fades out at its foot, so no edge crosses the sky */
.pin::before { z-index: 0; -webkit-mask-image: linear-gradient(180deg, #000 75%, transparent); mask-image: linear-gradient(180deg, #000 75%, transparent); }
.pin > .wrap, .pin > .handoff { position: relative; z-index: 1; }
.pin > .handoff { position: absolute; }
.learn .col { transition: opacity .4s; }
.learn .col[data-gone] { opacity: 0; }
/* missing data: the plan sits under the copy, the dark patch has the right of the screen */
.miss .two { grid-template-columns: minmax(0, 1fr); max-width: 76rem; }
.miss .two > * { max-width: 32rem; }
.miss .console { justify-self: start; }
.lb-name.sm { letter-spacing: .14em; font-size: 10.5px; }
/* a soft vignette frames the sky like a lens, painted, no filters */
#labels::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 55% 45%, transparent 55%, rgba(2,3,8,.55) 100%); }
/* missing data: one conversation, from the question to the answer */
.chat { gap: 10px; }
.reply { display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255,184,116,.35); background: rgba(255,184,116,.05); opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s; }
.reply[data-on] { opacity: 1; transform: none; }
.reply p { font-size: 14px; color: var(--ink-2); }
.k.warn { color: var(--amber); }
.reply ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; font-size: 14px; color: var(--ink); overflow: hidden; max-height: 14rem; transition: max-height .5s, opacity .4s; }
.reply ol[data-done] { max-height: 0; opacity: 0; }
.plan-act { display: flex; flex-wrap: wrap; gap: 6px; }
.chat .answer .hbars div { grid-template-columns: 9.5rem 1fr 3rem; }
.chat .stepper { margin-top: 2px; }
.chat .reply:not([data-on]), .chat .answer:not([data-on]) { display: none; }
.chat .reply[data-on], .chat .answer[data-on] { animation: rise .5s cubic-bezier(.05,.7,.1,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.miss .col { gap: .9rem; }

/* site chrome the prototype did not need */
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: #0b1a3d; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.foot-links { display: inline-flex; gap: 18px; } .foot a { text-decoration: none; } .foot a:hover { color: var(--ink); }
.signup input[aria-invalid] { color: #ffd9b3; }
.signup-done { display: flex; gap: 12px; align-items: flex-start; max-width: 30rem; padding: 16px 18px; border-radius: 18px; background: rgba(133,216,162,.08); border: 1px solid rgba(133,216,162,.4); text-align: left; }
.signup-done svg { width: 20px; height: 20px; color: var(--good); flex: none; margin-top: 2px; }
.signup-done strong { display: block; color: var(--ink); } .signup-done p { font-size: 14px; }
/* sending: the button keeps its colour and its arrow becomes a spinner, so a wait reads as work, not a fault */
.btn:disabled { cursor: progress; }
.signup[data-sending] .btn { opacity: 1; color: #0b1a3d; }
.signup[data-sending] input { opacity: .6; }
.spinner { width: 15px; height: 15px; flex: none; border-radius: 50%; border: 2px solid rgba(11,26,61,.25); border-top-color: #0b1a3d; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.signup .note { color: var(--ink-2); }
.signup .note[data-tone="bad"] { color: var(--amber); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* still: no WebGL, or reduced motion asked for. The same story, every beat shown finished. */
.still #world, .still #labels { display: none; }
.still body { background: radial-gradient(90rem 50rem at 75% 0%, #101a3a, transparent 70%) no-repeat, var(--night); }
.still .pin::before { display: none; }
.still .hero { background: url(art/sky.webp) 70% 50% / cover no-repeat; }
.still .close { min-height: auto; padding: clamp(5rem, 12vw, 9rem) 0; }
/* pictures of the world stand in for it */
.still-art { display: none; }
.still .still-art { display: block; width: 100%; max-width: 34rem; height: auto; justify-self: center; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent); mask-image: radial-gradient(closest-side, #000 72%, transparent); }
@media (min-width: 900px) {
  .still .learn .pin > .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
  .still .miss .two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .still .miss .two > .col, .still .miss .console { grid-column: 1; }
  .still .miss .still-art { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
.still .pinned { height: auto; }
.still .pin { position: static; height: auto; overflow: visible; padding: 6rem 0; }
.still .steps { gap: 2.4rem; }
.still .steps li { grid-area: auto; opacity: 1; transform: none; }
.still .bars, .still .handoff, .still .caret, .still .learn .pin::before { display: none; }
.still .answer, .still .reply { opacity: 1; transform: none; }
.still .chat .reply, .still .chat .answer { display: grid; animation: none; }
.still .rows tr { opacity: 1; }
@media (max-width: 899px) { .still .ask .pin, .still .miss .pin { padding-bottom: 6rem; } .still .two .col p:not(.contrast) { display: block; } }
