/* ═══════ CATHEDRAL — Clanker Church brand layer ═══════════════════════
   The lab dressed as a chapel, rendered professionally: warm near-black
   ground, bone ink, gold hairlines, one push-yellow signal. Square
   corners, no shadows, no gradients.

   Opt in with <body class="cathedral">. Nothing here applies to pages
   that do not carry the class, so legacy pages keep their own skin.

   Marks live in /marks.svg as <symbol>s:
     mark-chapel · mark-monstrance · mark-blade · mark-seal
   ─────────────────────────────────────────────────────────────────── */

body.cathedral {
  --void: #0b0705;
  --panel: #0f0b07;
  --parch: #14100c;
  --line: #241c14;
  --ink: #e3dccd;
  --dim: #a9b4ad;
  --faint: #7d8a83;
  --gold: #c9a227;
  --signal: #e8ff6a;
  --display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  background: var(--void);
  color: var(--ink);
  font-family: var(--mono);
}

body.cathedral ::selection { background: #3a2f16; color: #fff6dc; }

/* ── masthead ─────────────────────────────────────────────────────── */
.cc-mast {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}
.cc-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 0 !important;
  text-decoration: none;
  min-width: 0;
}
.cc-mark {
  width: 38px;
  height: 38px;
  flex: none;
  color: var(--ink);
  display: block;
}
.cc-word {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: .015em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.cc-word em {
  font-style: normal;
  color: var(--gold);
}
.cc-brand:hover .cc-word { color: #fff6dc; }

.cc-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.cc-nav a {
  border: 0 !important;
  color: var(--dim);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent !important;
}
.cc-nav a:hover,
.cc-nav a:focus-visible {
  color: var(--signal);
  border-bottom-color: var(--signal) !important;
  outline: none;
}
.cc-nav a.on { color: var(--ink); border-bottom-color: var(--gold) !important; }

/* small mark used as a section or link ornament */
.cc-sigil {
  width: 15px;
  height: 15px;
  color: var(--gold);
  vertical-align: -2px;
  margin-right: 7px;
  flex: none;
}

/* ── type ─────────────────────────────────────────────────────────── */
body.cathedral h1,
body.cathedral h2,
body.cathedral h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--ink);
}
body.cathedral h2 {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  font-size: 1.42rem;
  letter-spacing: .05em;
}
body.cathedral h2 .idx { color: var(--gold); }
body.cathedral p { color: var(--ink); }
body.cathedral .sub,
body.cathedral .lede { color: var(--dim); }

body.cathedral a {
  color: var(--ink);
  border-bottom: 1px solid #4a3a28;
  text-decoration: none;
}
body.cathedral a:hover,
body.cathedral a:focus-visible {
  color: var(--gold);
  border-bottom-color: var(--gold);
  outline: none;
}

/* ── surfaces: square, hairline, no glow ──────────────────────────── */
body.cathedral .banner,
body.cathedral .mixwrap,
body.cathedral .card,
body.cathedral .door,
body.cathedral .nwin,
body.cathedral .playbar,
body.cathedral .pchip {
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--panel);
  border-color: var(--line);
}
body.cathedral img { border-radius: 0 !important; border-color: var(--line); }
body.cathedral code { border-radius: 0 !important; }
body.cathedral blockquote { border-left-color: #4a3a28; }
body.cathedral blockquote::before { content: none !important; }

/* the old kicker row is replaced by the masthead on converted pages */
body.cathedral .kicker { display: none; }
body.cathedral .kicker::before { content: none; }

/* ── footer ───────────────────────────────────────────────────────── */
.cc-foot {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.cc-foot .cc-word { font-size: 1rem; letter-spacing: 0; text-transform: none; }
.cc-foot span { color: var(--faint); }
.cc-foot a { color: var(--dim); border-bottom: 0 !important; }
.cc-foot a:hover { color: var(--gold); }

@media (max-width: 640px) {
  .cc-mast { gap: 12px; padding-top: 16px; margin-bottom: 24px; }
  .cc-mark { width: 32px; height: 32px; }
  .cc-word { font-size: 1.3rem; }
  .cc-nav { gap: 14px; font-size: .66rem; width: 100%; margin-left: 0; }
}

/* ── hero ─────────────────────────────────────────────────────────── */
.cc-hero {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding: 18px 0 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.cc-hero-mark {
  width: 168px;
  height: 168px;
  color: var(--ink);
  opacity: .92;
  display: block;
}
.cc-eyebrow {
  font-size: .68rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 2px 0 14px;
}
.cc-hero h1.cc-claim {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: .004em;
  color: #f4ecdc;
  margin: 0 0 14px;
  max-width: 22ch;
}
.cc-lede {
  font-size: .95rem;
  line-height: 1.7;
  color: var(--dim);
  max-width: 62ch;
  margin: 0 0 16px;
}
.cc-hero-links {
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .cc-hero { grid-template-columns: 1fr; gap: 16px; }
  .cc-hero-mark { width: 96px; height: 96px; }
}

/* ── the retro window block, calmed down ──────────────────────────── */
body.cathedral .wired {
  --wf: #e3dccd;
  --wd: #a9b4ad;
  --wr: #c9a227;
  --wl: #241c14;
  font-family: var(--mono);
}
body.grimoire-index.cathedral .wired .wtop h2,
body.cathedral .wtop h2 {
  font-family: var(--display) !important;
  font-size: 1.5rem !important;
  letter-spacing: .03em !important;
  text-transform: none !important;
  color: #f4ecdc !important;
  font-weight: 500 !important;
}
body.cathedral .wtop .lay {
  font-size: .64rem;
  letter-spacing: .22em;
  color: var(--gold);
}
body.cathedral .wtop .now {
  font-size: .64rem;
  letter-spacing: .14em;
  color: var(--faint);
}
body.cathedral .cur { color: var(--gold); }
body.cathedral .nwin {
  box-shadow: none;
  background: #0f0b07;
  border-color: var(--line);
}
body.cathedral .nwin .tb {
  background: #14100c;
  border-bottom-color: var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .1em;
}
body.cathedral .nwin .tb i { background: var(--gold); }
body.cathedral .nwin b {
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: .01em;
  color: #f4ecdc;
}
body.cathedral .nwin .d { font-size: .78rem; color: var(--dim); }
body.cathedral .nwin .shot::after {
  background: linear-gradient(180deg, transparent 55%, rgba(11,7,5,.72));
}
body.cathedral .nwin .shot img { filter: grayscale(.9) contrast(1.02) brightness(.82); }
body.cathedral .nwin:hover, body.cathedral .nwin:focus-visible { border-color: var(--gold); }
body.cathedral .nwin:hover .shot img { filter: none; }
body.cathedral .ls {
  background: #0f0b07;
  border-color: var(--line);
  font-size: .84rem;
}
body.cathedral .ls > div { border-bottom-color: #1b1410; }
body.cathedral .ls .dir { color: var(--gold); }
body.cathedral .ls a { color: var(--ink); border-bottom-color: #4a3a28; }
body.cathedral .ls a:hover { color: #fff6dc; border-bottom-color: var(--gold); }

/* the old theme painted the first letter of h1 red; the claim stays bone */
body.cathedral h1::first-letter,
body.cathedral .cc-claim::first-letter { color: inherit; }
body.cathedral .wtop { align-items: center; }

/* when the masthead has to wrap (narrow page columns), move the nav under
   the wordmark and flush-left instead of floating it to the right edge */
@media (max-width: 920px) {
  .cc-nav { margin-left: 0; width: 100%; row-gap: 10px; }
}
