/* ============================================================
   Empyrien — shared stylesheet
   No build step; plain CSS. Used by every page except /feast
   (unlinked from the site; it keeps its own light reading system).

   Type:   Cormorant Garamond (display) · Literata (text) ·
           Source Code Pro (labels). All three cover the full
           transliteration set (á í ú ḍ ḥ ṣ ẓ ʻ ʼ) — keep it that way
           if a face is ever swapped; many fonts silently lack ḥ/ṣ.
   Colour: night, parchment ink, and one light — gold — with
           starlight and ember as the only other accents.
   ============================================================ */

:root {
  --night:     #08090e;
  --night-2:   #0e1018;
  --night-3:   #141722;

  --ink:       #eee8dc;   /* headings, emphasis     16:1 */
  --ink-body:  #cdc6b8;   /* running text           11:1 */
  --ink-2:     #bdb5a6;   /* secondary               9.8:1 */
  --ink-3:     #958d7e;   /* labels, meta            6.1:1 */
  --ink-4:     #6f695e;   /* decoration only — never text */

  --gold:      #dcc08a;
  --gold-2:    #c4a56c;
  --dawn:      #f0c27b;
  --ember:     #e6a47e;
  --star:      #b9c7e0;

  --line:      rgba(238, 232, 220, 0.14);
  --line-soft: rgba(238, 232, 220, 0.075);
  --line-gold: rgba(220, 192, 138, 0.38);

  --display: 'Cormorant Garamond', 'Cormorant', Garamond, Georgia, serif;
  --text:    'Literata', Georgia, 'Times New Roman', serif;
  --mono:    'Source Code Pro', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --gutter:  clamp(1rem, 4vw, 2.5rem);
  --measure: 38rem;
  --bar-h:   4rem;

  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* the nine-pointed star, for ornaments drawn with mask-image */
  --star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0 -10 L1.92 -5.26 L6.43 -7.66 L4.85 -2.8 L9.85 -1.74 L5.51 0.97 L8.66 5 L3.6 4.29 L3.42 9.4 L0 5.6 L-3.42 9.4 L-3.6 4.29 L-8.66 5 L-5.51 0.97 L-9.85 -1.74 L-4.85 -2.8 L-6.43 -7.66 L-1.92 -5.26 Z'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------- base */

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

html {
  background: var(--night);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 1rem);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  min-height: 100vh;
  background: var(--night);
  color: var(--ink-body);
  font-family: var(--text);
  font-size: 1.0625rem;
  font-weight: 350;
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body:has(.menu[open]) { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
strong { font-weight: 500; color: var(--ink); }
em { font-style: italic; }

::selection { background: rgba(220, 192, 138, 0.3); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--night-3);
  color: var(--ink);
  border: 1px solid var(--line-gold);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------- shared type */

.label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label .idx { color: var(--gold); margin-right: 0.7em; }
.label a { color: var(--ink-2); transition: color 0.3s; }
.label a:hover { color: var(--gold); }
.label .sep { color: var(--ink-4); margin: 0 0.7em; }

.ornament {
  display: block;
  width: 0.9rem;
  height: 0.9rem;
  margin: 0 auto;
  background: var(--gold);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
  mask: var(--star-mask) center / contain no-repeat;
}

/* ---------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 var(--gutter);
}
/* the glass lives on a pseudo-element: backdrop-filter on the bar itself
   would trap the fixed-position mobile menu inside the bar's box */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(8, 9, 14, 0.8);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--line-soft);
  transition: opacity 0.6s var(--ease-out);
}
.topbar--overlay { position: fixed; left: 0; right: 0; }
.topbar--overlay:not(.is-solid)::before { opacity: 0; }

.brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.brand-star {
  width: 1.05rem;
  height: 1.05rem;
  fill: var(--gold);
  transition: transform 1.4s var(--ease-out);
}
/* a ninth of a turn lands the star exactly where it started */
.brand:hover .brand-star { transform: rotate(40deg); }

.nav { display: flex; align-items: center; gap: clamp(1.2rem, 2.6vw, 2.4rem); }
.nav a {
  position: relative;
  padding: 0.5rem 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.3s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.15rem;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }
.nav .nav-x { display: inline-flex; align-items: center; gap: 0.5rem; }
.nav .nav-x svg { width: 0.8rem; height: 0.8rem; fill: currentColor; }

/* mobile menu — a <details>, so it opens without JavaScript */
.menu { display: none; }
.menu > summary {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  list-style: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu-icon { position: relative; width: 1.1rem; height: 0.5rem; }
.menu-icon::before, .menu-icon::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: currentColor;
  transition: transform 0.45s var(--ease-out), top 0.45s var(--ease-out);
}
.menu-icon::before { top: 0; }
.menu-icon::after { top: 100%; }
.menu[open] .menu-icon::before { top: 50%; transform: rotate(45deg); }
.menu[open] .menu-icon::after { top: 50%; transform: rotate(-45deg); }
.menu .when-open { display: none; }
.menu[open] .when-open { display: inline; }
.menu[open] .when-closed { display: none; }

.menu-panel {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--bar-h) + 2rem) var(--gutter) 3rem;
  background:
    radial-gradient(80% 50% at 50% 100%, rgba(240, 194, 123, 0.1), transparent 70%),
    var(--night);
}
.menu[open] .menu-panel { animation: menu-in 0.5s var(--ease-out) both; }
.menu-links { display: flex; flex-direction: column; }
.menu-links a {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line-soft);
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2rem, 9vw, 2.6rem);
  line-height: 1.1;
  color: var(--ink);
}
.menu-links a:last-child { border-bottom: 1px solid var(--line-soft); }
.menu-links .label { min-width: 2rem; color: var(--gold); }
.menu-foot { margin-top: 2rem; display: flex; justify-content: space-between; }

@keyframes menu-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 820px) {
  .nav { display: none; }
  .menu { display: block; }
}

/* reading progress — a thread of light along the top edge */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: 2px;
  background: linear-gradient(90deg, rgba(240, 194, 123, 0.2), var(--dawn));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* ---------------------------------------------------------- home: hero */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: clip;
  isolation: isolate;
  --hz: 55%;                              /* the horizon: where the light sits */
  --wm: clamp(2.35rem, 9vw, 6.4rem);      /* wordmark size */
  --mid: calc(var(--hz) - var(--wm) * 0.72);  /* centre of the name, just above the horizon */
}

