/* ============================================================
   The Wickstone Trust. Identity: "Lamp Room."
   Cream chart paper, deep-sea ink, one lamp-amber accent.
   Motion signature: a rotating keeper's beam and drifting fog.
   ============================================================ */

/* ---------- 1. reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; text-rendering: optimizeLegibility; }
img, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; }
:target { scroll-margin-block: 8rem; }

/* ---------- 2. design tokens ---------- */
:root {
  --paper: oklch(0.965 0.022 88);
  --paper-2: oklch(0.932 0.03 88);
  --paper-3: oklch(0.9 0.04 85);
  --ink: oklch(0.245 0.042 235);
  --ink-2: oklch(0.35 0.05 228);
  --ink-3: oklch(0.47 0.045 225);
  --sea: oklch(0.42 0.085 210);
  --teal: oklch(0.52 0.095 205);
  --amber: oklch(0.775 0.135 78);
  --amber-deep: oklch(0.62 0.14 68);
  --rust: oklch(0.56 0.15 42);
  --fog: oklch(0.9 0.008 240);
  --white: oklch(0.99 0.004 95);

  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --step--2: clamp(0.69rem, 0.67rem + 0.1vw, 0.74rem);
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.45vw, 1.42rem);
  --step-2: clamp(1.45rem, 1.28rem + 0.85vw, 1.9rem);
  --step-3: clamp(1.75rem, 1.45rem + 1.5vw, 2.55rem);
  --step-4: clamp(2.1rem, 1.6rem + 2.5vw, 3.4rem);
  --step-5: clamp(2.5rem, 1.6rem + 4.5vw, 4.6rem);

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.25rem;
  --space-xl: 3.25rem;
  --space-2xl: 5rem;
  --space-3xl: 8rem;

  --w-narrow: 42rem;
  --w-text: 56rem;
  --w-wide: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-swap: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 160ms;
  --dur-med: 320ms;
  --dur-slow: 700ms;

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 14px;

  --shadow-card: 0 1px 2px oklch(0.245 0.042 235 / 0.08), 0 8px 24px oklch(0.245 0.042 235 / 0.07);
  --shadow-lift: 0 2px 4px oklch(0.245 0.042 235 / 0.1), 0 16px 40px oklch(0.245 0.042 235 / 0.12);

  --beam-angle: 0deg;
  --beam-intensity: 1;
  --header-h: 4.25rem;
}

/* ---------- 3. base ---------- */
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { max-width: var(--w-narrow); }
strong { font-weight: 640; }
small { font-size: var(--step--1); }
::selection { background: var(--amber); color: var(--ink); }
main { display: block; }
.page-pad { padding-inline: var(--gutter); }
.wrap { max-width: var(--w-wide); margin-inline: auto; }
.wrap-text { max-width: var(--w-text); margin-inline: auto; }

/* ---------- 4. skip link + focus ---------- */
.skip-link {
  position: absolute;
  left: var(--space-s);
  top: -100%;
  z-index: 100;
  padding: var(--space-2xs) var(--space-s);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-s);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-s); }
:focus-visible {
  outline: 3px solid var(--amber-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 5. header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  background: oklch(from var(--paper) l c h / 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid oklch(from var(--ink) l c h / 0.14);
  transition: box-shadow var(--dur-med) var(--ease-out);
}
.site-header[data-scrolled] { box-shadow: var(--shadow-card); }
.header-in {
  width: 100%;
  max-width: var(--w-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--space-m);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-display);
  font-size: var(--step-1);
  text-decoration: none;
  white-space: nowrap;
}
.brand .lamp-dot {
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 40%, var(--white), var(--amber) 55%, var(--amber-deep));
  box-shadow: 0 0 calc(10px * var(--beam-intensity)) var(--amber);
  transition: box-shadow var(--dur-med) var(--ease-out);
}
.site-header:hover .lamp-dot { --beam-intensity: 1.8; }
.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  gap: var(--space-2xs);
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-nav a {
  display: block;
  padding: var(--space-2xs) var(--space-xs);
  font-size: var(--step--1);
  font-weight: 550;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--ink-2);
  border-radius: var(--radius-s);
  position: relative;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.site-nav a::after {
  content: "";
  position: absolute;
  inset-inline: var(--space-xs);
  bottom: 2px;
  height: 2px;
  background: var(--amber-deep);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-med) var(--ease-out);
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink); }
.site-nav a:hover::after, .site-nav a:focus-visible::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav-toggle {
  display: none;
  margin-left: auto;
  padding: var(--space-2xs);
  border: 1px solid oklch(from var(--ink) l c h / 0.25);
  border-radius: var(--radius-s);
  font-size: var(--step--1);
  font-weight: 600;
}
@media (max-width: 46rem) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid oklch(from var(--ink) l c h / 0.14);
    padding: var(--space-s) var(--gutter) var(--space-m);
  }
  .site-nav[data-open] { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding: var(--space-xs) 0; font-size: var(--step-0); }
}

