/* =========================================================
   Spifftopia MMP — Modern Medieval Theme (v2025)
   ========================================================= */

/* --- Germania font --- */
@font-face {
    font-family: 'Germania';
    src: url('Germania.woff2') format('woff2'),
        url('Germania.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- Theme variables --- */
:root {
  --bg: #f2ecdf;
  --bg-alt: #ebe3d0;
  --ink: #1b140d;
  --muted: #6b5a45;
  --accent: #b07b37;
  --accent-2: #d6b47e;
  --edge: #2f2417;
  --surface: #fffaf0;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 28px rgba(47,36,23,.12);

  --font-body: ui-serif, Georgia, "Times New Roman", serif;
  --font-display: 'Germania', ui-serif, Georgia, serif;
}

/* --- Layout: sticky footer --- */
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font: 16px/1.65 var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 900px at 10% 0%, #fff 0, transparent 60%),
    radial-gradient(1200px 900px at 100% 100%, #fff 0, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }

/* Parchment grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .14;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(0,0,0,.05) 50%, transparent 51%),
    radial-gradient(1px 1px at 80% 70%, rgba(0,0,0,.05) 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 20%, rgba(0,0,0,.05) 50%, transparent 51%);
  background-size: 300px 300px, 260px 260px, 220px 220px;
}

/* Containers */
.container { width: min(1100px, 92%); margin-inline: auto; position: relative; z-index: 1; }
.container--wide { width: min(1400px, 96%); } /* wider row for features */
.section { padding: 64px 0; }
.section.alt { background: var(--bg-alt); border-block: 2px solid var(--edge); }
.section-head { text-align: center; margin-bottom: 24px; }

/* Display font — force normal weight */
.section-title,
.brand-name,
.display,
.feature-title,
.card-title {
  font-family: var(--font-display);
  font-weight: 400;
}

.section-title {
  font-size: clamp(1.7rem, 1.1rem + 2.5vw, 2.4rem);
  margin: 0 0 6px;
}

.section-sub { color: var(--muted); margin: 0; }

.countdown-title {
  color: #f5f1e8 !important;
  font-size: clamp(1.7rem, 1.1rem + 2.5vw, 2.4rem);
  font-family: var(--font-display);
  font-weight: 400;
  margin-bottom: 0;
}

/* =========================================================
   HEADER / NAV (modern glass + underline links)
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,253,247,.75);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(47,36,23,.15);
  box-shadow: 0 6px 24px rgba(0,0,0,.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand-mark { width: 28px; height: 28px; }
.brand-name { font-size: 1.25rem; letter-spacing: .6px; }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 2px solid var(--edge);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle-bar { width: 22px; height: 2px; background: var(--edge); display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.site-nav { display: none; }
.site-nav.open { display: block; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Transparent nav links with bottom border hover/active */
.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  padding: 10px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  transition: color .2s ease, border-color .2s ease;
}
.site-nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.site-nav a.active {
  border-color: var(--accent);
  color: var(--accent);
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; }
  .site-nav ul { flex-direction: row; align-items: center; gap: 12px; padding: 0; }
}

/* === Mobile navigation layout adjustments === */
@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .brand {
    order: -1; /* ensure brand stays at the top */
    margin-bottom: 10px;
    justify-content: start;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .site-nav {
    width: 100%;
    text-align: left;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .site-nav a {
    display: block;
    width: 100%;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(47,36,23,.1);
  }

  .nav-toggle {
    position: absolute;
    right: 16px;
    top: 16px;
  }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  border-bottom: 2px solid var(--edge);
}
.hero.has-bg { padding: 0; background: none; }
.hero.has-bg::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(20,14,8,.35), rgba(20,14,8,.58)),
    url('../img/background.png') center/cover no-repeat;
  z-index: 0;
}
.hero-overlay {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: clamp(360px, 50vw, 560px);
  text-align: center;
  padding: 42px 0;
}
.hero-inner { padding: 0; }
.hero-logo {
  width: min(64vw, 420px);
  height: auto;
  margin: 0 auto 16px;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,.36));
}
.display { margin: 0 0 10px; font-size: clamp(2.2rem, 1.2rem + 3.6vw, 3.2rem); }
.hero .lead {
  max-width: 780px;
  margin-inline: auto;
  line-height: 1.6;
  font-size: 1.075rem;
  color: #f5f1e8;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.hero .lead strong { color: var(--accent-2); font-weight: 400; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero.has-bg .btn { box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.hero.has-bg .btn-ghost {
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(2px);
  color: #fdf8f0;
  border-color: #f0e2c6;
}
.divider {
  height: 16px;
  border-top: 2px solid var(--edge);
  border-bottom: 2px solid var(--edge);
  background: repeating-linear-gradient(90deg, transparent 0 26px, rgba(139,90,43,.22) 26px 28px);
}

