/*
 * Jamwoop design tokens: creative delivery package 1 (JW-DES-02, JW-EDN-08).
 * Mirrors the Figma variables and text styles approved at V2 (file kaHl26ob0fE9w6zmpaD1qp, page 5; typography Option C).
 * Used only by /design until a later package adopts it (V3); the live Christmas show changes only with V4.
 * Fonts: self-hosted, SIL OFL 1.1 (public/fonts/OFL-*.txt; provenance in docs/design/type-and-tokens.md).
 */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-latin-opsz-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-latin-ext-opsz-wght.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-ext-wght.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-cyrillic-wght.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-greek-wght.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

:root {
  /* Edition layer: the only colours an edition replaces. Master defaults (no edition) are brand navy 600 and brand
     yellow, proposed for a "Jamwoop master" mode in Figma; each edition sets them under [data-edition]. */
  --jw-edition-glow: #1c3275;
  --jw-edition-accent: #ffc629;
  /* The foreground that reads on the edition accent: navy on master yellow, ivory on Christmas berry. */
  --jw-edition-on-accent: #081638;

  /* Semantic colours (Figma collection "Semantic · Edition"); master brand values except where they point at the
     edition layer. */
  --jw-stage-background: #081638;
  --jw-surface-card: #0e1d4a;
  --jw-surface-card-strong: #13245a;
  --jw-surface-inverse: #fff9ee;
  --jw-text-primary: #fff9ee;
  --jw-text-secondary: #b9c2dd;
  --jw-text-on-accent: #081638;
  --jw-accent-action: #ffc629;
  --jw-accent-score: #ffc629;
  --jw-accent-highlight: #00c9c9;
  --jw-state-correct: #2bd67b;
  --jw-state-wrong: #ff4d5e;
  --jw-state-caught: #ff7029;
  --jw-team-1: #00c9c9;
  --jw-team-2: #ff7029;
  --jw-team-3: #ffc629;

  /* Type roles (Option C): Bricolage Grotesque for the show's voice, Inter for the interface and every number.
     Bricolage has no Cyrillic or Greek: those characters fall back to Inter. */
  --jw-font-display: "Bricolage Grotesque", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --jw-font-interface: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --jw-font-numeric: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* TV sizes are the Figma 1920×1080 sizes times one canvas unit, so 1280×720 is exactly two thirds. Supporting text
     also has a rem floor, so a small window or a larger user font setting never makes it too small; display roles
     stay proportional. */
  --jw-tv-unit: min(100vw / 1920, 100vh / 1080);
  --jw-size-tv-spectacle: calc(160 * var(--jw-tv-unit));
  --jw-size-tv-display-xl: calc(120 * var(--jw-tv-unit));
  --jw-size-tv-round: calc(96 * var(--jw-tv-unit));
  --jw-size-tv-display: calc(88 * var(--jw-tv-unit));
  --jw-size-tv-question: calc(72 * var(--jw-tv-unit));
  --jw-size-tv-title: calc(52 * var(--jw-tv-unit));
  --jw-size-tv-answer: max(calc(44 * var(--jw-tv-unit)), 1.625rem);
  --jw-size-tv-body: max(calc(36 * var(--jw-tv-unit)), 1.375rem);
  --jw-size-tv-label-min: max(calc(28 * var(--jw-tv-unit)), 1.25rem);

  /* Numeric roles: all Inter with tabular lining figures (.jw-num-*), each with its own prominence. */
  --jw-numeric-timer-size: max(calc(52 * var(--jw-tv-unit)), 2rem);
  --jw-numeric-timer-weight: 800;
  --jw-numeric-score-size: max(calc(48 * var(--jw-tv-unit)), 1.75rem);
  --jw-numeric-score-weight: 800;
  --jw-numeric-balance-size: max(calc(32 * var(--jw-tv-unit)), 1.25rem);
  --jw-numeric-balance-weight: 700;
  --jw-numeric-reward-size: max(calc(56 * var(--jw-tv-unit)), 2rem);
  --jw-numeric-reward-weight: 800;
  --jw-numeric-spectacle-size: calc(140 * var(--jw-tv-unit));
  --jw-numeric-spectacle-weight: 900;
  --jw-size-phone-title: 30px;
  --jw-size-phone-answer: 20px;
  --jw-size-phone-button: 20px;
  --jw-size-phone-number: 22px;
  --jw-size-phone-body: 17px;
  --jw-size-phone-label-min: 13px;
  --jw-size-host-title: 26px;
  --jw-size-host-body: 16px;
  --jw-size-host-mono: 14px;
  --jw-size-host-label-min: 12px;

  /* Dimensions (Figma collection "Dimensions"). */
  --jw-space-4: 4px;
  --jw-space-8: 8px;
  --jw-space-12: 12px;
  --jw-space-16: 16px;
  --jw-space-24: 24px;
  --jw-space-32: 32px;
  --jw-space-48: 48px;
  --jw-space-64: 64px;
  --jw-radius-sm: 10px;
  --jw-radius-md: 16px;
  --jw-radius-lg: 24px;
  --jw-radius-xl: 36px;
  --jw-radius-pill: 999px;

  /* Motion (Figma collection "Motion"): presentation only; the server owns every step and timer. Starting values, to be
     tuned during play (package 8). Tiers: a functional select, a game-show reveal, a spectacle celebration. */
  --jw-duration-select: 120ms;
  --jw-duration-reveal: 400ms;
  --jw-duration-celebration: 2400ms;
  --jw-duration-fast: 150ms;
  --jw-duration-base: 250ms;
  --jw-duration-slow: 400ms;
  --jw-duration-count-up: 600ms;
  --jw-duration-spectacle-in: 600ms;
  --jw-duration-spectacle: 1200ms;
  --jw-stagger: 120ms;
  --jw-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --jw-ease-enter: cubic-bezier(0, 0, 0.2, 1);
  --jw-ease-exit: cubic-bezier(0.4, 0, 1, 1);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --jw-duration-select: 0ms;
    --jw-duration-reveal: 0ms;
    --jw-duration-celebration: 0ms;
    --jw-duration-fast: 0ms;
    --jw-duration-base: 0ms;
    --jw-duration-slow: 0ms;
    --jw-duration-count-up: 0ms;
    --jw-duration-spectacle-in: 0ms;
    --jw-duration-spectacle: 0ms;
    --jw-stagger: 0ms;
  }
}

