/* Tesio's shared tokens and browser surfaces. Every page loads this before its
   own styles. Sizes grow with the screen: a phone gets 48 px targets, a Tesla's
   landscape screen (about 1920 px wide) gets 64 px targets and 19 px text, read
   at arm's length. Colours are the brand's (DESIGN.md); every text pair here is
   at least 4.5:1, and borders are at least 3:1. */
:root {
  color-scheme: dark;
  --bg: #171B1A;          /* charcoal */
  --surface: #222826;
  --surface-2: #2C3331;
  --line: #7C8582;        /* 3.4:1 on --surface-2 and up */
  --text: #FAF4E8;        /* ivory, 15.9:1 */
  --text-2: #D6D0C4;      /* 11.3:1 */
  --muted: #B3ADA2;       /* 7.8:1 on --bg, 5.8:1 on --surface-2 */
  --accent: #FFBB64;      /* amber, 10.4:1 */
  --on-accent: #171B1A;
  --danger: #FF8A75;      /* 7.6:1 */
  --danger-bg: #8E2A1E;
  --scrim: rgba(12, 14, 13, 0.82);

  --tap: clamp(48px, 2.4vw + 18px, 64px);
  --tap-big: clamp(56px, 3vw + 20px, 80px);
  --fs-body: clamp(15px, 0.5vw + 9px, 20px);
  --fs-label: clamp(15px, 0.6vw + 8px, 20px);
  --fs-small: clamp(13px, 0.4vw + 8px, 16px);
  --fs-h2: clamp(18px, 0.9vw + 8px, 26px);
  --gap: clamp(10px, 0.8vw + 4px, 20px);
  --radius: 10px;
}

html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
::selection { background: var(--accent); color: var(--on-accent); }
:where(input, textarea) { caret-color: var(--accent); }
::placeholder { color: var(--muted); opacity: 1; }
:where(input[type="range"], input[type="checkbox"], input[type="radio"], progress) { accent-color: var(--accent); }
* { scrollbar-color: var(--line) transparent; }

/* One visible focus ring everywhere, in the brand amber. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

/* Screen-reader-only text. */
.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
