
:root {
  --paper: #f5ede0; --surface: #ede4d2; --card: #efe7d6;
  --gold: #a8854a; --gold-dim: #8c6f3d;
  --ink: #1f1c17; --ink-dim: #5a5249; --red: #7a2e2e; --pageborder: #d0c5ad;
}
[data-theme="dark"] {
  --paper: #0a0a0c; --surface: #111114; --card: #18181c;
  --gold: #c9a84c; --gold-dim: #a8944a;
  --ink: #ddd8d0; --ink-dim: #a8a295; --red: #9a3a3a; --pageborder: #2a2a30;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a0a0c; --surface: #111114; --card: #18181c;
    --gold: #c9a84c; --gold-dim: #a8944a;
    --ink: #ddd8d0; --ink-dim: #a8a295; --red: #9a3a3a; --pageborder: #2a2a30;
  }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: Georgia, 'Times New Roman', 'Noto Serif JP', serif; line-height: 1.65; font-size: 17px; }
.wrap { max-width: 780px; margin: 0 auto; padding: 0 1.2rem 4rem; }
.headerbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 0 0; }
.crumbs { font-family: system-ui, sans-serif; font-size: 0.78rem; color: var(--ink-dim); }
.crumbs a { color: var(--gold-dim); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.lang-toggle { display: flex; gap: 0.4rem; align-items: center; }
.lang-btn {
  text-decoration: none; background: none; border: 1px solid var(--pageborder); color: var(--ink-dim); padding: 0.2rem 0.6rem; font-size: 0.72rem; font-family: system-ui, sans-serif; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: all 0.25s; border-radius: 2px; text-decoration: none; }
.lang-btn.active { background: var(--gold); color: var(--paper); border-color: var(--gold); font-weight: 600; }
.lang-btn:hover:not(.active) { border-color: var(--gold-dim); color: var(--gold); }
.header-search { color: var(--gold-dim); display: inline-flex; align-items: center; margin-right: 0.5rem; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); line-height: 1.25; margin: 1.4rem 0 0.4rem; font-weight: 700; }
.p-script { font-size: 1.1rem; color: var(--gold-dim); margin-bottom: 1rem; }
p.intro { color: var(--ink-dim); margin-bottom: 1.6rem; }
h2 { font-size: 1.45rem; line-height: 1.3; margin: 2.4rem 0 1rem; padding-top: 1.4rem; border-top: 1px solid var(--pageborder); font-weight: 700; }
.pl-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 0.9rem; padding: 0.55rem 0; border-bottom: 1px dotted var(--pageborder); }
.pl-name { font-weight: 700; font-size: 1.02rem; }
.pl-name a { color: var(--ink); text-decoration: none; }
.pl-name a:hover { color: var(--red); }
.pl-dates { font-family: system-ui, sans-serif; font-size: 0.78rem; color: var(--gold-dim); }
.pl-role { font-family: system-ui, sans-serif; font-size: 0.82rem; color: var(--ink-dim); flex-basis: 100%; }
.factbox { background: var(--surface); border: 1px solid var(--pageborder); border-radius: 3px; padding: 1rem 1.2rem; margin: 0 0 1.4rem; font-family: system-ui, sans-serif; font-size: 0.88rem; line-height: 1.7; }
.factbox .fb-dates { color: var(--gold-dim); letter-spacing: 0.06em; }
.bio { background: var(--surface); border-left: 3px solid var(--gold); padding: 1rem 1.2rem; margin: 0 0 1.6rem; font-size: 1rem; }
p.readmore { font-family: system-ui, sans-serif; font-size: 0.85rem; margin: 0 0 0.5rem; }
p.readmore::before { content: "\2192 "; color: var(--gold); }
h2.appears { font-size: 1.15rem; }
ul.appears { margin: 0 0 1rem 1.3rem; font-family: system-ui, sans-serif; font-size: 0.88rem; }
ul.appears li { margin-bottom: 0.4rem; }
a { color: var(--gold-dim); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red); }
.reviewed-line { font-family: system-ui, sans-serif; font-size: 0.78rem; color: var(--ink-dim); margin: 2rem 0 0; }
footer { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--pageborder); font-family: system-ui, sans-serif; font-size: 0.8rem; color: var(--ink-dim); text-align: center; }
footer a { color: var(--gold-dim); }
.footer-kanji { font-size: 2rem; color: var(--gold-dim); opacity: 0.35; margin-bottom: 0.6rem; font-family: serif; }

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(--pageborder); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0.8rem 2rem; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.6rem; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: 0.04em; }
.logo span { color: var(--gold); }
header nav { display: flex; align-items: center; gap: 2rem; }
header nav a { color: var(--ink-dim); text-decoration: none; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; transition: color 0.25s; }
header nav a:hover { color: var(--gold); }
.header-right { display: flex; align-items: center; gap: 0.8rem; }
.menu-toggle { display: none; background: none; border: none; color: var(--ink); cursor: pointer; padding: 0.5rem; }
.menu-toggle svg { width: 22px; height: 22px; }
.wrap { padding-top: 4.8rem; }
@media (max-width: 1020px) and (min-width: 721px) { header nav { gap: 1.1rem; } }
@media (max-width: 720px) {
  header nav { display: none; }
  header 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(--pageborder); gap: 1rem; }
  .menu-toggle { display: block; }
}

.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); }
