/*
  sales desk tokens. company desk, outside the family system.
  light is the record's palette and is canonical: bg #FAF1DC, surface #FFFAEE, ink #2A2113,
  muted #74664A, accent #8C2F4A, accent-ink #FFFFFF. dark is derived from it, same hue family,
  warm and plain. --raised, --hairline, --placeholder-bg, --shadow are derived tokens.

  measured contrast (wcag 2.2, text pairs, 4.5:1 floor), written by a script, not guessed:
  light  ink on bg 14.09, ink on surface 15.21
         muted on bg 4.99, muted on surface 5.39
         accent on bg 7.13, accent on surface 7.69
         accent-ink on accent 8.01
         placeholder: ink 12.93, muted 4.58, accent 6.54 on --placeholder-bg #F6E4E4
  dark   ink on bg 15.04, ink on surface 13.81, ink on raised 12.67
         muted on bg 7.79, muted on surface 7.15, muted on raised 6.56
         accent on bg 8.67, accent on surface 7.96, accent on raised 7.30
         accent-ink on accent 8.67
         placeholder: ink 12.08, muted 6.26, accent 6.97 on --placeholder-bg #3A2229
*/

:root {
  color-scheme: light;
  --bg: #FAF1DC;
  --surface: #FFFAEE;
  --raised: #FFFAEE;
  --ink: #2A2113;
  --muted: #74664A;
  --hairline: #E4D5B3;
  --accent: #8C2F4A;
  --accent-ink: #FFFFFF;
  --placeholder-bg: #F6E4E4;
  --shadow: 0 1px 2px rgba(42, 33, 19, 0.08), 0 6px 18px rgba(42, 33, 19, 0.08);

  --radius: 8px;
  --font-display: 'Bitter', Georgia, 'Times New Roman', serif;
  --font-body: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tap: 44px;
  --space: 16px;
}

/* system preference, unless the visitor has explicitly chosen light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1A150E;
    --surface: #241D14;
    --raised: #2C241A;
    --ink: #F3E9D3;
    --muted: #B9A887;
    --hairline: #3D3226;
    --accent: #E6A0B2;
    --accent-ink: #1A150E;
    --placeholder-bg: #3A2229;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.35);
  }
}

/* explicit choices win over the system preference */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1A150E;
  --surface: #241D14;
  --raised: #2C241A;
  --ink: #F3E9D3;
  --muted: #B9A887;
  --hairline: #3D3226;
  --accent: #E6A0B2;
  --accent-ink: #1A150E;
  --placeholder-bg: #3A2229;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FAF1DC;
  --surface: #FFFAEE;
  --raised: #FFFAEE;
  --ink: #2A2113;
  --muted: #74664A;
  --hairline: #E4D5B3;
  --accent: #8C2F4A;
  --accent-ink: #FFFFFF;
  --placeholder-bg: #F6E4E4;
  --shadow: 0 1px 2px rgba(42, 33, 19, 0.08), 0 6px 18px rgba(42, 33, 19, 0.08);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* one visible focus ring everywhere, never removed */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* every interactive target clears 44px on touch, per the house mobile rule */
button, [role="button"], summary {
  min-height: var(--tap);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
