/*
  MC/TECH design tokens.
  Derived from the Mestreclique mark: lime #CCEB34, olive #8FA810, black, white.
  Light and dark are both first-class - see base.css for how [data-theme] flips these.
*/

:root {
  /* Brand */
  --mc-lime: #CCEB34;
  --mc-lime-ink: #4B5A08;   /* AA-safe text/link colour derived from lime for light backgrounds */
  --mc-olive: #8FA810;
  --mc-lime-soft: #F3F7CF;  /* lime tinted surface, light mode only */

  /* Light mode surface */
  --bg: #FAFAF6;
  --bg-raised: #FFFFFF;
  --surface: #F2F2EA;
  --fg: #131310;
  --muted: #68685E;
  --border: #E2E2D6;
  --border-strong: #C7C7B6;

  --accent: var(--mc-lime);
  --accent-ink: var(--mc-lime-ink);
  --accent-contrast: #0B0C05;
  --accent-soft: var(--mc-lime-soft);

  /* Code blocks follow the site theme (not a fixed dark treatment) - light values here need
     to hold their own contrast on --code-bg, independent of the dark-mode token colours below. */
  --code-bg: var(--surface);
  --code-fg: var(--fg);
  --code-bar-overlay: rgba(0, 0, 0, 0.04);
  --code-bar-border: rgba(0, 0, 0, 0.08);
  --code-comment: var(--muted);
  --code-string: #4B6B1A;
  --code-number: #7A6300;
  --code-keyword: #A14E17;
  --code-function: #1F5F8A;
  --code-operator: #5C5C52;
  --code-tag: #9C3D54;
  --code-deleted: #A13A2A;
  --code-inserted: #2F7A4A;

  --danger: #A3341C;
  --danger-soft: #F6E4DE;
  --success: #2E6B45;
  --success-soft: #E1EFE3;
  --warning: #8A6110;
  --warning-soft: #F6ECD6;

  --shadow-1: 0 1px 2px rgba(19, 19, 16, 0.06), 0 4px 16px rgba(19, 19, 16, 0.06);
  --shadow-2: 0 8px 32px rgba(19, 19, 16, 0.14);

  /* Typography */
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* Radius: deliberately restrained, editorial not "app" */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 6px;

  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;

  --content-width: 1240px;
  --reading-width: 700px;
}

/* Explicit dark choice */
:root[data-theme="dark"] {
  --bg: #0A0A08;
  --bg-raised: #131310;
  --surface: #171712;
  --fg: #F3F3EA;
  --muted: #9B9B8C;
  --border: #26261F;
  --border-strong: #38382E;

  --accent: var(--mc-lime);
  --accent-ink: #DCF35C;
  --accent-contrast: #0B0C05;
  --accent-soft: #1E230A;

  --code-bg: #0C0C09;
  --code-fg: #ECECDD;
  --code-bar-overlay: rgba(255, 255, 255, 0.03);
  --code-bar-border: rgba(255, 255, 255, 0.08);
  --code-comment: #7D7D6C;
  --code-string: #D7E78C;
  --code-number: var(--mc-lime);
  --code-keyword: #E8A86B;
  --code-function: #8FC7E8;
  --code-operator: #A9A99A;
  --code-tag: #E88F9C;
  --code-deleted: #E2705A;
  --code-inserted: #8FD7A8;

  --danger: #E2705A;
  --danger-soft: #2B1712;
  --success: #6FCB93;
  --success-soft: #12231A;
  --warning: #E8B84B;
  --warning-soft: #2A210E;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* System default (no explicit choice made yet) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0A0A08;
    --bg-raised: #131310;
    --surface: #171712;
    --fg: #F3F3EA;
    --muted: #9B9B8C;
    --border: #26261F;
    --border-strong: #38382E;

    --accent-ink: #DCF35C;
    --accent-soft: #1E230A;

    --code-bg: #0C0C09;
    --code-fg: #ECECDD;
    --code-bar-overlay: rgba(255, 255, 255, 0.03);
    --code-bar-border: rgba(255, 255, 255, 0.08);
    --code-comment: #7D7D6C;
    --code-string: #D7E78C;
    --code-number: var(--mc-lime);
    --code-keyword: #E8A86B;
    --code-function: #8FC7E8;
    --code-operator: #A9A99A;
    --code-tag: #E88F9C;
    --code-deleted: #E2705A;
    --code-inserted: #8FD7A8;

    --danger: #E2705A;
    --danger-soft: #2B1712;
    --success: #6FCB93;
    --success-soft: #12231A;
    --warning: #E8B84B;
    --warning-soft: #2A210E;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
}
