/*
  OpenCaptions design tokens — shared by every page (app, overlay, landing site). No build step: link it, or
  @import it, before any other stylesheet.

  Colour rule: lime only on ink, or ink on lime. Never lime on paper, never lime as text on a light background.
  So lime is a *fill* (highlighter, primary button, live word) with ink on top; where an emphasis colour is needed
  as text or a stroke, use --accent-fg (ink on light, lime on dark). Keep lime to ~10 % of any screen.
*/
@import url('/fonts/inter.css'); /* the interface: served by OpenCaptions itself (scripts/fetch-fonts.js), nothing loads from Google, works offline */
@import url('/fonts/brand.css'); /* Atkinson Hyperlegible Next: the captions' default reading font */

/* Digits: Atkinson Hyperlegible Next only ships a slashed zero, which reads as "Ø" in prices, times and counts.
   Numerals come from the system UI font instead; every other character stays Atkinson. */
@font-face { font-family: 'OC Digits'; font-weight: 100 500; unicode-range: U+0030-0039; src: local('Helvetica Neue'), local('HelveticaNeue'), local('Segoe UI'), local('SegoeUI'), local('Roboto'), local('Arial'); }
@font-face { font-family: 'OC Digits'; font-weight: 600 900; unicode-range: U+0030-0039; src: local('Helvetica Neue Bold'), local('HelveticaNeue-Bold'), local('Segoe UI Bold'), local('SegoeUI-Bold'), local('Roboto Bold'), local('Roboto-Bold'), local('Arial Bold'), local('Arial-BoldMT'); }

:root {
  /* ---- brand palette (fixed) ---- */
  --ink: #111014;
  --paper: #FAF8F3;
  --lime: #D4FF3A;
  --graphite: #2B2A31;
  --fog: #E8E5DD;

  /* ---- type ---- */
  /* 2.0: one sans for everything, light (300) for headlines; captions keep their own reading font (--cap-font) */
  --font-display: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* ---- shape, depth, motion ---- */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .18s;
  --dur-fast: .15s; /* hover and press: quick enough to feel direct */
  --sweep: .32s; /* highlighter sweep on the live word */
  /* Motion, the way Apple and Linear move: things arrive fast and settle softly; a spring for things you flip. */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017 19.6%, 1.051 22.8%, 1.059 26.3%, 1.042 30.2%, 1.008 38.2%, .994 44.3%, 1.001 63.6%, 1);
  --dur-slow: .42s;

  /* ---- semantic: light (default) ---- */
  --bg: #FAFAF8;               /* page */
  --bg2: #FFFFFF;              /* panels, sheets, inputs */
  --bg3: #F1F1EE;              /* buttons, chips, wells */
  --fg: #0A0A0B;
  --fg2: #5E5E64;              /* secondary text (≥ 5:1 on the page) */
  --line: #E8E8E4;             /* hairlines */
  --line-strong: #D4D4CF;
  /* Quiet fills for buttons, chips and wells: translucent, so they read the same on the page and on a card. */
  --fill: rgba(10, 10, 11, .05);
  --fill-hover: rgba(10, 10, 11, .09);
  --translation: #3A3A3F; /* second-language caption lines: a muted tone, not a second accent */
  --accent: var(--lime);       /* events may override with their own colour (config/event.json → accent) */
  --on-accent: var(--ink);
  --accent-fg: var(--ink);     /* emphasis as text/stroke: never lime on light */
  --hl: var(--accent);         /* highlighter fill (search hits, selection) */
  --hl-ink: var(--on-accent);
  --primary-bg: #0A0A0B;       /* main action + selected state: black on light, white on dark */
  --primary-fg: #FAFAF8;
  --logo-o: var(--ink);
  --logo-line: var(--ink);     /* all-ink logo on light backgrounds */
  --ok: #1B7F45;
  --warn: #8F5400; /* 4.5:1 or more on every light surface, code chips included (WCAG AA) */
  --bad: #C8321F;
  --focus: var(--ink);
  /* Hues: colour for icons, sections and categories, beside the brand (never instead of a word or an icon: colour is
     never the only signal). Text-safe: 4.6:1 or more on the page, on cards and on their own 14 % tint (WCAG AA). */
  /* 2.0: icons and categories are quiet greys (colour was too much); the old hues stay in the contrast theme only */
  --c-blue: var(--fg2); --c-violet: var(--fg2); --c-teal: var(--fg2); --c-rose: var(--fg2); --c-orange: var(--fg2); --c-green: var(--fg2);
  --spark: var(--lime);        /* a sparkle on the primary button: lime on ink in light, ink on lime in dark */
  --shadow-sm: 0 1px 2px rgba(10, 10, 11, .04);
  --shadow: 0 1px 2px rgba(10, 10, 11, .04), 0 12px 32px -16px rgba(10, 10, 11, .12);
  --shadow-lg: 0 30px 60px -24px rgba(10, 10, 11, .25);
  --scrim: rgba(17, 16, 20, .38);
  --logo: url(/brand/mark-ink.svg);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23111014' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;
}

