/* The design system, on the web: the iOS app's tokens (app/SuitedFours/DesignSystem/Tokens.swift)
   under the names public/styles/tokens.css used, the reset, and the pill button. Every marketing
   page links this: the landing, the blog, /tools and each tool. DESIGN.md maps each token.
   Light and dark follow the system; there is no switch. */

@font-face {
  font-family: "Open Runde";
  src: url("../fonts/OpenRunde-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Runde";
  src: url("../fonts/OpenRunde-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Runde";
  src: url("../fonts/OpenRunde-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter var";
  src: url("../fonts/Inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* surfaces: Tokens.bg, surface, surface2 to 4 */
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-2: #f2f2f2;
  --surface-3: #ebebeb;
  --surface-4: #e2e2e2;

  /* ink: ink3 reads at 4.5:1 on bg, surface and surface2; ink4 is for chevrons, dividers and disabled only */
  --ink: #1c1c1c;
  --ink-2: #5a5a5a;
  --ink-3: #6e6e6e;
  --ink-4: #c8c8c8;
  --ink-inv: #ffffff;

  /* lines: Tokens.line, line2 */
  --line: rgba(0, 0, 0, .07);
  --line-2: rgba(0, 0, 0, .12);

  /* accent, the only colour: the primary action and the coach's mistake red */
  --accent: #a21f21;
  --accent-ink: #ffffff;
  --accent-soft: rgba(162, 31, 33, .10);
  --accent-glow: rgba(162, 31, 33, .55);
  /* the coach's "good" green (Severity.good), and the amber for "loose" */
  --good: #1a7a4a;
  --loose: #c07c10;
  --gold: #8a6100;

  /* the table: the one place the palette leaves the greys */
  --felt-hi: #2b7c5c;
  --felt: #1d6047;
  --felt-lo: #124534;
  --rail: #1a2621;
  --on-felt: rgba(255, 255, 255, .82);
  --on-felt-2: rgba(255, 255, 255, .52);
  --on-felt-3: rgba(255, 255, 255, .26);
  --felt-line: rgba(255, 255, 255, .15);

  /* chips */
  --chip-1: #f0ece2;
  --chip-5: #c0392f;
  --chip-25: #2f6fb5;
  --chip-100: #23262b;
  --chip-500: #6d4aa8;

  /* cards: paper, not a white rectangle */
  --card-paper-top: #ffffff;
  --card-paper-bottom: #f4f2ec;
  --card-frame: rgba(0, 0, 0, .08);
  --card-ink: #1c1c1c;
  --card-red: #a21f21;

  /* radii: Tokens.rXS to rXL; a pill is a capsule */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 38px;
  --r-pill: 9999px;
  --card-r: .19;

  /* spacing: 8 / 16 / 32 / 64 / 112 */
  --sp-xs: 8px;
  --sp-sm: 16px;
  --sp-md: 32px;
  --sp-lg: 64px;
  --sp-xl: 112px;

  /* surfaces read as pressed paper: an inset hairline, a lit top edge, a shaded bottom edge */
  --ring: inset 0 0 0 1px rgba(0, 0, 0, .06), inset 0 1px 0 0 rgba(255, 255, 255, .9), inset 0 -1px 0 0 rgba(0, 0, 0, .045);
  --ring-strong: inset 0 0 0 1px rgba(0, 0, 0, .10), inset 0 1px 0 0 rgba(255, 255, 255, .8), inset 0 -1px 0 0 rgba(0, 0, 0, .07);
  --lift: 0 1px 1px rgba(0, 0, 0, .03), 0 6px 16px -10px rgba(0, 0, 0, .22);
  --lift-lg: 0 2px 3px rgba(0, 0, 0, .04), 0 22px 48px -24px rgba(0, 0, 0, .30);

  /* motion: the strong ease-out and the spring that overshoots once */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --fast: 120ms;
  --med: 220ms;
  --slow: 320ms;

  /* type: Type.display and Type.text */
  --font-display: "Open Runde", ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --font-text: "Inter var", "Inter", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #0b0b0b;
    --surface-2: #161616;
    --surface-3: #1b1b1b;
    --surface-4: #242424;
    --ink: #ededed;
    --ink-2: #9a9a9a;
    --ink-3: #828282;
    --ink-4: #454545;
    --ink-inv: #0b0b0b;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .14);
    --accent: #d23e55;
    --accent-soft: rgba(207, 59, 82, .14);
    --accent-glow: rgba(207, 59, 82, .50);
    --good: #2ea36a;
    --loose: #e0a53a;
    --gold: #d4a636;
    --felt-hi: #1c5b45;
    --felt: #124334;
    --felt-lo: #0a2b21;
    --rail: #080f0d;
    --on-felt: rgba(255, 255, 255, .78);
    --on-felt-2: rgba(255, 255, 255, .46);
    --on-felt-3: rgba(255, 255, 255, .22);
    --felt-line: rgba(255, 255, 255, .12);
    --chip-1: #e4e0d6;
    --chip-5: #b8362d;
    --chip-25: #2c66a6;
    --chip-100: #1a1d21;
    --chip-500: #63439c;
    --card-paper-top: #f4f3ef;
    --card-paper-bottom: #e6e3db;
    --card-frame: rgba(0, 0, 0, .09);
    --card-ink: #141414;
    --ring: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 1px 0 0 rgba(255, 255, 255, .09), inset 0 -1px 0 0 rgba(0, 0, 0, .5);
    --ring-strong: inset 0 0 0 1px rgba(255, 255, 255, .12), inset 0 1px 0 0 rgba(255, 255, 255, .14), inset 0 -1px 0 0 rgba(0, 0, 0, .6);
    --lift: 0 1px 1px rgba(0, 0, 0, .5), 0 6px 16px -10px rgba(0, 0, 0, .8);
    --lift-lg: 0 2px 3px rgba(0, 0, 0, .5), 0 22px 48px -24px rgba(0, 0, 0, .9);
  }
}

/* ── reset ─────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button { font: inherit; color: inherit; margin: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { display: block; }
::selection { background: var(--accent-soft); }

/* ── buttons: pills, three tones ───────────────────────────────── */

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 108px; padding: 8px 22px; white-space: nowrap; border-radius: var(--r-pill); background: var(--ink); color: var(--ink-inv); font: 700 16px/1 var(--font-display); letter-spacing: -.2px; text-decoration: none; cursor: pointer; touch-action: manipulation; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 1px 0 0 rgba(255, 255, 255, .18), inset 0 -1px 0 0 rgba(0, 0, 0, .35), var(--lift); transition: transform var(--fast) var(--spring), background-color var(--med) var(--ease), box-shadow var(--med) var(--ease); }
.btn:active:not(:disabled) { transform: scale(.955); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:disabled { opacity: .32; cursor: not-allowed; filter: saturate(0); }
.btn.quiet { background: var(--surface-2); color: var(--ink-2); box-shadow: var(--ring); font-weight: 600; }
.btn.quiet:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.btn.accent { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, .22), inset 0 -1px 0 0 rgba(0, 0, 0, .22), 0 6px 14px -8px var(--accent-glow); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input[type="checkbox"] { width: 22px; height: 22px; }
