/* Chrysa — the window.
   The sky belongs to the visitor's own hour; sky.js sets --sky-* and --sun-*.
   Everything else is drawn, never approximated with a border-radius. */

:root {
  color-scheme: dark;

  /* Replaced at runtime by sky.js. These are the dusk values, so a page with
     JavaScript off still lands inside the world rather than on a flat colour. */
  --sky-top: #0B1430;
  --sky-mid: #23305C;
  --sky-low: #5A4A70;
  --sky-glow: #C98A6B;
  --sun-x: 78%;
  --sun-y: 70%;
  --sun-size: 86px;
  --sun-fill: #F2C24E;
  --sun-opacity: 0.95;
  --star-opacity: 0.35;

  /* The land is constant; only the light on it moves. */
  --hill-far: #1B2A4E;
  --hill-mid: #15203E;
  --hill-near: #0E1730;
  --ground: #0B1226;

  --ink: #F0F3FA;
  --ink-soft: #C4CFE6;
  --ink-dim: #8C9BBD;
  --gold: #F2C24E;
  --rule: #26355F;
  --rule-strong: #3A4C7E;

  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 40px);
  --col: min(680px, 100% - var(--gutter) * 2);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--rule-strong) transparent;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 18px/1.7 "Literata", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

/* The browser's own surfaces belong to the design too. */
::selection { background: var(--gold); color: #0B1226; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
a { color: var(--ink); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--gold); }

/* ───────────────────────── the window ───────────────────────── */

.window {
  position: relative;
  min-height: min(96svh, 880px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  padding-top: clamp(26px, 5vh, 52px);
}

.sky {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 80% at var(--sun-x) var(--sun-y),
      color-mix(in oklab, var(--sky-glow) 62%, transparent) 0%,
      transparent 58%),
    linear-gradient(to bottom,
      var(--sky-top) 0%,
      var(--sky-mid) 46%,
      var(--sky-low) 82%,
      var(--sky-glow) 100%);
  transition: background 1200ms var(--ease);
}

.stars { position: absolute; inset: 0; z-index: 0; opacity: var(--star-opacity);
         transition: opacity 1200ms var(--ease); }

.sun {
  position: absolute; z-index: 1;
  left: var(--sun-x); top: var(--sun-y);
  width: var(--sun-size); height: var(--sun-size);
  margin: calc(var(--sun-size) / -2) 0 0 calc(var(--sun-size) / -2);
  border-radius: 50%;
  background: var(--sun-fill);
  opacity: var(--sun-opacity);
  box-shadow: 0 0 var(--sun-size) color-mix(in oklab, var(--sun-fill) 45%, transparent);
  transition: all 1200ms var(--ease);
}

/* Drawn terrain. Three ridgelines, each an authored path, not a shape. */
.land {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  width: 100%; height: auto; display: block;
  pointer-events: none;
}

.window .inner {
  position: relative; z-index: 3;
  width: var(--col); margin: 0 auto;
  padding: 0 0 clamp(72px, 16vh, 150px);
}

/* Everything in the window sits on a sky that moves from near-black to bright
   blue over the day, so hero text is tinted from the foreground and carries its
   own soft scrim rather than relying on a background that will not hold still. */
.window h1 { text-shadow: 0 2px 26px rgba(6, 12, 30, 0.45); }
.window .standfirst { color: #F2F6FF; text-shadow: 0 1px 18px rgba(6, 12, 30, 0.55); }
.window .under { color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 14px rgba(6, 12, 30, 0.6); }

.wordmark {
  font: 500 15px/1 "Instrument Sans", system-ui, sans-serif;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 12px rgba(6, 12, 30, 0.55);
  /* In the flow, not absolute: the auto bottom margin eats the free space and
     pushes the headline to the foot of the window, so the two can never
     collide no matter how short or wide the viewport gets. */
  position: relative;
  z-index: 3;
  width: var(--col);
  margin: 0 auto auto;
  padding-bottom: clamp(26px, 5vh, 56px);
}

h1 {
  margin: 0;
  font: 400 clamp(40px, 7.4vw, 86px)/1.06 "Literata", Georgia, serif;
  letter-spacing: -0.04em;
  text-wrap: balance;
  max-width: 15ch;
}
h1 em { font-style: italic; color: var(--gold); }

.standfirst {
  margin: clamp(20px, 3vh, 30px) 0 0;
  font: 400 clamp(18px, 2.3vw, 22px)/1.55 "Instrument Sans", system-ui, sans-serif;
  color: var(--ink-soft);
  max-width: 42ch;
}

/* ───────────────────────── page body ───────────────────────── */

main { background: var(--ground); position: relative; z-index: 4; }

.col { width: var(--col); margin: 0 auto; }

section { padding: clamp(64px, 11vh, 118px) 0 0; }

h2 {
  margin: 0 0 clamp(26px, 4vh, 40px);
  font: 400 clamp(28px, 4.2vw, 46px)/1.14 "Literata", Georgia, serif;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 20ch;
}

h3 {
  margin: 0 0 10px;
  font: 600 20px/1.35 "Literata", Georgia, serif;
  letter-spacing: -0.02em;
  color: var(--ink);
}

p { margin: 0 0 1.1em; max-width: var(--measure); color: var(--ink-soft); }
p strong { color: var(--ink); font-weight: 600; }
p:last-child { margin-bottom: 0; }

.lede { font-size: 21px; color: var(--ink); max-width: 34ch; }

/* The ledger: the app's Day screen, as a page rhythm. */
.ledger { border-top: 1px solid var(--rule); }
.ledger > div {
  display: grid;
  grid-template-columns: minmax(0, 15ch) minmax(0, 1fr);
  gap: clamp(16px, 4vw, 48px);
  padding: clamp(22px, 3.4vh, 32px) 0;
  border-bottom: 1px solid var(--rule);
}
.ledger dt, .ledger .k {
  font: 500 14px/1.5 "Instrument Sans", system-ui, sans-serif;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-dim);
  margin: 4px 0 0;
}
.ledger dd, .ledger .v { margin: 0; }
.ledger p { margin: 0; }