/* =========================================================
   BUTTONS — transparent with accent underline
   ========================================================= */
.btn{
  --py: 11px; --px: 14px;
  display: inline-block;
  padding: var(--py) var(--px);
  background: transparent;
  color: var(--edge);
  text-decoration: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .08s ease;
  cursor: pointer;
}
.btn:hover{
  color: var(--accent);
  border-bottom-color: var(--accent);
  transform: translateY(-1px);
}
.btn:active{ transform: translateY(0); }
.btn:focus-visible{
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}
.btn-primary{
  background: rgba(255,247,238,.5);
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.btn-primary:hover{ background: rgba(255,247,238,.85); }
.btn-ghost{ background: transparent; color: var(--edge); }
.btn-small{ --py: 9px; --px: 12px; font-size: .95rem; }

/* =========================================================
   FEATURES — full-width grid, aligned content, no overlap
   ========================================================= */
.features{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* full row fill */
  gap: 28px;
  align-items: stretch;
}
.feature{
  position: relative;
  width: auto;
  max-width: none;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr; /* icon, title, body */
  align-items: start;

  background: linear-gradient(180deg, #fffdf9, #f9f2e6);
  border: 1px solid rgba(47,36,23,.15);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  transform: translateZ(0);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  padding: 18px;
}
.feature:hover{
  transform: translateY(-3px);
  box-shadow: 0 16px 42px rgba(0,0,0,.10);
  border-color: rgba(47,36,23,.24);
}
.feature-icon{
  font-size: 28px;
  margin-bottom: 10px;
  line-height: 1;
  text-align: center;
}
.feature-title{
  margin: 0 0 8px;
  letter-spacing: .2px;
  font-size: clamp(1.3rem, 1.05rem + 1.2vw, 1.7rem);
  text-align: center;
  min-height: 2.2em; /* keeps headings aligned across row */
}
.feature p{ margin: 0; text-align: left; }

/* =========================================================
   COUNTDOWN
   ========================================================= */
.countdown {
  display: grid;
  grid-auto-flow: column;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
  margin-top: 14px;
}
.cd-box {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(47,36,23,.2);
  border-radius: 16px;
  padding: 12px 14px;
  min-width: 88px;
  text-align: center;
  box-shadow: var(--shadow);
}
.cd-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1rem + 2vw, 2.1rem);
  line-height: 1;
}
.cd-label {
  display: block;
  margin-top: 4px;
  font-size: .8rem;
  color: var(--muted);
}
@media (max-width: 420px) {
  .countdown {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   MODALS (YouTube)
   ========================================================= */
.modal{
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  z-index: 3000;
}
.modal.show{ display: flex; }
.modal[aria-hidden="true"]{ display: none; }
.modal-backdrop{
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
}
.modal-dialog{
  position: relative; z-index: 1;
  width: min(960px, 92vw);
  background: #fffdf8;
  border: 1px solid rgba(47,36,23,.2);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  padding: 16px;
}
.modal-close{
  position: absolute; right: 12px; top: 10px;
  background: #fff; border: 1px solid rgba(47,36,23,.3);
  border-radius: 10px; padding: 6px 10px; cursor: pointer;
}
.modal-title{
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
}
.modal-media{
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(47,36,23,.15);
  border-radius: 12px;
  overflow: hidden;
}
.modal-iframe{ width: 100%; height: 100%; display: block; }

/* video buttons row */
.video-actions{
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* =========================================================
   FOOTER (centered logo)
   ========================================================= */
.site-footer {
  margin-top: 56px;
  border-top: 1px solid rgba(47,36,23,.18);
  background: linear-gradient(180deg, #f2ead8, #ece1cb);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 0;
  text-align: center;
}
.footer-logo-lg {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.12));
}
.footer-copy {
  margin: 6px 0 2px;
  color: var(--ink);
  opacity: .85;
}
.footer-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color .2s ease, opacity .2s ease;
  opacity: .9;
}
.footer-nav a:hover {
  border-color: rgba(47,36,23,.35);
  opacity: 1;
}

/* =========================================================
   TOAST
   ========================================================= */
#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(6px);
  background: #1f160e;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid var(--edge);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 2000;
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* =========================================================
   MISC / ACCESSIBILITY
   ========================================================= */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 10px;
  background: #fff;
  border: 2px solid var(--edge);
}
img { max-width: 100%; height: auto; }

/* ===== Credits page ===== */
.credits-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px 20px;
  align-items: stretch;
}

