/* ════════════════════════════════════════════════════════════════════════
   Curzi's Restaurant — design tokens (the single source of colour, type,
   space and motion for the whole site).

   Seed model: four seeds define everything.
     --seed-accent  the signal colour (Dominican red)
     --seed-ink     the text colour
     --seed-base    the ground the site sits on
     --seed-earth   the unifier: food-family hues are pulled toward it
                    so eight register colours read as one warm palette

   Every other colour is derived from the seeds with color-mix() in oklab,
   so changing a seed re-tunes surfaces, rules, chips, tints and controls
   together instead of leaving one stray colour behind.

   Literal values are declared first; the color-mix derivations replace
   them inside @supports, so a browser without color-mix still renders
   the intended palette rather than a broken one.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── seeds ────────────────────────────────────────────────────────── */
  --seed-accent: #F0566B;   /* Dominican red, lifted for text on navy (5:1) */
  --seed-ink:    #F6F1E7;   /* ivory text */
  --seed-base:   #06122A;   /* deep Dominican navy ground */
  --seed-earth:  #6F7FA3;   /* cool slate: pulls the food-family hairlines toward the flag blue */

  color-scheme: dark;

  /* ── derived surfaces, ink and rules (literal fallbacks) ─────────── */
  --bg:          #06122A;
  --surface:     #0E1C38;
  --surface-2:   #142545;
  --ink:         #F6F1E7;
  --ink-2:       #cfc5b6;
  --muted:       #a09688;
  --meta:        #7d7468;
  --rule:        #2b241d;
  --rule-soft:   #1e1815;
  --rule-strong: #3a3228;
  --bg-scrim:    rgba(6, 18, 42, .82);

  /* ── the single accent, and the two semantic tones ───────────────── */
  --accent:      #F0566B;
  --accent-hi:   #FF7A8B;
  --accent-ink:  #FFFFFF;   /* buttons are flag red #CE1126 with white text (5.9:1) */
  --accent-quiet:#9E3846;
  --accent-glow: rgba(240, 86, 107, .14);
  --ok:          #7fa96a;   /* "every day" availability */
  --warm:        #c9805a;   /* "fried when you order" */

  /* ── food families: hue kept, chroma unified (hairlines, not fills) ─ */
  --fam-pork:    #9c7534;
  --fam-beef:    #8d5f42;
  --fam-chicken: #a58739;
  --fam-seafood: #4c7d80;
  --fam-soup:    #746478;
  --fam-drinks:  #54749a;
  --fam-veg:     #5c8549;
  --fam-neutral: #7a7166;

  /* ── the monogram ring: one warm ramp, amber to cocoa ─────────────── */
  --ring-1: #d4a24e;
  --ring-2: #c08f42;
  --ring-3: #a87c39;
  --ring-4: #8c7148;
  --ring-5: #7a6440;
  --ring-6: #665436;
  --ring-7: #524430;
  --ring-8: #3f3527;

  /* ── type ────────────────────────────────────────────────────────── */
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.8125rem;
  --text-base: clamp(0.94rem, 0.9rem + 0.2vw, 1.03rem);
  --text-lg:   clamp(1.06rem, 1rem + 0.3vw, 1.2rem);
  --text-xl:   clamp(1.2rem, 1.05rem + 0.7vw, 1.55rem);
  --text-2xl:  clamp(1.45rem, 1.15rem + 1.3vw, 2.05rem);
  --text-3xl:  clamp(1.85rem, 1.3rem + 2.3vw, 2.9rem);

  --leading-body:  1.62;
  --leading-snug:  1.35;
  --leading-tight: 1.12;
  --tracking-tight: -0.015em;
  --tracking-wide:  0.07em;
  --tracking-caps:  0.14em;
  --measure: 66ch;

  /* ── space: a 4px grid, with fluid page rhythm ───────────────────── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --gutter:     clamp(1rem, 4vw, 2.25rem);
  --section-y:  clamp(1.75rem, 1rem + 3.5vw, 4rem);
  --header-h:   clamp(3.5rem, 2.6rem + 2vw, 4.5rem);
  --container:  72rem;
  --card-min:   16rem;

  /* ── shape, elevation, motion ────────────────────────────────────── */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-pill: 999px;

  --elev-none: none;
  --elev-ring: 0 0 0 1px var(--rule);
  --elev-1: 0 1px 2px rgba(0, 0, 0, .45);
  --elev-2: 0 14px 30px -16px rgba(0, 0, 0, .65);
  --elev-3: 0 28px 56px -22px rgba(0, 0, 0, .7);

  --motion-fast: 140ms;
  --motion:      220ms;
  --motion-slow: 420ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --focus: 0 0 0 2px var(--bg), 0 0 0 4px rgba(240, 86, 107, .62);
}

