/* Evergreen prototype — shared styles.
   One family (Archivo, variable width) does all the work: condensed + heavy for signage and the
   Sustainability Facts panel, normal width for reading. */

:root {
  --spruce: #1e3a2a;
  --spruce-2: #2c5440;
  --spruce-tint: #e3ebe5;
  --paper: #f3f5f1;
  --surface: #ffffff;
  --ink: #1d2420;
  --ink-2: #56625b;
  --rule: #d5dcd6;
  --kraft: #d8b98e;
  --kraft-tint: #f4eadb;
  --stamp: #a3302a;
  --label-black: #000;
  --focus: #3b6fd8;

  --r-sm: 4px;
  --r-md: 8px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-variation-settings: "wdth" 100;
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--spruce-2); text-underline-offset: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3, h4 {
  margin: 0;
  font-variation-settings: "wdth" 75;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--spruce);
}
h1 { font-size: clamp(2.2rem, 5.6vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; max-width: 68ch; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- site header ---------- */

.site-head { background: var(--surface); border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--spruce); }
.brand-mark { width: 28px; height: 28px; }
.brand-name { font-variation-settings: "wdth" 75; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; }
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:hover { text-decoration: underline; }

/* The "Prototype" drop-down: screens a shopper wouldn't reach from the normal nav. */
.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 500; color: var(--ink);
  padding: 2px 8px; margin: -2px -8px; border-radius: var(--r-sm);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--spruce-tint); }
.menu[open] > summary { background: var(--spruce-tint); }
.menu-chevron { width: 12px; height: 12px; transition: transform 0.15s; }
.menu[open] .menu-chevron { transform: rotate(180deg); }
.menu-panel {
  position: absolute; top: calc(100% + 10px); left: -8px; z-index: 40;
  min-width: 270px; padding: 6px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md);
  box-shadow: 0 10px 30px rgba(20, 40, 30, 0.14);
  display: grid;
}
.menu-panel a, .menu-panel button {
  display: grid; gap: 1px; text-align: left;
  font: inherit; color: var(--ink); text-decoration: none;
  background: none; border: 0; cursor: pointer;
  padding: 8px 10px; border-radius: var(--r-sm);
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--spruce-tint); text-decoration: none; }
.menu-panel a[aria-current="page"] { background: var(--spruce-tint); color: var(--spruce); font-weight: 700; }
.menu-panel .menu-hint { font-size: 0.8125rem; color: var(--ink-2); font-weight: 400; }
.menu-panel hr { border: 0; border-top: 1px solid var(--rule); margin: 6px 4px; }
.cart-link {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--spruce); text-decoration: none; font-weight: 700;
  border: 1.5px solid var(--spruce); border-radius: 999px; padding: 6px 14px;
}
.cart-count { background: var(--spruce); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 0.8125rem; }

main { padding-bottom: 72px; }

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700;
  padding: 12px 20px; border-radius: var(--r-md);
  border: 1.5px solid var(--spruce);
  background: var(--spruce); color: #fff;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--spruce-2); }
.btn.secondary { background: transparent; color: var(--spruce); }
.btn.secondary:hover { background: var(--spruce-tint); }
.btn.small { padding: 7px 12px; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

label.field { display: grid; gap: 6px; font-weight: 600; font-size: 0.9375rem; }
.field input, .field select, .field textarea {
  font: inherit; font-weight: 400;
  padding: 10px 12px; border-radius: var(--r-sm);
  border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--spruce); }
.hint { font-weight: 400; color: var(--ink-2); font-size: 0.875rem; }

