/*
 * THEME — the ONLY file with colours, fonts, radii, shadows and motion values.
 * app.css and every template/JS read these through var(--…). To re-skin, edit this file.
 *
 * Layer 1 (--gr-*): G-Research brand tokens, copied from ../../../../brand/tokens.css
 *                   (sources documented in brand/BRAND.md). Do not edit brand/ itself.
 * Layer 2 (semantic): what the UI uses. Dark (black) is the default; light = their white/grey
 *                   sections, chosen with the header toggle (html[data-theme="light"]).
 * Functional, non-brand colours (marked "derived"): --down (losses) and the dark-mode link blue.
 */

/* Hanken Grotesk (SIL OFL 1.1), self-hosted so it works offline. Free stand-in for the
   licensed "Indivisible" typeface the brand uses (see brand/BRAND.md §2). */
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/hanken-grotesk-latin.woff2") format("woff2");
  /* Subset (pyftsubset, 29.6 KB): exactly these ranges. Anything else falls through to latin-ext. */
  unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2027, U+2030-2039, U+2190-2193, U+2212, U+2713, U+2605, U+20AC, U+2122;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ---- Layer 1: brand ---- */
  --gr-black: #000000;
  --gr-white: #ffffff;
  --gr-blue: #0f25f2;
  --gr-yellow: #e5fc54;
  --gr-grey-100: #f7f7f7;
  --gr-grey-200: #f0efef;
  --gr-grey-300: #b2b2b2;
  --gr-grey-400: #404040;
  --gr-grey-500: #262626;
  --gr-font-sans: "Hanken Grotesk", "Space Grotesk", "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gr-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --gr-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.6);

  /* ---- Typography ---- */
  --font-sans: var(--gr-font-sans);
  --font-mono: var(--gr-font-mono);
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --tracking-display: -0.045em;   /* ≈ -2px at 38px, -4px at 90px */
  --tracking-tight: -0.02em;

  /* ---- Shape ---- */
  --radius: 0px;                  /* square corners: buttons, cards, inputs */
  --radius-sm: 4px;
  --radius-pill: 9999px;          /* tags only */
  --border: 1px;
  --border-strong: 2px;
  --shadow-overlay: var(--gr-shadow);

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.2s;
  --dur: 0.3s;
  --dur-slow: 0.5s;

  /* ---- Layout ---- */
  --container: 1200px;
  --gutter: 16px;
  --tabbar-h: 64px;
  --header-h: 56px;

  /* ---- Layer 2: semantic, DARK (default) ---- */
  color-scheme: dark;
  --bg: var(--gr-black);
  --bg-alt: #0b0b0b;              /* derived */
  --surface: #0f0f0f;             /* derived */
  --surface-2: var(--gr-grey-500);
  --line: var(--gr-grey-500);
  --line-strong: var(--gr-grey-400);
  --text: var(--gr-white);
  --muted: var(--gr-grey-300);
  --faint: #949494;               /* derived; 6.9:1 on black, 5.0:1 on surface-2 */
  --link: #8f9cff;                /* derived: lightened brand blue for AA on black */
  --accent: var(--gr-blue);       /* primary CTA background */
  --on-accent: var(--gr-white);
  --accent-hover: var(--gr-yellow);
  --on-accent-hover: var(--gr-black);
  --highlight: var(--gr-yellow);  /* own rank row, live ticks, highlighted node */
  --on-highlight: var(--gr-black);
  --up: var(--gr-yellow);
  --down: #ff7a6b;                /* derived: losses */
  --focus: var(--gr-white);       /* neutral ring; yellow is reserved for "you" / highlights */
  --header-focus: var(--gr-white); /* ring on the black header / tab bar band (same black in both themes) */
  --control-border: #7a7a7a;      /* derived: field / chip / slot outlines, 3:1+ on bg and surface (WCAG 1.4.11) */
  --meter-fill: var(--gr-yellow); /* ticket-race bar */
  --header-bg: var(--gr-black);
  --header-text: var(--gr-white);
  --header-muted: var(--gr-grey-300);
  --tabbar-bg: var(--gr-black);
  --tabbar-line: var(--gr-grey-500);
  --chart-line: var(--gr-white);
  --chart-grid: var(--gr-grey-500);
  --chart-fill: rgba(15, 37, 242, 0.22);
  --chart-buy: var(--gr-yellow);
  --chart-sell: #ff7a6b;
  --motif-line: var(--gr-grey-400);
  --motif-node: var(--gr-black);
  --qr-fg: var(--gr-black);
  --qr-bg: var(--gr-white);
  --sample-line: var(--gr-yellow);
  --notice-bg: var(--surface);
  --notice-line: var(--line-strong);
  --texture-image: url("../brand/grain.svg");      /* generative greyscale grain in the hero (not photography) */
  --texture-opacity: 0.32;
  --danger: #ff7a6b;
  --success: var(--gr-yellow);
  --on-success: var(--gr-black);   /* text on a filled success / danger block (door check-in) */
  --on-danger: var(--gr-black);
  --overlay: rgba(0, 0, 0, 0.72);
}

/* ---- Layer 2: semantic, LIGHT (their white / grey sections) ---- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: var(--gr-white);
  --bg-alt: var(--gr-grey-100);
  --surface: var(--gr-white);
  --surface-2: var(--gr-grey-200);
  --line: #e2e1e1;                /* derived, between grey-200 and grey-300 */
  --line-strong: var(--gr-grey-300);
  --text: var(--gr-black);
  --muted: var(--gr-grey-400);
  --faint: #6b6b6b;               /* derived */
  --link: var(--gr-blue);
  --accent: var(--gr-blue);
  --on-accent: var(--gr-white);
  --accent-hover: var(--gr-black);
  --on-accent-hover: var(--gr-white);
  --highlight: var(--gr-yellow);
  --on-highlight: var(--gr-black);
  --up: var(--gr-blue);
  --down: #c62828;                /* derived */
  --focus: var(--gr-blue);
  --header-focus: var(--gr-white);
  --control-border: #767676;      /* derived */
  --meter-fill: var(--gr-blue);   /* yellow on the light track is < 2:1 */
  --chart-line: var(--gr-black);
  --chart-grid: var(--gr-grey-200);
  --chart-fill: rgba(15, 37, 242, 0.10);
  --chart-buy: var(--gr-blue);
  --chart-sell: #c62828;
  --motif-line: var(--gr-grey-300);
  --motif-node: var(--gr-white);
  --sample-line: var(--gr-grey-400);
  --notice-bg: var(--gr-grey-100);
  --notice-line: var(--line-strong);
  --texture-image: url("../brand/grain-ink.svg");
  --texture-opacity: 0.18;
  --danger: #c62828;
  --success: var(--gr-blue);
  --on-success: var(--gr-white);
  --on-danger: var(--gr-white);
  --overlay: rgba(255, 255, 255, 0.8);
}