/* ---- semantic: dark ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #050506; --bg2: #0D0D0F; --bg3: #18181C; --fg: #F4F4F2; --fg2: #8E8E94;
    --line: #1C1C20; --line-strong: #2E2E33; --fill: rgba(244, 244, 242, .06); --fill-hover: rgba(244, 244, 242, .11); --translation: #B4B4B8;
    --accent-fg: var(--lime); --primary-bg: #F4F4F2; --primary-fg: #050506; --logo-o: var(--paper); --logo-line: var(--lime);
    --ok: #5BD68A; --warn: #F5B544; --bad: #FF7A66; --focus: var(--lime);
    --c-blue: var(--fg2); --c-violet: var(--fg2); --c-teal: var(--fg2); --c-rose: var(--fg2); --c-orange: var(--fg2); --c-green: var(--fg2); --spark: var(--ink);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8); --scrim: rgba(0, 0, 0, .6);
    --logo: url(/brand/mark-dark.svg);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23FAF8F3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
/* ---- semantic: high contrast (for low vision; chosen in the phone's Aa settings) ----
   Pure black and white, nothing dimmed: older lines stay white, the original text is yellow, lines are visible. */
:root[data-theme='contrast'] {
  --bg: #000; --bg2: #000; --bg3: #1F1F1F; --fg: #FFF; --fg2: #FFF;
  --line: #FFF; --line-strong: #FFF; --fill: #1F1F1F; --fill-hover: #333; --translation: #FFE14D;
  --accent-fg: #FFE14D; --primary-bg: #FFE14D; --primary-fg: #000; --logo-o: #FFF; --logo-line: #FFE14D;
  --ok: #7CFFAE; --warn: #FFE14D; --bad: #FF9B8A; --focus: #FFE14D; --hl: #FFE14D; --hl-ink: #000;
  --c-blue: #FFF; --c-violet: #FFF; --c-teal: #FFF; --c-rose: #FFF; --c-orange: #FFF; --c-green: #FFF; --spark: #000; /* low vision: pure white, no tints */
  --shadow-sm: none; --shadow: none; --shadow-lg: none; --scrim: rgba(0, 0, 0, .8);
  --logo: url(/brand/mark-dark.svg);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}
:root[data-theme='dark'] {
  --bg: #050506; --bg2: #0D0D0F; --bg3: #18181C; --fg: #F4F4F2; --fg2: #8E8E94;
  --line: #1C1C20; --line-strong: #2E2E33; --fill: rgba(244, 244, 242, .06); --fill-hover: rgba(244, 244, 242, .11); --translation: #B4B4B8;
  --accent-fg: var(--lime); --primary-bg: #F4F4F2; --primary-fg: #050506; --logo-o: var(--paper); --logo-line: var(--lime);
  --ok: #5BD68A; --warn: #F5B544; --bad: #FF7A66; --focus: var(--lime);
    --c-blue: var(--fg2); --c-violet: var(--fg2); --c-teal: var(--fg2); --c-rose: var(--fg2); --c-orange: var(--fg2); --c-green: var(--fg2); --spark: var(--ink);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8); --scrim: rgba(0, 0, 0, .6);
  --logo: url(/brand/mark-dark.svg);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23FAF8F3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}
