/* Wheel of the Year — the site's own skin.
   Every colour comes from a CSS variable. The palettes themselves live in the
   generated assets/schemes.css, straight from the app's src/theme/schemes.ts;
   site.js only sets data-scheme and data-mode on <html>. The values below are
   Twilight dark — the defaults, so there is no flash before the script runs. */

:root {
  --bg: #08060F;
  --bg-top: #1A1230;
  --surface: rgba(30, 22, 54, 0.72);
  --surface-border: rgba(180, 160, 230, 0.14);
  --text: #F4EFFF;
  --text-dim: #C9BEE6;
  --text-faint: #8A7FB0;
  --accent: #E8B857;
  --accent-soft: rgba(232, 184, 87, 0.16);
  --ring: rgba(180, 160, 230, 0.20);
  --glow: #8E6BD9;
  --star: #DCD3FF;
  --season-winter: #5C6BC0;
  --season-spring: #66BB8A;
  --season-summer: #E8B857;
  --season-autumn: #C56B87;

  --hub-unit: 2px;
  --display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --body: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --wrap: 1180px;
  --r: 20px;
}

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

/* The overlays below set `display`, which would otherwise beat the UA's
   [hidden] rule and leave an invisible full-screen layer eating every
   click on the page. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 420ms ease, color 420ms ease;
}
body.is-locked { overflow: hidden; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.14; }
p { margin: 0; }
em { font-style: italic; }
a { color: inherit; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  padding: 10px 16px; border-radius: 12px;
  background: var(--accent); color: var(--bg); font-weight: 600;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* ── the sky behind everything ───────────────────────────────────────── */

.sky {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(120% 78% at 50% -8%, var(--glow) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 62%);
  opacity: 0.85;
  transition: background 420ms ease;
}
[data-mode='light'] .sky { opacity: 0.55; }

#stars { position: fixed; inset: 0; z-index: -2; pointer-events: none; }

/* ── header ──────────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 240ms ease, background 240ms ease;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom-color: var(--surface-border);
}
.site-header .wrap {
  max-width: var(--wrap); margin: 0 auto;
  padding: 12px 24px;
  display: flex; align-items: center; gap: 22px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; font-family: var(--display); font-size: 21px; letter-spacing: 0.2px;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.site-nav { margin-left: auto; display: flex; gap: 22px; }
.site-nav a {
  text-decoration: none; color: var(--text-dim); font-size: 14.5px;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}
.site-nav a:hover { color: var(--text); border-bottom-color: var(--accent); }
.mode-flip {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--surface-border); background: var(--surface);
  color: var(--accent); font-size: 16px; line-height: 1;
  transition: transform 220ms ease;
}
.mode-flip:hover { transform: rotate(-18deg); }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .site-header .wrap { padding: 10px 18px; }
  .mode-flip { margin-left: auto; }
}

/* ── hero ────────────────────────────────────────────────────────────── */

.hero {
  max-width: var(--wrap); margin: 0 auto;
  padding: 46px 24px 30px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: 52px; align-items: center; min-height: 78vh;
}

.eyebrow {
  font-size: 12px; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--text-faint); font-weight: 500;
}
.hero-title {
  font-size: clamp(46px, 6.4vw, 82px);
  margin: 16px 0 20px; letter-spacing: -0.5px;
}
.hero-title em { color: var(--accent); }
.lede { color: var(--text-dim); font-size: 17.5px; max-width: 48ch; }

.banner-wrap { margin-top: 24px; }
.banner {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 11px 22px; border-radius: 18px;
  border: 1px solid var(--surface-border); background: var(--surface);
  text-align: left; transition: border-color 200ms ease, transform 200ms ease;
}
.banner:hover { border-color: var(--accent); transform: translateY(-1px); }
.banner-kicker {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-faint); font-weight: 500;
}
.banner-body { font-family: var(--display); font-style: italic; font-size: 20px; color: var(--text); }

