/*
 * Design tokens for the Verkilo static site (Oatmeal theme).
 * A focused subset of the Rails app's token system: only what the Oatmeal
 * theme + composition primitives need. OKLCH throughout.
 */
@layer reset, base, composition, components, modules, utilities;

:root {
  /* Fonts (mapped to the Google Fonts CDN loaded in the layout head) */
  --font-sans: "Geist", system-ui, sans-serif;
  --font-display: "Solway", ui-serif, Georgia, serif;
  --font-brand: "Merriweather Sans", "Geist", system-ui, sans-serif;
  --font-serif: ui-serif, serif;
  --font-mono: ui-monospace, monospace;

  /* Type scale */
  --text-xx-small: 0.55rem;
  --text-x-small: 0.75rem;
  --text-small: 0.85rem;
  --text-normal: 1rem;
  --text-prose: 1.0625rem; /* long-form reading text (about, legal, docs) */
  --text-medium: 1.1rem;
  --text-large: 1.5rem;
  --text-x-large: 1.8rem;
  --text-xx-large: 2.5rem;

  /* Spacing */
  --inline-space: 1ch;
  --inline-space-half: calc(var(--inline-space) / 2);
  --block-space: 1rem;

  /* Radii */
  --radius-2: 5px;
  --radius-3: 1rem;

  /* Layout */
  --main-width: 1400px;
  --main-padding: clamp(1rem, 4vw, 2rem);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-index */
  --z-nav: 30;

  /* Brand — "syo-ro" teal */
  --color-syo-ro-50: oklch(0.948 0.066 179.56);
  --color-syo-ro-100: oklch(0.896 0.142 179.34);
  --color-syo-ro-200: oklch(0.819 0.13 179.39);
  --color-syo-ro-300: oklch(0.735 0.116 179.27);
  --color-syo-ro-400: oklch(0.66 0.105 179.47);
  --color-syo-ro-500: oklch(0.577 0.091 179.5);
  --color-syo-ro-600: oklch(0.491 0.078 179.63);
  --color-syo-ro-700: oklch(0.398 0.063 179.53);
  --color-syo-ro-800: oklch(0.312 0.049 180.39);
  --color-syo-ro-900: oklch(0.22 0.035 179.11);
  --color-syo-ro-950: oklch(0.173 0.028 177.86);
  --color-brand: var(--color-syo-ro-600);

  /* Accent — Tailwind Olive (warm, from the Oatmeal template) */
  --color-olive-50: oklch(98.8% 0.003 106.5);
  --color-olive-100: oklch(96.6% 0.005 106.5);
  --color-olive-200: oklch(93% 0.007 106.5);
  --color-olive-300: oklch(88% 0.011 106.6);
  --color-olive-400: oklch(73.7% 0.021 106.9);
  --color-olive-500: oklch(58% 0.031 107.3);
  --color-olive-600: oklch(46.6% 0.025 107.3);
  --color-olive-700: oklch(39.4% 0.023 107.4);
  --color-olive-800: oklch(28.6% 0.016 107.4);
  --color-olive-900: oklch(22.8% 0.013 107.4);
  --color-olive-950: oklch(15.3% 0.006 107.1);

  /* Accent — Mist (cool slate; aligns with the Syo-Ro app UI) */
  --color-mist-50: oklch(98.7% 0.002 197.1);
  --color-mist-100: oklch(96.3% 0.002 197.1);
  --color-mist-200: oklch(92.5% 0.005 214.3);
  --color-mist-300: oklch(87.2% 0.007 219.6);
  --color-mist-400: oklch(72.3% 0.014 214.4);
  --color-mist-500: oklch(56% 0.021 213.5);
  --color-mist-600: oklch(45% 0.017 213.2);
  --color-mist-700: oklch(37.8% 0.015 216);
  --color-mist-800: oklch(27.5% 0.011 216.9);
  --color-mist-900: oklch(21.8% 0.008 223.9);
  --color-mist-950: oklch(14.8% 0.004 228.8);

  /* Neutral/accent candidate "Mauve" (H≈322°) — cool violet-gray */
  --color-mauve-50: oklch(98.5% 0 0);
  --color-mauve-100: oklch(96% 0.003 325.6);
  --color-mauve-200: oklch(92.2% 0.005 325.62);
  --color-mauve-300: oklch(86.5% 0.012 325.68);
  --color-mauve-400: oklch(71.1% 0.019 323.02);
  --color-mauve-500: oklch(54.2% 0.034 322.5);
  --color-mauve-600: oklch(43.5% 0.029 321.78);
  --color-mauve-700: oklch(36.4% 0.029 323.89);
  --color-mauve-800: oklch(26.3% 0.024 320.12);
  --color-mauve-900: oklch(21.2% 0.019 322.12);
  --color-mauve-950: oklch(14.5% 0.008 326);

  /* Neutral/accent candidate "Taupe" (H≈40°) — warm brown-gray */
  --color-taupe-50: oklch(98.6% 0.002 67.8);
  --color-taupe-100: oklch(96% 0.002 17.2);
  --color-taupe-200: oklch(92.2% 0.005 34.3);
  --color-taupe-300: oklch(86.8% 0.007 39.5);
  --color-taupe-400: oklch(71.4% 0.014 41.2);
  --color-taupe-500: oklch(54.7% 0.021 43.1);
  --color-taupe-600: oklch(43.8% 0.017 39.3);
  --color-taupe-700: oklch(36.7% 0.016 35.7);
  --color-taupe-800: oklch(26.8% 0.011 36.5);
  --color-taupe-900: oklch(21.4% 0.009 43.1);
  --color-taupe-950: oklch(14.7% 0.004 49.3);

  /* Accent candidate "Haze" — Mist curve, chroma ×2.38 (500=0.05), hue 198 (option C) */
  --color-haze-50: oklch(98.7% 0.0048 198);
  --color-haze-100: oklch(96.3% 0.0048 198);
  --color-haze-200: oklch(92.5% 0.0119 198);
  --color-haze-300: oklch(87.2% 0.0167 198);
  --color-haze-400: oklch(72.3% 0.0333 198);
  --color-haze-500: oklch(56% 0.05 198);
  --color-haze-600: oklch(45% 0.0405 198);
  --color-haze-700: oklch(37.8% 0.0357 198);
  --color-haze-800: oklch(27.5% 0.0262 198);
  --color-haze-900: oklch(21.8% 0.019 198);
  --color-haze-950: oklch(14.8% 0.0095 198);

  /* Accent candidate "Patina" — Mist curve, chroma ×2.38 (500=0.05), hue 190 (option D) */
  --color-patina-50: oklch(98.7% 0.0048 190);
  --color-patina-100: oklch(96.3% 0.0048 190);
  --color-patina-200: oklch(92.5% 0.0119 190);
  --color-patina-300: oklch(87.2% 0.0167 190);
  --color-patina-400: oklch(72.3% 0.0333 190);
  --color-patina-500: oklch(56% 0.05 190);
  --color-patina-600: oklch(45% 0.0405 190);
  --color-patina-700: oklch(37.8% 0.0357 190);
  --color-patina-800: oklch(27.5% 0.0262 190);
  --color-patina-900: oklch(21.8% 0.019 190);
  --color-patina-950: oklch(14.8% 0.0095 190);

  /* Accent candidate "Oxblood" (palette A) — vivid wine; Tailwind-normal
     lightness curve so 500/600 read as rich red, not near-black. */
  --color-oxblood-50: oklch(95.33% 0.014 17.4);
  --color-oxblood-100: oklch(90.47% 0.030 15.17);
  --color-oxblood-200: oklch(80.99% 0.063 17.31);
  --color-oxblood-300: oklch(71.81% 0.097 18.91);
  --color-oxblood-400: oklch(63.06% 0.135 20.52);
  --color-oxblood-500: oklch(55.37% 0.169 23.79);
  --color-oxblood-600: oklch(47.18% 0.141 23.32);
  --color-oxblood-700: oklch(38.61% 0.111 23.25);
  --color-oxblood-800: oklch(29.60% 0.082 22.49);
  --color-oxblood-900: oklch(19.89% 0.046 19.89);
  --color-oxblood-950: oklch(16.87% 0.032 21.01);

  /* Accent candidate "Clay" — Oxblood's curve, chroma dialed to Mauve/Olive
     level (500=0.034): a muted dusty rose-brown. */
  --color-clay-50: oklch(95.33% 0.0028 17.4);
  --color-clay-100: oklch(90.47% 0.006 15.17);
  --color-clay-200: oklch(80.99% 0.0127 17.31);
  --color-clay-300: oklch(71.81% 0.0195 18.91);
  --color-clay-400: oklch(63.06% 0.0272 20.52);
  --color-clay-500: oklch(55.37% 0.034 23.79);
  --color-clay-600: oklch(47.18% 0.0284 23.32);
  --color-clay-700: oklch(38.61% 0.0223 23.25);
  --color-clay-800: oklch(29.60% 0.0165 22.49);
  --color-clay-900: oklch(19.89% 0.0093 19.89);
  --color-clay-950: oklch(16.87% 0.0064 21.01);

  /* Accent candidate "Rosewood" — Oxblood curve, chroma x0.444 (500=0.075):
     soft dusty wine, midway between vivid Oxblood and muted Clay. */
  --color-rosewood-50: oklch(95.33% 0.0062 17.4);
  --color-rosewood-100: oklch(90.47% 0.0133 15.17);
  --color-rosewood-200: oklch(80.99% 0.028 17.31);
  --color-rosewood-300: oklch(71.81% 0.043 18.91);
  --color-rosewood-400: oklch(63.06% 0.0599 20.52);
  --color-rosewood-500: oklch(55.37% 0.075 23.79);
  --color-rosewood-600: oklch(47.18% 0.0626 23.32);
  --color-rosewood-700: oklch(38.61% 0.0493 23.25);
  --color-rosewood-800: oklch(29.60% 0.0364 22.49);
  --color-rosewood-900: oklch(19.89% 0.0204 19.89);
  --color-rosewood-950: oklch(16.87% 0.0142 21.01);

  /* Accent candidate "Rust" (H≈35.5°) — warm red-orange, chroma dialed down to
     500=0.09 (was 0.152) for a softer, less-vivid rust. */
  --color-rust-50: oklch(98.0% 0.0136 35.5);
  --color-rust-100: oklch(95.0% 0.029 35.5);
  --color-rust-200: oklch(90.0% 0.0491 35.5);
  --color-rust-300: oklch(83.0% 0.0716 35.5);
  --color-rust-400: oklch(75.0% 0.0853 35.5);
  --color-rust-500: oklch(66.5% 0.09 35.5);
  --color-rust-600: oklch(58.0% 0.0847 35.5);
  --color-rust-700: oklch(50.0% 0.0752 35.5);
  --color-rust-800: oklch(42.0% 0.0628 35.5);
  --color-rust-900: oklch(35.5% 0.0491 35.5);
  --color-rust-950: oklch(24.0% 0.0314 35.5);

  /* Accent candidate "Copper" (H≈60.4°) — warmer, more orange/yellow-shifted */
  --color-copper-50: oklch(98.0% 0.018 60.4);
  --color-copper-100: oklch(95.0% 0.037 60.4);
  --color-copper-200: oklch(90.0% 0.064 60.4);
  --color-copper-300: oklch(83.0% 0.094 60.4);
  --color-copper-400: oklch(75.0% 0.111 60.4);
  --color-copper-500: oklch(66.5% 0.117 60.4);
  --color-copper-600: oklch(58.0% 0.110 60.4);
  --color-copper-700: oklch(50.0% 0.098 60.4);
  --color-copper-800: oklch(42.0% 0.082 60.4);
  --color-copper-900: oklch(35.5% 0.064 60.4);
  --color-copper-950: oklch(24.0% 0.041 60.4);

  /* Accent candidate "Terracotta" (H≈32.9°) — near Rust, slightly lighter/more saturated */
  --color-terracotta-50: oklch(98.0% 0.022 32.9);
  --color-terracotta-100: oklch(95.0% 0.046 32.9);
  --color-terracotta-200: oklch(90.0% 0.079 32.9);
  --color-terracotta-300: oklch(83.0% 0.116 32.9);
  --color-terracotta-400: oklch(75.0% 0.137 32.9);
  --color-terracotta-500: oklch(66.5% 0.144 32.9);
  --color-terracotta-600: oklch(58.0% 0.136 32.9);
  --color-terracotta-700: oklch(50.0% 0.121 32.9);
  --color-terracotta-800: oklch(42.0% 0.101 32.9);
  --color-terracotta-900: oklch(35.5% 0.079 32.9);
  --color-terracotta-950: oklch(24.0% 0.051 32.9);

  /* Tailwind Teal — reference standard-curve teal (near-gray lights, mid-peak chroma) */
  --color-teal-50: oklch(98.4% 0.014 180.72);
  --color-teal-100: oklch(95.3% 0.051 180.801);
  --color-teal-200: oklch(91% 0.096 180.426);
  --color-teal-300: oklch(85.5% 0.138 181.071);
  --color-teal-400: oklch(77.7% 0.152 181.912);
  --color-teal-500: oklch(70.4% 0.14 182.503);
  --color-teal-600: oklch(60% 0.118 184.704);
  --color-teal-700: oklch(51.1% 0.096 186.391);
  --color-teal-800: oklch(43.7% 0.078 188.216);
  --color-teal-900: oklch(38.6% 0.063 188.416);
  --color-teal-950: oklch(27.7% 0.046 192.524);

  /* Accent candidate "Pine" — Tailwind Teal's lightness+hue with Mauve's chroma
     per stop: a proper standard-curve muted teal (gray lights, peak 0.034 @ 500). */
  --color-pine-50: oklch(98.4% 0 180.72);
  --color-pine-100: oklch(95.3% 0.003 180.801);
  --color-pine-200: oklch(91% 0.005 180.426);
  --color-pine-300: oklch(85.5% 0.012 181.071);
  --color-pine-400: oklch(77.7% 0.019 181.912);
  --color-pine-500: oklch(70.4% 0.034 182.503);
  --color-pine-600: oklch(60% 0.029 184.704);
  --color-pine-700: oklch(51.1% 0.029 186.391);
  --color-pine-800: oklch(43.7% 0.024 188.216);
  --color-pine-900: oklch(38.6% 0.019 188.416);
  --color-pine-950: oklch(27.7% 0.008 192.524);

  /* Site accent — locked to Pine. Repoint these 11 lines to reskin the whole
     accent (buttons, links, eyebrows, icons, wallpaper) in one place. */
  --color-accent-50: var(--color-pine-50);
  --color-accent-100: var(--color-pine-100);
  --color-accent-200: var(--color-pine-200);
  --color-accent-300: var(--color-pine-300);
  --color-accent-400: var(--color-pine-400);
  --color-accent-500: var(--color-pine-500);
  --color-accent-600: var(--color-pine-600);
  --color-accent-700: var(--color-pine-700);
  --color-accent-800: var(--color-pine-800);
  --color-accent-900: var(--color-pine-900);
  --color-accent-950: var(--color-pine-950);

  /* Neutral — Tailwind Stone (warm gray) */
  --color-stone-50: oklch(0.985 0.001 106.423);
  --color-stone-100: oklch(0.97 0.001 106.424);
  --color-stone-200: oklch(0.923 0.003 48.717);
  --color-stone-300: oklch(0.869 0.005 56.366);
  --color-stone-400: oklch(0.709 0.01 56.259);
  --color-stone-500: oklch(0.553 0.013 58.071);
  --color-stone-600: oklch(0.444 0.011 73.639);
  --color-stone-700: oklch(0.374 0.01 67.558);
  --color-stone-800: oklch(0.268 0.007 34.298);
  --color-stone-900: oklch(0.216 0.006 56.043);
  --color-stone-950: oklch(0.147 0.004 49.25);

  /* Neutral "Sandstone" — Stone's lightness curve on the cream canvas hue
     (H≈83°), chroma peaking at 0.03 mid-scale: a warm sand neutral. */
  --color-sandstone-50: oklch(98.5% 0.012 83);
  --color-sandstone-100: oklch(97% 0.015 83);
  --color-sandstone-200: oklch(92.3% 0.02 83);
  --color-sandstone-300: oklch(86.9% 0.024 83);
  --color-sandstone-400: oklch(70.9% 0.028 83);
  --color-sandstone-500: oklch(55.3% 0.03 83);
  --color-sandstone-600: oklch(44.4% 0.026 83);
  --color-sandstone-700: oklch(37.4% 0.022 83);
  --color-sandstone-800: oklch(26.8% 0.016 83);
  --color-sandstone-900: oklch(21.6% 0.012 83);
  --color-sandstone-950: oklch(14.7% 0.008 83);

  /* Semantic status (comparison checks / crosses) — light mode (deep). */
  --color-positive: oklch(0.44 0.12 150);
  --color-negative: oklch(0.44 0.18 27);
}

