/*
  CleverCopter design tokens.
  Every color, space, size and type value the site uses lives here.
  Components in site.css only reference these variables.

  Themes: light is the default in :root. Dark applies when the OS
  prefers it, or when <html data-theme="dark"> is set; data-theme="light"
  forces light. The dark values appear twice below because CSS can't
  share one block between a media query and an attribute selector —
  keep the two copies identical.
*/

:root {
  /* ---- Type ---- */
  --font-sans: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;

  --text-hero: 64px;
  --text-hero-mobile: 40px;
  --text-section-title: 24px;
  --text-card-title-lg: 18px;
  --text-body-lg: 18px;
  --text-nav: 16px;
  --text-body: 14px;
  --text-label: 12px;
  --text-caption: 11px;

  --weight-medium: 500;
  --weight-semibold: 600;

  --line-hero: 68px;
  --line-hero-mobile: 44px;
  --leading-tight: 1.4;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  --tracking-wide: 0.06em;

  /* ---- Spacing ---- */
  --space-2xs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-gutter: 20px;
  --space-xl: 24px;
  --space-section: 30px;

  /* ---- Radius ---- */
  --radius-sm: 8px;
  --radius-chip: 14px;
  --radius-stat: 20px;
  --radius-section: 30px;
  --radius-pill: 999px;

  /* ---- Sizes ---- */
  --border-hairline: 1px;

  --size-container: 1200px;
  --size-col-copy: 420px;
  --size-col-visual: 340px;
  --measure-narrow: 460px;
  --measure-band: 520px;
  --measure-prose: 720px;

  --size-tab-bar: 68px;
  --size-button: 48px;
  --size-chip: 28px;
  --size-logo-nav: 32px;
  --size-logo-footer: 24px;

  --size-icon-xl: 72px;
  --size-icon-lg: 48px;
  --size-icon-md: 44px;
  --size-icon-sm: 28px;
  --size-glyph-lg: 64px;

  --size-visual-height: 360px;
  --size-bar-width: 110px;
  --size-bar-height: 230px;
  --size-shot: 280px;
  --size-arrow: 40px;
  --size-dot: 8px;
  --size-split-bar: 14px;

  /* ---- Color: light theme ---- */
  --color-background: #f7f8fb;
  --color-card-top: #f3f7fb;
  --color-card-bottom: #eef0f2;
  --color-card-flat: #f0f3f6;
  --color-card-border: #ffffff;
  --color-tab-top: #eef2f6;
  --color-tab-bottom: #eceefd;

  --color-ink: #124c59;
  --color-numeral: #20137c;
  --color-text-strong: #373f45;
  --color-muted: #54555a;
  --color-subtle: #6b6d6e;

  --color-track: #e1e4eb;
  --color-chip: #e6e8f2;
  --color-active-tab: #ffffff;
  --color-on-accent: #ffffff;

  --accent-lavender: #968add;
  --accent-sand: #bfa78d;
  --accent-berry: #ab406b;
  --accent-teal-ink: #176475;

  --logo-body: #1b1d26;

  --shadow-float: 0 8px 30px #d8d8d8;

  /* ---- App brand gradients (same in both themes) ---- */
  --gradient-cashew: linear-gradient(135deg, #2f5689, #20137c);
  --gradient-speedo: linear-gradient(135deg, #5bb5a8, #176475);
  --gradient-cyclist: linear-gradient(135deg, #bfa78d, #ab406b);
}

/* Hero type shrinks on phones; components need no media query of their own. */
@media (max-width: 640px) {
  :root {
    --text-hero: var(--text-hero-mobile);
    --line-hero: var(--line-hero-mobile);
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-background: #0d0f16;
    --color-card-top: #1a1e28;
    --color-card-bottom: #151821;
    --color-card-flat: #171a23;
    --color-card-border: #2a2e3c;
    --color-tab-top: #1c1f2b;
    --color-tab-bottom: #171a24;

    --color-ink: #cfe3e8;
    --color-numeral: #ffffff;
    --color-text-strong: #e3e6ee;
    --color-muted: #a3a7b3;
    --color-subtle: #8c92a3;

    --color-track: #262a37;
    --color-chip: #232736;
    --color-active-tab: #232736;

    --accent-teal-ink: #5fb3c4;

    --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --color-background: #0d0f16;
  --color-card-top: #1a1e28;
  --color-card-bottom: #151821;
  --color-card-flat: #171a23;
  --color-card-border: #2a2e3c;
  --color-tab-top: #1c1f2b;
  --color-tab-bottom: #171a24;

  --color-ink: #cfe3e8;
  --color-numeral: #ffffff;
  --color-text-strong: #e3e6ee;
  --color-muted: #a3a7b3;
  --color-subtle: #8c92a3;

  --color-track: #262a37;
  --color-chip: #232736;
  --color-active-tab: #232736;

  --accent-teal-ink: #5fb3c4;

  --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.5);
}
