/* ============================================================
   MAESTRO — Design language (original)
   An enterprise documentation platform that orchestrates
   create / migrate / enhance across the systems you own.

   Ethos: precise, confident, premium. Color is a signal,
   not decoration. Numbers are engineered, set in mono.
   No borrowed DNA — this is Maestro's own system.
   ============================================================ */

/* ---- FONTS ----
   Bricolage Grotesque — display / headlines (editorial character)
   Geist               — UI + body (clean, modern grotesque)
   Geist Mono          — every numeric readout, units, deltas
   Loaded via <link rel="preconnect"/preload"> in the page <head> (not an
   @import here) so they don't render-block the stylesheet.
   ------------------------------------------------------------ */

:root {
  /* ---- Surfaces (warm paper, true white cards) ---- */
  --paper:         #F6F4EF;   /* page background, warm off-white */
  --surface:       #FFFFFF;   /* cards, raised surfaces */
  --surface-sunk:  #EEEAE2;   /* inset wells, calculator, inputs */
  --surface-hover: #F1EDE6;
  --surface-press: #E7E2D8;

  /* ---- Foreground (cool-warm near-black) ---- */
  --fg:            #15171C;   /* primary text */
  --fg-secondary:  #4E525C;   /* secondary text */
  --fg-tertiary:   #868A93;   /* captions, hints */
  --fg-quaternary: #B6B8BD;   /* placeholder, muted marks */
  --fg-on-accent:  #FBFAF8;

  /* ---- Borders ---- */
  --border:        #E4DFD6;
  --border-strong: #D2CCC0;
  --border-focus:  var(--accent);

  /* ---- Accent: TEAL (default signal color) ---- */
  --accent:        #1E6E63;
  --accent-hover:  #195C53;
  --accent-press:  #144A43;
  --accent-fg:     #FBFAF8;
  --accent-soft:   #DCEBE8;
  --accent-line:   #3E8E82;

  /* ---- Coral: secondary brand color (from the mark), used sparingly ---- */
  --coral:         #E15C52;
  --coral-soft:    #F7E0DD;

  /* ---- Semantic (used sparingly) ---- */
  --info:    #335A7A;
  --success: #3E6B4E;
  --warning: #8A6A2A;
  --danger:  #8A4038;

  /* ---- Shadows (restrained, warm-tinted) ---- */
  --shadow-xs: 0 1px 0 0 rgba(21,23,28,0.04);
  --shadow-sm: 0 1px 2px 0 rgba(21,23,28,0.06);
  --shadow-md: 0 4px 14px -6px rgba(21,23,28,0.12), 0 1px 2px 0 rgba(21,23,28,0.05);
  --shadow-lg: 0 18px 44px -18px rgba(21,23,28,0.22), 0 3px 8px -2px rgba(21,23,28,0.08);

  /* ---- Type families ---- */
  --font-display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --font-sans:    "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---- Type scale ---- */
  --text-2xs:  11px;
  --text-xs:   12px;
  --text-sm:   13.5px;
  --text-base: 15.5px;
  --text-md:   17px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  30px;
  --text-3xl:  38px;
  --text-4xl:  48px;
  --text-5xl:  64px;

  /* ---- Line heights ---- */
  --lh-tight:  1.08;
  --lh-snug:   1.24;
  --lh-normal: 1.5;
  --lh-loose:  1.65;

  /* ---- Tracking ---- */
  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.02em;
  --tracking-wider:  0.08em;

  /* ---- Weights ---- */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
}

/* ---- DARK ---- */
:root[data-theme="dark"] {
  --paper:         #131318;
  --surface:       #1B1B22;
  --surface-sunk:  #0E0E12;
  --surface-hover: #22222B;
  --surface-press: #292932;

  --fg:            #F1EFEA;
  --fg-secondary:  #A6A8B0;
  --fg-tertiary:   #6E727C;
  --fg-quaternary: #44464E;
  --fg-on-accent:  #15171C;

  --border:        #2A2A33;
  --border-strong: #3A3A45;

  --accent:        #4FB3A4;
  --accent-hover:  #63C0B2;
  --accent-press:  #79CDC0;
  --accent-fg:     #0E0E12;
  --accent-soft:   #16241F;
  --accent-line:   #4FB3A4;

  --coral:         #F2766C;
  --coral-soft:    #2C1917;

  --shadow-xs: 0 1px 0 0 rgba(0,0,0,0.4);
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.5);
  --shadow-md: 0 4px 14px -6px rgba(0,0,0,0.6), 0 1px 2px 0 rgba(0,0,0,0.4);
  --shadow-lg: 0 18px 44px -18px rgba(0,0,0,0.7), 0 3px 8px -2px rgba(0,0,0,0.5);
}

/* ---- Base ---- */
html, body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--fg);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---- Numeric readout primitive ---- */
.readout {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  color: var(--fg);
}

/* ============================================================
   ACCENT PALETTES — shared by site + app (driven by Tweaks).
   Teal is the canonical default (above). These are alternates.
   ============================================================ */
:root[data-accent="teal"] {
  --accent:#1E6E63; --accent-hover:#195C53; --accent-press:#144A43;
  --accent-soft:#DCEBE8; --accent-line:#3E8E82; --accent-fg:#FBFAF8;
}
:root[data-accent="brass"] {
  --accent:#B26A1F; --accent-hover:#97591A; --accent-press:#7C4915;
  --accent-soft:#F3E7D6; --accent-line:#C98A3E; --accent-fg:#FBFAF8;
}
:root[data-accent="electric"] {
  --accent:#3A4ED6; --accent-hover:#2F40B8; --accent-press:#263499;
  --accent-soft:#E4E6FA; --accent-line:#5E6FE0; --accent-fg:#FBFAF8;
}
:root[data-accent="ink"] {
  --accent:#1C2028; --accent-hover:#12151B; --accent-press:#0A0C10;
  --accent-soft:#E8E9EC; --accent-line:#3A404C; --accent-fg:#FBFAF8;
}
:root[data-theme="dark"][data-accent="teal"]     { --accent:#4FB3A4; --accent-hover:#63C0B2; --accent-press:#79CDC0; --accent-soft:#16241F; --accent-line:#4FB3A4; --accent-fg:#0E0E12; }
:root[data-theme="dark"][data-accent="brass"]    { --accent:#E0954A; --accent-hover:#EAA661; --accent-press:#F0B576; --accent-soft:#2A2118; --accent-line:#E0954A; --accent-fg:#15171C; }
:root[data-theme="dark"][data-accent="electric"] { --accent:#8A95F0; --accent-hover:#9AA4F4; --accent-press:#AAB2F7; --accent-soft:#181A2E; --accent-line:#8A95F0; --accent-fg:#0E0E12; }
:root[data-theme="dark"][data-accent="ink"]      { --accent:#C9CDD6; --accent-hover:#D8DBE2; --accent-press:#E6E8ED; --accent-soft:#1E2028; --accent-line:#C9CDD6; --accent-fg:#0E0E12; }
