/* ──────────────────────────────────────────────────────────────────────
   Greenroom — base tokens + reset
   Mirrors :root from docs/v3-dashboard-design.html. Single source of truth
   for palette/type/radius. Surface CSS reads from these vars only.
   ────────────────────────────────────────────────────────────────────── */

:root {
  /* Hint to native form controls that we support both modes so the
     browser themes its built-ins (scrollbars, date pickers, etc.). */
  color-scheme: light dark;

  /* ── Light theme (Greenroom — paper-of-day) ──
     Tightened a notch from the original tokens: ink runs a few shades
     darker, rules a touch more visible. Same design language, less
     washed-out. */

  /* paper — base + variants for nesting */
  --paper:        #eaebe7;
  --paper-2:      #e1e2dd;
  --paper-card:   #f6f7f3;
  --paper-hover:  #eaebe6;
  --paper-sel:    #d3d4cf;

  /* ink — text/icon ramp from near-black to faint */
  --ink:          #0e0f12;
  --ink-2:        #3d4045;
  --ink-3:        #6d7075;
  --ink-4:        #aaaca7;

  /* rules — borders/dividers */
  --rule:         #c6c7c1;
  --rule-soft:    #d4d5d0;
  --rule-strong:  #a8aaa4;

  /* accent — single bold color, used sparingly */
  --clay:         #b85a3a;
  --clay-soft:    #b85a3a14;
  --clay-strong:  #a14d31;   /* hover/pressed */

  /* Selected-pill (filter chip in "on" state). Light mode flips to ink-
     on-cream for a stamped feel; in dark mode the inversion would land
     on near-white, so we use a softer raised-surface instead. */
  --pill-on-bg:       #0e0f12;
  --pill-on-fg:       #fdf6f3;
  --pill-on-fg-muted: #fdf6f3aa;

  /* working colors */
  --steel:        #345d78;
  --steel-soft:   #345d7814;
  --steel-bg:     #cedceb;

  --moss:         #5a7c52;
  --moss-bg:      #d3dccd;

  --plum:         #614e76;
  --plum-bg:      #d3ccdf;

  --brick:        #8a4f41;
  --brick-bg:     #e0cac3;

  /* typography */
  --sans: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* radii */
  --radius:    4px;
  --radius-lg: 6px;
}

/* ── Dark theme (Greenroom — paper-of-night) ──
   Inverts the paper/ink ramp around the same warm-grey hue family so
   the design language carries over. Accents stay the same hue but
   shift a few stops brighter to keep contrast against the dark paper.
   The `-bg` tints become dark-saturated washes instead of light ones. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #15171b;
    --paper-2:      #1c1e23;
    --paper-card:   #1f2127;
    --paper-hover:  #25272d;
    --paper-sel:    #2e3038;

    --ink:          #ececea;
    --ink-2:        #c3c4c0;
    --ink-3:        #8e908b;
    --ink-4:        #5a5c58;

    --rule:         #2e3036;
    --rule-soft:    #25272c;
    --rule-strong:  #42454c;

    --clay:         #c97049;
    --clay-soft:    #c970491f;
    --clay-strong:  #db8260;

    /* Dark: use a raised paper surface rather than near-white ink so
       selected chips don't blast brightness over the dark background. */
    --pill-on-bg:       #2e3038;
    --pill-on-fg:       #ececea;
    --pill-on-fg-muted: #ececea99;

    --steel:        #7aa4c4;
    --steel-soft:   #7aa4c41f;
    --steel-bg:     #1d2c38;

    --moss:         #8aab80;
    --moss-bg:      #1f2a1c;

    --plum:         #9b87b7;
    --plum-bg:      #261e30;

    --brick:        #c08572;
    --brick-bg:     #2f1f1a;
  }
}

/* reset + body */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variation-settings: "opsz" 14, "wdth" 100;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

p { margin: 0; }
a { color: var(--steel); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; }

code, pre, kbd, samp {
  font-family: var(--mono);
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* scrollbar — subtle, dual-tone */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
  transition: background 200ms ease;
}
*:hover > ::-webkit-scrollbar-thumb,
:hover::-webkit-scrollbar-thumb { background: var(--rule); }
::-webkit-scrollbar-thumb:hover { background: var(--rule-strong); }

/* placeholder shown by routes during scaffold */
.route-placeholder {
  padding: 64px 48px;
  max-width: 640px;
}
.route-placeholder .eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  margin-bottom: 12px;
}
.route-placeholder .title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}
.route-placeholder .lede {
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.55;
}

/* utility: visually hidden but readable to screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* auth overlay — first-load token prompt */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22,24,28,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.auth-box {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(22,24,28,0.28);
  width: 480px;
  max-width: 100%;
  padding: 26px 28px 24px;
}
.auth-box .eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  margin-bottom: 10px;
}
.auth-box h2 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  color: var(--ink);
  font-variation-settings: "opsz" 30, "wdth" 100;
}
.auth-box .lede {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.55;
  margin: 0 0 18px;
}
.auth-box .lede code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--paper-2);
  padding: 1px 5px;
  border-radius: 2px;
}
.auth-input {
  width: 100%;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 14px;
  outline: none;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  margin-bottom: 16px;
  box-sizing: border-box;
}
.auth-input:focus {
  background: var(--paper-card);
  border-color: var(--steel);
  box-shadow: 0 0 0 2px var(--steel-soft);
}
.auth-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
