/* Hold the Scroll landing. Tokens mirror SpaceHostApp/Views/ZenTheme.swift. */
@font-face { font-family: "Instrument Serif"; src: url("assets/fonts/InstrumentSerif-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("assets/fonts/InstrumentSerif-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url("assets/fonts/Geist-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("assets/fonts/Geist-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --canvas: #F9F6F0;
  --card: #FFFFFF;
  --card-2: #F2EFE8;
  --pill: #ECE8E0;
  --border: #E8E3D7;
  --ink: #1A2530;
  --ink-2: #586875;
  --ink-3: #6F7E8A;
  --sage: #4A7C59;
  --sage-dark: #365C42;
  --sage-light: #E8F0EB;
  --clay: #A65F22;
  --clay-soft: #CDA584;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--canvas); padding: 8px 14px; border-radius: 99px; }
.skip:focus { left: 8px; }

/* ---------- type ---------- */
.display { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; line-height: .98; margin: 0; text-wrap: balance; }
.display em { font-style: italic; color: var(--sage-dark); }
h1.display { font-size: clamp(56px, 11vw, 168px); }
h2.display { font-size: clamp(42px, 6.6vw, 104px); }
h3.display { font-size: clamp(28px, 3vw, 40px); line-height: 1.05; }
.lede { font-size: clamp(17px, 1.45vw, 21px); color: var(--ink-2); max-width: 34ch; margin: 22px 0 0; text-wrap: pretty; }
.eyebrow { color: var(--sage-dark); margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.eyebrow--clay { color: var(--clay); }
.pro { font-size: 9px; padding: 3px 7px 2px; border-radius: 99px; background: var(--ink); color: var(--canvas); letter-spacing: .12em; }

.chips, .legend { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li, .legend li { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 8px; border-radius: 99px; background: rgba(255,255,255,.62); border: 1px solid var(--border); color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--sage { background: var(--sage); }
.dot--clay { background: var(--clay-soft); }
.dot--ink { background: var(--ink); }

.facts { list-style: none; padding: 0; margin: 40px auto 0; display: flex; justify-content: center; gap: clamp(20px, 6vw, 80px); }
.facts li { display: grid; justify-items: center; gap: 4px; }
.facts b { font: 400 clamp(64px, 9vw, 128px)/.9 var(--serif); color: var(--sage-dark); }
.facts span { font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- HUD ---------- */
.hud {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px var(--gutter);
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -.01em; justify-self: start; }
.hud__brand img { border-radius: 7px; box-shadow: 0 1px 2px rgba(26,37,48,.12); }
.hud__nav { display: flex; gap: 4px; padding: 5px; border-radius: 99px; background: rgba(249,246,240,.62); border: 1px solid rgba(232,227,215,.9); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); }
.hud__nav a { text-decoration: none; font-size: 13.5px; padding: 7px 13px; border-radius: 99px; color: var(--ink-2); transition: background .25s, color .25s; }
.hud__nav a:hover, .hud__nav a[aria-current="true"] { background: var(--card); color: var(--ink); }
.hud__nav .hud__cta { background: var(--ink); color: var(--canvas); }
.hud__nav .hud__cta:hover { background: var(--sage-dark); color: #fff; }
.hud__meter { justify-self: end; display: grid; grid-template-columns: auto auto; gap: 4px 12px; align-items: center; color: var(--ink-2); }
.hud__value { text-align: right; color: var(--ink); }
.hud__value b { font-weight: 400; font-variant-numeric: tabular-nums; }
.hud__bar { grid-column: 1 / -1; height: 2px; background: rgba(26,37,48,.1); position: relative; overflow: hidden; width: 170px; }
.hud__bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); transition: background .3s; }
.hud.is-braking .hud__bar i { background: var(--clay); }
.hud.is-braking .hud__label { color: var(--clay); }
.hud__chapter { position: fixed; left: var(--gutter); bottom: 22px; color: var(--ink-2); }
.hud__chapter span:first-child { color: var(--ink); }

/* ---------- 3D layer ---------- */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: none; z-index: 0; }
.grain { display: none; }
.intro { display: none; }

html.is-3d #gl { display: block; }
html.is-3d .chapter { position: relative; z-index: 2; pointer-events: none; }
html.is-3d .stage { position: fixed; inset: 0; pointer-events: none; }
html.is-3d .beat.is-on { pointer-events: auto; }
html.is-3d .beat {
  position: absolute;
  opacity: var(--o, 0);
  transform: translate3d(0, calc((1 - var(--o, 0)) * 28px), 0);
  filter: blur(calc((1 - var(--o, 0)) * 8px));
  will-change: opacity, transform;
}
html.is-3d .beat:has(a:focus-visible) { --o: 1 !important; filter: none; }
html.is-3d .beat--hero { left: var(--gutter); bottom: 12vh; max-width: 980px; }
html.is-3d .beat--left { left: var(--gutter); top: 50%; translate: 0 -50%; max-width: 620px; }
html.is-3d .beat--right { right: var(--gutter); top: 50%; translate: 0 -50%; max-width: 560px; }
html.is-3d .beat--top { left: var(--gutter); top: 16vh; max-width: 760px; }
html.is-3d .beat--card {
  left: var(--gutter); bottom: 9vh; width: min(440px, calc(100vw - 2 * var(--gutter)));
  padding: 28px 30px 30px; border-radius: 28px;
  background: rgba(255,255,255,.66); border: 1px solid rgba(232,227,215,.95);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 30px 60px -30px rgba(26,37,48,.25);
}
html.is-3d .beat--card p:last-child { margin: 14px 0 0; color: var(--ink-2); }
html.is-3d .beat--center { left: 50%; top: 50%; translate: -50% -50%; width: min(860px, calc(100vw - 2 * var(--gutter))); text-align: center; }
html.is-3d .beat--center .eyebrow { justify-content: center; }
html.is-3d .beat--center .lede { margin-inline: auto; }

html.is-3d .grain {
  display: block; position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Opening mask: the brand is a window into the world. */
html.is-3d .intro { display: block; position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.intro__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro__veil { fill: var(--canvas); opacity: var(--veil, 1); }
.intro__word { font-family: var(--serif); font-size: clamp(60px, 18.5vw, 360px); letter-spacing: -.035em; }
.intro__hint { position: absolute; left: 50%; bottom: 7vh; translate: -50% 0; margin: 0; color: var(--ink-2); opacity: var(--hint, 1); }
.intro__hint span { display: inline-block; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }

/* ---------- plans ---------- */
.plans { display: grid; grid-template-columns: 1fr 1.15fr; gap: 16px; margin: 40px auto 0; text-align: left; max-width: 900px; }
.plan { padding: 28px 30px; border-radius: 28px; background: rgba(255,255,255,.7); border: 1px solid var(--border); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.plan--pro { background: rgba(26,37,48,.92); color: var(--canvas); border-color: transparent; }
.plan h3 { margin: 0; font: 600 13px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.plan ul { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 15px; }
.plan li { padding-left: 22px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 6px; border-left: 1.6px solid var(--sage); border-bottom: 1.6px solid var(--sage); transform: rotate(-45deg); }
.plan--pro li::before { border-color: #9CC3A6; }
.cta-row { display: grid; justify-items: center; gap: 12px; margin: 30px 0 0; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 17px 30px; border-radius: 99px; background: var(--sage); color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; box-shadow: 0 18px 40px -18px rgba(54,92,66,.8); transition: transform .3s cubic-bezier(.2,.8,.2,1), background .3s; }
.btn:hover { transform: translateY(-2px); background: var(--sage-dark); }
.fine { font-size: 12.5px; color: var(--ink-2); max-width: 62ch; }
.fine a { color: inherit; }
.foot__links { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.foot__links a { text-decoration: none; }
.foot__links a:hover { color: var(--ink); text-decoration: underline; }

.foot { position: relative; z-index: 3; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 26px var(--gutter) 34px; color: var(--ink-2); font-size: 14px; background: var(--canvas); border-top: 1px solid var(--border); }
.foot p { margin: 0; }

/* ---------- static page (no WebGL, reduced motion, no JS) ---------- */
html:not(.is-3d) .hud__meter, html:not(.is-3d) .hud__chapter { display: none; }
html:not(.is-3d) .hud { position: sticky; top: 0; background: var(--canvas); }
html:not(.is-3d) .hud__nav, html:not(.is-3d) .btn--ghost { backdrop-filter: none; -webkit-backdrop-filter: none; }
html:not(.is-3d) .chapter { padding: clamp(48px, 8vw, 112px) var(--gutter); border-bottom: 1px solid var(--border); }
html:not(.is-3d) :is(.chapter, #pause) { scroll-margin-top: 84px; }
html:not(.is-3d) .stage { display: grid; gap: 48px; max-width: 1180px; margin: 0 auto; }
html:not(.is-3d) #open { min-height: 92vh; display: grid; align-items: end; background: linear-gradient(to bottom, rgba(249,246,240,0) 40%, var(--canvas)), url("assets/dawn.webp") center / cover no-repeat; }
html:not(.is-3d) .beat--card { padding: 28px; border-radius: 28px; background: var(--card); border: 1px solid var(--border); }
html:not(.is-3d) #rules .stage { grid-template-columns: repeat(3, 1fr); }
html:not(.is-3d) #rules .beat--top { grid-column: 1 / -1; }
html:not(.is-3d) .beat--center { text-align: center; }
html:not(.is-3d) .beat--center .eyebrow { justify-content: center; }
html:not(.is-3d) .beat--center .lede { margin-inline: auto; }
html.is-3d .screenshot { display: none; }
.film-screenshot { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-size: 14px; font-weight: 600; text-underline-offset: 3px; }
html.is-mobile-film .hud__nav, html.is-mobile-film .btn--ghost, html.is-mobile-film .beat--card, html.is-mobile-film .plan { backdrop-filter: none; -webkit-backdrop-filter: none; }
html.is-mobile-film .beat { filter: none; }
/* Match the 3D drawing buffer to Safari's stable viewport while its controls move. */
html.is-mobile-film #gl { bottom: auto; height: 100vh; height: 100lvh; }
html.is-mobile-film .grain, html.is-mobile-film .intro__canvas { display: none; }
html.is-mobile-film :is(#reach, #choice, #rules, #insights) .beat {
  inset: auto var(--gutter) max(12px, env(safe-area-inset-bottom));
  translate: none;
  width: auto;
  max-width: none;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--canvas);
  box-shadow: none;
  font-size: 14px;
}
html.is-mobile-film :is(#reach, #choice, #rules, #insights) .beat::before { content: none; }
html.is-mobile-film :is(#reach, #choice, #rules, #insights) .display { font-size: clamp(27px, 7.5vw, 36px); }
html.is-mobile-film :is(#reach, #choice, #rules, #insights) .eyebrow { margin-bottom: 6px; }
html.is-mobile-film :is(#reach, #choice, #rules, #insights) .lede {
  margin-top: 8px;
  font-size: 14px;
  max-width: none;
}
html.is-mobile-film #rules .beat--card p:not(.eyebrow) { margin: 8px 0 0; }
html.is-mobile-film :is(#choice, #rules, #insights) .ctas { margin: 6px 0 0; }
html.is-mobile-film :is(#choice, #rules, #insights) .ctas .btn { min-height: 44px; padding: 7px 12px; }
html.is-mobile-film :is(#choice .chips, #insights .legend) { display: none; }
html.is-mobile-film .film-screenshot { margin-top: 0; font-size: 13px; }
html:not(.is-3d) .with-shot { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; }
html:not(.is-3d) .with-shot .beat { grid-column: 1; }
html:not(.is-3d) .with-shot .screenshot { grid-column: 2; grid-row: 1 / span 2; }
.screenshot { display: grid; gap: 12px; width: min(100%, 420px); margin-inline: auto; color: var(--ink-2); font-size: 14px; text-align: center; }
.screenshot img { width: 100%; height: auto; border-radius: clamp(16px, 5vw, 32px); border: 1px solid var(--border); }
.beat--card .screenshot { margin-top: 24px; }

@media (max-width: 860px) {
  .hud { grid-template-columns: 1fr auto; padding-top: 14px; }
  .hud__nav a:not(.hud__cta) { display: none; }
  .hud__meter { display: none; }
  html.is-3d .beat--left, html.is-3d .beat--right { left: var(--gutter); right: var(--gutter); top: auto; bottom: 8vh; translate: none; max-width: none; }
  html.is-3d .beat--hero { bottom: 9vh; right: var(--gutter); }
  html.is-3d .beat--top { top: 12vh; right: var(--gutter); }
  html.is-3d .beat--card { bottom: 6vh; }
  html.is-3d .hud::before { content: ""; position: absolute; inset: 0 0 -18px 0; z-index: -1; pointer-events: none; background: linear-gradient(var(--canvas) 55%, rgba(249,246,240,0)); opacity: .92; }
  #insights .legend { display: none; }
  html.is-3d .beat--sky { top: 12vh; }
  .plans { grid-template-columns: 1fr; gap: 10px; margin-top: 22px; }
  .plan { padding: 20px 22px; }
  .plan ul { font-size: 14px; gap: 6px; margin-top: 14px; }
  html:not(.is-3d) #rules .stage, html:not(.is-3d) .with-shot { grid-template-columns: minmax(0, 1fr); }
  html:not(.is-3d) .stage { gap: 24px; }
  html:not(.is-3d) .with-shot .screenshot { grid-column: 1; grid-row: auto; }
  html:not(.is-3d) .beat--card { padding: 16px; }
  html:not(.is-3d) #open { min-height: 66svh; }
  .facts b { font-size: 64px; }
  .lede { font-size: 16px; }
}

/* soft linen halo behind copy that sits on the scene */
html.is-3d .beat { isolation: isolate; }
html.is-3d .beat:not(.beat--card)::before {
  content: ""; position: absolute; inset: -22% -16%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(249,246,240,.82), rgba(249,246,240,.5) 55%, rgba(249,246,240,0));
}
@media (min-width: 861px) {
  html.is-3d:not(.is-mobile-film) .beat .lede {
    color: #FFF9EF;
    text-shadow: 0 1px 3px #0F2633, 0 1px 10px rgba(15,38,51,.84);
  }
}
html.is-3d .beat--sky { left: 50%; top: 15vh; translate: -50% 0; width: min(900px, calc(100vw - 2 * var(--gutter))); text-align: center; }
html:not(.is-3d) .beat--sky { display: none; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 0; }
.ctas--center { justify-content: center; }
.btn--ghost { background: rgba(255,255,255,.72); color: var(--ink); border: 1px solid var(--border); box-shadow: 0 14px 30px -20px rgba(26,37,48,.35); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn--ghost:hover { background: var(--card); color: var(--sage-dark); }
.btn:focus-visible, .hud a:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }
@media (max-width: 860px) { .ctas { margin-top: 18px; } .ctas .btn { padding: 13px 20px; font-size: 15px; } }

/* Plans and questions follow the film in normal document flow. */
.pricing, .faq { position: relative; z-index: 3; background: var(--canvas); padding-inline: var(--gutter); scroll-margin-top: 84px; }
.pricing { padding-block: clamp(32px, 6vw, 86px); text-align: center; }
.pricing h2.display, .faq h2.display { font-size: clamp(38px, 5vw, 76px); }
.availability, .cta-row .fine { margin: 0; }
.availability { font-weight: 600; }
.faq { padding-bottom: clamp(48px, 7vw, 100px); }
.faq h2, .faq details, .faq__support { max-width: 720px; margin-inline: auto; }
.faq h2 { margin-bottom: 24px; }
.faq details { border-top: 1px solid var(--border); }
.faq details:last-of-type { border-bottom: 1px solid var(--border); }
.faq summary { padding-block: 15px; font-weight: 600; cursor: pointer; }
.faq details p { margin: 0 0 18px; color: var(--ink-2); }
.faq__support { margin-top: 20px; }
html:not(.is-3d) .chapter--finale { display: none; }
/* the speed meter only matters around the brake */
html.is-3d .hud__meter { opacity: 0; transition: opacity .5s; }
html.is-3d .hud.show-meter .hud__meter { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .intro__hint span { animation: none; } .btn:hover { transform: none; } }
@media (max-width: 860px) {
  html.is-3d .beat { filter: none !important; }
  html.is-3d .beat--card, html.is-3d .plan { backdrop-filter: none; -webkit-backdrop-filter: none; }
  html.is-3d .beat--card { background: rgba(255,255,255,.9); }
}
@media (max-height: 820px) and (min-width: 861px) { .plan ul { gap: 6px; font-size: 14px; } .plan { padding: 22px 26px; } }
@media (max-width: 860px) { .hud__chapter { display: none; } }