.hero-sky {
  position: absolute;
  inset: 0;
  z-index: -4;
  background:
    radial-gradient(70% 45% at 50% var(--hz), rgba(92, 64, 112, 0.2), transparent 72%),
    linear-gradient(180deg, #05060a 0%, #080a13 38%, #0e0f1c var(--hz), #0a0a10 72%, #060609 100%);
}

.hero-dawn {
  position: absolute;
  left: 50%;
  top: var(--hz);
  z-index: -3;
  width: 150vmax;
  height: 70vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(240, 194, 123, 0.2), rgba(230, 164, 126, 0.07) 42%, transparent 72%);
  animation: dawn 5s var(--ease-out) 0.2s both, breathe 12s ease-in-out 5.2s infinite;
}

.hero-horizon {
  position: absolute;
  left: 0; right: 0;
  top: var(--hz);
  z-index: -2;
  height: 1px;
  background: linear-gradient(90deg, transparent 4%, rgba(240, 194, 123, 0.5) 50%, transparent 96%);
  transform-origin: center;
  animation: horizon 3.2s var(--ease-out) 0.6s both;
}
.hero-horizon::after {
  /* the bloom where the sun will come up */
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(80vw, 980px);
  height: clamp(3rem, 10vh, 6rem);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(240, 194, 123, 0.2), rgba(240, 194, 123, 0.05) 55%, transparent);
}

