/* ==========================================================================
   EPOCH — public site design system  ·  "Deep Time, Gilded"
   Cinematic obsidian + molten gold (Direction D) welded to documentary
   gravitas: classical serif, parchment ink, an era timeline with real years
   (Direction A). Bespoke, self-contained — no external CDN / font hosts.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* --- palette: warm obsidian, molten gold, parchment ink --- */
  --bg:        #0a0806;
  --bg-2:      #0d0a07;
  --surface:   #14100b;
  --surface-2: #1b150e;
  --line:      #2a2119;
  --line-2:    #3a2e22;

  --ink:       #f4ecd8;   /* parchment */
  --ink-dim:   #ddd0b5;
  --mut:       #a99c82;
  --faint:     #7d7259;

  --gold:      #e0b978;
  --gold-hi:   #efd7a0;
  --gold-deep: #9c7a34;
  --ox:        #a24634;   /* oxblood — conflict / ruin accent */

  /* era-ladder colours — the six real Epoch eras, kept as restrained accents */
  --era-bronze:     #b87333;
  --era-iron:       #9aa0aa;
  --era-classical:  #d8b24a;
  --era-sail:       #4f9bab;
  --era-industrial: #c26a3a;
  --era-modern:     #6cc5e8;

  /* type */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --maxw: 1160px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 44px); }

/* serif display defaults */
h1, h2, h3, .serif { font-family: var(--serif); }

/* letterspaced small-caps eyebrow — the documentary voice */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 12px; letter-spacing: .34em;
  text-transform: uppercase; color: var(--gold); font-weight: 600;
}
.eyebrow--pill { border: 1px solid rgba(224,185,120,.3); padding: 7px 15px; border-radius: 3px;
  background: rgba(224,185,120,.05); }
.eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 10px var(--gold); animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.rule-gold { width: 90px; height: 1px; margin: 26px 0;
  background: linear-gradient(90deg, var(--gold), transparent); }
.rule-gold.center { margin-left: auto; margin-right: auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4vw, 46px); line-height: 1.1; margin: 16px 0 14px;
  font-weight: 600; letter-spacing: -.005em; }
.section-head p { color: var(--mut); font-size: clamp(15px, 1.5vw, 18px); margin: 0; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 30px;
  border-radius: 3px; font-family: var(--serif); font-size: 15px; font-weight: 600;
  letter-spacing: .04em; cursor: pointer; border: 1px solid transparent;
  transition: transform .18s, box-shadow .18s, background .18s, color .18s, border-color .18s; }
.btn-primary { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1c1305;
  box-shadow: 0 12px 34px -12px rgba(224,185,120,.6); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 40px -12px rgba(224,185,120,.8); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav { position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--serif);
  font-weight: 700; font-size: 19px; letter-spacing: .12em; }
.brand .mark { width: 26px; height: 26px; }
.brand .codetag { font-family: var(--sans); font-size: 9px; letter-spacing: .16em; color: var(--faint);
  border: 1px solid var(--line-2); padding: 3px 6px; border-radius: 3px; text-transform: uppercase; font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-family: var(--serif); font-size: 15px; color: var(--mut); transition: color .15s; }
.nav-links a:hover { color: var(--ink); }
.nav-links .btn { padding: 9px 20px; }
@media (max-width: 700px) { .nav-links a:not(.btn) { display: none; } }

/* ==========================================================================
   HERO — the gilded reveal
   ========================================================================== */