/* ---------- 6. hero + the beam ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-3xl) var(--space-2xl);
  background:
    radial-gradient(120% 90% at 82% -10%, oklch(from var(--amber) l c h / 0.16), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-bottom: 1px solid oklch(from var(--ink) l c h / 0.12);
}
.hero .beam {
  position: absolute;
  top: -12%;
  left: 68%;
  width: 140vmax;
  height: 140vmax;
  pointer-events: none;
  background: conic-gradient(
    from var(--beam-angle) at 50% 50%,
    transparent 0deg,
    oklch(from var(--amber) l c h / 0) 4deg,
    oklch(from var(--amber) l c h / calc(0.13 * var(--beam-intensity))) 7deg,
    oklch(from var(--white) l c h / calc(0.1 * var(--beam-intensity))) 9deg,
    oklch(from var(--amber) l c h / calc(0.13 * var(--beam-intensity))) 11deg,
    oklch(from var(--amber) l c h / 0) 14deg,
    transparent 180deg
  );
  filter: blur(2px);
  animation: beam-sweep 14s var(--ease-swap) infinite alternate;
}
@keyframes beam-sweep {
  from { --beam-angle: -24deg; }
  to { --beam-angle: 38deg; }
}
@property --beam-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.hero .fog-layer {
  position: absolute;
  inset: auto -20% -35%;
  height: 60%;
  pointer-events: none;
  background:
    radial-gradient(38% 60% at 20% 100%, oklch(from var(--fog) l c h / 0.8), transparent 70%),
    radial-gradient(30% 55% at 55% 100%, oklch(from var(--fog) l c h / 0.65), transparent 70%),
    radial-gradient(34% 50% at 85% 100%, oklch(from var(--fog) l c h / 0.8), transparent 70%);
  animation: fog-drift 26s ease-in-out infinite alternate;
}
@keyframes fog-drift {
  from { transform: translateX(-3%); }
  to { transform: translateX(3%); }
}
.hero-in { position: relative; max-width: var(--w-wide); margin-inline: auto; padding-inline: var(--gutter); }
.hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--step--1);
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  margin-block-end: var(--space-s);
}
.hero .kicker::before {
  content: "";
  width: 2rem;
  height: 2px;
  background: var(--rust);
}
.hero h1 { max-width: 14ch; }
.hero h1 em { font-style: italic; color: var(--sea); }
.hero .lede {
  margin-block-start: var(--space-m);
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 38rem;
}
.hero .hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-block-start: var(--space-l);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m) var(--space-xl);
  margin-block-start: var(--space-2xl);
  padding-block-start: var(--space-m);
  border-block-start: 1px solid oklch(from var(--ink) l c h / 0.12);
}
.hero-meta .num {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1;
  color: var(--ink);
}
.hero-meta .lbl {
  display: block;
  margin-block-start: var(--space-3xs);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- 7. sections, cards, buttons ---------- */