.motes {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.astrolabe {
  position: absolute;
  left: 50%;
  top: var(--mid);
  z-index: -1;
  width: min(84vmin, 800px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  /* clear a band around the name so no line crosses a letter */
  -webkit-mask-image:
    radial-gradient(ellipse 56% 17% at 50% 50%, transparent 58%, #000 100%),
    radial-gradient(circle, transparent 12%, #000 38%);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(ellipse 56% 17% at 50% 50%, transparent 58%, #000 100%),
    radial-gradient(circle, transparent 12%, #000 38%);
  mask-composite: intersect;
}
@media (max-aspect-ratio: 4/5) { .astrolabe { width: min(116vw, 620px); } }
.astrolabe svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
}
.astro-rings { stroke: rgba(238, 232, 220, 0.16); stroke-width: 0.25; animation: spin 420s linear infinite; }
.astro-rings .tick { stroke: rgba(238, 232, 220, 0.22); stroke-width: 2.6; stroke-linecap: butt; }
.astro-rings .major { stroke: rgba(220, 192, 138, 0.55); stroke-width: 0.35; }
.astro-star { stroke-width: 0.3; animation: spin 640s linear infinite reverse; }
.astro-star .s2 { stroke: rgba(220, 192, 138, 0.4); }
.astro-star .s4 { stroke: rgba(238, 232, 220, 0.1); }
.astro-star .notch { stroke: rgba(238, 232, 220, 0.08); }
.astro-star .tip { fill: var(--gold); stroke: none; }
.astro-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 3.6s var(--ease-in-out) both; }

.hero-center {
  position: absolute;
  left: 50%;
  top: var(--mid);
  transform: translate(-50%, -50%);
  width: 100%;
  padding: 0 var(--gutter);
  text-align: center;
}

.wordmark {
  font-family: var(--display);
  font-weight: 300;
  font-size: var(--wm);
  line-height: 1;
  letter-spacing: 0.3em;
  padding-left: 0.3em;          /* balances the tracking after the last letter */
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  text-shadow: 0 0 0.7em rgba(240, 194, 123, 0.22);
  animation: focus-in 2.8s var(--ease-out) 0.4s both;
}

.whisper {
  position: absolute;
  left: 0; right: 0;
  top: calc(50% + var(--wm) * 0.72 + clamp(1rem, 2.4vh, 1.6rem));
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  letter-spacing: 0.08em;
  color: var(--ink-2);
  animation: rise 2s var(--ease-out) 1.8s both;
}

.descend {
  position: absolute;
  left: 50%;
  bottom: clamp(1rem, 3vh, 2rem);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  animation: fade 1.6s var(--ease-out) 2.8s both;
  transition: color 0.3s;
}
.descend:hover { color: var(--ink); }
.descend::after {
  content: "";
  width: 1px;
  height: 2.8rem;
  background: linear-gradient(var(--gold), transparent);
  transform-origin: top;
  animation: drip 3s var(--ease-in-out) infinite;
}

/* ---------------------------------------------------------- home: doors */

.doors {
  position: relative;
  padding: clamp(5rem, 12vw, 9rem) var(--gutter) clamp(4rem, 9vw, 7rem);
}
.doors::before {
  /* the light from the hero spilling down into the room */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 28rem;
  background: radial-gradient(60% 100% at 50% 0%, rgba(240, 194, 123, 0.05), transparent 70%);
  pointer-events: none;
}

.section-head { text-align: center; max-width: 40rem; margin: 0 auto clamp(3rem, 7vw, 5rem); }
.section-head h2 {
  margin-top: 1rem;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.3rem, 5.4vw, 3.8rem);
  line-height: 1.08;
  color: var(--ink);
}
.section-head p:not(.label) {
  margin-top: 1.2rem;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-2);
}

/* a centred, wrapping row: add a door and the row re-balances, orphans centre */
.doorways {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3.5rem clamp(1.25rem, 2.6vw, 2.25rem);
  max-width: 74rem;
  margin: 0 auto;
}

.doorway { flex: 0 1 17.5rem; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.doorway:focus-visible { outline-offset: 10px; }

.doorway-window {
  position: relative;
  aspect-ratio: 200 / 280;
  transition: transform 0.9s var(--ease-out);
}
.doorway-window svg { width: 100%; height: 100%; overflow: visible; }
.doorway-window .arch-line {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.6s;
}
.doorway--begin .arch-line { stroke: var(--line-gold); }
.doorway-window .glow { transition: opacity 0.9s var(--ease-out); opacity: 0.75; }

.doorway-body { padding: 1.5rem 0.1rem 0; display: flex; flex-direction: column; flex: 1; }
.doorway-title {
  margin: 0.55rem 0 0.6rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.65rem, 2.3vw, 2rem);
  line-height: 1.1;
  color: var(--ink);
  transition: color 0.4s;
}
.doorway-desc { font-size: 0.97rem; line-height: 1.62; color: var(--ink-2); }
.doorway-meta {
  margin-top: auto;
  padding-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.doorway-meta .go { color: var(--gold); transition: transform 0.5s var(--ease-out); }

/* lit: on hover, on keyboard focus, and — on touch screens — when in view */
.doorway:is(:hover, :focus-visible, .is-lit) .doorway-window { transform: translateY(-6px); }
.doorway:is(:hover, :focus-visible, .is-lit) .arch-line { stroke: var(--gold); }
.doorway:is(:hover, :focus-visible, .is-lit) .glow { opacity: 1; }
.doorway:is(:hover, :focus-visible, .is-lit) .doorway-title { color: var(--gold); }
.doorway:is(:hover, :focus-visible, .is-lit) .go { transform: translateX(4px); }

/* the journey: a path of lights walks toward the dawn */
.art-journey .path circle { fill: rgba(238, 232, 220, 0.28); transition: fill 0.5s; transition-delay: calc(var(--i) * 70ms); }
.doorway:is(:hover, :focus-visible, .is-lit) .art-journey .path circle { fill: var(--dawn); }
.art-journey .sun { animation: sunrise 9s ease-in-out infinite alternate; }

/* the vision: two lines meet at a point of light */
.art-vision .ray { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease-in-out); }
.art-vision .apex { transform-box: fill-box; transform-origin: center; animation: spin 90s linear infinite; }
.art-vision .field circle { animation: twinkle 5s ease-in-out infinite; animation-delay: calc(var(--t) * -0.9s); }
.doorway:is(:hover, :focus-visible, .is-lit) .art-vision .apex { animation-duration: 14s; }

/* the letters: two of twenty-seven, then the rest */
.art-letters .cell { fill: rgba(238, 232, 220, 0.1); transition: fill 0.5s; transition-delay: calc(var(--i) * 45ms); }
.art-letters .cell.lit { fill: var(--gold); }
.doorway:is(:hover, :focus-visible, .is-lit) .art-letters .cell { fill: rgba(220, 192, 138, 0.8); }
.doorway:is(:hover, :focus-visible, .is-lit) .art-letters .cell.lit { fill: #fff3d9; }

@media (max-width: 560px) {
  .doorways { gap: 2.5rem; }
  .doorway { flex-basis: 100%; flex-direction: row; gap: 1.25rem; align-items: stretch; }
  .doorway-window { width: 36%; flex: none; }
  .doorway-body { padding-top: 0.2rem; }
  .doorway-title { font-size: 1.6rem; margin-top: 0.4rem; }
  .doorway-desc { font-size: 0.93rem; }
  .doorway-meta { padding-top: 0.9rem; }
  .doorway-meta .meta-info { display: none; }
}

/* ---------------------------------------------------------- elsewhere strip */

.elsewhere {
  max-width: 74rem;
  margin: clamp(4rem, 9vw, 6rem) auto 0;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.elsewhere p { font-family: var(--display); font-style: italic; font-size: 1.25rem; color: var(--ink-2); }
.elsewhere a { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); transition: color 0.3s; }
.elsewhere a:hover { color: var(--gold); }
.elsewhere svg { width: 0.9rem; height: 0.9rem; fill: currentColor; }

/* ---------------------------------------------------------- page heads */

.page-head {
  position: relative;
  isolation: isolate;
  overflow: clip;
  text-align: center;
  padding: clamp(4rem, 11vw, 7.5rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
}
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(70% 60% at 50% 18%, rgba(240, 194, 123, 0.07), transparent 70%);
}
.halo-art {
  position: absolute;
  left: 50%;
  top: clamp(1rem, 4vw, 3rem);
  z-index: -1;
  width: min(120vw, 44rem);
  aspect-ratio: 1;
  transform: translateX(-50%);
  opacity: 0.55;
  pointer-events: none;
  fill: none;
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%);
  mask: radial-gradient(circle, #000 30%, transparent 70%);
}
.halo-art g { animation: spin 600s linear infinite; transform-origin: center; transform-box: fill-box; }
.halo-art .r { stroke: rgba(238, 232, 220, 0.09); stroke-width: 0.25; }
.halo-art .s { stroke: rgba(220, 192, 138, 0.2); stroke-width: 0.25; }

.numeral {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(5rem, 15vw, 9.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--gold) 25%, rgba(220, 192, 138, 0.12) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.numeral--star {
  width: clamp(3.2rem, 9vw, 5rem);
  height: clamp(3.2rem, 9vw, 5rem);
  margin: 0 auto 0.6rem;
  background: linear-gradient(180deg, var(--gold), rgba(220, 192, 138, 0.2));
  -webkit-mask: var(--star-mask) center / contain no-repeat;
  mask: var(--star-mask) center / contain no-repeat;
}

.page-head .label + .numeral { margin-top: 1.6rem; }
.page-head h1 {
  max-width: 19ch;
  margin: 1.3rem auto 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.3rem, 5.8vw, 4.1rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-wrap: balance;
}
.page-head .kicker { color: var(--gold); }
.page-head .numeral + .kicker { margin-top: 0.6rem; }

.dek {
  max-width: 44ch;
  margin: 1.7rem auto 0;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.06rem, 1.7vw, 1.22rem);
  line-height: 1.65;
  color: var(--ink-2);
  text-wrap: pretty;
}
.page-meta {
  margin-top: 2.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.8rem;
}
.page-meta span + span::before { content: "·"; margin-right: 1.8rem; color: var(--ink-4); }
@media (max-width: 560px) {
  .page-meta { gap: 0.35rem 1.4rem; }
  .page-meta span + span::before { display: none; }
}

/* ---------------------------------------------------------- vision: contents */

.contents {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem var(--gutter) 0;
}
.contents-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1rem;
}

@media (max-width: 560px) { .contents-head p { display: none; } }

.chapter-row {
  position: relative;
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  gap: 0 2rem;
  align-items: start;
  padding: 2.1rem 0.25rem 2.2rem;
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
}
.chapter-row:last-child { border-bottom: 1px solid var(--line-soft); }
.chapter-row::before {
  /* a line of light draws across the top on hover */
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), rgba(220, 192, 138, 0));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s var(--ease-out);
}
.chapter-row:is(:hover, :focus-visible)::before { transform: scaleX(1); }

