/**
 * Classical design tokens.
 *
 * Transcribed from designAI/README.md § Design Tokens. This is the source of truth for the whole
 * app — never write a literal colour or a raw px spacing value in a template.
 *
 * The palette is deliberately dark and deliberately narrow: gold on ink, nothing else. Elevation
 * is a whisper — there are exactly two shadows in the entire system.
 */

:root {
  /* ---- ground & surfaces ---- */
  --ground: #1c1917;
  --card: #231f1c;
  --overlay: rgba(15, 13, 11, 0.7);

  /* ---- ink ---- */
  --ink: #f2ece2;
  --ink-2: rgba(242, 236, 226, 0.7);
  --ink-3: rgba(242, 236, 226, 0.55);
  --ink-4: rgba(242, 236, 226, 0.45);

  /* ---- gold ---- */
  --gold: #b68235;
  --gold-lt: #e1ad66;
  --gold-dk: #7d5411;

  /* gold tints — fills and hovers */
  --fill-08: rgba(182, 130, 53, 0.08);
  --fill-10: rgba(182, 130, 53, 0.1);
  --fill-12: rgba(182, 130, 53, 0.12);
  --fill-14: rgba(182, 130, 53, 0.14);
  --fill-18: rgba(182, 130, 53, 0.18);
  --fill-24: rgba(182, 130, 53, 0.24);

  /* hairlines */
  --hair-30: rgba(182, 130, 53, 0.3);
  --hair-35: rgba(182, 130, 53, 0.35);
  --hair-40: rgba(182, 130, 53, 0.4);

  --hover-gold-lt: rgba(225, 173, 102, 0.14);

  /* ---- semantic: separate from the accent, per the design system ---- */
  --jade: #6f9169; /* good / confirmed */
  --amber: #d3963f; /* warning / degraded */
  --cinnabar: #c1543c; /* veto / struck down — 雷部 */

  /* ---- ritual props ---- */
  --olive: #8a7a4e;
  --incense-unlit: rgba(198, 113, 57, 0.45);
  --ember: #e1ad66;
  --ember-glow: rgba(240, 198, 117, 0.55);

  /* ---- type ---- */
  --display: "Cormorant Garamond", "Noto Serif TC", Georgia, serif;
  --body: "Lora", "Noto Serif TC", Georgia, serif;
  /* zh-CN swaps TC for SC — different font files, loaded per locale. See CLAUDE.md § i18n. */

  --ls-plaque-side: 0.34em;
  --ls-burner: 0.28em;
  --ls-poem: 0.16em;
  --ls-kicker: 0.14em;
  --ls-kicker-sm: 0.12em;
  --ls-kicker-xs: 0.1em;
  --ls-plaque: 0.06em;

  /* ---- spacing: the 1.15× density scale. Do not interpolate. ---- */
  --s-2: 2px;
  --s-4: 4px;
  --s-6: 6px;
  --s-9: 9px;
  --s-11: 11px;
  --s-13: 13px;
  --s-16: 16px;
  --s-18: 18px;
  --s-20: 20px;
  --s-22: 22px;
  --s-26: 26px;
  --screen-pad: 26px 18px 18px;

  /* ---- radius: one value everywhere. No pills — that is the Organic direction. ---- */
  --r: 4px;
  --r-seal: 2px;

  /* ---- elevation: exactly two shadows exist ---- */
  --shadow-dialog: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-ember: 0 0 10px 3px var(--ember-glow);

  /* ---- ritual timing: mirrors app/ritual/beats.py ---- */
  --t-shake: 700ms;
  --t-strike: 600ms; /* 雷公執法 — never longer, or people strike things for fun */
  --t-crossfade: 180ms;
  --ease-overshoot: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/*
 * Single-theme by choice: this is a temple at night. There is no light mode — but every colour
 * is painted explicitly so the page never borrows the host's ground.
 */
html {
  color-scheme: dark;
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Numbers that stand as data line up. */
.mono {
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--gold-lt);
  outline-offset: 3px;
}

/*
 * The player zeroes translation and rotation in JS and keeps the audio cues. This only covers
 * CSS-driven decoration.
 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    /* Delays too, and this is not cosmetic. Several things on 籤詩 start hidden and are
       revealed by an animation that waits for the keeper — zero the duration but keep the
       delay and the reader is left looking at a blank card for two and a half seconds before
       it snaps in. A reduced-motion user should see the finished page, immediately. */
    animation-delay: 0ms !important;
    transition-delay: 0ms !important;
  }
}