.section { padding-block: var(--space-2xl); }
.section.tight { padding-block: var(--space-xl); }
.section-head { margin-block-end: var(--space-l); max-width: var(--w-text); }
.section-head .kicker {
  display: block;
  font-size: var(--step--1);
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  margin-block-end: var(--space-2xs);
}
.section-head p { margin-block-start: var(--space-xs); color: var(--ink-2); }
.band {
  background: var(--paper-2);
  border-block: 1px solid oklch(from var(--ink) l c h / 0.1);
}
.card-grid {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-m);
  background: var(--white);
  border: 1px solid oklch(from var(--ink) l c h / 0.12);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: oklch(from var(--amber-deep) l c h / 0.5);
}
.card h3 { font-size: var(--step-2); }
.card .meta {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}
.card p { color: var(--ink-2); font-size: var(--step--1); }
.card .card-cta {
  margin-block-start: auto;
  padding-block-start: var(--space-xs);
  font-weight: 620;
  font-size: var(--step--1);
  color: var(--rust);
}
.card .card-cta::after { content: " →"; transition: translate var(--dur-fast) var(--ease-out); display: inline-block; }
.card:hover .card-cta::after { translate: 4px 0; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.72em 1.4em;
  font-weight: 620;
  font-size: var(--step-0);
  text-decoration: none;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--sea); box-shadow: var(--shadow-card); }
.btn-lamp { background: var(--amber); color: var(--ink); border-color: oklch(from var(--ink) l c h / 0.16); }
.btn-lamp:hover, .btn-lamp:focus-visible { background: var(--amber-deep); color: var(--white); }
.btn-ghost { border-color: oklch(from var(--ink) l c h / 0.3); color: var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--ink); background: var(--white); }

/* ---------- 8. forms ---------- */
.form-grid {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  max-width: var(--w-text);
}
.field { display: flex; flex-direction: column; gap: var(--space-3xs); }
.field label { font-size: var(--step--1); font-weight: 620; }
.field input, .field textarea, .field select {
  padding: 0.65em 0.8em;
  background: var(--white);
  border: 1.5px solid oklch(from var(--ink) l c h / 0.28);
  border-radius: var(--radius-m);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--ink-3); }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px oklch(from var(--teal) l c h / 0.25);
}
.field input:user-invalid { border-color: var(--rust); box-shadow: 0 0 0 3px oklch(from var(--rust) l c h / 0.2); }
.field .hint { font-size: var(--step--2); color: var(--ink-3); }
.field .error-msg { display: none; font-size: var(--step--1); color: var(--rust); font-weight: 600; }
.field[data-error] .error-msg { display: block; }
.field[data-error] input, .field[data-error] textarea { border-color: var(--rust); }
.form-note {
  margin-block-start: var(--space-xs);
  font-size: var(--step--1);
  color: var(--ink-3);
}

/* ---------- 9. tables, timeline, stats ---------- */
.table-scroll { overflow-x: auto; border: 1px solid oklch(from var(--ink) l c h / 0.14); border-radius: var(--radius-l); background: var(--white); box-shadow: var(--shadow-card); }
table { width: 100%; border-collapse: collapse; min-width: 34rem; }
caption { caption-side: top; text-align: left; padding: var(--space-s) var(--space-m) 0; font-weight: 620; font-size: var(--step--1); color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
th, td { padding: var(--space-xs) var(--space-m); text-align: left; font-size: var(--step--1); border-block-end: 1px solid oklch(from var(--ink) l c h / 0.08); }
thead th { font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; font-size: var(--step--2); color: var(--ink-2); background: var(--paper-2); }
tbody tr:last-child td { border-block-end: none; }
tbody tr { transition: background var(--dur-fast) var(--ease-out); }
tbody tr:hover { background: oklch(from var(--amber) l c h / 0.12); }
td .lit { display: inline-flex; align-items: center; gap: var(--space-3xs); font-weight: 620; color: var(--teal); }
td .lit::before { content: ""; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(180deg, var(--amber-deep), var(--teal));
}
.timeline li { position: relative; padding-inline-start: var(--space-l); padding-block-end: var(--space-m); }
.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--amber-deep);
}
.timeline .yr { font-family: var(--font-display); font-size: var(--step-1); color: var(--sea); }
.stat-row { display: flex; flex-wrap: wrap; gap: var(--space-l); }

