/* ═══════════════════════════════════════════════════════════════
   THE NOCTURNE DISPATCH — the midnight supplement.
   Indigo-violet night. Gold engraving. Aurora silk.
   Italiana display / Cinzel small caps / Spectral body.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --night: oklch(18% 0.045 305);
  --night-deep: oklch(14.5% 0.04 302);
  --veil: oklch(24% 0.05 304);
  --gold: oklch(78% 0.11 85);
  --gold-bright: oklch(87% 0.115 90);
  --gold-dim: oklch(66% 0.09 82);
  --gold-hair: oklch(78% 0.11 85 / 0.32);
  --aurora-teal: oklch(80% 0.11 190);
  --aurora-violet: oklch(72% 0.13 310);
  --text: oklch(93% 0.012 85);
  --text-dim: oklch(76% 0.02 90);
  --text-faint: oklch(60% 0.025 95);
  --display: "Italiana", serif;
  --caps: "Cinzel", serif;
  --body: "Spectral", Georgia, serif;
  --z-overlay: 60;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--text);
  font-family: var(--body);
  font-weight: 300;
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#skyCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  display: block;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: var(--night-deep);
  padding: 0.6rem 1rem; z-index: 99;
  font-family: var(--caps); font-size: 0.8rem; text-decoration: none;
}
.skip-link:focus { left: 0; }

a { color: var(--gold); }

/* ═══ Masthead ═══ */
.masthead-zone {
  position: relative; z-index: 2;
  text-align: center;
  padding: clamp(2.4rem, 6vw, 4.5rem) clamp(1rem, 3vw, 2.5rem) 0;
  max-width: 1100px; margin: 0 auto;
}
.mast-date {
  font-family: var(--caps);
  font-size: 0.72rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--text-faint);
}
.mast-ornament {
  color: var(--gold-dim);
  font-size: 0.85rem;
  letter-spacing: 0.6em;
  margin: 1rem 0 0.6rem;
}
.masthead {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.7rem, 7.5vw, 5.9rem);
  line-height: 1.04;
  letter-spacing: 0.015em;
  color: var(--text);
  text-wrap: balance;
}
.masthead .gold { color: var(--gold-bright); }
.mast-sub {
  margin-top: 0.9rem;
  font-family: var(--body); font-style: italic; font-weight: 300;
  font-size: clamp(0.95rem, 1.9vw, 1.15rem);
  color: var(--text-dim);
}
.mast-line {
  margin-top: 0.85rem;
  font-family: var(--caps);
  font-size: 0.68rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--text-faint);
}
.mast-rule {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.6rem auto 0;
  max-width: 560px;
}
.rule-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-hair) 30%, var(--gold-hair) 70%, transparent); }
.rule-gem { color: var(--gold); font-size: 0.6rem; }

/* ═══ Invocation ═══ */
.invocation {
  position: relative; z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.6rem) clamp(1rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(0, 1fr);
  gap: clamp(1.6rem, 4.5vw, 4rem);
  align-items: center;
}
.emblem-wrap { position: relative; }
.emblem-wrap img {
  display: block; width: 100%; height: auto;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 52%, transparent 74%);
  mask-image: radial-gradient(circle at 50% 50%, black 52%, transparent 74%);
  filter: saturate(1.05);
}
.inv-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  line-height: 1.12;
  text-wrap: balance;
  margin-bottom: 1.1rem;
}
.inv-title em { font-style: normal; color: var(--gold-bright); }
.invocation-copy p { max-width: 58ch; color: var(--text-dim); }
.invocation-copy p + p { margin-top: 0.85rem; }
.inv-feed {
  font-style: italic;
  color: var(--text-faint) !important;
  font-size: 0.92rem;
  border-top: 1px solid var(--gold-hair);
  padding-top: 0.9rem;
  margin-top: 1.2rem !important;
}

/* ═══ Rite of reading ═══ */
.rite {
  position: relative; z-index: 2;
  max-width: 900px; margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem) clamp(2.2rem, 5vw, 3.4rem);
  text-align: center;
}
.rite-title {
  font-family: var(--caps);
  font-weight: 500;
  font-size: 0.85rem; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
}
.rite-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}
.rite-list li {
  background: oklch(24% 0.05 304 / 0.35);
  border: 1px solid var(--gold-hair);
  padding: 1.3rem 1.2rem 1.35rem;
  display: grid; gap: 0.35rem;
}
.rite-word {
  font-family: var(--display);
  font-size: 1.55rem;
  color: var(--text);
}
.rite-body { color: var(--text-dim); font-size: 0.92rem; }