/* Several feasts on the day: one card each, in a row that scrolls sideways. */
.banner-multi { margin-top: 24px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.banner-cards {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.banner-card {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px;
  max-width: min(320px, 72vw); padding: 10px 18px; border-radius: 18px;
  border: 1px solid var(--surface-border); background: var(--surface);
  scroll-snap-align: start; transition: border-color 200ms ease, background 200ms ease;
}
.banner-card:hover { border-color: var(--accent); }
.banner-card[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }
.banner-card-glyph { color: var(--accent); font-size: 17px; }
.banner-card-name {
  font-family: var(--display); font-style: italic; font-size: 20px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.hint {
  margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint);
}
.hint span {
  padding: 5px 11px; border: 1px solid var(--surface-border); border-radius: 20px;
}

/* ── the wheel ───────────────────────────────────────────────────────── */

.wheel-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.wheel-wrap {
  position: relative;
  width: min(560px, 84vw, 66vh); aspect-ratio: 1;
  filter: drop-shadow(0 24px 60px color-mix(in srgb, var(--glow) 26%, transparent));
}

#wheel {
  width: 100%; height: 100%; display: block;
  cursor: grab; touch-action: pan-y;
  -webkit-user-select: none; user-select: none;
}
#wheel.is-dragging { cursor: grabbing; }
#wheel:focus { outline: none; }
#wheel:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 50%; }

.wheel-node { cursor: pointer; }
.wheel-node .wheel-glyph { transition: opacity 200ms ease; opacity: 0.85; }
.wheel-node:hover .wheel-glyph { opacity: 1; }
.wheel-node.is-focused .wheel-glyph { opacity: 1; font-weight: 600; }
.wheel-focus-ring { filter: drop-shadow(0 0 7px var(--accent)); }
.wheel-indicator { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 70%, transparent)); }

/* the hub — the app's centre, scaled off the wheel's radius the same way */
.hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 50%; height: 50%; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: calc(var(--hub-unit) * 8);
  transition: background 200ms ease;
}
.hub:hover { background: radial-gradient(circle, var(--accent-soft) 0%, transparent 72%); }
.hub.is-fresh > * { animation: hub-in 280ms ease both; }
@keyframes hub-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hub.is-fresh > * { animation: none; } }

.hub-region {
  font-size: calc(var(--hub-unit) * 5.2); letter-spacing: calc(var(--hub-unit) * 0.5);
  text-transform: uppercase; font-weight: 500;
  margin-bottom: calc(var(--hub-unit) * 2); white-space: nowrap;
}
.hub-glyph { font-size: calc(var(--hub-unit) * 16); color: var(--accent); line-height: 1.1; }
.hub-name {
  font-family: var(--display); font-weight: 600;
  font-size: calc(var(--hub-unit) * 15); line-height: 1.06; color: var(--text);
  max-width: 100%; overflow-wrap: normal;
}
.hub-alt {
  font-family: var(--display); font-style: italic;
  font-size: calc(var(--hub-unit) * 8); color: var(--text-dim);
  margin-top: calc(var(--hub-unit) * 0.5);
}
.hub-rule {
  height: 1px; width: calc(var(--hub-unit) * 26); background: var(--surface-border);
  margin: calc(var(--hub-unit) * 3) 0;
}
.hub-dots { display: flex; gap: calc(var(--hub-unit) * 2.4); margin: calc(var(--hub-unit) * 2.6) 0; }
.hub-dots i {
  width: calc(var(--hub-unit) * 2.6); height: calc(var(--hub-unit) * 2.6); border-radius: 50%;
  border: 1px solid var(--accent);
}
.hub-dots i.is-on { background: var(--accent); }
.hub-date {
  color: var(--accent); font-weight: 600;
  font-size: calc(var(--hub-unit) * 7); letter-spacing: calc(var(--hub-unit) * 0.3);
}
.hub-cue {
  color: var(--text-faint); font-size: calc(var(--hub-unit) * 5);
  margin-top: calc(var(--hub-unit) * 3);
  letter-spacing: calc(var(--hub-unit) * 0.4); text-transform: uppercase;
}