/* ---------- 10. journal + light pages ---------- */
.article-list { display: grid; gap: var(--space-m); }
.entry {
  padding: var(--space-m);
  background: var(--white);
  border: 1px solid oklch(from var(--ink) l c h / 0.12);
  border-left: 4px solid var(--amber-deep);
  border-radius: var(--radius-m);
  text-decoration: none;
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.entry:hover, .entry:focus-visible { transform: translateX(4px); box-shadow: var(--shadow-card); }
.entry h3 { font-size: var(--step-2); }
.entry .date { font-size: var(--step--2); font-weight: 620; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.entry p { margin-block-start: var(--space-2xs); font-size: var(--step--1); color: var(--ink-2); }
.prose { max-width: var(--w-narrow); }
.prose > * + * { margin-block-start: var(--space-s); }
.prose p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.1em;
  float: left;
  line-height: 0.82;
  padding-inline-end: 0.08em;
  color: var(--sea);
}
.prose h2 { font-size: var(--step-2); margin-block-start: var(--space-l); }
.light-specs {
  display: grid;
  gap: 1px;
  background: oklch(from var(--ink) l c h / 0.14);
  border: 1px solid oklch(from var(--ink) l c h / 0.14);
  border-radius: var(--radius-l);
  overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
  margin-block: var(--space-l);
}
.light-specs div { padding: var(--space-s) var(--space-m); background: var(--white); }
.light-specs dt { font-size: var(--step--2); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.light-specs dd { margin: 0; font-family: var(--font-display); font-size: var(--step-1); color: var(--ink); }
.lantern {
  position: relative;
  width: min(100%, 30rem);
  aspect-ratio: 3 / 2;
  margin-block: var(--space-l);
  border-radius: var(--radius-l);
  overflow: hidden;
  background: linear-gradient(180deg, oklch(0.3 0.05 235) 0%, oklch(0.42 0.07 225) 55%, oklch(0.55 0.06 210) 100%);
}
.lantern .tower { position: absolute; left: 72%; bottom: 18%; width: 6%; height: 52%; background: var(--ink); border-radius: 3px 3px 0 0; }
.lantern .lamp-room {
  position: absolute; left: 69.5%; bottom: 70%; width: 11%; height: 9%;
  background: radial-gradient(circle at 50% 55%, var(--white), var(--amber) 45%, var(--amber-deep));
  border-radius: 50% 50% 12% 12%;
  box-shadow: 0 0 24px var(--amber);
  animation: lamp-breathe 5s ease-in-out infinite alternate;
}
@keyframes lamp-breathe {
  from { opacity: 0.85; box-shadow: 0 0 16px var(--amber); }
  to { opacity: 1; box-shadow: 0 0 36px var(--amber); }
}
.lantern .sweep {
  position: absolute; inset: -40%;
  background: conic-gradient(from var(--beam-angle) at 75.5% 68%, transparent 0deg, oklch(from var(--amber) l c h / 0) 8deg, oklch(from var(--amber) l c h / 0.3) 11deg, oklch(from var(--white) l c h / 0.22) 13deg, oklch(from var(--amber) l c h / 0.3) 15deg, oklch(from var(--amber) l c h / 0) 18deg, transparent 90deg);
  animation: beam-sweep 9s var(--ease-swap) infinite alternate;
}
.lantern .wave {
  position: absolute; inset-inline: 0; bottom: 0; height: 22%;
  background: repeating-linear-gradient(180deg, oklch(from var(--teal) l c h / 0.25) 0 2px, transparent 2px 7px);
  animation: wave-slide 7s linear infinite;
}
@keyframes wave-slide { from { background-position-y: 0; } to { background-position-y: 14px; } }
.lantern figcaption {
  position: absolute; inset-inline: 0; bottom: 0; padding: var(--space-2xs) var(--space-s);
  font-size: var(--step--2); color: oklch(from var(--white) l c h / 0.85); background: oklch(from var(--ink) l c h / 0.35);
}

/* ---------- 11. accordion ---------- */
.faq details { border-block-end: 1px solid oklch(from var(--ink) l c h / 0.14); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-s);
  padding-block: var(--space-s);
  cursor: pointer;
  font-weight: 620;
  font-size: var(--step-0);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--rust);
  transition: rotate var(--dur-med) var(--ease-out);
}
.faq details[open] summary::after { rotate: 45deg; }
.faq .answer { padding-block-end: var(--space-s); color: var(--ink-2); max-width: var(--w-narrow); }
.faq details[open] .answer { animation: faq-in var(--dur-med) var(--ease-out); }
@keyframes faq-in { from { opacity: 0; translate: 0 -4px; } to { opacity: 1; translate: 0 0; } }

/* ---------- 12. states ---------- */
.loading {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  font-size: var(--step--1); color: var(--ink-3); font-weight: 600;
}
.loading::before {
  content: ""; width: 1em; height: 1em; border-radius: 50%;
  border: 2.5px solid oklch(from var(--teal) l c h / 0.25); border-top-color: var(--teal);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }
