/*
 * Design tokens
 *
 * Source of truth for colour, depth, shape, type, motion and spacing.
 * Accent Pitch green on the system font, so Apple devices get SF Pro with its
 * own optical sizes and tracking. Depth is soft shadow and translucent
 * material, never a solid offset edge. Motion is springs, fitted as
 * cubic-bezier() curves because CSS has no spring timing function. Not
 * linear(): Safari can't run linear() animations on the GPU, so they drop to
 * 30fps on an iPhone in Low Power Mode (60fps on a 120Hz screen).
 *
 * Appearance is system preference only — light values on :root, dark values
 * under @media (prefers-color-scheme: dark). There is no [data-theme] switch.
 */

:root {
  --bg: oklch(0.975 0.004 155);  /* #F5F8F5 */
  --sf: oklch(1 0 0);  /* #FFFFFF */
  --sf2: oklch(0.955 0.006 155);  /* #EDF1EE */
  --line: oklch(0.905 0.008 155);  /* #DCE1DD */
  --field: oklch(0.99 0.002 155);  /* #FBFCFB */
  --tx: oklch(0.22 0.015 155);  /* #151D18 */
  --tx2: oklch(0.44 0.015 155);  /* #4C554F */
  --tx3: oklch(0.55 0.015 155);  /* #6B746E */
  --ac: oklch(0.58 0.16 150);  /* #009342 */
  --ac-deep: oklch(0.47 0.144 150);  /* #007029 */
  --ac-ink: oklch(1 0 0);  /* #FFFFFF */
  --ac-bg: oklch(0.945 0.045 150);  /* #D9F6DD */
  --ac-text: oklch(0.46 0.144 150);  /* #006D26 */
  --mint: oklch(0.87 0.12 150);  /* #99EBAA */
  --mint-tx: oklch(0.38 0.128 150);  /* #005417 */
  --butter: oklch(0.9 0.17 98);  /* #FCDE3D */
  --butter-tx: oklch(0.4 0.1 75);  /* #663E00 */
  --peach: oklch(0.85 0.1 28);  /* #FFB5A9 */
  --peach-tx: oklch(0.44 0.19 28);  /* #A20000 */
  --lilac: oklch(0.85 0.1 300);  /* #D8BFFF */
  --lilac-tx: oklch(0.41 0.2 300);  /* #5E17A3 */
  --warn: oklch(0.54 0.13 65);  /* #A15B00 */
  --warn-bg: oklch(0.95 0.045 75);  /* #FFEBCE */
  --dan: oklch(0.53 0.17 28);  /* #BA362E */
  --dan-bg: oklch(0.95 0.035 28);  /* #FFE6E2 */
  --info: oklch(0.5 0.15 290);  /* #644FB1 */
  --info-bg: oklch(0.95 0.035 290);  /* #EEEBFF */
  --scrim: oklch(0.2 0.02 155 / 0.35);  /* #0F191259 */
  --sh: 0 24px 64px oklch(0.2 0.02 155 / 0.18);  /* #0F19122E */
  --nx-bg: var(--ac-bg);
  --nx-tx: var(--tx);
  --nx-sub: var(--ac-text);
  --nx-bd: color-mix(in oklch, var(--ac) 20%, transparent);
  --nx-chip: var(--sf);
  --nx-chip-tx: var(--ac-text);
  --nx-btn: var(--ac);
  --nx-btn-tx: var(--ac-ink);
  --nx-btn-edge: var(--ac-deep);
  --nx-ghost: var(--sf);
  --nx-ghost-bd: var(--line);
  --nx-track: color-mix(in oklch, var(--ac) 18%, transparent);
  --mint-edge: color-mix(in oklch, var(--mint-tx) 16%, transparent);
  --butter-edge: color-mix(in oklch, var(--butter-tx) 16%, transparent);
  --peach-edge: color-mix(in oklch, var(--peach-tx) 16%, transparent);
  --lilac-edge: color-mix(in oklch, var(--lilac-tx) 16%, transparent);
  --ac-edge: var(--nx-bd);
  /* Solid data fills: the effort chart, the phone mini strip and the
     Insights breakdown bars. Saturated in both themes, unlike the
     pastel tints and their -tx text colors. High and better are the accent. */
  --mint-solid: var(--ac);
  --butter-solid: var(--warn);  /* #A15B00 */
  --peach-solid: var(--dan);  /* #BA362E */
  --neutral-solid: var(--tx3);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  --t-hero: 56px/60px;      /* marketing / design system only */
  --t-display: 30px/36px;   /* page title, desktop. letter-spacing -0.02em, 700 */
  --t-display-m: 28px/34px; /* page title, phone. -0.02em, 700 */
  --t-title: 22px/28px;     /* modal title, player name in cards. -0.01em, 700 */
  --t-heading: 17px/24px;   /* section heading, 700 (18px on desktop Today) */
  --t-body-l: 17px/25px;    /* up-next "last time you planned" quote, desktop */
  --t-body: 15px/22px;      /* default body */
  --t-body-s: 14px/20px;    /* card body, table cells */
  --t-label: 13px/18px;     /* labels, 600 */
  --t-micro: 12px/16px;     /* chips, meta, 600 */
  --t-figure: 20px/24px;    /* times, scores. 700, tabular-nums, -0.02em */
  --tracking-tight: -0.01em;  /* SF already tightens itself at display sizes */

  /* Shape */
  --bw: 1px;                /* every border: a hairline */
  --r-chip-sq: 6px;         /* rank letter badge, effort square */
  --r-field: 12px;          /* text fields, small inner boxes */
  --r-tile: 14px;           /* week-strip day tiles, private-note panel inside forms */
  --r-card: 18px;           /* cards, tables, panels */
  --r-card-l: 20px;         /* up-next and done-today cards */
  --r-modal: 22px;          /* modals, floating session card */
  --r-sheet: 26px;          /* phone bottom sheet (top corners) */
  --r-pill: 999px;          /* buttons, chips, segmented, avatars, search */

  /* Depth: bigger surfaces cast deeper shadows, so a card sits lower than a
     menu and a menu lower than a sheet */
  --sh-1: 0 0.5px 1px oklch(0.2 0.02 155 / 0.06), 0 1px 3px oklch(0.2 0.02 155 / 0.06);  /* cards, raised controls */
  --sh-2: 0 2px 6px oklch(0.2 0.02 155 / 0.06), 0 8px 24px oklch(0.2 0.02 155 / 0.1);    /* menus, popovers, selected thumbs */
  --focus-ring: 0 0 0 3px color-mix(in oklch, var(--ac) 35%, transparent);  /* with border-color: var(--ac) */
  --selected-ring: inset 0 0 0 var(--bw) var(--ac);

  /* Material: chrome that content scrolls under (the flash banner) */
  --material: oklch(0.985 0.004 155 / 0.72);
  --material-filter: blur(24px) saturate(180%);
  --material-edge: oklch(0.2 0.02 155 / 0.1);

  /* Motion. A critically damped spring (response 0.35s) for anything that
     moves, and a slightly bouncy one (damping 0.8) only after a flick. Press
     feedback is fast and lands on pointer-down. */
  --spring: cubic-bezier(0.235, 0.271, 0.117, 1.055);
  --spring-dur: 450ms;
  --spring-bounce: cubic-bezier(0.286, 0.515, 0.009, 1.176);
  --spring-bounce-dur: 600ms;
  --press-scale: 0.97;
  --press: transform 120ms cubic-bezier(0.2, 0, 0, 1);

  /* Spacing (px): 2 3 4 6 8 10 12 14 16 18 20 22 24 28 30 32 40 44 48 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* Layout */
  --sidebar-w: 232px;
  --content-max: 960px;     /* Today; other pages use full width minus padding */
  --page-pad-desktop: 30px 48px;  /* Today; 32px 44px on Roster/Announcements; 30px 40px on Planner/Calendar */
  --page-pad-phone: 4px 16px 0;
  --bottom-nav-h: 84px;
  --tap-min: 44px;

  /* Font-size-only companions to the --t-* shorthand scale above, for call
   * sites that set font-size and line-height separately instead of using
   * the `font: <weight> var(--t-*) var(--font)` shorthand. Values match the
   * size half of the nearest --t-* token; introduced while migrating the
   * old --text-*/--font-* scale. */
  --fz-micro: 12px;
  --fz-body-s: 14px;
  --fz-heading: 17px;
  --fz-figure: 20px;
  --fz-title: 22px;
  --fz-display-m: 28px;
  --fz-display: 30px;

  /* Fixed icon sizes for the older views; components size their icons
   * themselves (18 in buttons, 13-16 in chips, 20 standalone). */
  --icon-size-xs: 16px;
  --icon-size-sm: 20px;
  --icon-size-md: 24px;
  --icon-size-lg: 32px;
  --icon-size-2xl: 64px;

  /* Safe-area insets (phone chrome, not part of the colour system) */
  --safe-inset-top: env(safe-area-inset-top, 0px);
  --safe-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-inset-left: env(safe-area-inset-left, 0px);
  --safe-inset-right: env(safe-area-inset-right, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.165 0.01 155);  /* #0B100C */
    --sf: oklch(0.2 0.012 155);  /* #121814 */
    --sf2: oklch(0.245 0.014 155);  /* #1B221E */
    --line: oklch(0.3 0.014 155);  /* #28302B */
    --field: oklch(0.175 0.01 155);  /* #0D120F */
    --tx: oklch(0.95 0.008 155);  /* #EAF0EC */
    --tx2: oklch(0.77 0.015 155);  /* #ADB7B0 */
    --tx3: oklch(0.64 0.015 155);  /* #858F88 */
    --ac: oklch(0.7 0.16 150);  /* #43B966 */
    --ac-deep: oklch(0.5 0.144 150);  /* #007932 */
    --ac-ink: oklch(0.18 0.03 150);  /* #07150A */
    --ac-bg: oklch(0.3 0.06 150);  /* #14361D */
    --ac-text: oklch(0.84 0.11 150);  /* #95DFA4 */
    --mint: oklch(0.42 0.104 150);  /* #145C2C */
    --mint-tx: oklch(0.92 0.096 150);  /* #B7F7C3 */
    --butter: oklch(0.5 0.12 90);  /* #7E5E00 */
    --butter-tx: oklch(0.95 0.13 95);  /* #FFEE83 */
    --peach: oklch(0.44 0.14 28);  /* #902822 */
    --peach-tx: oklch(0.91 0.07 28);  /* #FFD0C8 */
    --lilac: oklch(0.42 0.15 300);  /* #5B3291 */
    --lilac-tx: oklch(0.91 0.07 300);  /* #E8D7FF */
    --warn: oklch(0.81 0.12 70);  /* #F2B366 */
    --warn-bg: oklch(0.3 0.05 70);  /* #3E290F */
    --dan: oklch(0.73 0.14 28);  /* #F38275 */
    --dan-bg: oklch(0.3 0.06 28);  /* #47211C */
    --info: oklch(0.78 0.1 290);  /* #B6ADF3 */
    --info-bg: oklch(0.31 0.06 290);  /* #302A4C */
    --scrim: oklch(0.08 0.01 155 / 0.62);  /* #0102019E */
    --sh: 0 24px 64px oklch(0 0 0 / 0.5);  /* #00000080 */
    --sh-1: 0 0 0 0.5px oklch(1 0 0 / 0.04), 0 1px 3px oklch(0 0 0 / 0.4);
    --sh-2: 0 0 0 0.5px oklch(1 0 0 / 0.06), 0 8px 24px oklch(0 0 0 / 0.5);
    --material: oklch(0.2 0.012 155 / 0.72);
    --material-edge: oklch(1 0 0 / 0.08);
    --nx-bg: var(--ac-bg);
    --nx-tx: var(--tx);
    --nx-sub: var(--ac-text);
    --nx-bd: color-mix(in oklch, var(--ac) 20%, transparent);
    --nx-chip: var(--sf);
    --nx-chip-tx: var(--ac-text);
    --nx-btn: var(--ac);
    --nx-btn-tx: var(--ac-ink);
    --nx-btn-edge: var(--ac-deep);
    --nx-ghost: var(--sf);
    --nx-ghost-bd: var(--line);
    --nx-track: color-mix(in oklch, var(--ac) 22%, transparent);
    --mint-edge: color-mix(in oklch, var(--mint-tx) 16%, transparent);
    --butter-edge: color-mix(in oklch, var(--butter-tx) 16%, transparent);
    --peach-edge: color-mix(in oklch, var(--peach-tx) 16%, transparent);
    --lilac-edge: color-mix(in oklch, var(--lilac-tx) 16%, transparent);
    --ac-edge: var(--nx-bd);
    --mint-solid: var(--ac);
    --butter-solid: oklch(0.76 0.15 70);  /* #ED9E2F */
    --peach-solid: oklch(0.66 0.17 28);  /* #E86154 */
    --neutral-solid: var(--tx3);
  }
}

html { font-family: var(--font); -webkit-font-smoothing: antialiased; font-optical-sizing: auto; }

/* Solid surfaces for people who find translucency hard to read through,
   and firmer edges for people who asked for more contrast */
@media (prefers-reduced-transparency: reduce) {
  :root { --material: var(--sf); --material-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: var(--tx3); --material: var(--sf); --material-filter: none; --material-edge: var(--tx3); }
}

*:focus-visible {
  outline: none;
  border-color: var(--ac);
  box-shadow: var(--focus-ring);
}
