
: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;
}

/* === CLICKABLE ARTICLE TAG (now an <a>) === */
.article-tag { text-decoration: none; display: block; position: relative; z-index: 2; }
.article-tag:hover { color: var(--gold-bright); }

/* === BROWSE ALL LINK (homepage) === */
.browse-all-row { text-align: center; margin-top: 3.5rem; }
.browse-all-link {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 0.25rem;
  transition: color 0.2s, border-color 0.2s;
}
.browse-all-link:hover { color: var(--gold-bright); border-bottom-color: var(--gold-bright); }

/* === HOMEPAGE TIMELINE PREVIEW === */
#timeline-preview { padding-bottom: 2.5rem; }
.homepage-timeline { max-width: 1100px; margin: 1.5rem auto 0; }
.preview-track { position: relative; height: 110px; padding: 30px 0; margin: 0 1rem; }
.preview-axis { position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-dim), transparent); }
.preview-event { position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 1.5rem; height: 1.5rem; display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: transform 0.2s; cursor: pointer; }
.preview-event .dot { width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-dim); transition: all 0.2s; box-shadow: 0 0 0 0 transparent; }
.preview-event:hover .dot, .preview-event:focus .dot {
  transform: scale(1.6); background: var(--gold-bright); box-shadow: 0 0 0 4px rgba(201,168,76,0.18); }
.preview-event.is-overview .dot {
  width: 12px; height: 12px; background: var(--gold);
  box-shadow: 0 0 0 2px var(--bg-deep), 0 0 0 3px var(--gold-dim); }
