/* Arkinnea design system.
   Two voices: Newsreader (scripture), Archivo (working sans).
   Two accents with one job each: gold is sacred order, blue is the visitor's
   attention (ADR 003/004). Grounds warm as the passage descends (void ladder). */

/* ---------- fonts (self-hosted, subset, variable) ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/NewsreaderItalic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/Archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  /* the void ladder: cold night at the top of the passage, candle-warmed dark
     at its end. Steps are near-imperceptible alone; the arc reads over the page. */
  --void-0: #06080f;
  --void-1: #080a11;
  --void-2: #0a0b12;
  --void-3: #0c0c13;
  --void-4: #0e0d13;
  --void-5: #100e13;
  --void-6: #121014;
  --void-7: #141114;
  --bone-0: #ece4d3; /* doctrine, display */
  --bone-1: #c8c1b3; /* reading */
  --bone-2: #94907f; /* dim furniture */
  --hairline: rgba(236, 228, 211, 0.14);
  --gold: #e8b968;
  --gold-dim: rgba(232, 185, 104, 0.32);
  --blue: #85b7f2;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Archivo", system-ui, "Helvetica Neue", sans-serif;
  --measure: 36rem;
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--void-0);
  color: var(--bone-1);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(133, 183, 242, 0.28); color: var(--bone-0); }
a { color: var(--blue); text-decoration-color: rgba(133, 183, 242, 0.4); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 1px; }
strong { color: var(--bone-0); font-weight: 560; }
em { font-style: italic; }

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 50;
  background: var(--void-0); color: var(--bone-0);
  padding: 0.5rem 1rem; font-family: var(--sans); font-size: 0.8rem;
  transition: top 0.2s;
}
.skip:focus { top: 1rem; }

/* ---------- furniture ---------- */
.microlabel {
  font-family: var(--sans);
  font-stretch: 80%;
  font-weight: 540;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-2);
}
.microlabel::after {
  content: "";
  display: inline-block;
  width: 2.2rem; height: 1px;
  background: var(--hairline);
  vertical-align: middle;
  margin-left: 0.9rem;
}

/* the beam divider: the single kinetic accent between sections (ADR 005) */
.beam {
  height: 1px;
  width: min(38rem, 72vw);
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--gold-dim) 20%, var(--gold) 50%, var(--gold-dim) 80%, transparent);
  opacity: 0.4;
  transform: scaleX(0.4);
  transition: transform 1.4s var(--ease-out), opacity 1.4s var(--ease-out), box-shadow 1.4s var(--ease-out);
}
.beam.lit {
  opacity: 1;
  transform: scaleX(1);
  box-shadow: 0 0 18px rgba(232, 185, 104, 0.35);
}

/* ---------- nav ---------- */
nav.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.4rem clamp(1.2rem, 4vw, 3rem);
  font-family: var(--sans);
}
nav.top .brand {
  color: var(--bone-0);
  text-decoration: none;
  font-stretch: 84%;
  font-weight: 620;
  font-size: 0.92rem;
  letter-spacing: 0.3em;
}
nav.top .links { display: flex; gap: clamp(1rem, 3vw, 2.2rem); }
nav.top .links a {
  color: var(--bone-2);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 520;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.3s;
}
nav.top .links a:hover { color: var(--blue); }

/* ---------- hero: the Assembly field ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--void-0);
}
.field { position: absolute; inset: 0; }
.field .field-svg, .field canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.field canvas { opacity: 0; transition: opacity 1.8s ease; }
.field canvas.on { opacity: 1; }
.field.gl .field-svg { opacity: 0; transition: opacity 1.8s ease; }

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.2rem;
}
/* lift the monument off dead center: thin sky above, the field and its
   ordered cluster own the lower third (desktop only; mobile stacks) */
@media (min-width: 721px) {
  .hero-inner { margin-bottom: clamp(4rem, 13vh, 8.5rem); }
}
.wordmark {
  font-family: var(--serif);
  font-size: clamp(3.1rem, 13vw, 10.5rem);
  font-weight: 390;
  font-variation-settings: "opsz" 72;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--bone-0);
  line-height: 1.04;
  margin: 0.6rem 0 1.2rem;
}
.threefold {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--bone-1);
}
.threefold span { white-space: nowrap; }
.greeting {
  margin-top: 1.6rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero-caption {
  position: absolute;
  z-index: 2;
  right: clamp(1.2rem, 4vw, 3rem);
  bottom: clamp(1.4rem, 5vh, 3rem);
  max-width: 17rem;
  text-align: right;
}
.hero-caption .microlabel::after { display: none; }
.hero-caption .microlabel::before {
  content: "";
  display: inline-block;
  width: 2.2rem; height: 1px;
  background: var(--hairline);
  vertical-align: middle;
  margin-right: 0.9rem;
}
.hero-caption p:not(.microlabel) {
  margin-top: 0.5rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--bone-2);
  line-height: 1.55;
}
.scroll-cue {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: clamp(3rem, 7vh, 5rem);
  background: var(--hairline);
  overflow: hidden;
}
.scroll-cue span {
  position: absolute;
  left: 0; top: -40%;
  width: 1px; height: 40%;
  background: var(--blue);
  animation: cue 2.6s var(--ease-out) infinite;
}
@keyframes cue { to { top: 110%; } }

