
:root {
  --bg-deep: #0a0a0c;
  --bg-surface: #111114;
  --bg-card: #18181c;
  --bg-card-hover: #1e1e24;
  --gold: #c9a84c;
  --gold-dim: #a8944a;
  --gold-bright: #e8c65a;
  --cream: #e8e0d0;
  --cream-dim: #b5ad9f;
  --text: #ddd8d0;
  --text-dim: #a8a295;
  --text-bright: #f0ebe2;
  --accent-red: #8b3a3a;
  --accent-red-bright: #c45454;
  --border: #2a2a30;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  font-size: 16px;

}

::selection {
  background: var(--gold);
  color: var(--bg-deep);
}

/* === HEADER === */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.logo span { color: var(--gold); }

nav { display: flex; align-items: center; gap: 2rem; }

nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.25s;
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.lang-toggle {
  display: flex;
  gap: 0.4rem;
  margin-left: 1rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--border);
}

@media (max-width: 720px) {
  .lang-toggle {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }
}

.lang-btn {
  text-decoration: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-family: var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
  border-radius: 2px;
}

.lang-btn.active {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
  font-weight: 600;
}

.lang-btn:hover:not(.active) {
  border-color: var(--gold-dim);
  color: var(--gold);
}

/* === HERO === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201, 168, 76, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(139, 58, 58, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(transparent, var(--bg-deep));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-label {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2rem;
  font-weight: 500;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.15;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.4s forwards;
}

.hero h1 em {
  font-style: italic;
  color: var(--gold);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 550px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.6s forwards;
}

.hero-line {
  width: 60px;
  height: 1px;
  background: var(--gold-dim);
  margin: 0 auto;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.8s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === SECTIONS === */
section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.2;
}

.divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, var(--gold-dim), transparent);
  max-width: 1200px;
  margin: 0 auto;
}

/* === ARTICLES GRID === */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2rem;
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--accent-red));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.article-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}

.article-card:hover::before {
  transform: scaleX(1);
}

.article-tag {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.article-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.35;
  margin-bottom: 0.8rem;
}

.article-card p {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.article-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  opacity: 0.8;
}

/* === FEATURED ARTICLE === */
.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 2.5rem;
  align-items: center;
}

.featured-visual {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.featured-visual::after {
  content: '南蛮';
  font-size: 5rem;
  color: var(--gold-dim);
  opacity: 0.15;
  font-family: serif;
}

.featured h3 { font-size: 1.8rem; }
.featured p { font-size: 0.95rem; }

/* === BIBLIOGRAPHY === */
.bib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.bib-item {
  padding: 1.5rem;
  border-left: 2px solid var(--gold-dim);
  background: var(--bg-card);
  transition: all 0.3s ease;
}

.bib-item:hover {
  border-left-color: var(--gold);
  background: var(--bg-card-hover);
}

.bib-author {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.bib-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--cream);
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.bib-detail {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.bib-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--gold-dim);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.25s;
}

.bib-link:hover { color: var(--gold-bright); }

/* === NEWSLETTER === */
.newsletter-section {
  text-align: center;
  padding: 6rem 2rem;
  position: relative;
}

.newsletter-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(201, 168, 76, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.newsletter-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
}

.newsletter-inner h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 1rem;
}

.newsletter-inner p {
  color: var(--text-dim);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.email-form {
  display: flex;
  gap: 0.5rem;
  max-width: 440px;
  margin: 0 auto;
}

.email-form input {
  flex: 1;
  padding: 0.85rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  border-radius: 2px;
  outline: none;
  transition: border-color 0.3s;
}

.email-form input::placeholder { color: var(--text-dim); }
.email-form input:focus { border-color: var(--gold-dim); }

.email-form button {
  padding: 0.85rem 1.8rem;
  background: var(--gold);
  color: var(--bg-deep);
  border: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.3s;
  white-space: nowrap;
}

.email-form button:hover {
  background: var(--gold-bright);
}

/* === ABOUT === */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1.2rem;
  color: var(--text);
  font-size: 0.95rem;
}

.about-sidebar {
  border-left: 1px solid var(--border);
  padding-left: 2rem;
}

.about-sidebar h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--cream);
  margin-bottom: 1rem;
}

.about-sidebar ul {
  list-style: none;
}

.about-sidebar li {
  padding: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(42, 42, 48, 0.5);
}

.about-sidebar li span {
  color: var(--gold-dim);
  margin-right: 0.5rem;
}

/* === FOOTER === */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-kanji {
  font-size: 2rem;
  color: var(--gold-dim);
  opacity: 0.3;
  margin-bottom: 1rem;
  font-family: serif;
}