.hero { position: relative; overflow: hidden; text-align: center;
  min-height: min(92vh, 860px); display: flex; align-items: center;
  background: radial-gradient(115% 90% at 50% 14%, #1d1305 0%, #0c0805 52%, #070504 100%); }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.rays { position: absolute; inset: 0;
  background: conic-gradient(from 205deg at 50% -6%, transparent, rgba(224,185,120,.11), transparent 26%,
              transparent 74%, rgba(224,185,120,.08), transparent);
  animation: sway 16s ease-in-out infinite alternate; }
@keyframes sway { from { transform: translateX(-2%); } to { transform: translateX(2%); } }
.glow { position: absolute; left: 50%; top: 4%; width: 720px; height: 420px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(224,185,120,.22), transparent 72%); filter: blur(8px); }
/* faint horizontal strata — a quiet nod to deep time / geological layers */
.strata { position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: repeating-linear-gradient(0deg, rgba(224,185,120,.05) 0 1px, transparent 1px 46px);
  -webkit-mask-image: linear-gradient(0deg, #000, transparent); mask-image: linear-gradient(0deg, #000, transparent); }
.vignette { position: absolute; inset: 0;
  background: radial-gradient(115% 105% at 50% 32%, transparent 40%, rgba(0,0,0,.82) 100%); }
.grain { position: absolute; inset: 0; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"); }

.hero-inner { position: relative; z-index: 2; margin: 0 auto; max-width: 820px;
  padding-top: 44px; padding-bottom: 44px; }
.wordmark { font-size: clamp(78px, 15vw, 176px); line-height: .86; margin: 22px 0 0;
  font-weight: 600; letter-spacing: .04em;
  background: linear-gradient(178deg, #fffdf7 4%, var(--gold-hi) 46%, var(--gold) 66%, var(--gold-deep) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 90px rgba(224,185,120,.3); }
.hero .codeline { font-family: var(--serif); font-size: 13px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--faint); margin-top: 18px; }
.hero .tagline { font-family: var(--serif); font-style: italic; font-size: clamp(18px, 2vw, 24px);
  line-height: 1.55; color: var(--ink-dim); max-width: 620px; margin: 0 auto; }
.hero .tagline b { font-style: normal; font-weight: 600; color: #fff; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.cta-note { margin-top: 18px; font-size: 12.5px; color: var(--faint); letter-spacing: .02em; }
.scroll-hint { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  font-family: var(--serif); font-size: 10px; letter-spacing: .4em; color: var(--mut); opacity: .5; z-index: 2; }

/* ---- era timeline motif (Direction A's device, gilded) ---- */
.timeline { display: flex; justify-content: center; gap: 0; max-width: 760px; margin: 0 auto;
  position: relative; }
.timeline::before { content: ""; position: absolute; top: 5px; left: 6%; right: 6%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224,185,120,.5), transparent); }
.timeline .e { flex: 1; position: relative; padding-top: 20px;
  font-family: var(--serif); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.timeline .e::after { content: ""; position: absolute; top: 1px; left: 50%; width: 9px; height: 9px;
  margin-left: -4.5px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--c, var(--gold));
  box-shadow: 0 0 8px -1px var(--c, var(--gold)); }
.timeline .e .yr { display: block; margin-top: 5px; font-size: 10.5px; font-style: italic;
  letter-spacing: 0; text-transform: none; color: var(--faint); }
@media (max-width: 640px) { .timeline .e { font-size: 9.5px; } .timeline .e .yr { display: none; } }

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { padding: clamp(66px, 9vw, 116px) 0; }
.section--tint { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* pillars + systems share the card look */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.systems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; transition: border-color .2s, transform .2s, background .2s; }
.pillar:hover { border-color: var(--line-2); transform: translateY(-3px); }
.pillar .ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 8px;
  font-size: 22px; color: var(--c, var(--gold)); margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--c, var(--gold)) 42%, transparent);
  background: color-mix(in srgb, var(--c, var(--gold)) 11%, transparent); }
.pillar h3 { margin: 0 0 9px; font-size: 19px; font-weight: 600; letter-spacing: -.005em; }
.pillar p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--mut); }
.pillar p i { color: var(--ink-dim); }
@media (max-width: 860px) { .pillars, .systems { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .pillars, .systems { grid-template-columns: 1fr; } }

/* era showcase */
.eras { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.era-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 24px 18px 20px; overflow: hidden; transition: transform .2s, border-color .2s; }
.era-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 55%, var(--line)); }
.era-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--c); }
.era-card::after { content: ""; position: absolute; inset: 0; opacity: .1; pointer-events: none;
  background: radial-gradient(80% 60% at 50% 0%, var(--c), transparent 70%); }
