/* Shared identity and semantic tokens. Both documents load this before their UI stylesheet. */
@font-face {
  font-family: Inter;
  src: url("./inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  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: Inter;
  src: url("./inter-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  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;
}
:root {
  --brand-ink: #030303;
  --brand-paper: #f7f7f2;
  --brand-graphite: #1a1a1a;
  --brand-ash: #8a8a84;
  --brand-signal: #b8fff3;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --font-body: Inter, Arial, sans-serif;
  --font-display: Inter, Arial, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-body: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-title: clamp(2rem, 3.3vw, 3.75rem);
  --text-hero: clamp(2.75rem, 6.4vw, 7.5rem);
  --leading-body: 1.6;
  --leading-heading: 1.12;
  --tracking-label: 0.12em;
  --tracking-heading: -0.045em;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-pill: 999px;
  --border-width: 1px;
  --motion-fast: 140ms;
  --motion-calm: 240ms;
  --motion-breathe: 1600ms;
  --ease-calm: cubic-bezier(0.2, 0.7, 0.2, 1);
  --sidebar-width: 16rem;
  --content-width: 112rem;
  --reading-width: 52rem;
  --control-height: 2.75rem;
  --focus-width: 2px;
  --focus-offset: 3px;
  --bg: var(--brand-paper);
  --surface: #ffffff;
  --surface-raised: #efefea;
  --surface-hover: #e5e5df;
  --text: var(--brand-ink);
  --text-muted: #60605a;
  --line: #d4d4cd;
  --line-strong: #85857e;
  --action: var(--brand-ink);
  --on-action: var(--brand-paper);
  --action-hover: #303030;
  --accent: #226b60;
  --accent-surface: #e2f1eb;
  --focus: #226b60;
  --success: #216454;
  --success-surface: #e2f1eb;
  --warning: #78551e;
  --warning-surface: #f4ebda;
  --danger: #a22e37;
  --danger-surface: #f9e8e8;
  --on-danger: #ffffff;
  --shadow-soft: 0 4px 20px #03030308;
  --shadow-dialog: 0 24px 100px #03030330;
  --backdrop: #03030370;
  --disabled-opacity: 0.55;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: var(--brand-ink);
  --surface: #111111;
  --surface-raised: var(--brand-graphite);
  --surface-hover: #272727;
  --text: var(--brand-paper);
  --text-muted: #a8a8a1;
  --line: #333330;
  --line-strong: #73736e;
  --action: var(--brand-paper);
  --on-action: var(--brand-ink);
  --action-hover: #dcdcd5;
  --accent: var(--brand-signal);
  --accent-surface: #142924;
  --focus: var(--brand-signal);
  --success: var(--brand-signal);
  --success-surface: #142924;
  --warning: #e9c389;
  --warning-surface: #30271b;
  --danger: #ffadb4;
  --danger-surface: #361b20;
  --on-danger: #030303;
  --shadow-soft: 0 4px 20px #00000020;
  --shadow-dialog: 0 24px 100px #00000070;
  --backdrop: #000000a8;
  color-scheme: dark;
}
/* OS fallback also applies when scripting is unavailable. Explicit Light always wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: var(--brand-ink);
    --surface: #111111;
    --surface-raised: var(--brand-graphite);
    --surface-hover: #272727;
    --text: var(--brand-paper);
    --text-muted: #a8a8a1;
    --line: #333330;
    --line-strong: #73736e;
    --action: var(--brand-paper);
    --on-action: var(--brand-ink);
    --action-hover: #dcdcd5;
    --accent: var(--brand-signal);
    --accent-surface: #142924;
    --focus: var(--brand-signal);
    --success: var(--brand-signal);
    --success-surface: #142924;
    --warning: #e9c389;
    --warning-surface: #30271b;
    --danger: #ffadb4;
    --danger-surface: #361b20;
    --on-danger: #030303;
    --shadow-soft: 0 4px 20px #00000020;
    --shadow-dialog: 0 24px 100px #00000070;
    --backdrop: #000000a8;
    color-scheme: dark;
  }
}
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-synthesis: none;
  font-optical-sizing: auto;
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
    --motion-calm: 0ms;
    --motion-breathe: 0ms;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