/* Questions sit on the same hairlines, drawn once. */
.qa { border-top: 1px solid var(--rule); }
.qa > div { padding: clamp(24px, 3.6vh, 34px) 0; border-bottom: 1px solid var(--rule); }
.qa h3 { color: var(--gold); font-style: italic; font-weight: 400; }
.qa p { color: var(--ink-soft); }

/* Refusals: the one place the page raises its voice. */
.refusals { list-style: none; margin: 0; padding: 0; }
.refusals li {
  font: 400 clamp(24px, 3.6vw, 38px)/1.25 "Literata", Georgia, serif;
  letter-spacing: -0.03em;
  padding: clamp(14px, 2.2vh, 20px) 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.refusals li:first-child { border-top: 1px solid var(--rule); }

/* ───────────────────────── controls ───────────────────────── */

.get {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--gold); color: #0B1226;
  font: 600 17px/1 "Instrument Sans", system-ui, sans-serif;
  letter-spacing: -0.01em;
  padding: 19px 30px; border-radius: 2px;
  text-decoration: none;
  box-shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.9);
  transition: background 220ms var(--ease), transform 220ms var(--ease);
}
.get:hover { background: #F7D178; transform: translateY(-1px); }
.get svg { width: 17px; height: 17px; }

.under {
  margin: 16px 0 0;
  font: 400 15px/1.5 "Instrument Sans", system-ui, sans-serif;
  color: var(--ink-dim);
}

.onward { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: baseline; }
.onward a {
  font: 500 17px/1.5 "Instrument Sans", system-ui, sans-serif;
  color: var(--ink);
  text-decoration-color: var(--rule-strong);
}

/* ───────────────────────── reading pages ───────────────────────── */

.back {
  display: inline-flex; align-items: center; gap: 9px;
  padding: clamp(28px, 5vh, 46px) 0 0;
  font: 500 15px/1 "Instrument Sans", system-ui, sans-serif;
  color: var(--ink-dim); text-decoration: none;
}
.back:hover { color: var(--gold); }
.back svg { width: 15px; height: 15px; }

article { padding: clamp(26px, 4vh, 40px) 0 0; }
article h1 {
  font-size: clamp(34px, 5.6vw, 62px);
  max-width: 19ch;
}
article h2 { margin-top: clamp(52px, 8vh, 84px); }
article ul { margin: 0 0 1.1em; padding-left: 1.15em; max-width: var(--measure); color: var(--ink-soft); }
article li { margin-bottom: 0.55em; }
article li::marker { color: var(--rule-strong); }

blockquote {
  margin: clamp(34px, 5vh, 52px) 0;
  padding: 0 0 0 clamp(20px, 4vw, 34px);
  border-left: 1px solid var(--gold);
  font: 400 clamp(22px, 3.2vw, 30px)/1.32 "Literata", Georgia, serif;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 24ch;
}

/* Comparison: a ledger turned sideways, not a card grid. */
.scroller { overflow-x: auto; margin: 26px 0 0; }
.compare {
  width: 100%; border-collapse: collapse;
  font: 400 16px/1.5 "Instrument Sans", system-ui, sans-serif;
  min-width: 620px;
}
.compare th, .compare td {
  text-align: left; padding: 15px 18px 15px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top; color: var(--ink-soft);
}
.compare thead th {
  font-weight: 600; color: var(--ink);
  border-bottom-color: var(--rule-strong);
  font-size: 15px;
}
.compare tbody th {
  font-weight: 500; color: var(--ink-dim);
  font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase;
  padding-right: 28px;
}
.compare tbody td:first-of-type { color: var(--gold); }

.band {
  margin: clamp(56px, 9vh, 88px) 0 0;
  padding: clamp(32px, 5vh, 48px) 0 0;
  border-top: 1px solid var(--rule-strong);
}

footer {
  margin: clamp(72px, 12vh, 128px) 0 0;
  padding: clamp(28px, 4vh, 40px) 0 clamp(56px, 9vh, 88px);
  border-top: 1px solid var(--rule);
  font: 400 15px/1.8 "Instrument Sans", system-ui, sans-serif;
  color: var(--ink-dim);
}
footer a { color: var(--ink-soft); }
footer p { margin: 0; color: var(--ink-dim); max-width: none; }

.fine { color: var(--ink-dim); font: 400 14px/1.6 "Instrument Sans", system-ui, sans-serif; }

/* ───────────────────────── the one authored moment ─────────────────────────
   On arrival the land settles up into the frame and the headline resolves.
   Everything is already visible first, so nothing depends on the animation. */

@media (prefers-reduced-motion: no-preference) {
  .window .land { animation: settle 1500ms var(--ease) both; }
  .window h1 { animation: rise 1100ms var(--ease) 120ms both; }
  .window .standfirst { animation: rise 1100ms var(--ease) 260ms both; }
  .window .inner .get-wrap { animation: rise 1100ms var(--ease) 380ms both; }
}
@keyframes settle {
  from { transform: translateY(26px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes rise {
  from { transform: translateY(14px); opacity: 0; filter: blur(5px); }
  to   { transform: none; opacity: 1; filter: none; }
}

@media (max-width: 620px) {
  body { font-size: 17px; }
  .ledger > div { grid-template-columns: 1fr; gap: 8px; }
  .ledger dt, .ledger .k { margin-top: 0; }
}