.controls { display: flex; align-items: center; gap: 14px; }
.step, .today {
  border: 1px solid var(--surface-border); background: var(--surface);
  color: var(--accent); transition: border-color 180ms ease, transform 180ms ease;
}
.step { width: 52px; height: 52px; border-radius: 50%; font-size: 24px; line-height: 1; }
.today {
  height: 52px; padding: 0 24px; border-radius: 26px;
  font-weight: 600; font-size: 15px; letter-spacing: 0.3px;
  display: inline-flex; align-items: center; gap: 8px;
}
.step:hover, .today:hover { border-color: var(--accent); transform: translateY(-1px); }

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr; gap: 34px; padding-top: 30px;
    min-height: 0; text-align: center; justify-items: center;
  }
  .lede { max-width: 60ch; }
  .hint { justify-content: center; }
  .wheel-wrap { width: min(520px, 90vw); }
}

/* ── bands ───────────────────────────────────────────────────────────── */

.band { max-width: var(--wrap); margin: 0 auto; padding: 82px 24px; }
/* The reveal is gated on .js, and never fades past half — a band that somehow
   misses its cue is dimmed, never invisible. */
.js .band {
  opacity: 0.45; transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.js .band.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .band { opacity: 1; transform: none; } }

.band-head { max-width: 62ch; margin-bottom: 34px; }
.band-head h2 { font-size: clamp(32px, 3.9vw, 48px); margin: 12px 0 14px; }
.band-head .sub { color: var(--text-dim); font-size: 16.5px; }

/* ── traditions ──────────────────────────────────────────────────────── */

.trad-actions { display: flex; gap: 10px; margin-bottom: 18px; }
.trad-actions button {
  padding: 8px 16px; border-radius: 18px; font-size: 13.5px;
  border: 1px solid var(--surface-border); color: var(--text-dim);
  transition: border-color 180ms ease, color 180ms ease;
}
.trad-actions button:hover { border-color: var(--accent); color: var(--text); }

.trad-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}
.trad {
  display: flex; flex-direction: column; align-items: stretch; gap: 5px;
  text-align: left; padding: 18px 18px 16px;
  border: 1px solid var(--surface-border); border-radius: var(--r);
  background: var(--surface);
  transition: border-color 200ms ease, transform 200ms ease, opacity 200ms ease;
}
.trad:hover { transform: translateY(-2px); border-color: var(--trad-accent); }
.trad[aria-pressed='false'] { opacity: 0.42; }
.trad[aria-pressed='true'] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--trad-accent) 34%, transparent); }
.trad-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.trad-glyph {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 19px;
  color: var(--trad-accent);
  border: 1px solid color-mix(in srgb, var(--trad-accent) 40%, transparent);
  background: color-mix(in srgb, var(--trad-accent) 12%, transparent);
}
.trad-count { font-size: 12px; color: var(--text-faint); letter-spacing: 0.4px; }
.trad-name { font-family: var(--display); font-size: 24px; }
.trad-family { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); }
.trad-blurb { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin-top: 6px; }
.trad-state {
  margin-top: 12px; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--trad-accent);
}
.trad[aria-pressed='false'] .trad-state { color: var(--text-faint); }
.trad.is-yours { border-style: dashed; }

/* ── settings ────────────────────────────────────────────────────────── */

.setting-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.setting {
  padding: 22px; border-radius: var(--r);
  border: 1px solid var(--surface-border); background: var(--surface);
}
.setting h3 { font-size: 24px; margin-bottom: 6px; }
.setting p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 16px; }
.setting .detail { display: block; color: var(--text-faint); font-size: 13px; margin-top: 8px; }
.setting.moon { display: flex; align-items: center; gap: 18px; }
.setting.moon p { margin-bottom: 0; }
.moon-disc { flex: 0 0 auto; line-height: 0; }

.segment {
  display: flex; gap: 4px; padding: 4px;
  border: 1px solid var(--surface-border); border-radius: 14px;
}
.segment.wide { max-width: 340px; margin-bottom: 26px; }
.segment button {
  flex: 1; padding: 11px 14px; border-radius: 10px;
  font-weight: 600; font-size: 14.5px; color: var(--text-dim);
  transition: background 200ms ease, color 200ms ease;
}
.segment button[aria-pressed='true'] { background: var(--accent); color: var(--bg); }

.caveat {
  margin-top: 30px; padding: 22px 24px; border-radius: var(--r);
  border: 1px solid var(--surface-border);
  color: var(--text-dim); font-size: 14.5px; max-width: 74ch;
}
.caveat em { color: var(--accent); font-style: italic; }