.chapter-main, .chapter-title, .chapter-desc { display: block; }
.chapter-num {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.4rem, 4.4vw, 3.3rem);
  line-height: 0.9;
  color: var(--gold);
  transition: transform 0.8s var(--ease-out);
}
.chapter-num--star {
  width: 1.8rem;
  height: 1.8rem;
  margin-top: 0.3rem;
  background: var(--gold);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
  mask: var(--star-mask) center / contain no-repeat;
}
.chapter-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  line-height: 1.08;
  color: var(--ink);
  transition: color 0.4s;
}
.chapter-kicker { margin-top: 0.7rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.chapter-desc { margin-top: 0.9rem; max-width: 50ch; font-size: 1rem; line-height: 1.62; color: var(--ink-2); }
.chapter-go {
  align-self: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.4s, transform 0.6s var(--ease-out);
}
.chapter-row:is(:hover, :focus-visible) .chapter-title { color: var(--gold); }
.chapter-row:is(:hover, :focus-visible) .chapter-go { color: var(--gold); transform: translateX(6px); }
.chapter-row:is(:hover, :focus-visible) .chapter-num { transform: translateX(4px); }

.chapter-row--interlude { background: linear-gradient(90deg, rgba(220, 192, 138, 0.035), transparent 60%); }

@media (max-width: 720px) {
  .chapter-row { grid-template-columns: 3.4rem minmax(0, 1fr); gap: 0 1.1rem; padding: 1.7rem 0 1.8rem; }
  .chapter-go { display: none; }
  .chapter-num { font-size: 2.2rem; }
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.5;
}
.pill--spec { border-color: rgba(230, 164, 126, 0.45); color: var(--ember); }

.aside-note {
  max-width: 40rem;
  margin: clamp(3rem, 7vw, 4.5rem) auto 0;
  padding: 0 var(--gutter);
  text-align: center;
  font-style: italic;
  font-weight: 300;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--ink-3);
}
.aside-note .ornament { margin-bottom: 1.4rem; width: 0.7rem; height: 0.7rem; opacity: 0.7; }

.crosslink {
  max-width: 64rem;
  margin: clamp(3rem, 7vw, 4.5rem) auto 0;
  padding: 0 var(--gutter);
}
.crosslink a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem 1.8rem;
  border: 1px solid var(--line-soft);
  background: radial-gradient(80% 140% at 0% 50%, rgba(240, 194, 123, 0.07), transparent 60%);
  transition: border-color 0.5s;
}
.crosslink a:hover { border-color: var(--line-gold); }
.crosslink .ct { font-family: var(--display); font-size: clamp(1.35rem, 2.4vw, 1.7rem); color: var(--ink); line-height: 1.2; }
.crosslink .ct em { color: var(--gold); }
@media (max-width: 560px) {
  .crosslink a { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.4rem 1.3rem; }
}

/* ---------------------------------------------------------- article */

/* An article is a grid: text runs in a reading column, and anything marked
   .wide (figures, arches, the timeline) steps out into a broader one. */
.article {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, 12rem)
    [text-start] min(var(--measure), 100% - 2 * var(--gutter)) [text-end]
    minmax(0, 12rem) [wide-end]
    minmax(var(--gutter), 1fr) [full-end];
  padding-bottom: 2rem;
}
.article > * { grid-column: text; min-width: 0; }
.article > .wide { grid-column: wide; }

.article, .prose {
  font-size: clamp(1.06rem, 0.35vw + 0.98rem, 1.19rem);
  line-height: 1.75;
  color: var(--ink-body);
}
.prose { max-width: var(--measure); margin: 0 auto; }
.article > * + *, .prose > * + * { margin-top: 1.15em; }

:is(.article, .prose) a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(220, 192, 138, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.3s, color 0.3s;
}
:is(.article, .prose) a:hover { text-decoration-color: var(--gold); }

:is(.article, .prose) h2 {
  margin-top: 4.2rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.85rem, 3.8vw, 2.55rem);
  line-height: 1.12;
  color: var(--ink);
  text-wrap: balance;
}
:is(.article, .prose) h2 + * { margin-top: 1.1rem; }
:is(.article, .prose) h3 {
  margin-top: 2.4rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--ink);
}

:is(.article, .prose) blockquote {
  padding-left: 1.4rem;
  border-left: 1px solid var(--line-gold);
  font-style: italic;
  color: var(--ink);
}
:is(.article, .prose) blockquote footer, .quote-grand footer {
  margin-top: 0.8rem;
  font-style: normal;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-3);
}
:is(.article, .prose) blockquote footer a, .quote-grand footer a { color: var(--gold); text-decoration: none; }
:is(.article, .prose) blockquote footer a:hover, .quote-grand footer a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

.quote-grand {
  margin: 3.6rem auto !important;
  max-width: 44rem;
  padding: 0 !important;
  border: 0 !important;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.4rem, 2.9vw, 1.95rem);
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
}
.quote-grand::before {
  content: "";
  display: block;
  width: 1rem;
  height: 1rem;
  margin: 0 auto 1.8rem;
  background: var(--gold);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
  mask: var(--star-mask) center / contain no-repeat;
}
.quote-grand footer { margin-top: 1.4rem; font-family: var(--text); }

.cite {
  display: block;
  margin-top: 0.9rem !important;
  font-size: 0.86rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--ink-3);
}
:is(.article, .prose) a.cite, .cite a { color: var(--ink-3); text-decoration: none; }
:is(.article, .prose) a.cite::after, .cite a::after { content: " ↗"; font-style: normal; color: var(--gold); }
:is(.article, .prose) a.cite:hover, .cite a:hover { color: var(--gold); }