/* ═══ Constellation nav ═══ */
.constellations {
  position: relative; z-index: 2;
  max-width: 1100px; margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.3rem 0;
  border-top: 1px solid var(--gold-hair);
  border-bottom: 1px solid var(--gold-hair);
}
.constellations button {
  appearance: none; background: none; border: none;
  font-family: var(--caps); font-weight: 500;
  font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.85rem 1.05rem;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease-out;
}
.constellations button::before {
  content: "✦";
  position: absolute; left: -0.42em; top: 50%; transform: translateY(-52%);
  color: var(--gold-hair);
  font-size: 0.6rem;
}
.constellations button:first-child::before { content: ""; }
.constellations button:hover { color: var(--gold-bright); }
.constellations button[aria-pressed="true"] { color: var(--gold-bright); }
.constellations button[aria-pressed="true"]::after {
  content: "";
  position: absolute; left: 20%; right: 20%; bottom: 0;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}
.constellations button:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.constellations .const-count { color: var(--text-faint); letter-spacing: 0.05em; margin-left: 0.4em; font-size: 0.68rem; }

/* ═══ Briefs ═══ */
.night-paper {
  position: relative; z-index: 2;
  max-width: 1100px; margin: 0 auto;
  padding: clamp(1.8rem, 4.5vw, 3rem) clamp(1rem, 3vw, 2.5rem) 2rem;
}

.brief { margin-bottom: clamp(2.6rem, 6vw, 4.2rem); }
.brief-heavens {
  display: flex; align-items: center; gap: 1.1rem;
  margin-bottom: 0.4rem;
}
.brief-stars { flex: 1; height: 14px; opacity: 0.85; }
.brief-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  line-height: 1.05;
  text-align: center;
  flex: 0 1 auto;
}
.brief-sub {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
}
.brief-deck {
  font-style: italic;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 68ch;
}
.brief-updated {
  font-family: var(--caps);
  font-size: 0.62rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.omens {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.1rem;
}
.omen {
  position: relative;
  border: 1px solid var(--gold-hair);
  background: linear-gradient(160deg, oklch(24% 0.05 304 / 0.55), oklch(19% 0.045 303 / 0.35));
  padding: 1.25rem 1.3rem 1.15rem;
  overflow: hidden;
  transition: border-color 0.25s ease-out;
  --mx: 50%; --my: 50%;
}
.omen::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), oklch(78% 0.11 85 / 0.09), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
}
.omen:hover { border-color: oklch(78% 0.11 85 / 0.6); }
.omen:hover::before { opacity: 1; }
.omen-kicker {
  font-family: var(--caps);
  font-size: 0.62rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.55rem;
}
.omen-title {
  font-family: var(--body); font-weight: 500;
  font-size: 1.16rem; line-height: 1.4;
  letter-spacing: 0.002em;
  text-wrap: balance;
}
.omen-title a { color: var(--text); text-decoration: none; }
.omen-title a:hover { color: var(--gold-bright); }
.omen-title a:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
.omen-summary {
  margin-top: 0.6rem;
  font-size: 0.92rem; line-height: 1.65;
  color: var(--text-dim);
}
.omen-why {
  margin-top: 0.65rem;
  font-size: 0.88rem; line-height: 1.6;
  font-style: italic;
  color: var(--text-dim);
}
.omen-why strong {
  font-family: var(--caps); font-style: normal; font-weight: 600;
  font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold);
}
.omen-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid oklch(78% 0.11 85 / 0.16);
}
.omen-src {
  font-family: var(--caps); font-weight: 500;
  font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}
