/* ==========================================================================
   Design tokens: the only place where colors, spacing, radii, shadows and
   fonts are defined. Values follow the "Token & komponen" design sheet.
   One accent (blue), two support colors (green = pass, amber = hint/warn).
   ========================================================================== */

:root {
  /* Fonts */
  --font-sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type scale */
  --fs-display: 44px;   --lh-display: 1.1;
  --fs-h1: 34px;        --lh-h1: 1.15;
  --fs-h2: 22px;        --lh-h2: 1.3;
  --fs-h3: 17px;
  --fs-body: 15px;      --lh-body: 1.65;
  --fs-small: 13px;
  --fs-tiny: 12px;      /* smallest text allowed */
  --fs-mono: 13.5px;    --lh-mono: 22px;

  /* Spacing (4 · 8 · 12 · 16 · 24 · 32 · 48) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  /* Radius (6 · 10 · 14 · pill) */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;

  /* Layout */
  --header-h: 64px;
  --footer-h: 44px;
  --content-max: 1200px;
  --tabbar-h: 64px;

  /* Light theme (default) */
  --c-bg: #FFFFFF;
  --c-surface: #F6F7F9;
  --c-border: #E4E7EC;
  --c-text: #101828;
  --c-muted: #566074;
  --c-accent: #3451D1;
  --c-accent-hover: #2A43B3;
  --c-accent-soft: #EEF1FD;
  --c-on-accent: #FFFFFF;
  --c-pass: #157347;
  --c-pass-soft: #E7F4EC;
  --c-hint: #8A4B00;
  --c-hint-soft: #FFF4E2;
  --c-tooltip-bg: #101828;
  --c-tooltip-text: #FFFFFF;
  --c-focus: #3451D1;

  /* Syntax highlighting */
  --syn-keyword: #3451D1;
  --syn-number: #8A4B00;
  --syn-string: #157347;
  --syn-comment: #6B7488;
  --syn-text: #101828;
  --syn-active-line: #EEF1FD;
  --syn-selection: #D7DEFA;

  /* Shadows: thin and quiet */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);

  --transition: 150ms ease;
  color-scheme: light;
}

/* Dark theme values, shared by the media query and the manual toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0E1116;
    --c-surface: #151A22;
    --c-border: #262D3A;
    --c-text: #E8EAEE;
    --c-muted: #A3ACBB;
    --c-accent: #8EA2FF;
    --c-accent-hover: #A8B7FF;
    --c-accent-soft: #1B2342;
    --c-on-accent: #0E1116;
    --c-pass: #5BD08F;
    --c-pass-soft: #12291D;
    --c-hint: #F0B35A;
    --c-hint-soft: #2E2312;
    --c-tooltip-bg: #E8EAEE;
    --c-tooltip-text: #0E1116;
    --c-focus: #8EA2FF;
    --syn-keyword: #8EA2FF;
    --syn-number: #F0B35A;
    --syn-string: #5BD08F;
    --syn-comment: #8590A3;
    --syn-text: #E8EAEE;
    --syn-active-line: #1B2342;
    --syn-selection: #2A3766;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c-bg: #0E1116;
  --c-surface: #151A22;
  --c-border: #262D3A;
  --c-text: #E8EAEE;
  --c-muted: #A3ACBB;
  --c-accent: #8EA2FF;
  --c-accent-hover: #A8B7FF;
  --c-accent-soft: #1B2342;
  --c-on-accent: #0E1116;
  --c-pass: #5BD08F;
  --c-pass-soft: #12291D;
  --c-hint: #F0B35A;
  --c-hint-soft: #2E2312;
  --c-tooltip-bg: #E8EAEE;
  --c-tooltip-text: #0E1116;
  --c-focus: #8EA2FF;
  --syn-keyword: #8EA2FF;
  --syn-number: #F0B35A;
  --syn-string: #5BD08F;
  --syn-comment: #8590A3;
  --syn-text: #E8EAEE;
  --syn-active-line: #1B2342;
  --syn-selection: #2A3766;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

@media (max-width: 640px) {
  :root {
    --fs-display: 32px;
    --fs-h1: 28px;
    --header-h: 56px;
  }
}