.note {
  font-size: 0.96em;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-2);
}
.article > .pill { justify-self: start; margin-top: 2.2rem; }
.article > .pill + * { margin-top: 1rem; }

/* ---- expandable entries */

.entries { margin-top: 2.4rem !important; }
.entries details { border-top: 1px solid var(--line-soft); }
.entries details:last-of-type { border-bottom: 1px solid var(--line-soft); }
.entries summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1.1rem;
  align-items: baseline;
  gap: 1.2rem;
  padding: 1.35rem 0.1rem;
  cursor: pointer;
  list-style: none;
  transition: color 0.3s;
}
.entries summary::-webkit-details-marker { display: none; }
.entries .e-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.2vw, 1.45rem);
  line-height: 1.25;
  color: var(--ink);
  transition: color 0.3s;
}
.entries .e-hint { text-align: right; }
.entries .e-mark { position: relative; width: 0.8rem; height: 0.8rem; align-self: center; }
.entries .e-mark::before, .entries .e-mark::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--gold);
  transition: transform 0.5s var(--ease-out);
}
.entries .e-mark::after { transform: rotate(90deg); }
.entries details[open] .e-mark::after { transform: rotate(0deg); }
.entries summary:hover .e-title { color: var(--gold); }
.entries .e-body { padding: 0.2rem 0.1rem 2rem; }
.entries .e-body > * + * { margin-top: 1.1em; }
.entries details[open] .e-body { animation: rise 0.7s var(--ease-out) both; }

@media (max-width: 560px) {
  .entries summary { grid-template-columns: minmax(0, 1fr) 1.1rem; gap: 0.4rem 1rem; }
  .entries .e-hint { grid-column: 1; grid-row: 2; text-align: left; }
  .entries .e-mark { grid-column: 2; grid-row: 1; }
}

/* ---- figures */

