/*
 * Ottercell Energy — design tokens.
 *
 * Every adjustable value lives here. site.css contains no colours, sizes or
 * timings of its own; it only refers to the names below.
 *
 * Two tiers:
 *   1. Raw values   — the palette and the scales. Change these to change
 *                     what a colour or a step actually is.
 *   2. Roles        — what a value is used for. Change these to point a role
 *                     at a different raw value.
 *
 * Breakpoints are the one thing that cannot be a variable (CSS does not allow
 * variables inside media queries). They are listed at the top of site.css.
 */

:root {
  /* ==================================================================
     1. RAW VALUES
     ================================================================== */

  /* ---------- palette ---------- */
  --white: #fff;
  --grey-50: #f5f7fb;
  --grey-100: #eaeef5;
  --grey-200: #dce2ed;
  --grey-400: #8fa0be;
  --grey-500: #76829a;
  --grey-600: #5b667a;
  --grey-900: #101828;
  --blue-300: #5fc1e8;
  --blue-500: #26a6de;
  --blue-700: #1857a6;
  --blue-900: #0c2b57;
  --green-700: #127a46;
  --red-700: #b42318;

  /* ---------- font families ---------- */
  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* ---------- type scale (1rem = the reader's browser font size) ---------- */
  --text-2xs: 0.625rem;
  --text-xs: 0.6875rem;
  --text-sm: 0.7813rem;
  --text-md: 0.9063rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.625rem;

  /* Fluid sizes: minimum, preferred (scales with the window), maximum. */
  --text-display: clamp(2.375rem, 4.6vw, 3.625rem);
  --text-title-lg: clamp(1.75rem, 3vw, 2.375rem);
  --text-title: clamp(1.625rem, 3vw, 2.125rem);

  /* ---------- font weights ---------- */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---------- line height and letter spacing ---------- */
  --leading-tight: 1.08;
  --leading-body: 1.5;
  --tracking-tight: -0.01em;
  --tracking-slight: 0.01em;
  --tracking-wide: 0.04em;

  /* ---------- spacing scale (0.25rem steps) ---------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-11: 2.75rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* ---------- radii ---------- */
  --radius-xs: 2px;
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-round: 50%;

  /* ---------- border widths ---------- */
  --border-thin: 1px;
  --border-thick: 2px;

  /* ---------- motion ---------- */
  --duration-fast: 0.15s;
  --duration-draw: 1.8s;
  --easing: ease;

  /* ---------- stacking order ---------- */
  --z-header: 50;
  --z-skip-link: 100;

  /* ==================================================================
     2. ROLES
     ================================================================== */

  /* ---------- colour: page ---------- */
  --color-bg: var(--white);
  --color-surface: var(--grey-50);
  --color-text: var(--grey-900);
  --color-text-muted: var(--grey-600);
  --color-heading: var(--blue-900);
  --color-border: var(--grey-200);
  --color-border-subtle: var(--grey-100);

  /* ---------- colour: brand ---------- */
  --color-brand: var(--blue-900);
  --color-accent: var(--blue-700);
  --color-highlight: var(--blue-500);
  --color-highlight-soft: var(--blue-300);
  --color-highlight-glow: rgb(38 166 222 / 18%);
  --color-status-ok: var(--green-700);
  --color-status-error: var(--red-700);

  /* ---------- colour: on dark (brand-coloured) backgrounds ---------- */
  --color-on-brand: var(--white);
  --color-on-brand-muted: rgb(255 255 255 / 68%);
  --color-on-brand-subtle: rgb(255 255 255 / 60%);
  --color-on-brand-line: rgb(255 255 255 / 35%);
  --color-on-brand-border: rgb(255 255 255 / 16%);
  --color-on-brand-surface: rgb(255 255 255 / 3%);

  /* ---------- colour: controls ---------- */
  --color-control-bg: var(--white);
  --color-control-border: var(--grey-500); /* 3:1 minimum against the page */
  --color-focus: var(--blue-700);
  --color-focus-on-brand: var(--blue-500);
  --color-diagram-guide: var(--grey-400);

  /* ---------- colour: header and footer ---------- */
  --color-header-bg: var(--grey-900);
  --color-footer-bg: var(--grey-900);

  /* ---------- borders ---------- */
  --border: var(--border-thin) solid var(--color-border);
  --border-subtle: var(--border-thin) solid var(--color-border-subtle);
  --border-on-brand: var(--border-thin) solid var(--color-on-brand-border);
  --border-control: var(--border-thin) solid var(--color-control-border);

  /* ---------- focus ring ---------- */
  --focus-width: 3px;
  --focus-offset: 2px;

  /* ---------- page layout ---------- */
  --wrap-max: 73.75rem;
  --gutter: var(--space-8);
  --gutter-narrow: var(--space-5);
  --header-height: 4.875rem;
  --section-padding: var(--space-24);
  --hero-padding-top: var(--space-24);
  --hero-padding-bottom: var(--space-16);
  --hero-padding-top-narrow: var(--space-14);
  --hero-padding-bottom-narrow: var(--space-10);
  --footer-padding-top: var(--space-12);
  --footer-padding-bottom: var(--space-8);
  --grid-gap: var(--space-16);
  --grid-gap-hero: var(--space-14);

  /* Column ratios for the two-column sections (left right). */
  --columns-hero: 1.05fr 0.95fr;
  --columns-technology: 0.85fr 1.15fr;
  --columns-origin: 1.1fr 0.9fr;
  --columns-contact: 0.8fr 1.2fr;
  --columns-use-case: var(--space-16) 1fr 1.4fr;
  --columns-use-case-narrow: var(--space-11) 1fr;

  /* Maximum line lengths. */
  --measure-display: 12.5ch;
  --measure-title: 12ch;
  --measure-text: 46ch;
  --measure-text-wide: 52ch;
  --measure-section-head: 40rem;
  --measure-hero-stats: 32.5rem;

  /* ---------- components ---------- */
  --logo-height: 2.125rem;
  --logo-height-footer: 1.625rem;

  --nav-gap: var(--space-9);
  --tap-target: 2.75rem; /* minimum comfortable touch size */
  --icon-size: 2.75rem;
  --icon-size-menu: 1.375rem;
  --icon-stroke: 1.6;

  --button-padding-y: var(--space-3);
  --button-padding-x: var(--space-6);
  --button-radius: var(--radius-sm);

  --control-padding-y: var(--space-3);
  --control-padding-x: var(--space-4);
  --control-radius: var(--radius-sm);
  --textarea-min-height: 6.25rem;

  --card-padding: var(--space-6);
  --card-radius: var(--radius-lg);
  --panel-padding: var(--space-7);
  --panel-radius: var(--radius-md);
  --form-padding: var(--space-10);
  --form-padding-narrow: var(--space-6);

  --bracket-size: 1.125rem;
  --bracket-width: var(--border-thick);
  --bracket-color: var(--color-highlight);

  --dot-size: 0.4375rem;
  --dot-ring: 3px;

  --battery-image-ratio: 1092 / 604; /* the taller of the two battery renders */
  --hero-grid-cell: 1.75rem; /* graph-paper background behind the cell diagram */
  --diagram-label-size: 11px; /* in the diagram's own units; scales with it */
  --draw-length: 600;
}