/* ── the same tokens, derived from the seeds ───────────────────────── */
@supports (color: color-mix(in oklab, red, blue)) {
  :root {
    --surface:     color-mix(in oklab, var(--seed-base), var(--seed-ink) 6%);
    --surface-2:   color-mix(in oklab, var(--seed-base), var(--seed-ink) 10%);
    --ink-2:       color-mix(in oklab, var(--seed-ink), var(--seed-base) 18%);
    --muted:       color-mix(in oklab, var(--seed-ink), var(--seed-base) 38%);
    --meta:        color-mix(in oklab, var(--seed-ink), var(--seed-base) 52%);
    --rule:        color-mix(in oklab, var(--seed-ink) 16%, var(--seed-base));
    --rule-soft:   color-mix(in oklab, var(--seed-ink) 8%, var(--seed-base));
    --rule-strong: color-mix(in oklab, var(--seed-ink) 26%, var(--seed-base));
    --bg-scrim:    color-mix(in oklab, var(--seed-base) 82%, transparent);

    --accent-hi:   color-mix(in oklab, var(--seed-accent), white 18%);
    --accent-quiet:color-mix(in oklab, var(--seed-accent), var(--seed-base) 42%);
    --accent-glow: color-mix(in oklab, var(--seed-accent) 14%, transparent);
    --accent-on-bg:color-mix(in oklab, var(--seed-accent) 8%, var(--seed-base));
    --ok:          color-mix(in oklab, #86b96f, var(--seed-earth) 22%);
    --warm:        color-mix(in oklab, #d08a62, var(--seed-earth) 22%);

    --fam-pork:    color-mix(in oklab, #b88020, var(--seed-earth) 42%);
    --fam-beef:    color-mix(in oklab, #a2643f, var(--seed-earth) 40%);
    --fam-chicken: color-mix(in oklab, #c9a227, var(--seed-earth) 45%);
    --fam-seafood: color-mix(in oklab, #3f8b90, var(--seed-earth) 42%);
    --fam-soup:    color-mix(in oklab, #7d6a86, var(--seed-earth) 40%);
    --fam-drinks:  color-mix(in oklab, #4c7fb2, var(--seed-earth) 45%);
    --fam-veg:     color-mix(in oklab, #57a03f, var(--seed-earth) 45%);
    --fam-neutral: color-mix(in oklab, var(--seed-earth), var(--seed-base) 25%);

    --ring-1: color-mix(in oklab, var(--seed-accent), var(--seed-base) 0%);
    --ring-2: color-mix(in oklab, var(--seed-accent), var(--seed-base) 12%);
    --ring-3: color-mix(in oklab, var(--seed-accent), var(--seed-base) 24%);
    --ring-4: color-mix(in oklab, var(--seed-earth),  var(--seed-base) 14%);
    --ring-5: color-mix(in oklab, var(--seed-earth),  var(--seed-base) 28%);
    --ring-6: color-mix(in oklab, var(--seed-earth),  var(--seed-base) 42%);
    --ring-7: color-mix(in oklab, var(--seed-earth),  var(--seed-base) 55%);
    --ring-8: color-mix(in oklab, var(--seed-earth),  var(--seed-base) 68%);

    --focus: 0 0 0 2px var(--bg),
             0 0 0 4px color-mix(in oklab, var(--seed-accent) 62%, transparent);
  }
}

/* ── light theme: same structure, warm paper instead of espresso ──────
   The page is dark by default. Set data-theme="light" on <html>
   (js/theme.js does this and remembers the choice) and the whole site
   re-tunes from the same token names. ──────────────────────────────── */
:root[data-theme="light"] {
  --seed-ink:  #0B1B33;
  --seed-base: #FBF7F0;
  color-scheme: light;

  --bg:          #FBF7F0;
  --surface:     #fffdf7;
  --surface-2:   #f0e8da;
  --ink:         #0B1B33;
  --ink-2:       #3c342c;
  --muted:       #5d5448;
  --meta:        #746a5d;
  --rule:        #dcd1be;
  --rule-soft:   #eae1d1;
  --rule-strong: #c7b99f;
  --bg-scrim:    rgba(246, 241, 231, .86);

  --accent:      #B3102A;
  --accent-hi:   #8E0C21;
  --accent-ink:  #FFFFFF;
  --accent-quiet:#C9707C;
  --accent-glow: rgba(179, 16, 42, .10);
  --ok:          #43713a;
  --warm:        #a4522c;

  --ring-1: #6d4f14;
  --ring-2: #7d5a17;
  --ring-3: #8f6c2a;
  --ring-4: #a3813f;
  --ring-5: #b09058;
  --ring-6: #bda073;
  --ring-7: #c9ae8a;
  --ring-8: #d5bd9d;

  --elev-1: 0 1px 2px rgba(40, 30, 16, .10);
  --elev-2: 0 14px 30px -18px rgba(40, 30, 16, .22);
  --elev-3: 0 28px 56px -24px rgba(40, 30, 16, .26);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px rgba(179, 16, 42, .45);
}

@supports (color: color-mix(in oklab, red, blue)) {
  :root[data-theme="light"] {
    --surface:     color-mix(in oklab, var(--seed-base), white 55%);
    --surface-2:   color-mix(in oklab, var(--seed-base), var(--seed-ink) 6%);
    --ink-2:       color-mix(in oklab, var(--seed-ink), var(--seed-base) 16%);
    --muted:       color-mix(in oklab, var(--seed-ink), var(--seed-base) 36%);
    --meta:        color-mix(in oklab, var(--seed-ink), var(--seed-base) 48%);
    --rule:        color-mix(in oklab, var(--seed-ink) 18%, var(--seed-base));
    --rule-soft:   color-mix(in oklab, var(--seed-ink) 10%, var(--seed-base));
    --rule-strong: color-mix(in oklab, var(--seed-ink) 30%, var(--seed-base));
    --bg-scrim:    color-mix(in oklab, var(--seed-base) 86%, transparent);

    --fam-pork:    color-mix(in oklab, #8a5f16, var(--seed-ink) 18%);
    --fam-beef:    color-mix(in oklab, #7c4a2c, var(--seed-ink) 16%);
    --fam-chicken: color-mix(in oklab, #8f7220, var(--seed-ink) 18%);
    --fam-seafood: color-mix(in oklab, #2f6b70, var(--seed-ink) 16%);
    --fam-soup:    color-mix(in oklab, #63516c, var(--seed-ink) 16%);
    --fam-drinks:  color-mix(in oklab, #3a5f86, var(--seed-ink) 18%);
    --fam-veg:     color-mix(in oklab, #43742e, var(--seed-ink) 18%);
    --fam-neutral: color-mix(in oklab, #6a5b47, var(--seed-ink) 14%);

    --ring-1: color-mix(in oklab, var(--seed-accent), var(--seed-ink) 42%);
    --ring-2: color-mix(in oklab, var(--seed-accent), var(--seed-ink) 36%);
    --ring-3: color-mix(in oklab, var(--seed-accent), var(--seed-ink) 30%);
    --ring-4: color-mix(in oklab, var(--seed-earth),  var(--seed-ink) 26%);
    --ring-5: color-mix(in oklab, var(--seed-earth),  var(--seed-ink) 20%);
    --ring-6: color-mix(in oklab, var(--seed-earth),  var(--seed-ink) 14%);
    --ring-7: color-mix(in oklab, var(--seed-earth),  var(--seed-ink) 8%);
    --ring-8: color-mix(in oklab, var(--seed-earth),  var(--seed-ink) 2%);
  }
}