/* entrance choreography: hero lines resolve once, in order */
.motion .hero-inner > *, .motion .hero-caption {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
}
.motion body.loaded .hero-inner > *, .motion body.loaded .hero-caption {
  opacity: 1;
  transform: none;
}
body.loaded .hero-inner > :nth-child(1) { transition-delay: 0.15s; }
body.loaded .hero-inner > :nth-child(2) { transition-delay: 0.35s; }
body.loaded .hero-inner > :nth-child(3) { transition-delay: 0.75s; }
body.loaded .hero-caption { transition-delay: 1.15s; }

/* ---------- scroll reveals ---------- */
.motion .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.motion .reveal.in { opacity: 1; transform: none; }

/* ---------- sections ---------- */
section { position: relative; padding: clamp(5rem, 12vh, 8.5rem) clamp(1.2rem, 5vw, 3rem); }
section > .beam:first-child { margin-bottom: clamp(3.5rem, 9vh, 6rem); }
[data-warmth="0"] { background: var(--void-1); }
[data-warmth="1"] { background: var(--void-2); }
[data-warmth="2"] { background: var(--void-3); }
[data-warmth="3"] { background: var(--void-4); }
[data-warmth="4"] { background: var(--void-5); }
[data-warmth="5"] { background: var(--void-5); }
[data-warmth="6"] { background: var(--void-6); }
[data-warmth="7"] { background: var(--void-7); }

.sec-head { max-width: 44rem; margin: 0 auto 3.5rem; }
.sec-head h2 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 430;
  font-variation-settings: "opsz" 44;
  color: var(--bone-0);
  line-height: 1.18;
  margin: 1.1rem 0 0.9rem;
}
.sec-note { color: var(--bone-2); font-size: 1rem; max-width: var(--measure); }

/* creed */
.creed .microlabel, .creed p { max-width: 42rem; margin-left: auto; margin-right: auto; }
.creed .lede {
  margin-top: 1.4rem;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  line-height: 1.55;
  color: var(--bone-0);
  font-weight: 380;
  font-variation-settings: "opsz" 30;
}
.creed .body { margin-top: 1.3rem; }

/* ---------- chambers ---------- */
.tenets { padding-left: 0; padding-right: 0; padding-bottom: 0; background: var(--void-1); }
.tenets .sec-head { padding: 0 clamp(1.2rem, 5vw, 3rem); }
.chamber {
  position: relative;
  overflow: hidden;
  padding: clamp(4.5rem, 11vh, 8rem) clamp(1.2rem, 5vw, 3rem);
  border-top: 1px solid rgba(236, 228, 211, 0.06);
}
.chamber[data-warmth="1"] { background: var(--void-2); }
.chamber[data-warmth="2"] { background: var(--void-3); }
.chamber[data-warmth="3"] { background: var(--void-4); }
.chamber[data-warmth="4"] { background: var(--void-5); }
.ch-inner { position: relative; max-width: 44rem; margin: 0 auto; }
/* the passage weaves: odd chambers sit left of center, even chambers right,
   the numeral always on the open side */