.figure {
  max-width: 62rem;
  margin: 3.4rem auto !important;
  padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1rem, 3vw, 2.4rem) clamp(1.2rem, 2.6vw, 2rem);
  border: 1px solid var(--line-soft);
  background: radial-gradient(60% 80% at 85% 50%, rgba(240, 194, 123, 0.05), transparent 70%), var(--night-2);
}
.figure figcaption {
  max-width: 40rem;
  margin: 1.4rem auto 0;
  text-align: center;
  font-style: italic;
  font-weight: 300;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.figure .fig-label { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 640px) { .figure .fig-label > :last-child { display: none; } }

/* convergence chart: two independent counts, arriving together */
.conv svg { width: 100%; height: auto; overflow: visible; }
.conv .axis { stroke: var(--line); stroke-width: 1; }
.conv .tick { stroke: var(--line); stroke-width: 1; }
.conv .tick-label { fill: var(--ink-3); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; }
.conv .route { fill: none; stroke-width: 1.6; stroke-linecap: round; }
.conv .route.solar { stroke: var(--gold); }
.conv .route.lunar { stroke: var(--star); }
.conv .route-glow { fill: none; stroke-width: 7; stroke-linecap: round; opacity: 0.12; }
.conv .origin { stroke-width: 1.4; fill: var(--night-2); }
.conv .origin.solar { stroke: var(--gold); }
.conv .origin.lunar { stroke: var(--star); }
.conv .year { font-family: var(--display); font-size: 26px; fill: var(--ink); }
.conv .year-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; fill: var(--ink-3); text-transform: uppercase; }
.conv .route-label { font-family: var(--text); font-style: italic; font-size: 14px; }
.conv .route-label.solar { fill: var(--gold); }
.conv .route-label.lunar { fill: var(--star); }
.conv .meet-year { font-family: var(--display); font-size: 44px; font-weight: 400; fill: var(--dawn); }
.conv .meet-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; fill: var(--ink-2); }
.conv .meet-glow { fill: url(#meetGlow); }
.conv .meet-star { fill: #fff4dc; }
.conv .v-narrow { display: none; }
@media (max-width: 640px) {
  .conv .v-wide { display: none; }
  .conv .v-narrow { display: block; }
}
.js .conv .route, .js .conv .route-glow { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .conv .meet, .js .conv .route-label, .js .conv .origin-label { opacity: 0; }
.js .conv .meet { transform: scale(0.4); transform-box: fill-box; transform-origin: center; }
.conv.is-in .route, .conv.is-in .route-glow { stroke-dashoffset: 0; transition: stroke-dashoffset 3.2s var(--ease-in-out) 0.3s; }
.conv.is-in .origin-label { opacity: 1; transition: opacity 1s var(--ease-out); }
.conv.is-in .route-label { opacity: 1; transition: opacity 1.2s var(--ease-out) 1.2s; }
.conv.is-in .meet { opacity: 1; transform: none; transition: opacity 1.2s var(--ease-out) 3.2s, transform 1.6s var(--ease-out) 3.2s; }

/* ---- filters (The Faith) */

.filters { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 2.8rem !important; }
.filters button {
  padding: 0.5rem 1.05rem;
  border: 1px solid var(--line-soft);
  border-radius: 2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
.filters button:hover { color: var(--ink); border-color: var(--line); }
.filters button[aria-pressed="true"] { color: var(--gold); border-color: var(--line-gold); background: rgba(220, 192, 138, 0.06); }
.filters[hidden] { display: none; }   /* filtering needs script; site.js reveals the bar */
.filters + .entries { margin-top: 1.4rem !important; }
.entries details[hidden] { display: none; }

/* ---- principles grid (The Faith) */

.p-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1px;
  margin-top: 1.8rem !important;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.p-grid > div { padding: 1.3rem 1.35rem 1.4rem; background: var(--night); font-size: 0.95rem; line-height: 1.6; color: var(--ink-2); }
.p-grid strong {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.22rem;
  line-height: 1.25;
  color: var(--ink);
}

/* ---- three arches (The Trilemma) */

.arches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 1.75rem);
  margin: 3.4rem 0 1rem !important;
}
.arch { position: relative; display: flex; flex-direction: column; }
/* the curve is drawn half a pixel in from each side so its stroke meets the body's borders */
.arch-top { display: block; width: calc(100% - 1px); margin-left: 0.5px; height: auto; aspect-ratio: 200 / 118.32; overflow: visible; }
.arch-top path { fill: var(--night-2); stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.arch-body {
  flex: 1;
  margin-top: -1px;
  padding: 0.2rem clamp(1.1rem, 2vw, 1.6rem) 1.9rem;
  background: var(--night-2);
  border: 1px solid var(--line);
  border-top: 0;
}
.arch h3 {
  margin: 0;
  text-align: center;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  line-height: 1.1;
  color: var(--ink);
}
.arch .verdict { margin-top: 0.55rem; text-align: center; color: var(--gold); }
.arch p { margin-top: 1rem; font-size: 0.97rem; line-height: 1.66; color: var(--ink-2); }
.arch p em, .arch p strong { color: var(--ink); font-weight: 400; }
/* the open door: lit from within, a star at its crown */
.arch--open .arch-top path { fill: #201e20; stroke: var(--gold); }
.arch--open .arch-body { border-color: var(--gold); background: linear-gradient(180deg, #201e20, var(--night-2) 55%); }
.arch--open::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 24%;
  transform: translateX(-50%);
  background: var(--gold);
  filter: drop-shadow(0 0 8px rgba(240, 194, 123, 0.7));
  -webkit-mask: var(--star-mask) center / contain no-repeat;
  mask: var(--star-mask) center / contain no-repeat;
}
@media (max-width: 760px) {
  .arches { grid-template-columns: 1fr; gap: 1.4rem; }
  .arch-top { aspect-ratio: auto; height: 4.6rem; }
  .arch--open::before { margin-top: 2.1rem; }
}

/* ---- abjad tiles (Numbers) */

.abjad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 1.6vw, 1rem);
  margin: 3rem 0 !important;
}
.abjad .tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 4.7rem;
  padding: 1rem 0.9rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--night-2);
}
.abjad .glyph { font-family: 'Amiri', 'Geeza Pro', 'Noto Naskh Arabic', 'Times New Roman', serif; font-size: 2.3rem; line-height: 1.35; color: var(--ink); }
.abjad .val { margin-top: 0.35rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--ink-3); white-space: nowrap; }
.abjad .op { font-family: var(--display); font-size: 1.9rem; line-height: 1; color: var(--ink-3); }
.abjad .sum {
  border-color: var(--line-gold);
  background: radial-gradient(circle at 50% 40%, rgba(240, 194, 123, 0.18), transparent 70%), var(--night-2);
}
.abjad .sum .glyph { font-family: var(--display); color: var(--gold); }
.abjad .sum .val { color: var(--gold); }
.js .abjad > * { opacity: 0; transform: translateY(12px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: calc(var(--i, 0) * 170ms); }
.abjad.is-in > * { opacity: 1; transform: none; }
@media (max-width: 560px) {
  .abjad .tile { min-width: 3.5rem; padding: 0.75rem 0.55rem 0.65rem; }
  .abjad .glyph { font-size: 1.9rem; }
  .abjad .op { font-size: 1.5rem; }
}

/* ---- two voices across a century (The Hour) */

.voices { margin: 3rem 0 1rem !important; }
.voices-head { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4rem; margin-bottom: 1.8rem; }
.voices-head .then-h { text-align: right; color: var(--gold); }
.voices-head .now-h { color: var(--star); }
.voices-list { position: relative; display: grid; grid-template-columns: 1fr 1fr; column-gap: 4rem; }
.voices-list::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--line-gold) 6%, rgba(185, 199, 224, 0.32) 94%, transparent);
}
.voice { position: relative; margin-bottom: 1.6rem; }
.voice.then { grid-column: 1; text-align: right; }
.voice.now { grid-column: 2; margin-top: 3.4rem; }
.voice::after {
  content: "";
  position: absolute;
  top: 0.4rem;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
}
.voice.then::after { right: calc(-2rem - 3.5px); background: var(--gold); box-shadow: 0 0 10px rgba(220, 192, 138, 0.6); }
.voice.now::after { left: calc(-2rem - 3.5px); background: var(--star); box-shadow: 0 0 10px rgba(185, 199, 224, 0.5); }
.voice .v-who { font-family: var(--mono); font-size: 0.66rem; line-height: 1.5; letter-spacing: 0.14em; text-transform: uppercase; }
.voice.then .v-who { color: var(--gold); }
.voice.now .v-who { color: var(--star); }
.voice .v-text { margin-top: 0.55rem; }
.voice.then .v-text { font-family: var(--display); font-style: italic; font-size: 1.3rem; line-height: 1.5; color: var(--ink); }
.voice.now .v-text { font-size: 0.98rem; line-height: 1.66; color: var(--ink-2); }
@media (max-width: 720px) {
  .voices-head { display: flex; justify-content: space-between; gap: 1rem; }
  .voices-head .then-h { text-align: left; }
  .voices-head .now-h { text-align: right; }
  .voices-list { grid-template-columns: 1fr; }
  .voices-list::before { display: none; }
  .voice.then, .voice.now { grid-column: 1; margin-top: 0; padding: 0.2rem 0; }
  .voice.then { margin-right: 12%; padding-left: 1rem; text-align: left; border-left: 1px solid var(--line-gold); }
  .voice.now { margin-left: 12%; padding-right: 1rem; text-align: right; border-right: 1px solid rgba(185, 199, 224, 0.4); }
  .voice::after { display: none; }
}

/* ---- the instrument (Twenty-Seven Letters) */

