/* Every colour, size, space, radius and duration lives here; no other file holds a raw value.
   Day is the default and night follows the device. Contrast ratios and sources: docs/plan/design.md. */
:root {
  color-scheme: light dark;

  /* Grounds and text (day) */
  --bg: #F3EBDA;
  --surface: #FBF7EE;
  --surface-2: #EDE3CF;
  --ink: #17203A;
  --ink-soft: #404961;
  --accent-text: #86350B;
  --teal-text: #0C5754;
  --danger-text: #9B0E33;

  /* Fills: the sun orange is the only action colour; red means danger only */
  --action-fill: #E8632A;
  --action-label: #17203A;
  --danger-fill: #B0103A;
  --danger-label: #FFFFFF;

  /* Lines and graphics */
  --border-strong: #6E7488;
  --hairline: #DDD1B9;
  --sun: #E05C24;
  --star: #8F6400;
  --stripe-rust: #92452B;
  --stripe-teal: #006E79;
  --stripe-mustard: #AC7C19;
  --stripe-sage: #6C8C5D;

  /* Type: the UI uses the system stack; stories use an old-style serif (display face: slice 3) */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Hebrew", "Noto Sans Arabic", sans-serif;
  --font-story: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, "Noto Serif", serif;
  --text-s: 1.125rem;
  --text-m: 1.25rem;
  --text-l: 1.5rem;
  --text-xl: 2rem;
  --text-xxl: 2.5rem;
  --leading-body: 1.5;
  --leading-heading: 1.2;
  --weight-bold: 700;
  --measure-story: 34em;

  /* Space (4px steps, in rem) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Shape */
  --radius-s: 0.5rem;
  --radius-m: 1rem;
  --radius-l: 1.5rem;
  --radius-pill: 62.5rem;
  --tap: 4rem;                    /* minimum tap target: 64px */
  --emblem: 12rem;                /* the main emblem button on a phone: 192px, never under 160px */
  --emblem-wide: 16rem;
  --page-max: 60rem;
  --frame: 0.125rem;              /* thin poster frame */
  --stripe-height: 0.5rem;

  /* Motion and focus */
  --motion: 200ms;
  --focus-width: 0.25rem;
  --focus-offset: 0.1875rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131A2E;
    --surface: #1C2541;
    --surface-2: #243050;
    --ink: #F3E8D2;
    --ink-soft: #C2BEB4;
    --accent-text: #FF965E;
    --teal-text: #51C2BE;
    --danger-text: #FF90A0;
    --action-label: #131A2E;
    --danger-fill: #FF6B81;
    --danger-label: #1F0705;
    --border-strong: #8A93AE;
    --hairline: #34405E;
    --sun: #E8632A;
    --star: #F2B544;
    --stripe-rust: #D89683;
    --stripe-teal: #40A8AF;
    --stripe-mustard: #F5C26F;
    --stripe-sage: #95A430;
  }
}