@media (min-width: 1100px) {
  .chamber:nth-of-type(odd) .ch-inner { margin-left: max(9vw, calc(50vw - 52rem)); margin-right: auto; }
  .chamber:nth-of-type(even) .ch-inner { margin-right: max(9vw, calc(50vw - 52rem)); margin-left: auto; }
  .chamber:nth-of-type(even) .ch-numeral { right: auto; left: max(-14rem, -18vw); }
}
.ch-numeral {
  position: absolute;
  top: 50%;
  right: max(-14rem, -16vw);
  transform: translateY(-50%);
  font-family: var(--serif);
  font-size: clamp(16rem, 34vw, 30rem);
  font-weight: 300;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(232, 185, 104, 0.26);
  user-select: none;
  pointer-events: none;
}
@supports not (-webkit-text-stroke: 1px black) {
  .ch-numeral { color: rgba(232, 185, 104, 0.06); }
}
.command {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6.5vw, 4.6rem);
  font-weight: 420;
  font-variation-settings: "opsz" 72;
  color: var(--bone-0);
  line-height: 1.06;
  margin: 1.2rem 0 1.6rem;
}
.command.big { font-size: clamp(2.6rem, 7vw, 5.2rem); }
.law {
  font-size: clamp(1.1rem, 1.7vw, 1.28rem);
  line-height: 1.78;
  color: var(--bone-1);
  max-width: var(--measure);
}
.thinkers { margin-top: 3rem; }
.quote { margin: 1.6rem 0 0; padding-left: 1.4rem; border-left: 1px solid var(--hairline); }
.quote blockquote {
  font-style: italic;
  font-size: 1.06rem;
  line-height: 1.66;
  color: var(--bone-1);
  font-variation-settings: "opsz" 14;
}
.quote figcaption { margin-top: 0.7rem; }
.quote cite {
  font-style: normal;
  font-family: var(--sans);
  font-stretch: 86%;
  font-size: 0.72rem;
  font-weight: 520;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-2);
}
.parable { margin-top: 3rem; }
.parable p:not(.microlabel) {
  margin-top: 1.1rem;
  padding-left: 1.4rem;
  border-left: 2px solid var(--gold-dim);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--bone-1);
  max-width: var(--measure);
}
.more {
  display: inline-block;
  margin-top: 2.6rem;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 560;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(133, 183, 242, 0.35);
  padding-bottom: 0.3rem;
  transition: border-color 0.3s;
}
.more:hover { border-color: var(--blue); }
.more::after { content: " \2192"; }

/* ---------- worship ---------- */
.worship .forms {
  max-width: 44rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.6rem 3rem;
}
.form h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 480;
  color: var(--bone-0);
  margin-bottom: 0.6rem;
}
.form p { font-size: 0.98rem; color: var(--bone-1); }
.form.featured {
  grid-column: 1 / -1;
  padding: 2.2rem 2.4rem;
  border: 1px solid rgba(232, 185, 104, 0.18);
  background: rgba(232, 185, 104, 0.03);
}
.form.featured h3 { font-size: 1.7rem; }
.form.featured p { font-size: 1.08rem; max-width: 38rem; }
.form .aside {
  margin-top: 1.1rem;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--bone-2);
}

/* ---------- holy days ---------- */
.countdown {
  margin-top: 0.4rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: var(--bone-2);
}
.countdown strong { color: var(--gold); font-weight: 600; }
.holy-grid {
  max-width: 44rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.holy h3 {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 460;
  color: var(--bone-0);
  margin: 0.7rem 0 0.5rem;
}
.holy .microlabel { color: var(--gold); }
.holy .microlabel::after { background: var(--gold-dim); }
.holy .note { font-style: italic; font-size: 0.9rem; color: var(--bone-2); margin-bottom: 0.7rem; }
.holy p { font-size: 0.98rem; }
.holy .quote { margin-top: 1.4rem; }
.amendment { max-width: 44rem; margin: 4.5rem auto 0; text-align: center; }
.amendment .microlabel::after { display: none; }
.amendment .engraved {
  margin-top: 1.6rem;
  padding: 2.4rem 1rem;
  border-top: 1px solid var(--gold-dim);
  border-bottom: 1px solid var(--gold-dim);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 350;
  font-variation-settings: "opsz" 40;
  line-height: 1.75;
  color: var(--bone-0);
}

/* ---------- open door ---------- */
.door .sec-head, .door > p, .door > div { max-width: 42rem; margin-left: auto; margin-right: auto; }
.door .body { margin-top: 1.3rem; }
.door .quote, .door .parable { margin-top: 2.2rem; }

/* ---------- footer ---------- */
footer { padding: 4.5rem clamp(1.2rem, 5vw, 3rem) 3.5rem; text-align: center; background: var(--void-0); }
footer .beam { margin-bottom: 3rem; }
.blessing {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--bone-0);
}
.ledger { margin-top: 1.4rem; font-size: 0.95rem; color: var(--bone-1); max-width: 38rem; margin-left: auto; margin-right: auto; }
.dim { color: var(--bone-2); }
.foot-links { margin-top: 2.2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem 2rem; }
.foot-links a {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 520;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-2);
  text-decoration: none;
}
.foot-links a:hover { color: var(--blue); }
footer p.dim { margin-top: 2rem; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.08em; }