.person-card{
  background: linear-gradient(180deg, #fffdf9, #f9f2e6);
  border: 1px solid rgba(47,36,23,.15);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  padding: 14px;
  text-align: center;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 8px;
}

.person-img{
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(47,36,23,.18);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  margin: 0 auto 6px;
}
.person-img--square{ border-radius: 12px; } /* for PNG logos/icons that aren't portraits */

.person-name{
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.8rem;
}
.person-role{
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

.person-links{
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2px;
}
.person-link, .person-tag{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--edge);
  font-size: .95rem;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px dashed transparent;
  transition: border-color .2s ease, color .2s ease, transform .08s ease;
}
.person-link:hover{
  color: var(--accent);
  border-color: rgba(47,36,23,.25);
  transform: translateY(-1px);
}

.person-name a{
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.person-name a:hover{
  color: var(--accent);
  border-color: var(--accent);
}

/* If you want bigger cards on wide screens */
@media (min-width: 1200px){
  .credits-grid{ grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* === Credits: exactly 3 cards per row (responsive) === */
.credits-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 across on desktop */
  gap: 24px;
  align-items: stretch;
}

/* Tablets: 2 across */
@media (max-width: 990px){
  .credits-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Phones: 1 across */
@media (max-width: 600px){
  .credits-grid{
    grid-template-columns: 1fr;
  }
}

/* ===== Credits Hero ===== */
.credits-hero.has-bg::before {
  /* Override background image just for this page */
  background:
    linear-gradient(180deg, rgba(20,14,8,.4), rgba(20,14,8,.65)),
    url('../img/creditbg.png') center/cover no-repeat;
}

/* Slightly shorter hero height */
.credits-hero .hero-overlay {
  min-height: clamp(260px, 40vw, 400px);
}

/* Title styling */
.credits-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem);
  color: #fffdf5;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  margin: 0;
}

/* ===== Archive Hero ===== */
.archive-hero.has-bg::before {
  /* Override background image just for this page */
  background:
    linear-gradient(180deg, rgba(20,14,8,.4), rgba(20,14,8,.65)),
    url('../img/archivebg.png') center/cover no-repeat;
}

/* Slightly shorter hero height */
.archive-hero .hero-overlay {
  min-height: clamp(260px, 40vw, 400px);
}

/* Title styling */
.archive-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem);
  color: #fffdf5;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  margin: 0;
}

/* ===== 404 Hero ===== */
.error-hero.has-bg::before {
  /* Override background image just for this page */
  background:
    linear-gradient(180deg, rgba(20,14,8,.4), rgba(20,14,8,.65)),
    url('../img/404bg.png') center/cover no-repeat;
}

/* Slightly shorter hero height */
.error-hero .hero-overlay {
  min-height: clamp(360px, 50vw, 560px);
}

/* Title styling */
.error-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem);
  color: #fffdf5;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  margin: 0;
}

/* ===== Archive page ===== */

/* 3-up grid like credits, but for videos */
.archive-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 990px){
  .archive-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px){
  .archive-grid{ grid-template-columns: 1fr; }
}