/* ── scheme swatches ─────────────────────────────────────────────────── */

.swatch-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.swatch {
  display: block; text-align: left; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--surface-border);
  transition: transform 200ms ease, border-color 200ms ease;
}
.swatch:hover { transform: translateY(-2px); }
.swatch.is-on { border: 2px solid var(--sw-accent); }
.sw-preview {
  position: relative; height: 92px; padding: 12px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.sw-orb {
  position: absolute; top: -18px; right: -12px;
  width: 62px; height: 62px; border-radius: 50%; opacity: 0.7;
}
.sw-dots { display: flex; gap: 6px; position: relative; }
.sw-dots span { width: 13px; height: 13px; border-radius: 50%; }
.sw-bar { height: 4px; width: 44px; border-radius: 2px; position: relative; }
.sw-check {
  position: absolute; top: 9px; right: 9px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.sw-label { display: block; padding: 12px 14px 14px; background: var(--surface); }
.sw-name { display: block; font-family: var(--display); font-size: 21px; }
.sw-desc { display: block; color: var(--text-faint); font-size: 12.5px; margin-top: 1px; }

/* ── the app ─────────────────────────────────────────────────────────── */

.app-band .band-head { max-width: 66ch; }

.feature-lead {
  display: flex; gap: 22px; align-items: flex-start;
  padding: 26px; margin-bottom: 16px;
  border-radius: var(--r);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: linear-gradient(140deg, var(--accent-soft), transparent 70%), var(--surface);
}
.feature-lead-icon {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 16px;
  display: grid; place-items: center; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}
.feature-lead-icon svg { width: 27px; height: 27px; }
.feature-lead h3 { font-size: 30px; margin-bottom: 8px; }
.feature-lead p { color: var(--text-dim); font-size: 15.5px; max-width: 64ch; }

.feature-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.feature {
  padding: 20px; border-radius: var(--r);
  border: 1px solid var(--surface-border); background: var(--surface);
  transition: border-color 200ms ease, transform 200ms ease;
}
.feature:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-icon { display: block; color: var(--accent); margin-bottom: 12px; }
.feature-icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 22px; margin-bottom: 6px; }
.feature p { color: var(--text-dim); font-size: 14.5px; line-height: 1.55; }

.store-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.primary {
  display: inline-flex; align-items: center; padding: 14px 26px;
  border-radius: 26px; text-decoration: none; font-weight: 600;
  background: var(--accent); color: var(--bg);
  transition: transform 180ms ease, opacity 180ms ease;
}
.primary.ghost { background: none; color: var(--accent); border: 1px solid var(--accent); }
.primary[aria-disabled='true'] { opacity: 0.7; cursor: default; }
.primary:hover { transform: translateY(-1px); }
.store-note { margin-top: 14px; color: var(--text-faint); font-size: 13.5px; }

/* ── the index of feasts ─────────────────────────────────────────────── */

.search-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
#search {
  flex: 1 1 320px; min-width: 0;
  padding: 13px 18px; border-radius: 16px;
  border: 1px solid var(--surface-border); background: var(--surface);
  color: var(--text); font-size: 15.5px;
}
#search::placeholder { color: var(--text-faint); }
#search:focus { outline: none; border-color: var(--accent); }
.search-count { color: var(--text-faint); font-size: 13px; letter-spacing: 0.6px; }

