/* FactFlip design tokens — single source of truth (see docs/DESIGN.md).
   Every colour pair used for text is checked for WCAG AA in test/design.test.js.
   Gameplay (#2) and content (#3) must reuse these tokens, never raw values. */
:root {
  color-scheme: light;

  /* ── Palette ─────────────────────────────────────────────── */
  --ff-grape-900: #241446;  /* ink: text, outlines, dark surfaces */
  --ff-grape-700: #4a3478;  /* secondary text on light surfaces */
  --ff-grape-100: #ece6fb;  /* subtle fills, chips */
  --ff-cream-50:  #fff7ec;  /* page background */
  --ff-white:     #ffffff;  /* card faces */
  --ff-flip-600:  #c2185b;  /* brand "flip" magenta: primary actions */
  --ff-flip-700:  #9c1149;  /* pressed / hover of primary */
  --ff-sun-400:   #ffc233;  /* card A accent (left / top) */
  --ff-sky-400:   #52c7ea;  /* card B accent (right / bottom) */
  --ff-mint-700:  #157a43;  /* correct */
  --ff-mint-100:  #d9f5e4;
  --ff-tomato-700:#c0262f;  /* wrong */
  --ff-tomato-100:#fde1e1;

  /* ── Semantic aliases ────────────────────────────────────── */
  --ff-bg: var(--ff-cream-50);
  --ff-surface: var(--ff-white);
  --ff-ink: var(--ff-grape-900);
  --ff-ink-soft: var(--ff-grape-700);
  --ff-primary: var(--ff-flip-600);
  --ff-primary-pressed: var(--ff-flip-700);
  --ff-on-primary: var(--ff-white);
  --ff-card-a: var(--ff-sun-400);
  --ff-card-b: var(--ff-sky-400);
  --ff-correct: var(--ff-mint-700);
  --ff-correct-bg: var(--ff-mint-100);
  --ff-wrong: var(--ff-tomato-700);
  --ff-wrong-bg: var(--ff-tomato-100);
  --ff-focus: var(--ff-flip-600);

  /* ── Typography ──────────────────────────────────────────── */
  --ff-font-display: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round",
    "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ff-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
    "Helvetica Neue", Arial, sans-serif;
  --ff-font-number: var(--ff-font-display);
  /* Fluid scale, 360 px → 1200 px viewport */
  --ff-text-xs: 0.8125rem;                          /* 13 px — never for body copy */
  --ff-text-sm: 0.9375rem;                          /* 15 px */
  --ff-text-md: 1.0625rem;                          /* 17 px — body */
  --ff-text-lg: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --ff-text-xl: clamp(1.5rem, 1.25rem + 1.2vw, 2.125rem);   /* question */
  --ff-text-2xl: clamp(2rem, 1.5rem + 2.5vw, 3.25rem);      /* revealed values */
  --ff-text-3xl: clamp(2.75rem, 2rem + 4vw, 4.5rem);        /* logo / game over */
  --ff-weight-body: 400;
  --ff-weight-strong: 700;
  --ff-weight-display: 800;
  --ff-leading-tight: 1.1;
  --ff-leading-body: 1.5;

  /* ── Space, radius, outline, shadow ──────────────────────── */
  --ff-space-1: 0.25rem;
  --ff-space-2: 0.5rem;
  --ff-space-3: 0.75rem;
  --ff-space-4: 1rem;
  --ff-space-5: 1.5rem;
  --ff-space-6: 2rem;
  --ff-space-7: 3rem;
  --ff-radius-sm: 0.75rem;
  --ff-radius-md: 1.25rem;
  --ff-radius-lg: 1.75rem;
  --ff-radius-pill: 999px;
  --ff-outline: 3px solid var(--ff-ink);   /* the "sticker" outline */
  --ff-shadow: 0 6px 0 var(--ff-ink);      /* hard offset shadow, no blur */
  --ff-shadow-pressed: 0 2px 0 var(--ff-ink);
  --ff-tap-min: 48px;                       /* ≥ 44 px touch targets */

  /* ── Motion ──────────────────────────────────────────────── */
  --ff-ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ff-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ff-dur-tap: 80ms;     /* press feedback, < 100 ms */
  --ff-dur-quick: 180ms;
  --ff-dur-reveal: 320ms; /* card flip / value count-up (#28: shorter, still readable) */

  /* ── Layout ──────────────────────────────────────────────── */
  --ff-content-max: 60rem;
  --ff-game-max: 34rem;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --ff-dur-tap: 0ms;
    --ff-dur-quick: 0ms;
    --ff-dur-reveal: 0ms;
  }
}