/* Video cards */
.video-card{
  background: linear-gradient(180deg, #fffdf9, #f9f2e6);
  border: 1px solid rgba(47,36,23,.15);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  padding: 14px;
  text-align: center;
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
}

.video-thumb{
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(47,36,23,.18);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  padding: 0;
  background: #000;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}
.video-thumb:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.14);
  border-color: rgba(47,36,23,.28);
}
.video-thumb img{
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.play-pill{
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(0,0,0,.6); color: #fff; font-weight: 600;
  padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(2px);
}

.video-title{
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
}

/* Homepage Learn section layout */
.section.alt .archive-grid{
  margin-top: 28px;
  justify-items: center;
}
.section.alt .video-card{
  max-width: 360px;
}

/* === Homepage video cards section === */
.homepage-videos {
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 36px;                   /* space between the two cards */
  max-width: 780px;            /* keeps them neatly centered */
  margin-inline: auto;
}

.homepage-videos .video-card {
  width: 100%;
  max-width: 360px;
  transition: transform 0.2s ease;
}

/* Smooth lift and glow on hover */
.homepage-videos .video-card:hover {
  transform: translateY(-2px);
}

/* === Play pill fade-in === */
.play-pill {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(2px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease, transform .3s ease;
}

/* Fade in on hover */
.video-thumb:hover .play-pill {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   DARK MODE (toggle on <html data-mode="dark">)
   ========================================================= */

/* Let browsers know we support both */
:root { color-scheme: light dark; }

/* Palette overrides — put variables on the same element that owns them */
:root[data-mode="dark"] {
  --bg: #13100d;
  --bg-alt: #1b1713;
  --ink: #f2e9da;
  --muted: #b9aa92;
  --accent: #d2a463;
  --accent-2: #f0d19b;
  --edge: #e5d5b9;
  --surface: #1f1a14;

  --shadow: 0 10px 28px rgba(0,0,0,.45);
}

/* Optional: smooth-ish theme transition */
html { transition: background-color .2s ease, color .2s ease; }

/* Page background + parchment grain */
:root[data-mode="dark"] body {
  background:
    radial-gradient(1200px 900px at 10% 0%, #17130f 0, transparent 60%),
    radial-gradient(1200px 900px at 100% 100%, #17130f 0, transparent 60%),
    var(--bg);
}
:root[data-mode="dark"] body::before {
  opacity: .18;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.05) 50%, transparent 51%),
    radial-gradient(1px 1px at 80% 70%, rgba(255,255,255,.05) 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,.05) 50%, transparent 51%);
}

/* Header / glass nav */
:root[data-mode="dark"] .site-header {
  background: rgba(20,18,15,.7);
  border-bottom-color: rgba(229,213,185,.14);
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
}
:root[data-mode="dark"] .nav-toggle { border-color: var(--edge); }
:root[data-mode="dark"] .nav-toggle-bar { background: var(--edge); }
:root[data-mode="dark"] .site-nav a {
  color: var(--ink);
  border-bottom-color: transparent;
}
:root[data-mode="dark"] .site-nav a:hover,
:root[data-mode="dark"] .site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Hero (base + page variants) */
:root[data-mode="dark"] .hero.has-bg::before {
  background:
    linear-gradient(180deg, rgba(10,8,6,.55), rgba(10,8,6,.75)),
    url('../img/background.png') center/cover no-repeat;
}
:root[data-mode="dark"] .credits-hero.has-bg::before {
  background:
    linear-gradient(180deg, rgba(10,8,6,.55), rgba(10,8,6,.78)),
    url('../img/creditbg.png') center/cover no-repeat;
}
:root[data-mode="dark"] .archive-hero.has-bg::before {
  background:
    linear-gradient(180deg, rgba(10,8,6,.55), rgba(10,8,6,.78)),
    url('../img/archivebg.png') center/cover no-repeat;
}
:root[data-mode="dark"] .error-hero.has-bg::before {
  background:
    linear-gradient(180deg, rgba(10,8,6,.6), rgba(10,8,6,.85)),
    url('../img/404bg.png') center/cover no-repeat;
}
:root[data-mode="dark"] .hero .lead { color: #efe7d8; }

/* Buttons */
:root[data-mode="dark"] .btn { color: var(--ink); }
:root[data-mode="dark"] .btn:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
:root[data-mode="dark"] .btn-primary {
  background: rgba(40,34,27,.7);
  color: var(--accent);
  border-bottom-color: var(--accent);
}
:root[data-mode="dark"] .btn-primary:hover { background: rgba(40,34,27,.9); }

/* Cards / features / modals */
:root[data-mode="dark"] .feature,
:root[data-mode="dark"] .person-card,
:root[data-mode="dark"] .video-card,
:root[data-mode="dark"] .cd-box,
:root[data-mode="dark"] .modal-dialog {
  background: linear-gradient(180deg, #211c16, #1a1612);
  border-color: rgba(229,213,185,.14);
  box-shadow: var(--shadow);
}
:root[data-mode="dark"] .feature:hover,
:root[data-mode="dark"] .person-card:hover,
:root[data-mode="dark"] .video-card:hover {
  border-color: rgba(229,213,185,.24);
}
:root[data-mode="dark"] .video-thumb { border-color: rgba(229,213,185,.18); }

/* Footer */
:root[data-mode="dark"] .site-footer {
  background: linear-gradient(180deg, #1d1915, #17130f);
  border-top-color: rgba(229,213,185,.14);
}
:root[data-mode="dark"] .footer-nav a { color: var(--ink); }

/* Toast */
:root[data-mode="dark"] #toast {
  background: #0f0d0a;
  border-color: var(--edge);
  color: var(--ink);
}

/* Mobile nav separators */
@media (max-width: 900px) {
  :root[data-mode="dark"] .site-nav a {
    border-bottom: 1px solid rgba(229,213,185,.12);
  }
}

/* Theme toggle look (nav button) */
.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  border-bottom: 2px solid transparent;
}
.mode-toggle:hover { color: var(--accent); border-bottom-color: var(--accent); }
.mode-toggle .mt-icon { font-size: 1rem; line-height: 1; }

/* === Dark-mode modal close button fix === */
:root[data-mode="dark"] .modal-close {
  background: #1a1612;
  border-color: rgba(229,213,185,.25);
  color: var(--ink);
  box-shadow: 0 2px 4px rgba(0,0,0,.5);
}
:root[data-mode="dark"] .modal-close:hover {
  background: #262018;
  border-color: rgba(229,213,185,.4);
  color: var(--accent);
}
