/* ── Tokens ─────────────────────────────────────────────────────────────
   Two worlds, one identity: night sky by default, aged spellbook in light.
   Violet ink and star-gold carry across both.

   Shared by every page. Lives in its own file rather than inline because a
   second page means a second copy, and two copies of a palette drift apart
   the first time one colour changes.                                      */
:root {
  --void:      #0B0716;
  --panel:     #150E29;
  --panel-2:   #1D1338;
  --rule:      #33245C;
  --ink:       #EDE6FA;
  --ink-soft:  #B4A6D6;
  --ink-faint: #7B6BA3;
  --arcane:    #B57BFF;
  --arcane-dim:#8B5CE0;
  --gold:      #F2C879;
  --star:      #FFFFFF;
  --glow: 0 0 24px rgba(181,123,255,.35);

  --grimoire: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --measure: 62ch;
}
@media (prefers-color-scheme: light) {
  :root {
    --void:      #F4EBD9;
    --panel:     #EDE1C9;
    --panel-2:   #E5D6B8;
    --rule:      #CDB995;
    --ink:       #2E1F4A;
    --ink-soft:  #5B4880;
    --ink-faint: #8A7AA8;
    --arcane:    #6B3FBF;
    --arcane-dim:#8A63D8;
    --gold:      #A87A2C;
    --star:      #8A7AA8;
    --glow: 0 0 0 rgba(0,0,0,0);
  }
}
:root[data-theme="light"] {
  --void:#F4EBD9; --panel:#EDE1C9; --panel-2:#E5D6B8; --rule:#CDB995;
  --ink:#2E1F4A; --ink-soft:#5B4880; --ink-faint:#8A7AA8;
  --arcane:#6B3FBF; --arcane-dim:#8A63D8; --gold:#A87A2C; --star:#8A7AA8;
  --glow: 0 0 0 rgba(0,0,0,0);
}
:root[data-theme="dark"] {
  --void:#0B0716; --panel:#150E29; --panel-2:#1D1338; --rule:#33245C;
  --ink:#EDE6FA; --ink-soft:#B4A6D6; --ink-faint:#7B6BA3;
  --arcane:#B57BFF; --arcane-dim:#8B5CE0; --gold:#F2C879; --star:#FFFFFF;
  --glow: 0 0 24px rgba(181,123,255,.35);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--void); color: var(--ink);
  font-family: var(--sans); font-size: 16.5px; line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.sheet { position: relative; z-index: 1; max-width: 1020px; margin: 0 auto; padding: 0 26px 100px; }

h1, h2, h3 { font-family: var(--grimoire); font-weight: 600; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.04; letter-spacing: -.015em; }
h2 { font-size: clamp(23px, 3vw, 32px); line-height: 1.16; }
h3 { font-size: 18px; }
p  { margin: 0; max-width: var(--measure); }
a  { color: var(--arcane); }
:focus-visible { outline: 2px solid var(--arcane); outline-offset: 3px; }

/* ── Shared atoms ─────────────────────────────────────────────────────── */
.rune {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold);
}
section { padding: 62px 0; border-top: 1px solid var(--rule); }
section:first-of-type { border-top: 0; padding-top: 26px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-lg { display: flex; flex-direction: column; gap: 42px; }

header.mast { display: flex; justify-content: space-between; align-items: baseline;
              gap: 18px; padding-top: 22px; flex-wrap: wrap; }
.wordmark { font-family: var(--grimoire); font-size: 19px; letter-spacing: .04em;
            text-decoration: none; color: var(--ink); }
.wordmark b { color: var(--arcane); font-weight: 600; }

.btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  padding: 12px 20px; text-decoration: none; display: inline-block;
  border: 1px solid var(--arcane); background: var(--arcane); color: var(--void);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--glow); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--arcane); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

code { font-family: var(--mono); font-size: .88em; background: var(--panel-2);
       padding: 1.5px 6px; border: 1px solid var(--rule); }
pre { font-family: var(--mono); font-size: 13px; line-height: 1.65; margin: 0;
      background: var(--panel); border: 1px solid var(--rule);
      padding: 18px 20px; overflow-x: auto; color: var(--ink-soft); }
pre b { color: var(--arcane); font-weight: 400; }

.scroll {
  font-size: 15px; color: var(--ink-soft); max-width: var(--measure);
  border-left: 2px solid var(--gold); padding-left: 17px;
}
footer { border-top: 1px solid var(--rule); padding-top: 26px;
         display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
         font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
         text-transform: uppercase; color: var(--ink-faint); }

/* The bake is level; a level butterfly reads as a specimen pinned to a board.
   One number, shared by every place the asset appears, so they cannot drift.
   Positive is clockwise, and this bake faces left, so positive is the one that
   lifts the head -- negative pitches it into a dive. */
:root { --tilt: 14deg; }
.tilt { transform: rotate(var(--tilt)); }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
