/* ==========================================================================
   Hearthbowl — Design Tokens
   Direction A "Hearth & Field": spruce green, apricot, oat.
   Every colour pairing used for text is WCAG AA (ratios noted inline,
   measured against --color-bg unless stated).
   ========================================================================== */

:root {
  color-scheme: light;

  /* ---- Colour: core ---------------------------------------------------- */
  --color-ink:         #1F2A24; /* body text          13.9:1 */
  --color-muted:       #5C6660; /* secondary text      5.58:1 */
  --color-spruce:      #1E4D3B; /* primary            9.0:1 · white on it 9.6:1 */
  --color-spruce-600:  #2F6B52; /* hover               6.3:1 on white */
  --color-spruce-100:  #E8F0EA; /* mint tint for quiet panels */
  --color-apricot:     #F4A261; /* fills only · ink on it 7.2:1 */
  --color-apricot-200: #FBE3CC; /* soft apricot wash */
  --color-terracotta:  #B4532A; /* links + focus      4.67:1 · white on it 4.99:1 */
  --color-clay:        #EADFCC; /* tinted section / dividers */
  --color-bg:          #FBF7F0; /* oat page ground */
  --color-surface:     #FFFFFF;
  --color-night:       #13241C; /* footer · oat text on it 15.2:1 */

  /* Semantic aliases — components use these, not the raw palette */
  --text:          var(--color-ink);
  --text-muted:    var(--color-muted);
  --text-inverse:  var(--color-bg);
  --link:          var(--color-terracotta);
  --link-hover:    var(--color-spruce);
  --focus-ring:    var(--color-terracotta);
  --border:        var(--color-clay);
  --surface:       var(--color-surface);
  --success:       #2F6B52;
  --danger:        #A23B1E; /* 5.6:1 on white */

  /* ---- Colour: brand accents (swapped via [data-brand]) ---------------- */
  --brand-northfield: #2C5470; /* 7.5:1  slate blue */
  --brand-greenleaf:  #3F6E45; /* 5.6:1  leaf green */
  --brand-harbor:     #8A5A12; /* 5.5:1  baked honey */
  --brand-trailpack:  #7B3B5C; /* 7.5:1  wild plum */
  --brand-accent:    var(--color-spruce);

  /* ---- Typography ------------------------------------------------------ */
  --font-display: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --font-body:    "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Fluid scale: 360px → 1280px viewport, base 16 → 18px, ratio 1.2 → 1.25 */
  --step--1: clamp(0.833rem, 0.807rem + 0.116vw, 0.900rem);
  --step-0:  clamp(1.000rem, 0.951rem + 0.217vw, 1.125rem);
  --step-1:  clamp(1.200rem, 1.119rem + 0.359vw, 1.406rem);
  --step-2:  clamp(1.440rem, 1.316rem + 0.553vw, 1.758rem);
  --step-3:  clamp(1.728rem, 1.544rem + 0.816vw, 2.197rem);
  --step-4:  clamp(2.074rem, 1.810rem + 1.170vw, 2.747rem);
  --step-5:  clamp(2.488rem, 2.119rem + 1.643vw, 3.433rem);

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

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-bold:    700;
  --weight-display: 600;

  /* ---- Spacing (4px base) --------------------------------------------- */
  --space-3xs: 0.25rem; /*   4 */
  --space-2xs: 0.5rem;  /*   8 */
  --space-xs:  0.75rem; /*  12 */
  --space-s:   1rem;    /*  16 */
  --space-m:   1.5rem;  /*  24 */
  --space-l:   2rem;    /*  32 */
  --space-xl:  3rem;    /*  48 */
  --space-2xl: 4rem;    /*  64 */
  --space-3xl: 6rem;    /*  96 */
  --space-4xl: 8rem;    /* 128 */
  --space-section: clamp(3rem, 2rem + 4vw, 6rem);

  /* ---- Layout ---------------------------------------------------------- */
  --container: 75rem;                       /* 1200px */
  --gutter:    clamp(1rem, 4vw, 2.5rem);
  --header-h:  4.5rem;

  /* ---- Radius ---------------------------------------------------------- */
  --radius-sm:   6px;   /* inputs, small chips */
  --radius-md:   12px;  /* cards */
  --radius-lg:   20px;  /* feature panels */
  --radius-xl:   32px;  /* hero media */
  --radius-pill: 999px; /* buttons, filter chips */

  /* ---- Elevation (ink-tinted, never pure black) ------------------------ */
  --shadow-sm: 0 1px 2px rgb(31 42 36 / 0.08);
  --shadow-md: 0 6px 16px -4px rgb(31 42 36 / 0.12);
  --shadow-lg: 0 18px 40px -12px rgb(31 42 36 / 0.18);

  /* ---- Motion ---------------------------------------------------------- */
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;
  --ease:     cubic-bezier(0.2, 0.7, 0.2, 1);

  /* ---- Layers ---------------------------------------------------------- */
  --z-header: 50;
  --z-drawer: 60;
}

/* Brand scoping: any element with data-brand re-points --brand-accent */
[data-brand="northfield"]       { --brand-accent: var(--brand-northfield); }
[data-brand="greenleaf-select"] { --brand-accent: var(--brand-greenleaf); }
[data-brand="harbor-bakery"]    { --brand-accent: var(--brand-harbor); }
[data-brand="trailpack"]        { --brand-accent: var(--brand-trailpack); }

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; }
}