.omen-src:hover { color: var(--gold-bright); text-shadow: 0 0 12px oklch(87% 0.115 90 / 0.5); }
.omen-src:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.omen-signals { font-size: 0.8rem; font-style: italic; color: var(--text-faint); }
.omen-learn {
  appearance: none; cursor: pointer;
  background: none;
  border: 1px solid var(--gold-hair);
  border-radius: 999px;
  color: var(--gold);
  font-family: var(--caps); font-weight: 500;
  font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 0.34rem 0.85rem;
  margin-left: auto;
  transition: all 0.2s ease-out;
}
.omen-learn:hover { background: var(--gold); color: var(--night-deep); border-color: var(--gold); }
.omen-learn:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

.brief-empty {
  border: 1px dashed var(--gold-hair);
  padding: 1.2rem 1.4rem;
  text-align: center;
  font-style: italic;
  color: var(--text-dim);
  max-width: 66ch;
  margin: 0 auto;
}
.brief-empty strong {
  display: block;
  font-family: var(--caps); font-style: normal; font-weight: 500;
  font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

/* ═══ Colophon ═══ */
.midnight-colophon {
  position: relative; z-index: 2;
  max-width: 720px; margin: 0 auto;
  padding: 0.6rem clamp(1rem, 3vw, 2.5rem) 3.4rem;
  text-align: center;
  font-size: 0.9rem; font-style: italic;
  color: var(--text-dim);
}
.midnight-colophon p + p { margin-top: 0.35rem; }
.midnight-colophon .mast-ornament { margin-bottom: 1.1rem; }
.colophon-fine { margin-top: 1rem; font-size: 0.8rem; color: var(--text-faint); }

/* ═══ Star chart overlay ═══ */
.starchart { position: fixed; inset: 0; z-index: var(--z-overlay); display: grid; place-items: center; padding: 1.2rem; }
.starchart[hidden] { display: none; }
.starchart-backdrop {
  position: absolute; inset: 0;
  background: oklch(10% 0.03 300 / 0.72);
  backdrop-filter: blur(5px);
}
.starchart-panel {
  position: relative;
  width: min(840px, 100%);
  max-height: min(86vh, 860px);
  overflow-y: auto;
  background: linear-gradient(170deg, var(--veil), var(--night));
  border: 1px solid var(--gold-hair);
  box-shadow: 0 0 0 6px oklch(18% 0.045 305 / 0.85), 0 0 0 7px var(--gold-hair), 0 40px 110px oklch(0% 0 0 / 0.65);
  padding: clamp(1.4rem, 3.5vw, 2.6rem);
}
.starchart-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.9rem; }
.starchart-slug {
  font-family: var(--caps); font-weight: 500;
  font-size: 0.66rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold);
}
.starchart-close {
  appearance: none; cursor: pointer;
  background: none; border: 1px solid var(--gold-hair);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: var(--caps); font-size: 0.64rem; letter-spacing: 0.16em;
  padding: 0.35rem 0.85rem;
}
.starchart-close:hover { color: var(--gold-bright); border-color: var(--gold); }
.starchart-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1.12;
  text-wrap: balance;
  margin-bottom: 0.9rem;
}
.starchart-lede { color: var(--text-dim); line-height: 1.75; max-width: 66ch; }
.starchart-terms-title {
  font-family: var(--caps); font-weight: 500;
  font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold);
  border-top: 1px solid var(--gold-hair);
  margin-top: 1.5rem; padding-top: 1.3rem;
}
.starchart-term { margin-top: 1rem; }
.starchart-term dt {
  font-family: var(--display); font-size: 1.3rem;
  color: var(--text);
}
.starchart-term dd { margin-top: 0.3rem; font-size: 0.93rem; line-height: 1.65; color: var(--text-dim); }
.starchart-term .why { margin-top: 0.4rem; font-style: italic; }
.starchart-term .why strong {
  font-family: var(--caps); font-style: normal; font-weight: 600;
  font-size: 0.58rem; letter-spacing: 0.22em;
  color: var(--gold);
}

/* ═══ Responsive ═══ */
@media (max-width: 860px) {
  .invocation { grid-template-columns: 1fr; text-align: center; }
  .emblem-wrap { max-width: 330px; margin: 0 auto; }
  .invocation-copy p { margin-left: auto; margin-right: auto; }
  .brief-heavens { flex-direction: column; gap: 0.5rem; }
  .brief-stars { width: 70%; }
}

/* ═══ Motion hygiene ═══ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
