/* hearth tokens. the look is the catalog record's (roll: ukiyo-e woodblock x vhs covers).
   dark is the primary theme: kiyochika's 1881 night fire, the prussian-sumi corner of his sky as the
   ground and one card of brown smoke. light is the same print on its washi sky. every text pair is
   measured in AGENTS.md; the shader reads --fire-ground and --smoke so the fire follows the theme. */

@font-face {
  font-family: "Zen Antique";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/zen-antique-latin-400-normal.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;
}

@font-face {
  font-family: "DotGothic16";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dotgothic16-latin-400-normal.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;
}

:root {
  color-scheme: dark;

  /* the record's palette, sampled from the references */
  --bg: #1f2a2e; /* prussian-sumi bokashi, top-left sky of kiyochika's hisamatsu fire */
  --surface: #623a1f; /* the brown smoke billows of the same print */
  --ink: #e9ddc4; /* the washi margin */
  --muted: #dab199; /* the sky where the fire lights it */
  --accent: #eeccad; /* the pale core of the flames */
  --accent-ink: #623a1f; /* smoke brown set on the flame core */

  /* derived, never a new colour: focus is the flame core (9.71:1 on bg, 6.47:1 on surface) */
  --focus: var(--accent);
  --key: #1d2325; /* the sumi key line: the storehouse roof silhouette in the same print */
  --hairline: color-mix(in srgb, var(--ink) 55%, transparent);
  --smoke: #623a1f;
  --fire-ground: var(--bg);

  /* smoke glass: near-opaque so text keeps 4.5:1 over the brightest fire (measured in e2e) */
  --glass: color-mix(in srgb, var(--surface) 90%, transparent);
  --glass-filter: blur(16px) brightness(0.45) saturate(0.8);

  --font-display: "Zen Antique", "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  --font-text: "DotGothic16", "Courier New", ui-monospace, monospace;

  --radius: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --tap: 44px;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-cartouche: 26px;

  --fade: 700ms;
}

/* light: the same print on its washi sky. ratios: ink 11.83 on bg and 15.36 on surface, muted 7.28
   and 9.45, accent 3.89 and 5.05 (fills and focus only), accent-ink 5.05 on accent */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #e9ddc4; /* the washi margin of the hisamatsu print */
    --surface: #fefbef; /* the bright paper of hiroshige's fireworks at ryogoku */
    --ink: #1d2325; /* the storehouse roof silhouette */
    --muted: #623a1f; /* brown smoke */
    --accent: #ab5418; /* the flame where it turns to smoke */
    --accent-ink: #fefbef;
    --focus: var(--accent);
    --hairline: color-mix(in srgb, var(--muted) 45%, transparent);
    --glass-filter: blur(16px) saturate(0.7) brightness(1.08);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9ddc4;
  --surface: #fefbef;
  --ink: #1d2325;
  --muted: #623a1f;
  --accent: #ab5418;
  --accent-ink: #fefbef;
  --focus: var(--accent);
  --hairline: color-mix(in srgb, var(--muted) 45%, transparent);
  --glass-filter: blur(16px) saturate(0.7) brightness(1.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --fade: 200ms;
  }
}
