/* ============================================================
   OC's Best Farmers Markets — design system
   Warm & rustic, earthy palette, editorial italic display
============================================================ */

:root {
  /* Earthy palette */
  --bg:        #f5efe2;
  --bg-2:      #ede4d0;
  --paper:     #faf6ec;
  --ink:       #1f2418;
  --ink-soft:  #4a4a3a;
  --rule:      #d8cfb8;

  --green:     #3d5a3d;
  --green-d:   #2a3f2a;
  --terracotta:#c44d2e;
  --terracotta-d:#a13d22;
  --brown:     #8b6f3f;
  --brown-l:   #b89a6b;
  --cream-warm:#fbf3df;

  /* Type */
  --display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --body:    "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --ui:      "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;

  /* Spacing */
  --pad: clamp(20px, 4vw, 56px);
  --radius: 4px;
  --maxw: 1240px;

  --shadow-card: 0 1px 0 rgba(0,0,0,0.04), 0 18px 40px -28px rgba(40,30,10,0.25);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* ---- Type rhythm ---- */
.display {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 0.96;
  text-wrap: balance;
}
.eyebrow {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brown);
}
.lede {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.35;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.ui-label {
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ---- Grain texture overlay (subtle paper feel) ---- */
.grain::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.16  0 0 0 0 0.10  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.18'/></svg>");
  z-index: 1;
}

/* ---- Top nav ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(6px);
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--green);
  display: grid; place-items: center;
  color: var(--cream-warm);
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  font-weight: 600;
}
.nav {
  display: flex; gap: 28px;
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--brown); }
.nav a.is-active { color: var(--ink); border-bottom-color: var(--terracotta); }
.nav-cta {
  background: var(--ink);
  color: var(--cream-warm);
  padding: 9px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background .18s;
}
.nav-cta:hover { background: var(--terracotta); }

@media (max-width: 760px) {
  .nav { display: none; }
}

/* ---- Section frame ---- */
section {
  padding: clamp(72px, 9vw, 128px) var(--pad);
  position: relative;
  z-index: 2;
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 56px;
}
.section-head h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(40px, 5.6vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}
.section-head .lede { margin: 0; max-width: 56ch; }
@media (max-width: 760px) {
  .section-head { grid-template-columns: 1fr; gap: 18px; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  background: var(--ink);
  color: var(--cream-warm);
  transition: transform .12s ease, background .18s ease;
}
.btn:hover { background: var(--terracotta); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--cream-warm); }
.btn-terracotta { background: var(--terracotta); }
.btn-terracotta:hover { background: var(--terracotta-d); }

/* ---- Cards ---- */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px;
}

/* ---- Form controls ---- */
input, textarea, select {
  font: inherit;
  font-family: var(--body);
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 12px 14px;
  color: var(--ink);
  transition: border-color .18s, background .18s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--green);
  background: #fff;
}
label.field {
  display: block;
  margin-bottom: 18px;
}
label.field > span.field-label {
  display: block;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brown);
  margin-bottom: 6px;
}
.checkrow {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.checkpill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--ui);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.checkpill input { display: none; }
.checkpill.is-on {
  background: var(--green);
  border-color: var(--green);
  color: var(--cream-warm);
}
.checkpill.is-on .dot { background: var(--cream-warm); }
.checkpill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brown-l);
}

/* ---- Hairline rule ---- */
.rule {
  height: 1px;
  background: var(--rule);
  margin: 0 var(--pad);
  position: relative;
  z-index: 2;
}

/* ---- Utility ---- */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.stack-8 > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-24 > * + * { margin-top: 24px; }
.muted { color: var(--ink-soft); }
.tiny { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--ui); font-weight: 600; color: var(--brown); }

/* Smooth scroll for anchor nav */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 72px; }