footer p {
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

footer a {
  color: var(--gold-dim);
  text-decoration: none;
}

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

.footer-rss {
  margin-bottom: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.5;
}
.footer-rss:hover { opacity: 0.8; }

/* === MOBILE NAV === */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .featured {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 2rem;
  }
}

@media (max-width: 720px) {
  nav { display: none; }
  nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 12, 0.97);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
  }

  .menu-toggle { display: block; }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .email-form {
    flex-direction: column;
  }

  section { padding: 3rem 1.2rem; }
}

/* === SCROLL ANIMATIONS === */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === SKIP LINK === */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--gold);
  color: var(--bg-deep);
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 3px 0;
}

.skip-link:focus {
  left: 0;
}

/* === CARD LINK OVERLAY === */
.card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* === NEWSLETTER THANK YOU === */
.newsletter-thanks {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.2rem;
}

/* /articles/ and /topics/ index pages, extra rules layered on top of the homepage chrome */
.hero.hero-compact { min-height: 50vh; padding-top: 7rem; padding-bottom: 3rem; }
.index-nav { display: flex; gap: 2rem; justify-content: center; margin: 2rem 0 4rem; flex-wrap: wrap; }
.index-nav a { color: var(--gold); text-decoration: none; font-family: var(--font-display); font-size: 1.25rem; padding: 0.4rem 0; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.index-nav a:hover { border-bottom-color: var(--gold); }
.index-heading { font-family: var(--font-display); font-size: 2rem; color: var(--cream); margin: 4rem 0 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.index-heading:first-of-type { margin-top: 1rem; border-top: none; padding-top: 0; }
.index-topic-heading { font-family: var(--font-display); font-size: 1.5rem; color: var(--gold); margin: 2.5rem 0 1.25rem; }
.index-topic-heading a { color: var(--gold); text-decoration: none; }
.index-topic-heading a:hover { color: var(--gold-bright); }
.index-topic-count { color: var(--text-dim); font-size: 1rem; font-family: var(--font-body); font-weight: 400; }
.article-tag { color: var(--gold); text-decoration: none; }
.article-tag:hover { color: var(--gold-bright); }
.topic-page-meta { text-align: center; color: var(--text-dim); margin-top: 1rem; }
.back-link { display: inline-block; margin-top: 3rem; color: var(--gold); text-decoration: none; font-family: var(--font-display); font-size: 1.1rem; }
.back-link:hover { border-bottom: 1px solid var(--gold); }


.header-search { display: inline-flex; align-items: center; padding: 0.35rem; margin-right: 0.5rem; color: var(--text-dim); transition: color 0.2s; text-decoration: none; }
.header-search:hover { color: var(--gold); }
.header-search svg { display: block; }
/* Self-hosted Latin webfonts (Phase B, 2026-07-03).
 * Source Serif 4 + Cormorant Garamond, variable, latin + latin-ext,
 * fetched from Google Fonts and served first-party from /assets/fonts/.
 * build.py prepends this file to the injected palette CSS. */

/* latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/cormorant-garamond-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/cormorant-garamond-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/cormorant-garamond-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/cormorant-garamond-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/source-serif-4-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/source-serif-4-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/source-serif-4-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/source-serif-4-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === ARCHIVE QUARTERLY — light-first palette (Phase 5) ===
   The legacy variable names (--bg-deep, --cream, --text, …) are kept so the
   existing component CSS works unchanged; only the *values* flip. Dark mode
   is opt-in via the footer toggle, or activated by `prefers-color-scheme:
   dark` when the user has not made an explicit choice. */
:root {
  --bg-deep: #f5ede0;
  --bg-surface: #ede4d2;
  --bg-card: #efe7d6;
  --bg-card-hover: #e6dcc4;
  --gold: #a8854a;
  --gold-dim: #8c6f3d;
  --gold-bright: #c69d56;
  /* In-body text links: --gold is 2.95:1 on paper (fails AA); --link passes
     at 5.04:1. Gold stays for large display text, rules, and dark mode. */
  --link: #7a6135;
  --link-hover: #5c4826;
  --cream: #2a2520;
  --cream-dim: #4a443c;
  --text: #1f1c17;
  --text-dim: #5a5249;
  --text-bright: #0a0908;
  --accent-red: #7a2e2e;
  --accent-red-bright: #9a3a3a;
  --border: #d0c5ad;
  --font-body: 'Source Serif 4', 'Source Serif Pro', 'Noto Serif JP', Georgia, serif;
}
[data-theme="dark"] {
  --bg-deep: #0a0a0c;
  --bg-surface: #111114;
  --bg-card: #18181c;
  --bg-card-hover: #1e1e24;
  --gold: #c9a84c;
  --gold-dim: #a8944a;
  --gold-bright: #e8c65a;
  --link: #c9a84c;
  --link-hover: #e8c65a;
  --cream: #e8e0d0;
  --cream-dim: #b5ad9f;
  --text: #ddd8d0;
  --text-dim: #a8a295;
  --text-bright: #f0ebe2;
  --accent-red: #8b3a3a;
  --accent-red-bright: #c45454;
  --border: #2a2a30;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-deep: #0a0a0c;
    --bg-surface: #111114;
    --bg-card: #18181c;
    --bg-card-hover: #1e1e24;
    --gold: #c9a84c;
    --gold-dim: #a8944a;
    --gold-bright: #e8c65a;
    --link: #c9a84c;
    --link-hover: #e8c65a;
    --cream: #e8e0d0;
    --cream-dim: #b5ad9f;
    --text: #ddd8d0;
    --text-dim: #a8a295;
    --text-bright: #f0ebe2;
    --accent-red: #8b3a3a;
    --accent-red-bright: #c45454;
    --border: #2a2a30;
  }
}
/* meta theme-color matches the active palette */
html { color-scheme: light dark; }

/* === Light-mode overrides for hard-coded translucent dark colors ===
   Existing templates use `rgba(10,10,12,…)` for the fixed header backdrop and
   open-nav backgrounds. On paper that renders near-black; replace with a
   paper-tinted alpha and restore the original under [data-theme="dark"] /
   prefers-color-scheme: dark. Same idea for the gold-tinted hero glows. */
header { background: rgba(245, 237, 224, 0.88); border-bottom-color: var(--border); }
nav.open { background: rgba(245, 237, 224, 0.97); }

.hero::before {
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(168, 133, 74, 0.10) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(122, 46, 46, 0.05) 0%, transparent 60%);
}
.newsletter-section::before {
  background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(168, 133, 74, 0.08) 0%, transparent 70%);
}