@media (max-width: 48em) /* --breakpoint-md */ {
  :root {
    --text-xx-small: 0.65rem;
    --text-x-small: 0.85rem;
    --text-small: 0.95rem;
    --text-normal: 1.1rem;
    --text-medium: 1.2rem;
  }
}

/* Status colors brighten in dark mode for contrast on the dark canvas
   (explicit toggle + system preference). */
html[data-theme="dark"] {
  --color-positive: oklch(0.74 0.117 145);
  --color-negative: oklch(0.74 0.139 42);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --color-positive: oklch(0.74 0.117 145);
    --color-negative: oklch(0.74 0.139 42);
  }
}

/* ─────────────────── Docs-site additions (support.verkilo.com) ────────────
 * The support site shares the ramps above with verkilo.com and adds the scale
 * steps the docs redesign needs. Root font-size is 112.5% (18px), so the
 * comments give the rendered pixel size, not the design's 16px-base spec.
 */
:root {
  /* Type scale — intermediate steps between --text-x-small and --text-medium
     that the docs shell leans on (mono kickers, tree, prose, ledes). */
  --text-micro: 0.65rem;   /* 11.7px — kickers, breadcrumb, meta rail, kbd */
  --text-compact: 0.8rem;  /* 14.4px — nav, doc tree, on-this-page, footer */
  --text-body: 0.92rem;    /* 16.6px — docs prose */
  --text-lede: 1.08rem;    /* 19.4px — article and page ledes */

  /* Fluid headline sizes. Docs runs three h1 weights (home, section, article)
     and one article h2; each tops out at the redesign's specified size. */
  --text-h1-home: clamp(2.4rem, 1.5rem + 3.6vw, 3.8rem);     /* → 68px */
  --text-h1-section: clamp(2.1rem, 1.4rem + 2.8vw, 3rem);    /* → 54px */
  --text-h1-article: clamp(2rem, 1.35rem + 2.6vw, 2.9rem);   /* → 52px */
  --text-h2-article: clamp(1.45rem, 1.1rem + 1.5vw, 1.75rem);/* → 31px */

  /* Spacing scale — the docs layout is built on rules and gutters rather than
     the marketing site's section bands, so it needs finer steps than
     --block-space alone. */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 5.5rem;

  /* Composition defaults. Every value the layout primitives use, named for
     the role it plays there, so composition.css types no literals. Three
     steps fall between the ladder's rungs; they are named rather than forced
     onto the nearest rung so the rhythm is unchanged. */
  --space-hair: 0.35rem;  /* .flow-2xs — tighter than --space-3xs reads */
  --space-nudge: 1.75rem; /* .grid-roomy — between --space-md and --space-lg */
  --space-step: 2.5rem;   /* .flow-lg / .grid-loose — between lg and xl */

  --space-gap: var(--space-sm);              /* default gap, every primitive */
  --space-band: clamp(3rem, 8vw, 6rem);      /* .region vertical band */
  --space-flow-xl: clamp(2.5rem, 6vw, 4rem); /* .flow-xl */
  --space-split: clamp(2rem, 5vw, 4.5rem);   /* .split column gap */

  --col-grid: 16rem;         /* .grid default minimum column */
  --col-grid-compact: 12rem;
  --col-grid-narrow: 8rem;
  --col-rail: 12rem;         /* .rail fixed side column */

  /* Breakpoints. CSS cannot read a custom property inside a media condition,
     so every @media repeats the literal with a comment naming the token;
     these two declarations are the documentation of record. Em units, so the
     boundaries scale with the reader's font size (px spec ÷ 16). */
  --breakpoint-md: 48em; /* 768px */
  --breakpoint-lg: 64em; /* 1024px */

  /* Radii. Figures and prev/next plates are deliberately square — they are
     plates, not cards — so only fields and pills carry a radius here. */
  --radius-1: 0.25rem;     /* kbd, small chips */
  --radius-field: 0.45rem; /* search field, inputs, screenshot mats */
  --radius-pill: 999px;

  /* Measures — line lengths the redesign specifies, named by role. */
  --measure-docs-prose: 66ch;
  --measure-docs-lede: 64ch;
  --measure-docs-lede-mid: 56ch;
  --measure-docs-lede-short: 48ch;
  --measure-docs-blurb: 44ch;
  --measure-docs-note: 78ch;

  /* Docs shell geometry. Everything sticky below the masthead offsets by
     --docs-header, so the two must stay in step. */
  --docs-header: 4.1rem;  /* 74px */
  --docs-tree: 15.3rem;   /* 276px */
  --docs-toc: 12rem;      /* 216px */
  --docs-gutter: 2.7rem;  /* 48px */
  --docs-column-gap: 3.1rem; /* 56px */
  --docs-max: 80rem;      /* 1440px */
  --docs-search-max: 23.3rem; /* 420px */
  --docs-dialog-width: 38rem;
  --docs-dialog-offset: 12vh;
  --docs-results-max: 55vh;   /* the results list scrolls past this */

  /* Tracking. Display type is set tight, the monospace utility voice wide;
     every value the docs use is named here rather than typed per rule. */
  --tracking-tight: -0.01em;
  --tracking-tighter: -0.015em;
  --tracking-display: -0.022em;
  --tracking-display-lg: -0.025em;
  --tracking-caps: 0.12em;
  --tracking-caps-loose: 0.06em;
  --tracking-caps-wide: 0.08em;
  --tracking-caps-mid: 0.1em;
  --tracking-caption: 0.03em;

  /* Named lengths for the parts whose size is the design, not the scale. */
  --space-4xs: 0.125rem;
  --docs-mark: 1.1rem;          /* the wordmark's peak glyph */
  --docs-toggle: 1.8rem;        /* the theme toggle's circle */
  --docs-index-num: 2.9rem;     /* numeral column, home + section index */
  --docs-index-num-compact: 2.4rem;
  --docs-term: 7.3rem;          /* term column of a definition grid */
  --rule-width: 0.1875rem;      /* page-head spot rule, 3px */
  --rule-length: 5.3rem;        /* page-head spot rule, 96px */
  --rule-length-short: 3.1rem;  /* article h2 spot rule, 56px */

  /* The skip link has to paint over the sticky masthead, which sits at
     --z-nav; same stacking level would lose on DOM order. */
  --z-skip: 40;

  /* Marks and rings — the only strokes on the site heavier than a hairline:
     the copper spine beside the current tree/TOC entry, and the focus ring. */
  --spine-width: 0.12rem;
  --focus-ring-width: 0.12rem;
  --focus-ring-offset: 0.12rem;
  --underline-offset: 0.15em; /* link hover underline; em, so it tracks size */
}
