/*
  Design tokens: theme  "Contour" (Chart Datum as cartographic texture).
  site.css reads only these custom properties. Day palette by default. The night palette
  follows prefers-color-scheme: dark; there is no manual switch.
  Fonts are self-hosted (SIL Open Font License; licences in assets/fonts/), latin subset.
  Type scale and spacing follow aimock.copilotkit.dev.
*/
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-normal-latin-var.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-italic-latin-var.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("/assets/fonts/jetbrains-mono-latin-var.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/jetbrains-mono-400-italic-latin.woff2") format("woff2"); }

:root {
  color-scheme: light;

  /* Typography: the type scale of aimock.copilotkit.dev. Atkinson Hyperlegible Next for prose
     and headings, so that similar characters in ids and figures stay distinct (1 l I, 0 O);
     JetBrains Mono for the brand, labels, buttons, numbers, coordinates and code. */
  --font-sans: "Atkinson Hyperlegible Next", -apple-system, system-ui, "Segoe UI", sans-serif;
  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);
  --font-display: var(--font-sans);
  --font-label: var(--font-sans);                 /* italic only: hydrographic names, as on charts */
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --font-features-mono: "liga" 0, "calt" 0;
  --font-size-base: 1rem;
  --font-size-small: 0.875rem;
  --font-size-label: 0.8rem;                      /* mono labels, table heads */

  --font-size-lead: 1.2rem;
  --font-size-sub: 1.15rem;                       /* section introductions */
  --font-size-display: clamp(1.75rem, 1.2rem + 1.2vw, 2rem);     /* Home title, inside the title panel */
  --font-size-h1: clamp(1.9rem, 1.2rem + 2.6vw, 3rem);
  --font-size-h2: clamp(1.5rem, 1.15rem + 1.4vw, 2.25rem);
  --font-size-h3: 1.05rem;
  --line-height-body: 1.6;                        /* interface text: navigation, tables, captions */
  --line-height-prose: 1.7;                       /* running text: paragraphs, list items */
  --line-height-lead: 1.7;
  --line-height-heading: 1.1;
  --font-weight-heading: 700;
  --tracking-display: -0.025em;                  /* Home hero only, as on the aimock hero */
  --tracking-title: -0.02em;                      /* page titles, as on the aimock docs */
  --tracking-heading: -0.015em;                   /* Home section headings, as on the aimock home */
  --tracking-doc: -0.01em;                        /* headings inside documentation pages (aimock docs: 0) */

  --measure: 68ch;
  --measure-prose: 36rem;                        /* running text: about 70 characters a line in the body face */
  --measure-page: 52rem;                          /* text column of a stand-alone page; a docs page's content is the same */

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-7: 2.5rem;
  --space-8: clamp(2.5rem, 2rem + 1.5vw, 3.25rem);
  --space-flow: 1rem;                             /* between paragraphs */
  /* Section rhythm. The type follows aimock.copilotkit.dev; the gaps are tighter than
     aimock's (144px between sections there), for less whitespace.
     Headings have line-height 1.1, so each gap at a heading adds --space-h2-leading
     (0.25em) to match the visible gap of a 1.6 line-height. */
  --space-section: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);            /* end of a section to the next heading */
  --space-h2-content: clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);        /* heading to its content */
  --space-h2-sub: 0.75rem;                        /* heading to its subtitle */
  --space-h2-leading: 0.25em;                     /* in the heading's em: (1.6 - 1.1) / 2 */
  --space-head: clamp(1rem, 0.8rem + 0.6vw, 1.5rem);                 /* below a section introduction */
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 2rem);
  --content-max: 70rem;
  --sidebar-w: 260px;                            /* documentation sidebar, as on the aimock docs */
  --header-h: 4rem;                               /* sticky header height, for scroll-margin */

  /* Layers */
  --z-sticky: 20;
  --z-skip: 30;

  /* Shape */
  --radius-sm: 2px; --radius-md: 4px; --border-width: 1px;
  --graticule: 120px 110px;  /* graticule cell, as in the hero chart */

  /* Motion */
  --duration-fast: 160ms;
  --easing: cubic-bezier(0.22, 1, 0.36, 1);      /* ease-out-quint */
  --easing-expo: cubic-bezier(0.16, 1, 0.3, 1);  /* ease-out-expo */

  /* Colour: day */
  --color-bg: oklch(1 0 0);
  --color-surface: oklch(0.955 0.018 230);
  --color-text: oklch(0.2 0.02 260);
  --color-text-muted: oklch(0.46 0.03 255);
  /* Running text is one step softer than headings and a step stronger than muted text, so a
     page of it reads as text and not as a caption. check-contrast.mjs checks it (prose pairs). */
  --color-prose: oklch(0.34 0.03 255);
  --color-border: oklch(0.86 0.02 240);
  --color-link: oklch(0.5 0.21 345);
  --color-link-hover: oklch(0.38 0.17 345);
  --color-accent: oklch(0.5 0.21 345);
  --color-focus: oklch(0.5 0.21 345);
  --color-note-bg: oklch(1 0 0);
  --color-note-border: oklch(0.5 0.21 345);
  --color-note-text: oklch(0.2 0.02 260);
  --color-code-bg: oklch(0.955 0.018 230);
  --color-code-text: oklch(0.2 0.02 260);
  --color-shoal: oklch(0.86 0.06 225);
  --color-shallow: oklch(0.92 0.04 225);
  --color-land: oklch(0.89 0.075 85);
  --color-coast: oklch(0.2 0.02 260);
  --color-on-accent: oklch(1 0 0);
  --color-grat: oklch(0.83 0.035 235);
  --color-contour: oklch(0.55 0.07 235);
  --color-sounding: oklch(0.42 0.04 250);
  --color-d10: oklch(0.95 0.025 225);
  --color-panel: oklch(1 0 0);
  --color-plot-official: oklch(0.2 0.02 260);
  --color-plot-ticon: oklch(0.52 0.12 240);
  --color-plot-fit: oklch(0.5 0.21 345);
  --color-plot-grid: oklch(0.9 0.02 235);
  --color-plot-grid-strong: oklch(0.78 0.03 240);
  --color-accent-glow: oklch(0.5 0.21 345 / 0.1);
  /* The code window on Home: chart ink in the day palette, a step below the page at night */
  --color-code-panel: oklch(0.24 0.04 255);
  --color-code-panel-raised: oklch(0.285 0.045 255);
  --color-code-panel-border: oklch(0.36 0.045 255);
  --color-code-panel-text: oklch(0.95 0.01 240);
  --color-code-panel-muted: oklch(0.78 0.03 240);
  --color-code-panel-accent: oklch(0.76 0.15 345);
  /* Syntax colours in the code window (scripts/highlight.mjs), from the chart: magenta
     keywords, sea-green strings, land-tint numbers, shoal-blue names */
  --color-tk-comment: oklch(0.74 0.03 245);
  --color-tk-keyword: oklch(0.78 0.14 345);
  --color-tk-string: oklch(0.84 0.1 175);
  --color-tk-number: oklch(0.87 0.1 85);
  --color-tk-fn: oklch(0.84 0.08 230);
  --color-tk-type: oklch(0.9 0.06 205);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-bg: oklch(0.15 0.005 250);
    --color-surface: oklch(0.2 0.008 250);
    --color-text: oklch(0.86 0.008 250);
    --color-text-muted: oklch(0.635 0.02 250);
    --color-prose: oklch(0.77 0.012 250);
    --color-border: oklch(0.3 0.01 250);
    --color-link: oklch(0.68 0.12 158);
    --color-link-hover: oklch(0.78 0.09 160);
    --color-accent: oklch(0.68 0.12 158);
    --color-focus: oklch(0.68 0.12 158);
    --color-note-bg: oklch(0.15 0.005 250);
    --color-note-border: oklch(0.68 0.12 158);
    --color-note-text: oklch(0.86 0.008 250);
    --color-code-bg: oklch(0.2 0.008 250);
    --color-code-text: oklch(0.86 0.008 250);
    --color-shoal: oklch(0.3 0.045 235);
    --color-shallow: oklch(0.22 0.03 235);
    --color-land: oklch(0.34 0.04 85);
    --color-coast: oklch(0.66 0.012 250);
    --color-on-accent: oklch(0.15 0.005 250);
    --color-grat: oklch(0.27 0.02 245);
    --color-contour: oklch(0.5 0.05 235);
    --color-sounding: oklch(0.68 0.02 245);
    --color-d10: oklch(0.18 0.018 240);
    --color-panel: oklch(0.15 0.005 250);
    --color-plot-official: oklch(0.86 0.008 250);
    --color-plot-ticon: oklch(0.8 0.1 225);
    --color-plot-fit: oklch(0.68 0.12 158);
    --color-plot-grid: oklch(0.27 0.02 245);
    --color-plot-grid-strong: oklch(0.4 0.03 245);
    --color-accent-glow: oklch(0.68 0.12 158 / 0.15);
    --color-code-panel: oklch(0.12 0.006 250);
    --color-code-panel-raised: oklch(0.175 0.008 250);
    --color-code-panel-border: oklch(0.3 0.01 250);
    --color-code-panel-text: oklch(0.88 0.008 250);
    --color-code-panel-muted: oklch(0.7 0.02 250);
    --color-code-panel-accent: oklch(0.72 0.12 158);
    --color-tk-comment: oklch(0.68 0.02 250);
    --color-tk-keyword: oklch(0.76 0.12 158);
    --color-tk-string: oklch(0.8 0.08 220);
    --color-tk-number: oklch(0.84 0.09 85);
    --color-tk-fn: oklch(0.86 0.05 250);
    --color-tk-type: oklch(0.84 0.07 195);
  }
}


@media (max-width: 48rem) {
  :root { --header-h: 5.75rem; }                 /* two-row header: brand line + nav row */
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-fast: 0ms; }
}