.era-card .num { font-family: var(--serif); font-size: 13px; letter-spacing: .16em; color: var(--c); font-weight: 700; }
.era-card .yr { font-size: 10.5px; font-style: italic; color: var(--faint); float: right; margin-top: 3px; }
.era-card h3 { margin: 8px 0 7px; font-size: 20px; font-weight: 600; position: relative; }
.era-card p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--mut); position: relative; }
@media (max-width: 900px) { .eras { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .eras { grid-template-columns: repeat(2, 1fr); } }

/* gallery — warm relief plates */
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 132px; gap: 14px; }
.shot { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.shot .cap { position: absolute; left: 14px; bottom: 11px; font-family: var(--serif); font-size: 12px;
  letter-spacing: .08em; color: var(--ink); z-index: 2; text-shadow: 0 1px 10px rgba(0,0,0,.9); }
.shot::after { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.6)); }
.shot--wide { grid-column: span 3; } .shot--tall { grid-column: span 3; grid-row: span 2; }
.shot--sq { grid-column: span 2; }
.map-fill { position: absolute; inset: 0; }
.map-fill::before { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(224,185,120,.12) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(224,185,120,.12) 1px, transparent 1px);
  background-size: 28px 28px; opacity: .45; }
.map-fill.f1 { background: radial-gradient(60% 80% at 32% 60%, rgba(120,95,55,.75), #16100a 72%); }
.map-fill.f2 { background: radial-gradient(60% 70% at 60% 42%, rgba(162,70,52,.55), #180f0b 72%); }
.map-fill.f3 { background: radial-gradient(70% 70% at 50% 48%, rgba(79,155,171,.4), #0c1417 72%); }
.map-fill.f4 { background: radial-gradient(60% 80% at 42% 50%, rgba(216,178,74,.5), #17120a 72%); }
.map-fill.f5 { background: radial-gradient(70% 70% at 55% 42%, rgba(224,185,120,.42), #16110a 72%); }
@media (max-width: 760px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 120px; }
  .shot--wide, .shot--tall, .shot--sq { grid-column: span 1; grid-row: span 1; }
}

/* ==========================================================================
   DEVLOG + BLOG
   ========================================================================== */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; transition: border-color .2s, transform .2s; height: 100%; }
.post-card:hover { border-color: var(--gold-deep); transform: translateY(-3px); }
.post-card .post-cover { display: block; width: calc(100% + 48px); height: 168px; object-fit: cover;
  margin: -24px -24px 18px; border-radius: var(--radius) var(--radius) 0 0; }
.article-cover { width: 100%; max-height: 460px; object-fit: cover; border-radius: 14px;
  border: 1px solid var(--line); margin: 4px 0 34px; }

.post-card .tag { align-self: flex-start; font-family: var(--serif); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold); border: 1px solid rgba(224,185,120,.3);
  padding: 4px 10px; border-radius: 3px; background: rgba(224,185,120,.05); margin-bottom: 16px; }
.post-card h3 { margin: 0 0 10px; font-size: 21px; font-weight: 600; line-height: 1.22; }
.post-card p { margin: 0 0 18px; font-size: 14px; color: var(--mut); line-height: 1.6; }
.post-card .meta { margin-top: auto; font-size: 12.5px; color: var(--faint); display: flex; gap: 8px; align-items: center; }
.post-card .meta .who { color: var(--ink-dim); }
@media (max-width: 820px) { .posts { grid-template-columns: 1fr; } }

/* wiki */
.wiki-group { margin-bottom: 44px; }
.wiki-group:last-child { margin-bottom: 0; }
.wiki-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.wiki-tag { font-size: 11px; color: var(--mut); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 2px 10px; letter-spacing: .02em; }

.empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 52px 28px; text-align: center; background: var(--surface); }
.empty h3 { margin: 0 0 10px; font-size: 22px; font-weight: 600; }
.empty p { margin: 0; color: var(--mut); font-size: 15px; }

.blog-hero { padding: clamp(56px, 9vw, 104px) 0 26px; border-bottom: 1px solid var(--line);
  background: radial-gradient(115% 100% at 50% 0%, #1a1206, var(--bg) 62%); text-align: center; }
.blog-hero h1 { font-size: clamp(38px, 5.5vw, 60px); font-weight: 600; margin: 16px 0 12px; letter-spacing: -.01em; }
.blog-hero p { color: var(--mut); max-width: 560px; margin: 0 auto; font-size: 16px; }

.featured { display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; background: var(--surface); margin-bottom: 42px; }
.featured .art { position: relative; min-height: 250px; background: radial-gradient(70% 90% at 40% 30%, rgba(224,185,120,.4), #16110a 72%); }
.featured .body { padding: 38px; display: flex; flex-direction: column; }
.featured .body h2 { font-size: clamp(24px, 2.8vw, 32px); margin: 14px 0 12px; line-height: 1.2; font-weight: 600; }
.featured .body p { color: var(--mut); margin: 0 0 22px; font-size: 15px; }
@media (max-width: 760px) { .featured { grid-template-columns: 1fr; } }

/* single post — a reading page */
.article { max-width: min(1500px, 92vw); margin: 0 auto; padding: clamp(44px, 7vw, 84px) clamp(20px, 5vw, 44px); }
.article .kicker { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.article h1 { font-size: clamp(32px, 4.8vw, 52px); line-height: 1.12; font-weight: 600; letter-spacing: -.01em; margin: 0 0 20px; }
.article .byline { display: flex; align-items: center; gap: 14px; color: var(--mut); font-size: 14px;
  padding-bottom: 28px; margin-bottom: 34px; border-bottom: 1px solid var(--line); }
.article .byline .avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); background: linear-gradient(180deg, var(--gold-hi), var(--gold-deep)); color: #1c1305; font-weight: 700; font-size: 16px; }
.article .byline .who b { color: var(--ink); font-weight: 600; }

/* long-form reading uses the serif — documentary feel */
.prose { font-family: var(--serif); font-size: 19px; line-height: 1.8; color: var(--ink-dim); }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: 28px; font-weight: 600; margin: 46px 0 16px; color: var(--ink); letter-spacing: -.01em; }
.prose h3 { font-size: 22px; font-weight: 600; margin: 36px 0 12px; color: var(--ink); }
.prose p { margin: 0 0 22px; }
.prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(224,185,120,.4); }
.prose a:hover { text-decoration-color: var(--gold); }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 26px; }
.prose li { margin: 7px 0; }
.prose img { border-radius: 8px; border: 1px solid var(--line); margin: 26px 0; }
.prose blockquote { margin: 26px 0; padding: 10px 22px; border-left: 3px solid var(--gold); color: var(--ink-dim);
  font-style: italic; background: rgba(224,185,120,.05); border-radius: 0 6px 6px 0; }
.prose code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8em; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.prose pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px;
  overflow-x: auto; margin: 0 0 24px; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.more-devlogs { border-top: 1px solid var(--line); padding-top: 36px; margin-top: 54px; }

/* ==========================================================================
   CTA BAND + FOOTER
   ========================================================================== */
.cta-band { position: relative; overflow: hidden; text-align: center; padding: clamp(70px, 10vw, 120px) 0;
  background: radial-gradient(90% 130% at 50% 0%, #1d1305, var(--bg) 60%); border-top: 1px solid var(--line); }
.cta-band .timeline { margin: 0 auto 34px; }
.cta-band h2 { font-size: clamp(30px, 4.4vw, 50px); font-weight: 600; margin: 0 0 16px; letter-spacing: -.01em; }
.cta-band p { color: var(--mut); max-width: 540px; margin: 0 auto 30px; font-size: 16px; }
.cta-band .cta-row { justify-content: center; }

.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 50px 0 36px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer .brand { margin-bottom: 14px; }
.footer .tag { color: var(--faint); font-size: 13.5px; max-width: 340px; line-height: 1.65; font-family: var(--serif); font-style: italic; }
.footer nav { display: flex; gap: 52px; flex-wrap: wrap; }
.footer nav h4 { font-family: var(--serif); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 13px; }
.footer nav a { display: block; color: var(--mut); font-size: 14px; margin-bottom: 9px; transition: color .15s; }
.footer nav a:hover { color: var(--gold); }
.footer-base { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--faint); font-size: 12.5px; }

/* ==========================================================================
   LOGIN (editor access)
   ========================================================================== */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(115% 90% at 50% 8%, #1d1305 0%, #0c0805 55%, #070504 100%); }
.login-wrap { width: 100%; max-width: 400px; }
.login-brand { display: flex; align-items: center; gap: 11px; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: .14em; margin-bottom: 26px; }
.login-card { background: rgba(20,16,11,.7); border: 1px solid var(--line); border-radius: 14px;
  padding: 34px 30px; backdrop-filter: blur(8px); box-shadow: 0 30px 80px -40px rgba(0,0,0,.9); }
.login-card h1 { font-size: 30px; font-weight: 600; margin: 12px 0 10px; letter-spacing: -.01em; }
.login-sub { color: var(--mut); font-size: 14px; margin: 0 0 24px; line-height: 1.55; }
.login-card label { display: block; font-family: var(--serif); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--mut); margin: 16px 0 7px; }
.login-card input { width: 100%; background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 12px 14px; color: var(--ink); font-size: 15px; font-family: var(--sans);
  transition: border-color .15s, box-shadow .15s; }
.login-card input:focus { outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(224,185,120,.14); }
.login-card .btn { width: 100%; justify-content: center; margin-top: 24px; }
.login-error { background: rgba(162,70,52,.14); border: 1px solid rgba(162,70,52,.5); color: #f0c9c0;
  border-radius: 7px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 4px; }
.login-back { display: block; text-align: center; margin-top: 22px; color: var(--faint); font-size: 13px; }
.login-back:hover { color: var(--gold); }

/* ==========================================================================
   WIKI — a Wikipedia-style article, gilded
   Looks AND functions like an encyclopedia page: a floated infobox, an in-flow
   numbered Contents box (auto-built + scroll-spy), hatnotes, ruled serif section
   heads, bordered wikitables, and a references list — all in the obsidian /
   molten-gold / parchment palette. SCOPED under .wiki-article / .wiki-index so
   the blog's shared .prose style is untouched.
   ========================================================================== */

/* --- the article is a single reading column; the infobox floats within it --- */
.wiki-article { max-width: 940px; margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) clamp(20px, 5vw, 44px) clamp(60px, 8vw, 96px); }
.wiki-article .kicker { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.wiki-article h1 { font-family: var(--serif); font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.12; font-weight: 600; letter-spacing: -.01em; margin: 0;
  padding-bottom: 14px; border-bottom: 2px solid var(--line-2); }
.wiki-article .byline { color: var(--faint); font-size: 13px; margin: 12px 0 4px; }

/* hatnote — the italic "this article is about…" line under the title */
.wiki-article .hatnote { font-family: var(--serif); font-style: italic; color: var(--mut);
  font-size: 15px; margin: 18px 0; padding-left: 26px; }

/* ruled serif section heads — the encyclopedia signature */
.wiki-article .prose { font-size: 17.5px; line-height: 1.78; }
.wiki-article .prose > *:first-child { margin-top: 0; }
.wiki-article .prose h2 { font-size: 25px; margin: 40px 0 14px; padding-bottom: 8px; clear: none;
  border-bottom: 1px solid var(--line); scroll-margin-top: 82px; }
.wiki-article .prose h3 { font-size: 20px; margin: 28px 0 10px; scroll-margin-top: 82px; }
.wiki-article .prose h2 .anchor, .wiki-article .prose h3 .anchor {
  opacity: 0; margin-left: 9px; color: var(--gold-deep); font-weight: 400;
  text-decoration: none; transition: opacity .15s; }
.wiki-article .prose h2:hover .anchor, .wiki-article .prose h3:hover .anchor { opacity: 1; }

/* wikitables — bordered, header-tinted, tabular numerics */
.wiki-article .prose table { display: block; width: max-content; max-width: 100%; overflow-x: auto;
  border-collapse: collapse; font-family: var(--sans); font-size: 13.5px; line-height: 1.5;
  margin: 22px 0; border: 1px solid var(--line-2); }
.wiki-article .prose thead th { background: var(--surface); color: var(--ink); font-weight: 600; }
.wiki-article .prose th, .wiki-article .prose td { border: 1px solid var(--line);
  padding: 8px 12px; text-align: left; vertical-align: top; }
.wiki-article .prose td[align="right"], .wiki-article .prose th[align="right"] {
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wiki-article .prose td[align="center"], .wiki-article .prose th[align="center"] { text-align: center; }
.wiki-article .prose tbody tr:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.wiki-article .prose caption { caption-side: top; text-align: left; color: var(--mut);
  font-family: var(--sans); font-size: 12.5px; padding-bottom: 8px; }

/* fenced blocks read as definitions / formulas; mark = gilded highlight */
.wiki-article .prose pre { border-left: 3px solid var(--gold-deep); font-size: 13.5px; line-height: 1.6; }
.wiki-article .prose mark { background: rgba(224,185,120,.22); color: var(--ink);
  padding: 0 .25em; border-radius: 2px; }

/* citation superscripts + a references list (authored in-body) */
.wiki-article .prose sup { font-size: .72em; }
.wiki-article .prose .refs, .wiki-article .prose .wiki-refs { font-size: 14px; color: var(--mut); }
.wiki-article .prose .refs li, .wiki-article .prose .wiki-refs li { margin: 5px 0; }

/* ---- the floated infobox (authored at the top of the article body) ---- */
.wiki-article .infobox { float: right; width: 310px; margin: 6px 0 22px 30px; clear: right;
  border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden;
  background: var(--surface); font-family: var(--sans); font-size: 12.7px; line-height: 1.5; }
.wiki-article .infobox .ib-title { font-family: var(--serif); font-size: 17px; line-height: 1.25;
  text-align: center; padding: 13px 14px; color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(224,185,120,.16), rgba(224,185,120,.04));
  border-bottom: 1px solid var(--line-2); }
.wiki-article .infobox .ib-sub { text-align: center; font-style: italic; color: var(--mut);
  font-family: var(--serif); font-size: 13px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.wiki-article .infobox .ib-head { text-align: center; font-family: var(--serif); font-weight: 600;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold);
  padding: 8px 14px; background: rgba(224,185,120,.06); }
.wiki-article .infobox table { width: 100%; border-collapse: collapse; display: table; margin: 0; border: 0; }
.wiki-article .infobox th, .wiki-article .infobox td { text-align: left; vertical-align: top;
  padding: 8px 14px; border: 0; border-top: 1px solid var(--line); font-size: 12.7px; }
.wiki-article .infobox tr:first-child th, .wiki-article .infobox tr:first-child td { border-top: 0; }
.wiki-article .infobox th { width: 40%; color: var(--faint); font-weight: 600; }
.wiki-article .infobox td { color: var(--ink-dim); }
.wiki-article .infobox code { font-size: 11.5px; }

/* ---- the Contents box (built by JS, inserted before the first section) ---- */
.wiki-toc { display: inline-block; min-width: 260px; max-width: 100%; vertical-align: top;
  margin: 6px 0 26px; padding: 12px 20px 14px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 8px; }
.wiki-toc .toc-h { font-family: var(--serif); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold); text-align: center; margin-bottom: 8px; }
.wiki-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.wiki-toc li { margin: 0; }
.wiki-toc a { display: block; padding: 3px 0 3px 10px; color: var(--mut); font-size: 13.5px;
  border-left: 2px solid transparent; transition: color .15s, border-color .15s; }
.wiki-toc a:hover { color: var(--gold); }
.wiki-toc a.lvl-2 { counter-increment: toc; counter-reset: tocsub; }
.wiki-toc a.lvl-2::before { content: counter(toc) "\00a0\00a0"; color: var(--faint);
  font-variant-numeric: tabular-nums; }
.wiki-toc a.lvl-3 { padding-left: 30px; font-size: 12.8px; counter-increment: tocsub; }
.wiki-toc a.lvl-3::before { content: counter(toc) "." counter(tocsub) "\00a0\00a0"; color: var(--faint);
  font-variant-numeric: tabular-nums; }
.wiki-toc a.active { color: var(--gold); border-left-color: var(--gold); }

@media (max-width: 700px) {
  .wiki-article .infobox { float: none; width: auto; margin: 0 0 24px; }
  .wiki-toc { display: block; }
}

/* --- wiki index (the /wiki portal) --- */
.wiki-index { max-width: 920px; margin: 0 auto; }
.wiki-cat { margin-bottom: 44px; }
.wiki-cat:last-child { margin-bottom: 0; }
.wiki-cat .cat-h { display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--ink);
  margin: 0 0 6px; padding-bottom: 9px; border-bottom: 1px solid var(--line-2); }
.wiki-cat .cat-h .cnt { font-family: var(--sans); font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); }
.wiki-cat ul { list-style: none; margin: 0; padding: 0; columns: 2 250px; column-gap: 46px; }
.wiki-cat li { break-inside: avoid; }
.wiki-cat a.entry { display: flex; align-items: baseline; gap: 12px; padding: 12px 2px;
  border-bottom: 1px solid var(--line); color: var(--ink-dim); transition: color .15s; }
.wiki-cat a.entry:hover { color: var(--gold); }
.wiki-cat a.entry .t { font-family: var(--serif); font-size: 16.5px; line-height: 1.3; }
.wiki-cat a.entry .m { margin-left: auto; font-size: 11.5px; color: var(--faint); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