.feast-list {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.feast {
  display: grid; grid-template-columns: 96px 26px 1fr auto;
  align-items: center; gap: 12px; text-align: left;
  padding: 12px 16px; border-radius: 14px;
  border: 1px solid transparent; background: var(--surface);
  transition: border-color 180ms ease, transform 160ms ease;
}
.feast:hover { border-color: var(--feast-accent); transform: translateX(2px); }
.feast.is-current { border-color: var(--accent); }
.feast.is-off { opacity: 0.5; }
.feast-date { font-size: 12.5px; color: var(--text-faint); letter-spacing: 0.4px; }
.feast-date i { display: block; font-style: normal; font-size: 10.5px; opacity: 0.7; }
.feast-glyph { font-size: 17px; color: var(--feast-accent); text-align: center; }
.feast-main { min-width: 0; }
.feast-name { display: block; font-family: var(--display); font-size: 20px; }
.feast-name i { font-style: italic; color: var(--text-dim); font-size: 15px; }
.feast-tagline {
  display: block; color: var(--text-faint); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feast-region { font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--feast-accent); }
.empty { color: var(--text-faint); padding: 20px 2px; }

@media (max-width: 560px) {
  .feast { grid-template-columns: 78px 22px 1fr; }
  .feast-region { display: none; }
}

/* ── deities ─────────────────────────────────────────────────────────── */

.deity-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}
.deity {
  display: block; text-align: left; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--surface-border); background: var(--surface);
  transition: border-color 180ms ease, transform 160ms ease;
}
.deity:hover { border-color: var(--accent); transform: translateY(-2px); }
.deity-name { display: block; font-family: var(--display); font-size: 21px; }
.deity-pantheon {
  display: block; font-size: 10.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--accent); margin-top: 2px;
}
.deity-epithet { display: block; color: var(--text-faint); font-size: 13px; margin-top: 5px; }

/* ── closing ─────────────────────────────────────────────────────────── */

.closing .panel {
  padding: 46px; border-radius: 28px; text-align: center;
  border: 1px solid var(--surface-border); background: var(--surface);
}
.closing h2 {
  font-size: clamp(26px, 3.2vw, 38px); font-style: italic; font-weight: 500;
  margin: 14px auto 18px; max-width: 26ch;
}
.closing p { color: var(--text-dim); max-width: 62ch; margin: 0 auto; }
.cta { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; margin-top: 28px; }
.cta a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.cta a:hover { border-bottom-color: var(--accent); }

/* ── footer ──────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--surface-border); margin-top: 40px; }
.site-footer .wrap {
  max-width: var(--wrap); margin: 0 auto; padding: 28px 24px;
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  color: var(--text-faint); font-size: 13.5px;
}
.site-footer .links { display: flex; gap: 20px; }
.site-footer a { color: var(--text-faint); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ── the lore sheet ──────────────────────────────────────────────────── */

.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.55); opacity: 0;
  transition: opacity 300ms ease;
}
.scrim.is-open { opacity: 1; }

.sheet {
  position: fixed; z-index: 70; top: 0; right: 0; bottom: 0;
  width: min(560px, 100vw);
  background: color-mix(in srgb, var(--bg) 86%, var(--surface));
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--surface-border);
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.22, 0.9, 0.3, 1);
  display: flex; flex-direction: column;
}
.sheet.is-open { transform: none; }
@media (prefers-reduced-motion: reduce) { .sheet, .scrim { transition: none; } }

.sheet-close {
  position: absolute; top: 16px; right: 18px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--surface-border); background: var(--surface);
  color: var(--text-dim); font-size: 14px;
}
.sheet-close:hover { color: var(--accent); border-color: var(--accent); }

.sheet-scroll { overflow-y: auto; padding: 34px 34px 60px; }

.sheet-head { display: flex; align-items: center; gap: 14px; }
.sheet-glyph { font-size: 40px; color: var(--accent); line-height: 1; }
.sheet-region { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; }
.sheet-date { color: var(--accent); font-size: 13.5px; font-weight: 500; margin-top: 4px; }
.sheet-rule { color: var(--text-faint); font-size: 12.5px; margin-top: 2px; }
.sheet-name { font-size: 38px; margin-top: 18px; line-height: 1.18; }
.sheet-alt { font-family: var(--display); font-style: italic; font-size: 18px; color: var(--text-dim); }
.sheet-tagline {
  font-family: var(--display); font-style: italic; font-size: 17px;
  color: var(--text-dim); margin-top: 12px;
}

