/*
  Sunbaby design tokens (provisional, v0.1, 2026-11-01)
  Concept: winter sun. A low, warm sun rising over snow and a spruce line.
  Light mode is a bright winter morning; dark mode is the long Canadian night
  just before sunrise. Documented in docs/design-system.md.
  Pages consume these tokens only; no raw colour values in page CSS.
*/

@font-face {
  font-family: "Young Serif";
  src: url("/fonts/young-serif-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;

  /* Palette: raw named colours */
  --sb-snow: #f3f6f7;          /* page background, cool snow white */
  --sb-frost: #e3ebed;         /* raised surfaces, form panel */
  --sb-drift: #d3dfe2;         /* snow drift in the hero, hairlines */
  --sb-spruce: #17393a;        /* ink: headings and body text */
  --sb-spruce-soft: #46605f;   /* secondary text */
  --sb-pine: #1d6a5b;          /* action colour: buttons, links, focus */
  --sb-pine-deep: #134d42;     /* pressed / hover on action */
  --sb-marigold: #f4b23e;      /* the sun, never used for text */
  --sb-honey: #ffd27f;         /* sun halo */
  --sb-dawn: #fde7c8;          /* horizon glow */
  --sb-berry: #a3324a;         /* errors only */

  /* Semantic roles: what pages actually use */
  --color-bg: var(--sb-snow);
  --color-surface: var(--sb-frost);
  --color-line: var(--sb-drift);
  --color-text: var(--sb-spruce);
  --color-text-muted: var(--sb-spruce-soft);
  --color-action: var(--sb-pine);
  --color-action-hover: var(--sb-pine-deep);
  --color-on-action: #ffffff;
  --color-focus: var(--sb-pine);
  --color-error: var(--sb-berry);
  --color-success: var(--sb-pine);
  --color-sun: var(--sb-marigold);
  --color-sun-halo: var(--sb-honey);
  --color-horizon: var(--sb-dawn);
  --color-sky-top: #dfeaf0;
  --color-trees: #b7c9cc;
  --color-snow-front: var(--sb-snow);
  --halo-opacity: 0.55;

  /* Type */
  --font-display: "Young Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Type scale: perfect fourth (1.333) from a 17px base, fluid at the top end */
  --text-xs: 0.8125rem;   /* 13px: legal, footnotes */
  --text-sm: 0.9375rem;   /* 15px: helper text, footer */
  --text-md: 1.0625rem;   /* 17px: body */
  --text-lg: 1.25rem;     /* 20px: lede, item titles */
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 1.9rem);      /* section headings */
  --text-2xl: clamp(2.35rem, 1.5rem + 3.6vw, 4.2rem);    /* the promise (h1) */

  --leading-tight: 1.08;
  --leading-snug: 1.3;
  --leading-body: 1.6;
  --measure: 62ch;

  /* Spacing: 4px base, roughly doubling */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6.5rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --content-max: 68rem;

  /* Shape: soft like a snowbank, varied by role (not one radius everywhere) */
  --radius-field: 0.75rem;
  --radius-panel: 1.75rem;
  --radius-pill: 999px;

  /* Motion: one orchestrated moment (the sunrise); everything else is response */
  --ease-sunrise: cubic-bezier(0.16, 0.84, 0.3, 1);
  --ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);
  --duration-sunrise: 1800ms;
  --duration-quick: 160ms;
  --duration-medium: 280ms;
}

/* Dark: the winter night before sunrise. Applied when the OS is dark. */
@media (prefers-color-scheme: dark) {
  :root {
    --sb-snow: #0f1f23;
    --sb-frost: #172c31;
    --sb-drift: #1d363c;
    --sb-spruce: #e7efef;
    --sb-spruce-soft: #a9bdbe;
    --sb-pine: #82d3bf;
    --sb-pine-deep: #a6e3d3;
    --sb-marigold: #f5b942;
    --sb-honey: #f7c86f;
    --sb-dawn: #2b3236;
    --sb-berry: #ff8fa3;

    --color-line: #2a454b;
    --color-on-action: #0f1f23;
    --color-sky-top: #0b181c;
    --color-trees: #1c3338;
    --color-snow-front: var(--sb-snow);
    --halo-opacity: 0.22;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-sunrise: 0ms;
    --duration-quick: 0ms;
    --duration-medium: 0ms;
  }
}
