/*
 * Design tokens shared by the public site and the bureau: the single source of every
 * color, size, radius, shadow, duration and text style. Same names and values as the
 * app's design system, in kebab-case. Pages and components read variables from here and
 * write no raw value of their own.
 *
 * Served as-is at /tokens.css (site/ is copied to the Hosting root) and imported by the
 * bureau from this same file, so there is no second copy to drift.
 *
 * Fonts are not loaded here: each page loads them with a <link> (an @import would block
 * rendering behind a second round trip).
 */
:root {
  color-scheme: light;

  /* Surfaces */
  --surface-page: #fafafa;
  --surface-card: #ffffff;
  --surface-sunken: #f3f4f6;
  --surface-inverse: #1a1a1a;
  --surface-brand-soft: #eefbf6;
  --surface-glass: rgb(255 255 255 / 92%);
  --surface-training: #123d2c;
  --surface-training-pressed: #0e3123;
  --surface-training-track: #416456;

  /* Text */
  --text-strong: #1a1a1a;
  --text-body: #2d2d2d;
  --text-muted: #5b6472;
  --text-brand: #157f54;
  --text-on-inverse: #ffffff;
  --text-danger: #c53030;
  --text-training-muted: #d0d8d5;

  /* Actions */
  --action-primary: #2ecb8b;
  --action-primary-pressed: #25a672;
  --action-on-primary: #1a1a1a;
  --action-danger: #c53030;
  --action-danger-pressed: #a32828;

  /* Borders and overlays */
  --border-control: #858d99;
  --border-subtle: #e5e7eb;
  --state-pressed: rgb(26 26 26 / 5%);
  --scrim-modal: rgb(0 0 0 / 40%);
  --scrim-media: rgb(26 26 26 / 64%);
  --skeleton-base: #e5e7eb;
  --skeleton-highlight: #f3f4f6;

  /* Status tones: always used as a background and text pair */
  --tone-neutral-bg: #f3f4f6;
  --tone-neutral-fg: #5b6472;
  --tone-brand-soft-bg: #eefbf6;
  --tone-brand-soft-fg: #157f54;
  --tone-brand-solid-bg: #2ecb8b;
  --tone-brand-solid-fg: #1a1a1a;
  --tone-ink-bg: #1a1a1a;
  --tone-ink-fg: #ffffff;
  --tone-success-bg: #d0f0dc;
  --tone-success-fg: #23673f;
  --tone-attention-bg: #fcede6;
  --tone-attention-fg: #a8431f;
  --tone-danger-bg: #fbe4e4;
  --tone-danger-fg: #8c2323;
  --tone-info-bg: #daeafa;
  --tone-info-fg: #285e9a;

  /* Sport pills */
  --sport-running-bg: #feeadd;
  --sport-running-fg: #a8431f;
  --sport-cycling-bg: #daeafa;
  --sport-cycling-fg: #285e9a;
  --sport-hiking-bg: #d0f0dc;
  --sport-hiking-fg: #23673f;
  --sport-swimming-bg: #d4f0f8;
  --sport-swimming-fg: #196a82;
  --sport-dogo-bg: #f0e4d8;
  --sport-dogo-fg: #7a5638;

  /* Spacing (grid of 4) */
  --space-tight: 4px;
  --space-inline: 8px;
  --space-stack: 12px;
  --space-row-v: 12px;
  --space-section-header-gap: 12px;
  --space-card-padding: 16px;
  --space-screen: 20px;
  --space-hero-padding: 20px;
  --space-sheet: 20px;
  --space-section-gap: 24px;
  --space-dialog: 24px;
  /* Web only: horizontal page margin from 768px up, and the hero's padding on a wide screen */
  --space-page-margin-wide: 32px;
  --space-hero-padding-wide: 48px;

  /* Radii */
  --radius-field: 8px;
  --radius-card: 12px;
  --radius-hero: 16px;
  --radius-sheet: 24px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgb(0 0 0 / 6%);
  --shadow-floating: 0 8px 40px rgb(0 0 0 / 10%);
  --shadow-brand: 0 6px 20px rgb(46 203 139 / 30%);
  --shadow-control: 0 1px 4px rgb(0 0 0 / 12%);

  /* Fixed sizes */
  --size-touch: 48px;
  --size-button-md: 52px;
  --size-button-sm: 40px;
  --size-field: 52px;
  --size-pill: 28px;
  --size-header-mobile: 56px;
  --size-header-desktop: 64px;
  --size-container: 1100px;
  /* A dialog-like block: the sign-in card, a toast, a confirmation (screen - 48, 400 max). */
  --size-card-narrow: 400px;
  --size-measure: 68ch;

  /* Motion */
  --motion-press: 100ms;
  --motion-fast: 150ms;
  --motion-enter: 250ms;
  --motion-exit: 200ms;
  --motion-shimmer: 1200ms;
  --ease-press: cubic-bezier(0, 0, 0.58, 1);
  --ease-fast: cubic-bezier(0.42, 0, 0.58, 1);
  --ease-enter: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-exit: cubic-bezier(0.55, 0.055, 0.675, 0.19);

  /* Fonts */
  --font-display: 'Montserrat', system-ui, sans-serif;
  --font-text: 'Inter', system-ui, -apple-system, sans-serif;

  /* Colored ring, swapped for white by .on-inverse */
  --focus-ring: var(--text-strong);

  /* Web text roles: sizes that change with the viewport (see the media query below) */
  --web-display-size: 32px;
  --web-h2-size: 26px;

  /* Text roles as font shorthands, for a style whose role changes with the viewport */
  --type-hero-number: 800 32px/1.1 var(--font-display);
  --type-screen-title: 800 26px/1.2 var(--font-display);
  --type-kpi: 800 22px/1.2 var(--font-display);
  --type-section-title: 800 18px/1.25 var(--font-display);
  --type-card-title: 700 15px/1.3 var(--font-display);
  --type-label: 600 14px/1.3 var(--font-display);
  --type-input: 400 16px/1.4 var(--font-text);
  --type-body: 400 14px/1.5 var(--font-text);
  --type-body-strong: 600 14px/1.5 var(--font-text);
  --type-meta: 500 12px/1.4 var(--font-text);
  --type-pill: 600 12px/1.3 var(--font-display);
  --type-overline: 600 12px/1.3 var(--font-display);
  --type-web-display: 800 var(--web-display-size) / 1.1 var(--font-display);
  --type-web-h2: 800 var(--web-h2-size) / 1.2 var(--font-display);
  --type-web-body: 400 16px/1.6 var(--font-text);
}