/* The net-zero choice: a two-position segmented control. */
.choice { display: inline-grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--spruce); border-radius: var(--r-md); overflow: hidden; }
.choice button {
  font: inherit; border: 0; background: var(--surface); color: var(--spruce);
  padding: 8px 12px; cursor: pointer; text-align: left; line-height: 1.2;
}
.choice button + button { border-left: 1.5px solid var(--spruce); }
.choice button[aria-pressed="true"] { background: var(--spruce); color: #fff; }
.choice .c-name { display: block; font-weight: 700; font-size: 0.875rem; }
.choice .c-price { display: block; font-size: 1.05rem; font-weight: 700; }

/* ---------- home ---------- */

.hero { padding: clamp(40px, 7vw, 88px) 0 40px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.hero h1 { max-width: 15ch; }
.hero .lede { font-size: 1.2rem; max-width: 46ch; margin-top: 20px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.demo-tag { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 20px; }
.demo-tag h3 { margin-bottom: 4px; }
.demo-tag .choice { width: 100%; margin: 16px 0; }
.demo-split { display: grid; grid-template-columns: 1fr auto; gap: 4px 0; font-size: 0.9375rem; }
.demo-split dd { padding-left: 16px; }
.demo-split dt { color: var(--ink-2); }
.demo-split dd { margin: 0; text-align: right; font-weight: 600; }
.demo-split .total dt, .demo-split .total dd { color: var(--ink); font-weight: 800; border-top: 1px solid var(--rule); padding-top: 6px; }

.how { padding: 48px 0; border-top: 1px solid var(--rule); }
.how ol { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; counter-reset: step; }
.how li { counter-increment: step; }
.how li::before {
  content: counter(step);
  display: block;
  font-variation-settings: "wdth" 62; font-weight: 900; font-size: 3rem; line-height: 1;
  color: var(--spruce); margin-bottom: 8px;
}
.how li strong { display: block; margin-bottom: 4px; }

.friday { background: var(--spruce); color: #fff; padding: 56px 0; }
.friday h2 { color: #fff; max-width: 18ch; }
.friday p { color: #e4ece6; font-size: 1.1rem; }
.friday .btn { background: #fff; color: var(--spruce); border-color: #fff; }

.farms { padding: 48px 0; }
.farm-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 20px; }
.farm-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 20px; text-decoration: none; color: inherit; display: grid; gap: 6px; }
.farm-card:hover { border-color: var(--spruce); }
.farm-card.soon { background: transparent; border-style: dashed; }

/* ---------- storefront ---------- */

.farm-hero { padding: 40px 0 24px; display: grid; gap: 12px; }
.farm-meta { display: flex; gap: 20px; flex-wrap: wrap; color: var(--ink-2); font-size: 0.9375rem; }
.store-note { background: var(--kraft-tint); border-left: 4px solid var(--kraft); padding: 14px 16px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin: 8px 0 24px; max-width: 80ch; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.product { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 18px; display: grid; gap: 10px; align-content: start; }
.product .p-cut { font-variation-settings: "wdth" 75; font-weight: 800; font-size: 1.3rem; color: var(--spruce); text-decoration: none; }
.product .p-weight { color: var(--ink-2); font-size: 0.9375rem; }
.product .choice { width: 100%; }
.product .p-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.product .p-footprint { font-size: 0.875rem; color: var(--ink-2); }

/* ---------- product detail ---------- */

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(24px, 5vw, 56px); padding-top: 32px; }
.detail-main .choice { margin: 18px 0; }
.breadcrumbs { font-size: 0.875rem; margin-bottom: 16px; }

/* ---------- the Sustainability Facts panel (the one loud element) ---------- */

.facts {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  padding: 6px 8px 8px;
  font-variation-settings: "wdth" 100;
  font-size: 13px;
  line-height: 1.25;
  width: 100%;
  max-width: 340px;
}
.facts h3 {
  color: #000;
  font-variation-settings: "wdth" 62;
  font-weight: 900;
  font-size: 2.35rem;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0 0 2px;
}
.facts .serving { font-size: 14px; }
.facts .serving strong { font-weight: 800; }
.facts .bar-8 { border-top: 9px solid #000; margin: 4px 0 2px; }
.facts .bar-4 { border-top: 4px solid #000; margin: 3px 0; }
.facts .bar-1 { border-top: 1px solid #000; }
.facts .big { display: flex; justify-content: space-between; align-items: end; font-weight: 900; font-variation-settings: "wdth" 75; }
.facts .big span:first-child { font-size: 15px; }
.facts .big span:last-child { font-size: 30px; line-height: 1; }
.facts .row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-top: 1px solid #000; }
.facts .row.indent { padding-left: 14px; }
.facts .row b { font-weight: 800; }
.facts .dv { font-weight: 800; }
.facts .foot { font-size: 11px; line-height: 1.3; margin-top: 4px; }
.facts .zero { font-weight: 900; }

/* ---------- cart / checkout ---------- */

.page-head { padding: 36px 0 20px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(24px, 4vw, 48px); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel h3 { margin-bottom: 12px; }

.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 16px 0; border-top: 1px solid var(--rule); }
.line:first-child { border-top: 0; padding-top: 0; }
.line .l-name { font-weight: 700; }
.line .l-price { text-align: right; font-weight: 700; }
.line .l-controls { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--rule); border-radius: var(--r-sm); }
.qty button { font: inherit; border: 0; background: none; width: 32px; height: 32px; cursor: pointer; color: var(--spruce); font-weight: 700; }
.qty span { min-width: 28px; text-align: center; }
.link-btn { font: inherit; border: 0; background: none; padding: 0; color: var(--spruce-2); text-decoration: underline; cursor: pointer; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { width: 42px; height: 24px; border-radius: 999px; background: #c4ccc6; position: relative; flex: none; transition: background 0.15s; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle input:checked + .track { background: var(--spruce); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }

.summary { display: grid; grid-template-columns: 1fr auto; gap: 6px 0; margin: 0; }
.summary dd { padding-left: 12px; }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; text-align: right; font-weight: 600; }
.summary .sub { font-size: 0.8125rem; color: var(--ink-2); grid-column: 1 / -1; margin-top: -4px; }
.summary .total dt, .summary .total dd { color: var(--ink); font-weight: 800; font-size: 1.15rem; border-top: 1.5px solid var(--ink); padding-top: 8px; margin-top: 4px; }

.pickup-option { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 12px; border: 1.5px solid var(--rule); border-radius: var(--r-sm); cursor: pointer; }
.pickup-option + .pickup-option { margin-top: 8px; }
.pickup-option:has(input:checked) { border-color: var(--spruce); background: var(--spruce-tint); }

.fake-card { display: grid; gap: 10px; }
.fake-card .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- receipt ---------- */

.receipt {
  background: var(--kraft-tint);
  border: 1px solid var(--kraft);
  border-radius: var(--r-sm);
  padding: 28px;
  position: relative;
  max-width: 720px;
}
.receipt .code { font-variation-settings: "wdth" 75; font-weight: 800; font-size: 1.6rem; color: var(--spruce); }
.receipt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 24px; align-items: start; }
.qr { width: 140px; height: 140px; background: #fff; padding: 8px; border: 1px solid var(--kraft); }
.stamp {
  display: inline-block; vertical-align: middle; margin-left: 14px;
  border: 3px solid var(--stamp); color: var(--stamp);
  font-variation-settings: "wdth" 62; font-weight: 900; font-size: 1.25rem; line-height: 1;
  padding: 6px 10px; border-radius: var(--r-sm); transform: rotate(-6deg);
  opacity: 0.9;
}
@media (prefers-reduced-motion: no-preference) {
  .stamp.animate { animation: stamp-in 420ms cubic-bezier(.2,.8,.2,1.2) both; }
  @keyframes stamp-in { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 0.9; } }
}

/* ---------- tables (ledger, dashboard) ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
table.data th { text-align: left; font-weight: 700; color: var(--ink-2); padding: 8px 10px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data td.r, table.data th.r { text-align: right; }
.pill { display: inline-block; font-size: 0.8125rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--spruce-tint); color: var(--spruce); white-space: nowrap; }
.pill.warn { background: #fbecd0; color: #7a4b00; }
.pill.done { background: #e8e8e8; color: #333; }
.pill.retired { background: #f6dedc; color: var(--stamp); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 24px 0 32px; }
.stat { border-top: 3px solid var(--spruce); padding-top: 10px; }
.stat .v { font-variation-settings: "wdth" 75; font-weight: 800; font-size: 2rem; color: var(--spruce); line-height: 1.1; }
.stat .k { color: var(--ink-2); font-size: 0.9375rem; }

.meter { height: 14px; background: var(--spruce-tint); border-radius: 999px; overflow: hidden; display: flex; }
.meter span { display: block; height: 100%; }
.meter .m-alloc { background: var(--spruce); }
.meter .m-buffer { background: var(--kraft); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.875rem; margin-top: 8px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

.section { padding: 28px 0; }
.section + .section { border-top: 1px solid var(--rule); }

/* ---------- producer tools ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--rule); margin: 20px 0 24px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--spruce); border-color: var(--spruce); }

.steps { list-style: none; padding: 0; margin: 0 0 24px; display: flex; gap: 8px; flex-wrap: wrap; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; font-size: 0.9375rem; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 0.8125rem; }
.steps li.on { color: var(--spruce); }
.steps li.on::before { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.steps li + li::after { content: none; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.radio-cards { display: grid; gap: 8px; }
.radio-card { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--rule); border-radius: var(--r-sm); cursor: pointer; font-weight: 400; }
.radio-card:has(input:checked) { border-color: var(--spruce); background: var(--spruce-tint); }
.radio-card strong { display: block; }

.callout { border: 1.5px dashed var(--spruce-2); border-radius: var(--r-md); padding: 14px 16px; background: var(--surface); }
.callout.phase2 { border-color: var(--kraft); background: var(--kraft-tint); }

.calc { display: grid; grid-template-columns: 1fr auto; gap: 6px 0; margin: 0; font-size: 0.9375rem; }
.calc dd { padding-left: 16px; }
.calc dt { color: var(--ink-2); }
.calc dd { margin: 0; text-align: right; font-weight: 600; }
.calc .eq dt, .calc .eq dd { border-top: 1.5px solid var(--ink); padding-top: 6px; color: var(--ink); font-weight: 800; }

footer.site-foot { border-top: 1px solid var(--rule); padding: 28px 0 40px; color: var(--ink-2); font-size: 0.875rem; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-md);
  font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.2); z-index: 20;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-grid, .detail, .two-col { grid-template-columns: 1fr; }
  .how ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { max-width: none; }
}
@media (max-width: 560px) {
  .how ol { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .receipt-grid { grid-template-columns: 1fr; }
  .site-nav { order: 3; width: 100%; }
}

.summary dd.sub { text-align: left; font-weight: 400; padding-left: 0; }
table.data td:first-child { white-space: nowrap; }
.two-col > .panel + .panel { margin-top: 0; }