.sheet-actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px;
  padding: 14px; border-radius: 16px;
  border: 1px dashed var(--surface-border); background: var(--accent-soft);
}
.sheet-action {
  flex: 1 1 180px; display: flex; flex-direction: column;
  font-size: 12.5px; color: var(--text-faint);
}
.sheet-action b { color: var(--accent); font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.sheet-action-note {
  flex: 1 1 100%; color: var(--accent); font-size: 12.5px;
  text-decoration: none; border-bottom: 1px solid transparent; align-self: flex-start;
}
.sheet-action-note:hover { border-bottom-color: var(--accent); }

.sheet-body-text { margin-top: 20px; color: var(--text); font-size: 15px; line-height: 1.62; }
.sheet-section {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-faint); font-family: var(--body); font-weight: 600;
  margin: 26px 0 11px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 20px;
  border: 1px solid var(--surface-border); background: var(--accent-soft);
  font-size: 12.5px; color: var(--text-dim); font-weight: 500;
}
.chip.is-link { color: var(--text); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.chip.is-link i { font-style: normal; color: var(--accent); }
.chip.is-link:hover { border-color: var(--accent); }

.customs { list-style: none; padding: 0; margin: 0; }
.customs li {
  position: relative; padding-left: 24px; margin-bottom: 10px;
  color: var(--text-dim); font-size: 14px; line-height: 1.5;
}
.customs li::before { content: '◈'; position: absolute; left: 0; color: var(--accent); }

.greeting {
  margin-top: 30px; padding: 20px; border-radius: 18px; text-align: center;
  border: 1px solid var(--surface-border); background: var(--accent-soft);
  font-family: var(--display); font-style: italic; font-size: 21px; color: var(--accent);
}
.sheet-note { color: var(--text-faint); font-size: 12px; margin-top: 9px; }

@media (max-width: 620px) {
  .sheet {
    top: auto; left: 0; height: 88vh; width: 100%;
    border-left: 0; border-top: 1px solid var(--surface-border);
    border-radius: 26px 26px 0 0;
    transform: translateY(100%);
  }
  .sheet-scroll { padding: 30px 22px 50px; }
}

/* ── the deity portrait ──────────────────────────────────────────────── */

.deity-modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 22px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0; transition: opacity 240ms ease;
}
.deity-modal.is-open { opacity: 1; }
.deity-card {
  position: relative; width: min(520px, 100%);
  max-height: 84vh; overflow-y: auto;
  padding: 32px; border-radius: 24px;
  border: 1px solid var(--surface-border);
  background: color-mix(in srgb, var(--bg) 82%, var(--surface));
  transform: translateY(12px); transition: transform 240ms ease;
}
.deity-modal.is-open .deity-card { transform: none; }
.deity-card h2 { font-size: 34px; margin: 4px 0 2px; }
.deity-card .deity-epithet { font-family: var(--display); font-style: italic; font-size: 17px; margin-bottom: 16px; color: var(--text-dim); }
.deity-body { margin-top: 18px; color: var(--text); font-size: 15px; line-height: 1.62; }
.deity-aka { margin-top: 14px; color: var(--text-faint); font-size: 13px; }
.deity-close {
  position: absolute; top: 14px; right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--surface-border); color: var(--text-dim); font-size: 13px;
}
.deity-close:hover { color: var(--accent); border-color: var(--accent); }

/* ── legal pages ─────────────────────────────────────────────────────── */

.legal { max-width: 760px; margin: 0 auto; padding: 60px 24px 40px; }
.legal h1 { font-size: clamp(38px, 5vw, 54px); margin-bottom: 8px; }
.legal .updated { color: var(--text-faint); font-size: 13.5px; margin-bottom: 34px; }
.legal h2 { font-size: 26px; margin: 36px 0 10px; }
.legal p, .legal li { color: var(--text-dim); font-size: 15.5px; line-height: 1.68; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--accent); }
.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em; padding: 1px 6px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
}
.legal .back { display: inline-block; margin-bottom: 24px; color: var(--accent); text-decoration: none; font-size: 14px; }
.legal .back:hover { text-decoration: underline; }
.legal .summary {
  padding: 20px 24px; border-radius: var(--r); margin-bottom: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: var(--accent-soft); color: var(--text-dim); font-size: 15px; line-height: 1.6;
}
.legal .summary strong { color: var(--accent); }
.legal .num {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; margin-right: 12px; border-radius: 50%;
  font-family: var(--body); font-size: 13px; font-weight: 600;
  color: var(--accent); border: 1px solid var(--surface-border); background: var(--accent-soft);
  vertical-align: 3px;
}
