/* Self-hosted heading face: Noto Serif SC 600, subset to the characters the
   site actually uses (rebuild with scripts/build_fonts.py after editing titles) */
@font-face {
  font-family: "Display ZH";
  src: url("../assets/fonts/display-zh.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Design Tokens — Green Open-Air Cinema (TASK.md Section 3.1)
   Strictly 8-shade green palette + day/night preference & manual override
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* 8-level canonical green palette */
  --pal-0: #071a11;
  --pal-1: #0f2a1e;
  --pal-2: #1b4229;
  --pal-3: #2f6431;
  --pal-4: #4f8a37;
  --pal-5: #7db648;
  --pal-6: #b4e06a;
  --pal-7: #e2f7a8;

  /* Typography (Latin + Refined Chinese Sans) */
  --font-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  /* Headings: cinematic serif for Chinese, falls back to the system Song face */
  --font-display: "Display ZH", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "Inter", var(--font-zh);
  /* Mono is only for Latin / digits (timecodes, 16:9, tool names) */
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --hair: rgba(13, 34, 22, 0.1);

  /* Fixed semantic anchors shared by both themes */
  --lime: #b4e06a;
  --on-lime: #0d2216;
  --forest: #0f2a1e;
  --on-forest: #e8f5d4;

  /* Default Day Valley theme */
  --bg: #f1f5e8;
  --bg-tex: url("../assets/dither/bg-light.png");
  --ink: #0d2216;
  --muted: #4f6553;
  --line: rgba(13, 34, 22, 0.13);
  --green: #2f6431;
  --card: #12301f;
  --pill-bg: rgba(13, 34, 22, 0.72);
  --pill-fg: #e2f7a8;
  --nav-shadow: 0 10px 30px rgba(7, 26, 17, 0.24), inset 0 0 0 1px rgba(180, 224, 106, 0.14);
}

/* Honor explicit light override (default Day Valley primary theme) */
:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
}

/* Night Valley tokens when explicitly switched to dark */
:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
  --bg: #07130d;
  --bg-tex: url("../assets/dither/bg-dark.png");
  --ink: #e4f3d2;
  --muted: #93ab8c;
  --line: rgba(228, 243, 210, 0.12);
  --green: #b4e06a;
  --card: #102a1c;
  --hair: rgba(228, 243, 210, 0.1);
  --nav-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(180, 224, 106, 0.18);
}

/* Theme toggle icon & day/night hero image branching */
.theme-icon-moon {
  display: block;
}
.theme-icon-sun {
  display: none;
}
.hero-bg-day {
  display: block;
}
.hero-bg-night {
  display: none;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-moon {
  display: none;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-sun {
  display: block;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .hero-bg-day {
  display: none;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .hero-bg-night {
  display: block;
}
