:root {
  --bg: #F7F6F2;
  --surface: #FBFBF9;
  --surface-2: #F1EFE8;
  --border: #D4D1CA;
  --text: #28251D;
  --muted: #7A7974;
  --faint: #BAB9B4;
  --primary: #1B474D;
  --primary-hover: #0C4E54;
  --accent: #C97B4A;   /* warm terracotta — dairy-ish */
  --gold: #D19900;
  --error: #A12C7B;
  --shadow-sm: 0 1px 2px rgba(40, 37, 29, 0.04), 0 1px 3px rgba(40, 37, 29, 0.05);
  --shadow-md: 0 4px 12px rgba(40, 37, 29, 0.06), 0 2px 6px rgba(40, 37, 29, 0.04);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font-family: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: "Chillax", "General Sans", sans-serif; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 3.75rem); line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.15; }
h3 { font-size: 1.2rem; line-height: 1.3; }
h4 { font-size: 1rem; }
p  { margin: 0 0 0.75em; color: var(--text); }
a  { color: var(--primary); text-decoration: none; border-bottom: 1px solid rgba(27,71,77,0.25); }
a:hover { color: var(--primary-hover); border-bottom-color: var(--primary-hover); }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }

/* ---------- header ---------- */
.site-header, .app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px; border-bottom: 1px solid var(--border);
  background: var(--bg); position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(160%) blur(6px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; border-bottom: none; font-family: "Chillax", sans-serif; font-weight: 600; font-size: 1.1rem; color: var(--text); }
.brand em { font-style: normal; color: var(--accent); }
.site-header nav { display: flex; align-items: center; gap: 24px; }
.site-header nav a { border-bottom: none; color: var(--muted); font-weight: 500; }
.site-header nav a:hover { color: var(--text); }