.empty {
  padding: var(--space-l); text-align: center;
  border: 1.5px dashed oklch(from var(--ink) l c h / 0.3);
  border-radius: var(--radius-l);
  color: var(--ink-3);
}
.error-panel {
  padding: var(--space-m); background: oklch(from var(--rust) l c h / 0.09);
  border: 1px solid oklch(from var(--rust) l c h / 0.4); border-radius: var(--radius-m);
  color: var(--ink); font-size: var(--step--1);
}
.status-open { color: var(--teal); font-weight: 650; }
.status-restored { color: var(--amber-deep); font-weight: 650; }
.toast {
  position: fixed; inset-inline: auto var(--space-s); bottom: var(--space-s);
  z-index: 90; max-width: min(24rem, calc(100vw - 2rem));
  padding: var(--space-xs) var(--space-s);
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius-m); box-shadow: var(--shadow-lift);
  font-size: var(--step--1); font-weight: 550;
  opacity: 0; translate: 0 12px; pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out), translate var(--dur-med) var(--ease-out);
}
.toast[data-show] { opacity: 1; translate: 0 0; }

/* ---------- 13. reveal + motion ---------- */
[data-reveal] { opacity: 0; translate: 0 18px; transition: opacity var(--dur-slow) var(--ease-out), translate var(--dur-slow) var(--ease-out); transition-delay: var(--reveal-delay, 0ms); }
[data-reveal].is-in { opacity: 1; translate: 0 0; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .scroll-rise { animation: scroll-rise both linear; animation-timeline: view(); animation-range: entry 5% cover 30%; }
    @keyframes scroll-rise { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
    [data-reveal] { opacity: 1; translate: 0 0; }
  }
}
::view-transition-old(root) { animation: vt-out 200ms var(--ease-swap) both; }
::view-transition-new(root) { animation: vt-in 260ms var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; translate: 0 -8px; } }
@keyframes vt-in { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }

/* ---------- 14. reduced motion + print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; translate: 0 0; }
  .hero .beam, .hero .fog-layer, .lantern .sweep { display: none; }
}
@media print {
  .site-header, .site-footer, .hero .beam, .hero .fog-layer, .toast, .btn { display: none !important; }
  body { background: white; color: black; }
  a { text-decoration: none; }
}

/* ---------- 15. fiction strip + footer ---------- */
.fiction-strip {
  padding: var(--space-2xs) var(--gutter);
  background: oklch(from var(--amber) l c h / 0.25);
  border-block-end: 1px solid oklch(from var(--ink) l c h / 0.12);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  text-align: center;
}
.site-footer {
  margin-block-start: var(--space-3xl);
  background: var(--ink);
  color: oklch(from var(--paper) l c h / 0.92);
}
.footer-in {
  max-width: var(--w-wide);
  margin-inline: auto;
  padding: var(--space-xl) var(--gutter);
  display: grid;
  gap: var(--space-l);
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
}
.footer-brand { grid-column: 1 / -1; max-width: 30rem; }
.footer-brand .brand { color: var(--paper); }
.footer-brand p { color: oklch(from var(--paper) l c h / 0.7); font-size: var(--step--1); margin-block-start: var(--space-2xs); }
.footer-col h3 { font-size: var(--step--1); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: oklch(from var(--amber) l c h / 0.9); margin-block-end: var(--space-2xs); }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: var(--space-3xs); }
.footer-col a, .footer-col .link-btn {
  color: oklch(from var(--paper) l c h / 0.8);
  text-decoration: none;
  font-size: var(--step--1);
  padding: 0;
  background: none; border: none; text-align: left; cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}
.footer-col a:hover, .footer-col a:focus-visible, .footer-col .link-btn:hover { color: var(--amber); text-decoration: underline; }
.footer-legal {
  border-block-start: 1px solid oklch(from var(--paper) l c h / 0.16);
  padding: var(--space-s) var(--gutter);
  font-size: var(--step--2);
  color: oklch(from var(--paper) l c h / 0.6);
}
.footer-legal a { color: inherit; }
.link-btn { color: var(--teal); text-decoration: underline; font-weight: 620; }