.preview-event.topic-religion .dot { background: var(--accent-red); }
.preview-event.topic-trade    .dot { background: #6b8e6b; }
.preview-event.topic-politics .dot { background: var(--gold-dim); }
.preview-event.topic-military .dot { background: #8a6b3f; }
.preview-event.topic-people   .dot { background: #b58c63; }
.preview-event.topic-culture  .dot { background: #a59ac8; }
.preview-event.topic-places   .dot { background: #7099a0; }
.preview-event.is-overview .dot { background: var(--gold); }

.preview-eras { position: relative; height: 1.5rem; margin: 0.5rem 1rem 0;
  font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.04em; }
.preview-era { position: absolute; top: 0; text-align: center; color: var(--gold-dim);
  border-top: 1px solid rgba(201, 168, 76, 0.2); padding-top: 0.4rem; }
.preview-era[data-era="persecution"] { color: var(--accent-red); }
.preview-years { display: flex; justify-content: space-between;
  font-family: var(--font-display); font-size: 0.85rem; color: var(--gold);
  margin: 0.5rem 1rem 0; }
.preview-cta { display: inline-block; margin: 1.5rem auto 0; color: var(--gold);
  font-family: var(--font-display); font-size: 1.05rem; text-decoration: none;
  border-bottom: 1px solid var(--gold-dim); padding-bottom: 0.2rem;
  transition: color 0.2s, border-color 0.2s; }
.homepage-timeline { text-align: center; }
.preview-cta:hover { color: var(--gold-bright); border-bottom-color: var(--gold-bright); }
@media (max-width: 720px) {
  .preview-track { margin: 0 0.5rem; height: 90px; padding: 25px 0; }
  .preview-event { width: 1.2rem; height: 1.2rem; }
  .preview-eras { font-size: 0.65rem; margin: 0.5rem 0.25rem 0; }
  .preview-era { font-size: 0.6rem; }
}
/* === Hero byōbu background (Phase E image programme, 2026-07-04) === */
.hero { position: relative; background: linear-gradient(rgba(245,237,224,0.90), rgba(245,237,224,0.965) 65%, #f5ede0), url('/images/home/hero-bg.jpg') center 38% / cover no-repeat; }
[data-theme="dark"] .hero { background: linear-gradient(rgba(10,10,12,0.92), rgba(10,10,12,0.98) 65%, #0a0a0c), url('/images/home/hero-bg.jpg') center 38% / cover no-repeat; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero { background: linear-gradient(rgba(10,10,12,0.92), rgba(10,10,12,0.98) 65%, #0a0a0c), url('/images/home/hero-bg.jpg') center 38% / cover no-repeat; }
}
.hero-credit { position: absolute; right: 1.1rem; bottom: 0.55rem; font-family: system-ui, sans-serif; font-size: 0.62rem; color: var(--text-dim); opacity: 0.75; margin: 0; }

/* === D2 homepage portal (2026-07-04) === */
.hero-search { display: flex; gap: 0.6rem; max-width: 560px; margin: 1.8rem 0 0.9rem; }
.hero-search input[type="search"] { flex: 1; min-width: 0; padding: 0.7rem 1rem; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); border-radius: 2px; font-size: 0.95rem; font-family: inherit; }
.hero-search input[type="search"]:focus { outline: none; border-color: var(--gold-dim); }
.hero-search button { padding: 0.7rem 1.3rem; background: var(--gold); color: var(--bg-deep); border: none; border-radius: 2px; font-weight: 600; font-size: 0.9rem; cursor: pointer; font-family: system-ui, sans-serif; transition: background 0.2s; }
.hero-search button:hover { background: var(--gold-dim); }
.hero-cta { margin: 0 0 1.4rem; font-size: 0.92rem; }
.hero-cta a { color: var(--gold); text-decoration: none; border-bottom: 1px dotted var(--gold-dim); }
.hero-cta a:hover { color: var(--accent-red); border-bottom-color: var(--accent-red); }
.era-band { display: flex; gap: 6px; margin: 1.2rem 0 0.4rem; }
.era-band-seg { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem 0.9rem 0.9rem; background: var(--bg-card); border: 1px solid var(--border); border-top: 3px solid var(--gold-dim); border-radius: 2px; text-decoration: none; transition: all 0.25s; min-width: 0; flex-basis: 0; }
.era-band-seg:hover { border-top-color: var(--accent-red); background: var(--bg-card-hover); transform: translateY(-3px); }
.eb-years { font-family: system-ui, sans-serif; font-size: 0.68rem; letter-spacing: 0.12em; color: var(--gold); }
.eb-name { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; font-weight: 600; color: var(--cream); line-height: 1.2; }
.eb-count { font-family: system-ui, sans-serif; font-size: 0.72rem; color: var(--text-dim); }
@media (max-width: 760px) { .era-band { flex-direction: column; } .era-band-seg { flex-grow: 0 !important; flex-basis: auto; } }
.hr-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.hr-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.2rem 1.4rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 2px; text-decoration: none; transition: all 0.25s; }
.hr-card:hover { border-color: var(--gold-dim); background: var(--bg-card-hover); }
.hr-cit { font-weight: 600; color: var(--cream); font-size: 0.95rem; line-height: 1.4; }
.hr-verdict { font-size: 0.85rem; color: var(--text-dim); line-height: 1.55; }
.hs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.hs-card { display: flex; flex-direction: column; gap: 0.4rem; padding: 1.2rem 1.4rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 2px; text-decoration: none; transition: all 0.25s; }
.hs-card:hover { border-color: var(--gold-dim); background: var(--bg-card-hover); }
.hs-name { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; font-weight: 600; color: var(--cream); }
.hs-desc { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }
.hs-count { font-family: system-ui, sans-serif; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-top: 0.2rem; }
.epilogue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2.5rem; }
.ep-block h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; color: var(--cream); margin-bottom: 0.5rem; }
.ep-block p { font-size: 0.9rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 0.8rem; }
.ep-block .ep-link { color: var(--gold); text-decoration: none; font-size: 0.9rem; border-bottom: 1px dotted var(--gold-dim); }
.ep-block .ep-link:hover { color: var(--accent-red); border-bottom-color: var(--accent-red); }
.ep-block .email-form { margin: 0; max-width: none; }

.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-consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: none; padding: 0.9rem 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.55; color: var(--text-dim); }
.cookie-consent.is-visible { display: block; }
.cookie-consent .cc-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.55rem 1.4rem; }
.cookie-consent .cc-text { flex: 1 1 22rem; min-width: 0; }
.cookie-consent .cc-title { margin: 0 0 0.15rem; font-weight: 600; color: var(--text); font-size: 0.9rem; }
.cookie-consent p { margin: 0; max-width: 72ch; }
.cookie-consent a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.cookie-consent a:hover { color: var(--gold-bright); }
.cookie-consent .cc-actions { flex: none; display: flex; gap: 0.55rem; }
.cookie-consent .cc-btn { flex: none; border-radius: 4px; padding: 0.5rem 1.15rem; font: inherit; font-weight: 600; letter-spacing: 0.02em; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.cookie-consent .cc-accept { background: var(--gold); color: #16130d; border: 1px solid var(--gold); }
.cookie-consent .cc-accept:hover { background: var(--gold-bright); border-color: var(--gold-bright); }
.cookie-consent .cc-decline { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.cookie-consent .cc-decline:hover { color: var(--text); border-color: var(--text-dim); }