/* Semantic roles that come from the edition layer. Declared on the root and on every edition root, because var()
   resolves where a property is declared: an edition's layer must be re-read where the edition is set. */
:root,
[data-edition] {
  --jw-stage-glow: var(--jw-edition-glow);
  --jw-accent-edition: var(--jw-edition-accent);
  --jw-text-on-edition-accent: var(--jw-edition-on-accent);
}

/* Editions set only their own layer (Figma "Semantic · Edition", mode Christmas Heist). */
[data-edition="christmas-heist"] {
  --jw-edition-glow: #0e5a3a;
  --jw-edition-accent: #e2324a;
  --jw-edition-on-accent: #fff9ee;
}

/* Roles as classes, for the specimen and for packages that adopt them. */
.jw-display {
  font-family: var(--jw-font-display);
  font-optical-sizing: auto;
}

.jw-interface {
  font-family: var(--jw-font-interface);
}

/* Every dynamic number (scores, timers, Pocket, Vault, counts): tabular lining figures, so columns never jitter. */
.jw-num {
  font-family: var(--jw-font-numeric);
  font-variant-numeric: tabular-nums lining-nums;
}

.jw-num-timer {
  font-family: var(--jw-font-numeric);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: var(--jw-numeric-timer-size);
  font-weight: var(--jw-numeric-timer-weight);
}

.jw-num-score {
  font-family: var(--jw-font-numeric);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: var(--jw-numeric-score-size);
  font-weight: var(--jw-numeric-score-weight);
}

.jw-num-balance {
  font-family: var(--jw-font-numeric);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: var(--jw-numeric-balance-size);
  font-weight: var(--jw-numeric-balance-weight);
}

.jw-num-reward {
  font-family: var(--jw-font-numeric);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: var(--jw-numeric-reward-size);
  font-weight: var(--jw-numeric-reward-weight);
}

.jw-num-spectacle {
  font-family: var(--jw-font-numeric);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: var(--jw-numeric-spectacle-size);
  font-weight: var(--jw-numeric-spectacle-weight);
}
