/* ExamCrush design tokens. Fonts: Manrope & Inter (SIL OFL), self-hosted. */
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap;
  src: url("/fonts/manrope-700.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap;
  src: url("/fonts/manrope-800.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap;
  src: url("/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap;
  src: url("/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap;
  src: url("/fonts/inter-600.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: oklch(97.4% 0.012 78); --surface: oklch(99.6% 0.004 78);
  --surface-2: oklch(96.2% 0.014 78); --ink: oklch(21% 0.02 265);
  --ink-soft: oklch(38% 0.02 265); --muted: oklch(47% 0.02 65);
  --border: oklch(92.5% 0.016 78); --border-strong: oklch(86% 0.03 70);
  /* T10 §7.6: 58% accent-strong only reached 3.84:1 on --accent-soft (topic
     chips, "A" letters, active rail item). 52% clears 4.5 everywhere it is
     TEXT — 4.94 on accent-soft, 5.84 on surface, 5.48 on bg, 5.29 on surface-2 —
     and only deepens the two places it is a FILL (.q-progress-seg.is-current),
     where contrast against the card goes 4.54 -> 5.84. */
  --accent: oklch(66% 0.17 47); --accent-strong: oklch(52% 0.175 45);
  --accent-soft: oklch(94.5% 0.045 62); --accent-border: oklch(85% 0.08 55);
  /* White text on solid orange: --btn-primary is the AA-safe orange
     (99.5% on 58% = 8.5:1); --accent stays for decorative/soft fills. */
  --on-accent: oklch(99.5% 0.003 95); --btn-primary: oklch(58% 0.175 45);
  --btn-primary-hover: oklch(52% 0.175 44); --tint-blue: oklch(93% 0.028 230);
  --tint-yellow: oklch(95% 0.055 95); --marker: oklch(84% 0.15 95);
  --success: oklch(58% 0.13 155); --success-soft: oklch(95% 0.04 155);
  --danger: oklch(52% 0.17 27); --danger-soft: oklch(95% 0.035 27);
  --warn: oklch(60% 0.14 80); --warn-soft: oklch(95% 0.05 90);
  /* T08 dark-pass tokens (light values preserve the pre-T08 look):
     --scrim   dialog backdrop; --circle-edge icon-circle ring edge (light: none);
     --seal-*  solid chips/badges carrying --on-accent text on a status colour
     (plain --success is only 4.0:1 under white text; the seal mix is 5.3:1). */
  --scrim: color-mix(in oklab, var(--ink) 45%, transparent);
  --circle-edge: transparent;
  --seal-success: color-mix(in oklab, var(--success) 82%, var(--ink));
  --seal-danger: var(--danger);
  --seal-danger-hover: color-mix(in oklab, var(--danger) 80%, var(--ink));

  --font-display: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-hero: clamp(2rem, 4.6vw + 1rem, 3.5rem);
  --fs-h1: clamp(1.45rem, 2.2vw + .9rem, 2rem);
  --fs-q: clamp(1.125rem, 1.2vw + 1rem, 1.375rem);
  --fs-h2: 1.0625rem; --fs-body: 1rem; --fs-sm: .875rem; --fs-xs: .8125rem;
  --fs-overline: .75rem;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 56px;
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px; --r-full: 999px;
  --shadow-1: 0 1px 2px color-mix(in oklab, var(--ink) 6%, transparent),
              0 2px 8px color-mix(in oklab, var(--ink) 4%, transparent);
  --shadow-2: 0 1px 2px color-mix(in oklab, var(--ink) 6%, transparent),
              0 8px 24px color-mix(in oklab, var(--ink) 7%, transparent);
  --shadow-3: 0 -8px 32px color-mix(in oklab, var(--ink) 12%, transparent);
  --z-topbar: 40; --z-actionbar: 42; --z-tabbar: 45; --z-sheet: 60; --z-toast: 70;
  /* Height of the sticky shell topbar (12px padding × 2 + 44px control + border),
     so in-page sticky bars can park directly under it. */
  --topbar-h: 73px;

  --dur-fast: 120ms; --dur-med: 200ms; --dur-slow: 320ms; --dur-enter: 420ms;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0.06, 0.68, 0.19);
  --ease-inout: cubic-bezier(0.65, 0.05, 0.36, 1);
  --ease-spring: linear(0, 0.009, 0.035 2.1%, 0.146, 0.281 6.7%, 0.728 12.9%,
    0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%,
    1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%,
    0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
}
@supports not (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); }
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(20% 0.015 60); --surface: oklch(25% 0.016 60);
  --surface-2: oklch(30% 0.018 60); --ink: oklch(95% 0.012 78);
  --ink-soft: oklch(82% 0.012 78); --muted: oklch(70% 0.02 70);
  --border: oklch(33% 0.02 60); --border-strong: oklch(42% 0.03 60);
  --accent: oklch(74% 0.15 50); --accent-strong: oklch(80% 0.14 52);
  --accent-soft: oklch(30% 0.05 50); --accent-border: oklch(45% 0.08 50);
  /* Same white-on-deep-orange rule as light: --btn-primary deliberately stays
     darker than --accent so --on-accent text keeps AA (4.5:1). Hover also goes
     DOWN (toward --bg): lightening it to 64% dropped white text to 3.5:1. */
  --on-accent: oklch(99.5% 0.003 95); --btn-primary: oklch(58% 0.175 45);
  --btn-primary-hover: color-mix(in oklab, var(--btn-primary) 85%, var(--bg));
  --tint-blue: oklch(28% 0.03 230);
  --tint-yellow: oklch(30% 0.05 95); --marker: oklch(80% 0.14 95);
  --success: oklch(70% 0.13 155); --success-soft: oklch(28% 0.05 155);
  --danger: oklch(68% 0.16 27); --danger-soft: oklch(30% 0.06 27);
  --warn: oklch(75% 0.13 85); --warn-soft: oklch(30% 0.05 90);
  /* Shadows must invert base: an --ink-tinted shadow is a light glow on a dark
     canvas and disappears — dark elevations go black-alpha instead. */
  --shadow-1: 0 1px 2px oklch(0% 0 0 / 0.55), 0 2px 8px oklch(0% 0 0 / 0.35);
  --shadow-2: 0 1px 2px oklch(0% 0 0 / 0.55), 0 8px 24px oklch(0% 0 0 / 0.45);
  --shadow-3: 0 -8px 32px oklch(0% 0 0 / 0.6);
  /* A 45% --ink veil over a dark page FOGS it white; the scrim goes black. */
  --scrim: oklch(0% 0 0 / 0.62);
  --circle-edge: var(--border);
  /* Solid status seals under --on-accent: raw --success/--danger (68-70%)
     only reach 2.5-3.1:1 against white text — mix toward the dark bg. */
  --seal-success: color-mix(in oklab, var(--success) 58%, var(--bg));
  --seal-danger: color-mix(in oklab, var(--danger) 62%, var(--bg));
  --seal-danger-hover: color-mix(in oklab, var(--danger) 52%, var(--bg));
}