.btn-ghost, .btn-primary, .btn-secondary { font-family: inherit; font-weight: 600; font-size: 0.95rem; padding: 10px 18px; border-radius: 8px; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; border-bottom: none; transition: all 0.15s ease; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- landing hero ---------- */
.hero {
  padding: 90px 40px 60px;
  background:
    radial-gradient(circle at 15% 20%, rgba(27,71,77,0.06) 0, transparent 50%),
    radial-gradient(circle at 85% 10%, rgba(201,123,74,0.07) 0, transparent 45%),
    var(--bg);
}
.hero-inner { max-width: 1100px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: var(--accent); font-weight: 600; margin-bottom: 20px; }
.hero h1 { margin-bottom: 24px; max-width: 20ch; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; margin-bottom: 32px; }
.cta-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 60px; }
.hero-stats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px; border-top: 1px solid var(--border); padding-top: 32px; }
.hero-stats li { display: flex; flex-direction: column; gap: 4px; }
.hero-stats strong { font-family: "Chillax", sans-serif; font-size: 2.4rem; color: var(--primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-stats span { color: var(--muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- landing sections ---------- */
.section { padding: 80px 40px; max-width: 1200px; margin: 0 auto; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.95rem; margin: 0; }

.pricing { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); max-width: none; }
.pricing .section-head, .pricing .plans, .pricing .fine-print { max-width: 1200px; margin-left: auto; margin-right: auto; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.plan { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 28px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,71,77,0.08); }
.ribbon { position: absolute; top: -12px; right: 20px; background: var(--primary); color: white; font-size: 0.75rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.plan h3 { color: var(--primary); }
.plan .price { font-family: "Chillax", sans-serif; font-size: 3rem; font-weight: 600; margin: 12px 0 20px; color: var(--text); line-height: 1; }
.plan .price span { font-size: 1.5rem; vertical-align: super; color: var(--muted); }
.plan .price em { font-style: normal; font-size: 1rem; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; }
.plan ul li { padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 0.95rem; }
.plan ul li:last-child { border-bottom: none; }
.plan button { margin-top: auto; }
.fine-print { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 24px; }

.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.method-grid h4 { color: var(--primary); margin-bottom: 6px; }
.method-grid p { color: var(--muted); font-size: 0.95rem; }

.site-footer { padding: 40px; border-top: 1px solid var(--border); background: var(--surface); display: grid; grid-template-columns: 1fr 2fr; gap: 32px; max-width: 100%; }
.site-footer strong { font-family: "Chillax", sans-serif; font-size: 1.1rem; }
.site-footer p { color: var(--muted); font-size: 0.9rem; }
.site-footer .built-by { margin-top: 12px; font-size: 0.85rem; color: var(--muted); }
.site-footer .built-by a { color: var(--primary); font-weight: 600; border-bottom-color: rgba(27,71,77,0.3); }
.built-by-side { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.built-by-side a { color: var(--primary); font-weight: 600; }
@media (max-width: 700px) {
  .site-footer { grid-template-columns: 1fr; }
  .site-header, .app-header { padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
  .site-header nav { gap: 12px; font-size: 0.85rem; }
  .hero { padding: 60px 20px 40px; }
  .section { padding: 60px 20px; }
}

/* ---------- app / directory ---------- */
.app { background: var(--bg); min-height: 100vh; }
.app-header-right { display: flex; align-items: center; gap: 12px; }
.badge { background: var(--surface-2); color: var(--muted); font-size: 0.8rem; padding: 6px 12px; border-radius: 999px; font-weight: 500; }

.gate { min-height: calc(100vh - 72px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.gate-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; max-width: 440px; width: 100%; box-shadow: var(--shadow-md); }
.gate-card h2 { margin-bottom: 8px; color: var(--primary); }
.gate-card p { color: var(--muted); margin-bottom: 24px; }
.gate-card label { display: block; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.gate-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 1rem; margin-bottom: 16px; background: var(--bg); }
.gate-card input:focus { outline: 2px solid var(--primary); outline-offset: 2px; border-color: transparent; }
.gate-card button { width: 100%; justify-content: center; }
.gate-error { color: var(--error); font-size: 0.9rem; margin-top: 8px; }

.app-main { display: grid; grid-template-columns: 280px 1fr; gap: 0; min-height: calc(100vh - 72px); }
.filters { border-right: 1px solid var(--border); background: var(--surface); padding: 28px 24px; position: sticky; top: 72px; height: calc(100vh - 72px); overflow-y: auto; }
.filter-group { margin-bottom: 28px; }
.filter-group label { display: block; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.filter-group input[type="search"] { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 0.95rem; background: var(--bg); }
.filter-group input[type="search"]:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; cursor: pointer; color: var(--muted); font-weight: 500; }
.chip.active { background: var(--primary); color: white; border-color: var(--primary); }
.chip .n { font-variant-numeric: tabular-nums; opacity: 0.7; margin-left: 4px; }
.switch { display: inline-flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: normal; font-size: 0.95rem; color: var(--text); font-weight: 400; }
.count { font-family: "Chillax", sans-serif; font-size: 1.6rem; font-weight: 600; color: var(--primary); margin: 0; font-variant-numeric: tabular-nums; }

.results { padding: 28px 32px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; }
.entry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.entry-head h3 { font-size: 1.05rem; color: var(--primary); flex: 1; }
.entry .seg { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.seg.Processors { background: rgba(27,71,77,0.1); color: var(--primary); }
.seg.Cooperatives { background: rgba(201,123,74,0.15); color: #A05F35; }
.seg.Transporters { background: rgba(209,153,0,0.15); color: #8A6600; }
.seg\[data-key="Plant-Based"\] { background: rgba(67,122,34,0.12); color: #3D6C1E; }
.seg[data-key="Plant-Based"] { background: rgba(67,122,34,0.12); color: #3D6C1E; }
.entry .products { color: var(--muted); font-size: 0.9rem; }
.entry dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0; font-size: 0.9rem; }
.entry dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; padding-top: 2px; }
.entry dd { margin: 0; overflow-wrap: anywhere; }
.entry dd a { font-size: 0.9rem; }
.entry .procure { background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 6px; font-size: 0.88rem; line-height: 1.4; }
.entry .procure strong { display: block; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.entry .sources { font-size: 0.8rem; color: var(--muted); }
.entry .sources strong { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-right: 6px; }
.entry .sources a { font-size: 0.8rem; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 1.1rem; }

@media (max-width: 900px) {
  .app-main { grid-template-columns: 1fr; }
  .filters { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .results { padding: 20px; }
  .grid { grid-template-columns: 1fr; }
}