/* ---------- tenet pages / codex ---------- */
.tp-hero {
  position: relative;
  min-height: clamp(20rem, 52vh, 30rem);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 6.5rem clamp(1.2rem, 5vw, 3rem) 3rem;
  background: var(--void-0);
}
.tp-hero .field { z-index: 0; }
.tp-hero-inner { position: relative; z-index: 2; max-width: 44rem; margin: 0 auto; width: 100%; }
.tp-hero .ch-numeral {
  top: auto;
  bottom: -0.18em;
  right: clamp(0.5rem, 5vw, 4rem);
  transform: none;
  font-size: clamp(9rem, 18vw, 15rem);
  -webkit-text-stroke: 1px rgba(232, 185, 104, 0.3);
}
.tenet-page, .codex { padding: 3.5rem clamp(1.2rem, 5vw, 3rem) 5rem; }
.tenet-page .law { margin: 0 auto; max-width: 40rem; font-size: clamp(1.2rem, 1.9vw, 1.4rem); }
.tenet-page .beam, .codex .beam { margin: 3.5rem auto; }
.tp-sec { max-width: 40rem; margin: 0 auto; padding: 0; }
.tp-sec .quote { margin-top: 1.8rem; }
.tp-nav {
  max-width: 40rem;
  margin: 4.5rem auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  border-top: 1px solid var(--hairline);
  padding-top: 1.6rem;
}
.tp-nav a {
  text-decoration: none;
  color: var(--bone-0);
  font-family: var(--serif);
  font-size: 1.05rem;
}
.tp-nav a .microlabel { display: block; margin-bottom: 0.3rem; }
.tp-nav a .microlabel::after { display: none; }
.tp-nav a:nth-child(2) { text-align: center; }
.tp-nav a:nth-child(3) { text-align: right; }
.tp-nav a:hover { color: var(--blue); }

.codex { max-width: 46rem; margin: 0 auto; }
.codex h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 440;
  color: var(--bone-0);
  margin: 3.2rem 0 1.1rem;
  line-height: 1.2;
}
.codex .codex-num {
  display: block;
  font-family: var(--sans);
  font-stretch: 80%;
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.24em;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.codex h3 { font-family: var(--serif); font-weight: 500; color: var(--bone-0); margin: 2rem 0 0.8rem; }
.codex p { margin: 1.1rem 0; }
.codex blockquote {
  margin: 1.6rem 0;
  padding-left: 1.4rem;
  border-left: 1px solid var(--hairline);
  font-style: italic;
  color: var(--bone-1);
}
.codex blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-family: var(--sans);
  font-stretch: 86%;
  font-size: 0.72rem;
  font-weight: 520;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-2);
}
.codex ul, .codex ol { padding-left: 1.4rem; margin: 1.1rem 0; }
.codex li { margin: 0.5rem 0; }
.codex table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-size: 0.95rem; }
.codex th {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-2);
  text-align: left;
  padding: 0.6rem 0.8rem 0.6rem 0;
  border-bottom: 1px solid var(--hairline);
}
.codex td { padding: 0.6rem 0.8rem 0.6rem 0; border-bottom: 1px solid rgba(236, 228, 211, 0.07); }
.codex code { font-family: var(--sans); font-size: 0.9em; color: var(--bone-1); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .worship .forms, .holy-grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column; justify-content: center; padding-bottom: 4rem; }
  .hero-inner { margin-top: auto; }
  .hero-caption {
    position: static;
    margin: 3rem auto auto;
    text-align: center;
    max-width: none;
    padding: 0 1.2rem;
  }
  .ch-numeral { right: -6rem; opacity: 0.45; }
  .tp-nav { grid-template-columns: 1fr; gap: 1.4rem; }
  .tp-nav a:nth-child(2), .tp-nav a:nth-child(3) { text-align: left; }
  nav.top { flex-direction: column; align-items: center; gap: 0.8rem; padding: 1.1rem 1rem; }
  nav.top .links { gap: 1.1rem; }
  nav.top .links a { font-size: 0.68rem; letter-spacing: 0.12em; }
}

/* ---------- reduced motion: everything static, everything present ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motion .hero-inner > *, .motion .hero-caption, .motion .reveal { opacity: 1; transform: none; transition: none; }
  .beam { transform: scaleX(1); opacity: 1; box-shadow: 0 0 18px rgba(232, 185, 104, 0.35); transition: none; }
  .scroll-cue span { animation: none; display: none; }
  .field canvas { display: none; }
  .field.gl .field-svg { opacity: 1; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; color: #1a1a1a; }
  .field, .scroll-cue, nav.top, .beam { display: none; }
  .wordmark, .command, .sec-head h2, .blessing, .form h3, .holy h3, .codex h2, .codex h3 { color: #111; }
  .law, .quote blockquote, .creed .lede, .amendment .engraved { color: #222; }
  a { color: #1a4c8b; }
  section, .chamber { background: #fff !important; padding: 2rem 0; }
  .hero { min-height: 0; }
}
