/* tokens.css: BRAND.md sections 3 to 5 as custom properties. Change the brand here, nowhere else. */

@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-latin-wght.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin-wght.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* 3. Color, light (default) */
  --blue: #1F4FFF;
  --blue-press: #1A41D6;
  --blue-tint: #E6ECFF;
  --red: #F23A2F;
  --yellow: #FFC800;
  --green: #12B886;
  --orange: #FF7A1A;
  --violet: #7B3FE4;
  --navy: #0B1640;
  --ink-2: #56607A;
  --paper: #FFFFFF;
  --mist: #F3F5FA;
  --line: #DDE2EE;

  /* Text-safe product inks (text on white) */
  --yellow-ink: #7A5A00;
  --red-ink: #C8231A;
  --green-ink: #0B7A57;
  --orange-ink: #B34D00;
  --violet-ink: #6230C9;
  --blue-ink: #1F4FFF;

  /* Semantic roles (these flip in dark mode) */
  --canvas: var(--paper);
  --surface: var(--mist);
  --raised: var(--paper);
  --text: var(--navy);
  --text-2: var(--ink-2);
  --rule: var(--line);
  --link: var(--blue);
  --link-press: var(--blue-press);
  --accent-fill: var(--blue);
  --on-accent: #FFFFFF;
  --tint: var(--blue-tint);
  --mark: var(--blue);
  --focus: var(--blue);

  /* Product fields: fill and the text that sits on it */
  --field-yellow: var(--yellow);
  --field-red: var(--red);
  --field-orange: var(--orange);
  --field-green: var(--green);
  --field-violet: var(--violet);
  --field-blue: var(--blue);
  --on-field-dark: var(--navy);
  --on-field-light: #FFFFFF;

  /* 4. Shape */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;
  --stroke-icon: 1.75px;

  /* 4. Spacing, 4 px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --section-pad: var(--s-9);

  /* 4. Elevation: navy-tinted, soft, rare */
  --shadow-1: 0 1px 2px rgb(11 22 64 / .06), 0 6px 16px rgb(11 22 64 / .06);
  --shadow-2: 0 18px 40px rgb(11 22 64 / .12);

  /* 4. Grid */
  --max-width: 1200px;
  --gutter: 24px;
  --side: 24px;

  /* 5. Typography */
  --font-display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;

  --display-size: 88px;
  --display-lh: 0.95;
  --display-track: -0.02em;
  --h1-size: 56px;
  --h1-lh: 1.05;
  --h2-size: 40px;
  --h2-lh: 1.1;
  --h3-size: 26px;
  --h3-lh: 1.2;
  --lead-size: 21px;
  --lead-lh: 1.5;
  --body-size: 17px;
  --body-lh: 1.6;
  --ui-size: 16px;
  --small-size: 14px;
  --small-lh: 1.5;
  --measure: 68ch;

  /* 8. Motion */
  --dur-fast: 120ms;
  --dur-ui: 180ms;
  --dur-slow: 200ms;
  --dur-morph: 900ms;
  --dur-hero: 2200ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

@media (max-width: 720px) {
  :root {
    --display-size: 46px;
    --display-lh: 1.0;
    --h1-size: 36px;
    --h1-lh: 1.08;
    --h2-size: 30px;
    --h2-lh: 1.12;
    --h3-size: 22px;
    --h3-lh: 1.25;
    --lead-size: 18px;
    --body-size: 16px;
    --section-pad: var(--s-8);
    --gutter: 16px;
    --side: 16px;
  }
}

/* 3. Dark (navy canvas): explicit choice, or the OS preference when no choice is saved */
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0B1640;
  --surface: #121F52;
  --raised: #1A2A66;
  --text: #F4F6FF;
  --text-2: #A9B4D9;
  --rule: #26356F;
  --link: #6F8CFF;
  --link-press: #93A9FF;
  --accent-fill: #6F8CFF;
  --on-accent: #0B1640;
  --tint: #1A2A66;
  --mark: #FFFFFF;
  --focus: #FFD23F;
  --field-yellow: #FFD23F;
  --field-red: #FF5A50;
  --field-orange: #FF9444;
  --field-green: #2ED3A0;
  --field-violet: #9C6BFF;
  --field-blue: #6F8CFF;
  --yellow-ink: #FFD23F;
  --red-ink: #FF5A50;
  --green-ink: #2ED3A0;
  --orange-ink: #FF9444;
  --violet-ink: #9C6BFF;
  --blue-ink: #6F8CFF;
  --on-field-light: #0B1640;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .25), 0 6px 16px rgb(0 0 0 / .2);
  --shadow-2: 0 18px 40px rgb(0 0 0 / .35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0B1640;
    --surface: #121F52;
    --raised: #1A2A66;
    --text: #F4F6FF;
    --text-2: #A9B4D9;
    --rule: #26356F;
    --link: #6F8CFF;
    --link-press: #93A9FF;
    --accent-fill: #6F8CFF;
    --on-accent: #0B1640;
    --tint: #1A2A66;
    --mark: #FFFFFF;
    --focus: #FFD23F;
    --field-yellow: #FFD23F;
    --field-red: #FF5A50;
    --field-orange: #FF9444;
    --field-green: #2ED3A0;
    --field-violet: #9C6BFF;
    --field-blue: #6F8CFF;
    --yellow-ink: #FFD23F;
    --red-ink: #FF5A50;
    --green-ink: #2ED3A0;
    --orange-ink: #FF9444;
    --violet-ink: #9C6BFF;
    --blue-ink: #6F8CFF;
    --on-field-light: #0B1640;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .25), 0 6px 16px rgb(0 0 0 / .2);
    --shadow-2: 0 18px 40px rgb(0 0 0 / .35);
  }
}