.instrument {
  margin: 2.6rem 0 !important;
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1.1rem, 4vw, 2.6rem) clamp(1.5rem, 3vw, 2.2rem);
  border: 1px solid var(--line-soft);
  background: radial-gradient(70% 90% at 50% 0%, rgba(240, 194, 123, 0.07), transparent 70%), var(--night-2);
  text-align: center;
}
.instrument .k-label b { color: var(--gold); font-weight: 400; }
.sentence {
  min-height: 4.8em;
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.35rem, 3.4vw, 1.95rem);
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.sentence .hid { color: var(--ink-4); font-style: normal; }
.alphabet {
  display: grid;
  grid-template-columns: repeat(26, minmax(0, 1fr));
  gap: 3px;
  max-width: 34rem;
  margin: 1.4rem auto 0;
}
.alphabet span {
  padding: 0.3rem 0 0.25rem;
  border: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--ink-4);
  transition: color 0.4s, border-color 0.4s, background-color 0.4s;
}
.alphabet span.on { color: var(--night); background: var(--gold); border-color: var(--gold); }
@media (max-width: 560px) { .alphabet { grid-template-columns: repeat(13, minmax(0, 1fr)); max-width: 20rem; } }
.range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  max-width: 28rem;
  height: 26px;
  margin: 1.7rem auto 0;
  background: transparent;
  cursor: pointer;
  --fill: 0%;
}
.range:focus { outline: none; }
.range::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--gold) var(--fill), var(--line) var(--fill)); }
.range::-moz-range-track { height: 2px; border-radius: 2px; background: var(--line); }
.range::-moz-range-progress { height: 2px; border-radius: 2px; background: var(--gold); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -12px;
  border: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-11 -11 22 22'%3E%3Cpath fill='%23dcc08a' d='M0 -10 L1.92 -5.26 L6.43 -7.66 L4.85 -2.8 L9.85 -1.74 L5.51 0.97 L8.66 5 L3.6 4.29 L3.42 9.4 L0 5.6 L-3.42 9.4 L-3.6 4.29 L-8.66 5 L-5.51 0.97 L-9.85 -1.74 L-4.85 -2.8 L-6.43 -7.66 L-1.92 -5.26 Z'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.3s var(--ease-out), filter 0.3s;
}
.range::-moz-range-thumb { width: 26px; height: 26px; border: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-11 -11 22 22'%3E%3Cpath fill='%23dcc08a' d='M0 -10 L1.92 -5.26 L6.43 -7.66 L4.85 -2.8 L9.85 -1.74 L5.51 0.97 L8.66 5 L3.6 4.29 L3.42 9.4 L0 5.6 L-3.42 9.4 L-3.6 4.29 L-8.66 5 L-5.51 0.97 L-9.85 -1.74 L-4.85 -2.8 L-6.43 -7.66 L-1.92 -5.26 Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.range:hover::-webkit-slider-thumb, .range:focus-visible::-webkit-slider-thumb { transform: rotate(40deg); filter: drop-shadow(0 0 6px rgba(240, 194, 123, 0.8)); }
.range:focus-visible::-moz-range-thumb { filter: drop-shadow(0 0 6px rgba(240, 194, 123, 0.8)); }
.readout { margin-top: 1.3rem; font-size: 0.92rem; color: var(--ink-3); }
.readout .big { display: block; margin-top: 0.2rem; font-family: var(--display); font-size: clamp(1.9rem, 4.4vw, 2.5rem); line-height: 1.2; color: var(--gold); }
.readout .ratio { display: block; margin-top: 0.3rem; }

/* ---- the next door */

.next {
  max-width: 64rem;
  margin: clamp(4rem, 9vw, 6rem) auto 0;
  padding: 0 var(--gutter);
}
.next-door {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem clamp(1.4rem, 4vw, 3rem);
  padding: clamp(1.8rem, 4vw, 2.8rem) clamp(1.4rem, 4vw, 3rem);
  border: 1px solid var(--line-soft);
  background: radial-gradient(90% 140% at 0% 50%, rgba(240, 194, 123, 0.08), transparent 60%), var(--night-2);
  overflow: hidden;
  transition: border-color 0.6s;
}
.next-door:hover { border-color: var(--line-gold); }
.next-door .n-num {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(3.6rem, 9vw, 6rem);
  line-height: 0.9;
  color: var(--gold);
}
.next-door .n-title { margin-top: 0.4rem; font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.08; color: var(--ink); transition: color 0.4s; }
.next-door .n-desc { margin-top: 0.6rem; max-width: 46ch; font-size: 0.98rem; line-height: 1.6; color: var(--ink-2); }
.next-door .n-go {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  transition: transform 0.6s var(--ease-out);
}
.next-door .n-star {
  width: clamp(2.6rem, 6vw, 3.6rem);
  height: clamp(2.6rem, 6vw, 3.6rem);
  background: var(--gold);
  -webkit-mask: var(--star-mask) center / contain no-repeat;
  mask: var(--star-mask) center / contain no-repeat;
}
.next-door:hover .n-title { color: var(--gold); }
.next-door:hover .n-go { transform: translateX(6px); }
.next-back { margin-top: 1.4rem; display: flex; justify-content: space-between; gap: 1rem; }
@media (max-width: 640px) {
  .next-door { grid-template-columns: auto minmax(0, 1fr); }
  .next-door .n-go { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------- the journey */

/* The sky follows the story: --p runs 0 → 1 as the reader moves through it,
   dark before 1844, first light at the Báb, full dawn at the end. */
.journey {
  --p: 0;
  background: transparent;   /* the body's own fill would paint over the sky */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, #04050a 0%, #070912 45%, #0c0d18 100%); }
.sky > * { position: absolute; inset: 0; transition: opacity 2.6s var(--ease-out), transform 2.6s var(--ease-out); }
.sky-stars {
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(238, 232, 220, 0.7), transparent 60%),
    radial-gradient(1px 1px at 27% 42%, rgba(238, 232, 220, 0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 41% 12%, rgba(238, 232, 220, 0.6), transparent 60%),
    radial-gradient(1px 1px at 58% 30%, rgba(238, 232, 220, 0.5), transparent 60%),
    radial-gradient(1px 1px at 69% 9%, rgba(238, 232, 220, 0.65), transparent 60%),
    radial-gradient(1.5px 1.5px at 83% 24%, rgba(238, 232, 220, 0.55), transparent 60%),
    radial-gradient(1px 1px at 92% 47%, rgba(238, 232, 220, 0.4), transparent 60%),
    radial-gradient(1px 1px at 6% 55%, rgba(238, 232, 220, 0.35), transparent 60%),
    radial-gradient(1px 1px at 35% 64%, rgba(238, 232, 220, 0.3), transparent 60%),
    radial-gradient(1px 1px at 76% 60%, rgba(238, 232, 220, 0.3), transparent 60%),
    radial-gradient(1.5px 1.5px at 50% 5%, rgba(238, 232, 220, 0.5), transparent 60%),
    radial-gradient(1px 1px at 18% 80%, rgba(238, 232, 220, 0.25), transparent 60%),
    radial-gradient(1px 1px at 88% 75%, rgba(238, 232, 220, 0.25), transparent 60%);
  opacity: calc(1 - var(--p) * 0.8);
}
.sky-dusk { background: radial-gradient(90% 55% at 50% 100%, rgba(92, 64, 112, 0.32), transparent 75%); opacity: calc(0.35 + var(--p) * 0.65); }
.sky-dawn {
  background: radial-gradient(110% 62% at 50% 100%, rgba(240, 194, 123, 0.38), rgba(230, 164, 126, 0.15) 38%, transparent 72%);
  opacity: min(1, calc(var(--p) * 1.3));
}
.sky-sun {
  inset: auto;
  left: 50%;
  bottom: 0;
  width: min(44vw, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 243, 214, 0.9) 0%, rgba(246, 211, 154, 0.55) 30%, rgba(240, 194, 123, 0.18) 55%, transparent 70%);
  transform: translate(-50%, calc(100% - var(--p) * 38%));
  opacity: clamp(0, calc(var(--p) * 1.6 - 0.45), 1);
}
.motes--journey { opacity: calc(0.35 + var(--p) * 0.65); transition: opacity 2.6s var(--ease-out); }

.topbar--bare::before { opacity: 0; }
.topbar--bare .chapter { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); text-align: right; }

.stage { flex: 1; display: grid; place-items: center; padding: 1rem var(--gutter) 1.5rem; }
.jcard {
  width: 100%;
  max-width: 36rem;
  text-align: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.jcard.vis { opacity: 1; transform: none; }
.jcard h1 {
  margin-bottom: 1.4rem;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.95rem, 5.2vw, 2.9rem);
  line-height: 1.16;
  color: var(--ink);
  text-wrap: balance;
}
.jcard h1:focus { outline: none; }
.jcard p { margin-bottom: 1rem; font-size: clamp(1.02rem, 2.2vw, 1.14rem); line-height: 1.75; color: var(--ink-2); text-wrap: pretty; }
.jcard p strong { color: var(--ink); }
.jcard blockquote {
  margin: 1.6rem 0;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.28rem, 2.9vw, 1.55rem);
  line-height: 1.55;
  color: var(--ink);
}
.jcard blockquote footer { margin-top: 0.8rem; font-family: var(--mono); font-style: normal; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.jcard .pill { margin-bottom: 1.3rem; font-size: 0.64rem; line-height: 1.5; color: var(--ember); }
.jactions { margin-top: 2.2rem; display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.jbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 2.9rem;
  padding: 0.6rem 1.7rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: rgba(8, 9, 14, 0.35);
  font-family: var(--display);
  font-size: 1.16rem;
  line-height: 1.3;
  color: var(--ink);
  transition: border-color 0.3s, color 0.3s, background-color 0.3s;
}
.jbtn:hover { border-color: var(--line-gold); color: var(--gold); }
.jbtn.primary { border-color: var(--line-gold); color: var(--gold); }
.jbtn.primary:hover { border-color: var(--gold); background: rgba(220, 192, 138, 0.08); }

.journey-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem var(--gutter) calc(1.1rem + env(safe-area-inset-bottom, 0px));
}
.journey-bar button {
  padding: 0.6rem 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.3s;
}
.journey-bar button:hover { color: var(--ink); }
.journey-bar .back { justify-self: start; }
.journey-bar .restart { justify-self: end; }
.jdots { display: flex; gap: 8px; }
.jdots span { width: 6px; height: 6px; transform: rotate(45deg); background: var(--line); transition: background-color 0.6s; }
.jdots span.on { background: var(--gold); }

/* ---------------------------------------------------------- 404 */

.lost {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - var(--bar-h) - 12rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem var(--gutter);
  text-align: center;
  overflow: clip;
}
.lost .halo-art { top: 50%; transform: translate(-50%, -50%); width: min(92vw, 36rem); opacity: 0.7; }
.lost h1 {
  max-width: 16ch;
  margin-top: 1.2rem;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  line-height: 1.1;
  color: var(--ink);
  text-wrap: balance;
}
.lost .dek { margin-top: 1.4rem; }
.lost-links { margin-top: 2.4rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }
.lost-links a { padding: 0.55rem 1.2rem; border: 1px solid var(--line); border-radius: 2rem; transition: color 0.3s, border-color 0.3s; }
.lost-links a:hover { color: var(--gold); border-color: var(--line-gold); }

/* ---------------------------------------------------------- colophon */

.colophon {
  position: relative;
  margin-top: clamp(5rem, 11vw, 8rem);
  padding: clamp(3.5rem, 8vw, 5rem) var(--gutter) 3rem;
  text-align: center;
  border-top: 1px solid var(--line-soft);
  background: radial-gradient(50% 70% at 50% 0%, rgba(240, 194, 123, 0.06), transparent 70%);
}
.colophon .ornament { width: 1.3rem; height: 1.3rem; }
.colophon-whisper {
  margin-top: 1.4rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.colophon-nav {
  margin: 2.2rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 2rem;
}
.colophon-nav a { transition: color 0.3s; }
.colophon-nav a:hover { color: var(--gold); }
.colophon-fine { margin-top: 2.6rem; color: var(--ink-4); }
.colophon-fine { color: var(--ink-3); opacity: 0.8; }

/* ---------------------------------------------------------- reveal on scroll */

/* hidden only once site.js has confirmed it is running (see the inline
   script in each page's head), so a failed script never hides content */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------------------------------------------------------- keyframes */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes focus-in {
  from { opacity: 0; filter: blur(16px); letter-spacing: 0.44em; }
  to   { opacity: 1; filter: blur(0); letter-spacing: 0.3em; }
}
@keyframes dawn {
  from { opacity: 0; transform: translate(-50%, -38%) scale(0.85); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.78; }
}
@keyframes horizon { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes drip {
  0%   { transform: scaleY(0); opacity: 1; }
  55%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}
@keyframes sunrise { from { transform: translateY(3px); } to { transform: translateY(-5px); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