@media (min-width: 1024px) {
  :root {
    --web-display-size: 48px;
    --web-h2-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-press: 0ms;
    --motion-fast: 0ms;
    --motion-enter: 0ms;
    --motion-exit: 0ms;
    --motion-shimmer: 0ms;
  }

  html {
    scroll-behavior: auto;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Dark surfaces (ink, training green): the ring turns white. */
.on-inverse {
  --focus-ring: var(--text-on-inverse);
}

/* Text styles: the 12 roles of the app. */
.text-hero-number {
  font: var(--type-hero-number);
  color: var(--text-strong);
}

.text-screen-title {
  font: var(--type-screen-title);
  color: var(--text-strong);
}

.text-kpi {
  font: var(--type-kpi);
  color: var(--text-strong);
}

.text-section-title {
  font: var(--type-section-title);
  color: var(--text-strong);
}

.text-card-title {
  font: var(--type-card-title);
  color: var(--text-strong);
}

.text-label {
  font: var(--type-label);
  color: var(--text-strong);
}

.text-input {
  font: var(--type-input);
  color: var(--text-strong);
}

.text-body {
  font: var(--type-body);
  color: var(--text-body);
}

.text-body-strong {
  font: var(--type-body-strong);
  color: var(--text-strong);
}

.text-meta {
  font: var(--type-meta);
  color: var(--text-muted);
}

.text-pill {
  font: var(--type-pill);
}

.text-overline {
  font: var(--type-overline);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Web-only roles, for the public site. */
.text-web-display {
  font: var(--type-web-display);
  color: var(--text-strong);
}

.text-web-h2 {
  font: var(--type-web-h2);
  color: var(--text-strong);
}

.text-web-body {
  max-width: var(--size-measure);
  font: var(--type-web-body);
  color: var(--text-body);
}

/* Aligned digits for any column of figures. */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}
