/* ============================================================================
   DESIGN LANGUAGE — "Nordic craftsman" (D24)
   One token sheet, two skins: the admin console (style.css) and the client
   portal (portal/portal.css) both draw ONLY from these variables.

   Voice: calm, solid, trust-first. Deep granite/spruce base, warm paper
   neutrals, one high-vis AMBER accent (the work-gear nod) used sparingly —
   primary actions, the quota bar, the active nav mark. Nothing dances while
   you're reading numbers.

   Type: Bricolage Grotesque (display — headings, wordmark, big numbers) over
   Hanken Grotesk (body/UI). Self-hosted in /static/fonts — no font CDN (GDPR).
   Spec: docs/business/05-design-language.md
   ========================================================================== */

/* ------------------------------------------------------------------ fonts */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-v9-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-v9-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 800; font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-v9-latin-800.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/hanken-grotesk-v12-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/hanken-grotesk-v12-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/hanken-grotesk-v12-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/hanken-grotesk-v12-latin-700.woff2") format("woff2");
}

/* ----------------------------------------------------------- shape & motion */

:root {
  --font: "Hanken Grotesk", -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Hanken Grotesk", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --radius-s: 7px;
  --radius-m: 10px;
  --radius-l: 14px;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --t-fast: 140ms;
  --t-med: 240ms;

  /* Subtle paper grain — sidebar + portal masthead texture. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");

  /* The spruce masthead is the SAME in both themes — it IS the brand. */
  --spruce: #1d2a23;
  --spruce-deep: #16201a;
  --spruce-line: #2c3a31;
  --spruce-text: #c7cfc4;
  --spruce-text-strong: #eceade;

  /* High-vis amber — identical accent family across themes. */
  --amber: #f2a93b;
  --amber-deep: #9a6206;
}

/* --------------------------------------------------------------- light mode */

:root[data-theme="light"] {
  --bg: #f4f2ec;            /* warm paper */
  --bg-raised: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #f1eee6;
  --border: #d9d4c6;
  --border-soft: #e7e3d8;
  --text: #1f2a24;          /* spruce ink */
  --muted: #5c645a;         /* darkened to clear WCAG AA (≥4.5:1) on tinted surfaces */
  --accent: #b97309;        /* amber, darkened for light-bg legibility */
  --accent-strong: #9a6206;
  --accent-bright: #f2a93b; /* fills, bars, marks */
  --accent-soft: rgba(242, 169, 59, 0.17);
  --good: #2f7d4f;
  --good-soft: rgba(47, 125, 79, 0.12);
  --warn: #a26800;
  --warn-soft: rgba(217, 144, 13, 0.15);
  --bad: #b5483a;           /* brick, not neon */
  --bad-soft: rgba(181, 72, 58, 0.11);
  --shadow: 0 8px 24px rgba(42, 48, 38, 0.08);
  --header-veil: rgba(244, 242, 236, 0.86);
  color-scheme: light;
}

/* ---------------------------------------------------------------- dark mode */

:root[data-theme="dark"] {
  --bg: #131a16;            /* spruce night */
  --bg-raised: #18211c;
  --surface: #1c2620;
  --surface-2: #151f19;
  --border: #2f3d34;
  --border-soft: #243029;
  --text: #e9e7dc;          /* warm paper white */
  --muted: #93a094;
  --accent: #f2a93b;
  --accent-strong: #f2a93b;
  --accent-bright: #f2a93b;
  --accent-soft: rgba(242, 169, 59, 0.14);
  --good: #62b485;
  --good-soft: rgba(98, 180, 133, 0.13);
  --warn: #e0a33e;
  --warn-soft: rgba(224, 163, 62, 0.13);
  --bad: #e07b66;
  --bad-soft: rgba(224, 123, 102, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --header-veil: rgba(19, 26, 22, 0.85);
  color-scheme: dark;
}

/* ------------------------------------------------------------------- base */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--display);
  letter-spacing: -0.012em;
  font-weight: 700;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-weight: 400; font-size: 12.5px; }
code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  padding: 1px 5px; border-radius: 5px;
}
::selection { background: var(--accent-soft); }
button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-bright); outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