[data-theme="dark"] header { background: rgba(10, 10, 12, 0.85); }
[data-theme="dark"] nav.open { background: rgba(10, 10, 12, 0.97); }
[data-theme="dark"] .hero::before {
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201, 168, 76, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(139, 58, 58, 0.04) 0%, transparent 60%);
}
[data-theme="dark"] .newsletter-section::before {
  background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(201, 168, 76, 0.04) 0%, transparent 70%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) header { background: rgba(10, 10, 12, 0.85); }
  :root:not([data-theme="light"]) nav.open { background: rgba(10, 10, 12, 0.97); }
  :root:not([data-theme="light"]) .hero::before {
    background:
      radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201, 168, 76, 0.06) 0%, transparent 70%),
      radial-gradient(ellipse 50% 50% at 80% 20%, rgba(139, 58, 58, 0.04) 0%, transparent 60%);
  }
  :root:not([data-theme="light"]) .newsletter-section::before {
    background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(201, 168, 76, 0.04) 0%, transparent 70%);
  }
}

/* Body baseline — explicit colors so the inherit chain is robust on every page */
body { background: var(--bg-deep); color: var(--text); }

/* Theme toggle button */
.theme-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  padding: 0.45rem 0.55rem; line-height: 0; cursor: pointer; border-radius: 100px;
  transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--gold-dim); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

footer .footer-inner { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }

/* The 5-item canonical nav + search + theme toggle can crowd mid-width
   headers (nav hides behind the hamburger only at <=720px). */
@media (max-width: 1020px) and (min-width: 721px) {
  nav { gap: 1.1rem; }
}

.cookie-notice { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: none; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.7rem 1.3rem; padding: 0.85rem 1.2rem; background: var(--bg-card); border-top: 1px solid var(--border); box-shadow: 0 -2px 14px rgba(0,0,0,0.16); font-size: 0.82rem; line-height: 1.5; color: var(--text-dim); }
.cookie-notice p { margin: 0; max-width: 64ch; }
.cookie-notice a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.cookie-notice a:hover { color: var(--gold-bright); }
.cookie-notice button { flex: none; background: var(--gold); color: #16130d; border: none; border-radius: 4px; padding: 0.45rem 1.1rem; font: inherit; font-weight: 600; letter-spacing: 0.03em; cursor: pointer; transition: background 0.2s; }
.cookie-notice button:hover { background: var(--gold-bright); }


.topic-era-heading { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-weight: 600; color: var(--gold); margin: 3.5rem 0 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); letter-spacing: 0.02em; }
.topic-era-heading:first-of-type { margin-top: 1rem; padding-top: 0; border-top: none; }
.topic-era-count { color: var(--text-dim); font-size: 1rem; font-family: system-ui, sans-serif; font-weight: 400; margin-left: 0.5rem; }
