/* Prairie Fill — base stylesheet & component library (owned by Claude).
   Import after tokens.css. Build pages with these classes; request additions on the board. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth;
  scroll-padding-top: calc(var(--pf-sticky-offset) + 20px); /* anchor jumps clear the sticky header */ }
::selection { background: var(--pf-green); color: var(--pf-cream); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--pf-bg);
  color: var(--pf-text);
  font-family: var(--pf-font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pf-green-700); text-underline-offset: 2px; }
a:hover { color: var(--pf-green); }

h1, h2, h3, h4 { font-family: var(--pf-font-head); color: var(--pf-ink); line-height: 1.15; font-weight: 600; margin: 0 0 var(--pf-4); }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 var(--pf-4); }
.lead { font-size: 1.2rem; color: var(--pf-ink-soft); }
.muted { color: var(--pf-ink-soft); }

/* Layout */
.container { width: min(100% - 2rem, var(--pf-container)); margin-inline: auto; }
.section { padding-block: var(--pf-8); }
.grid { display: grid; gap: var(--pf-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: var(--pf-4); }
.center { text-align: center; }

/* Skip link (a11y) */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--pf-green); color: #fff; padding: var(--pf-2) var(--pf-4); border-radius: 0 0 var(--pf-radius) 0; z-index: 100; }
.skip-link:focus { left: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: var(--pf-2); font: inherit; font-weight: 600;
  padding: var(--pf-3) var(--pf-5); border-radius: var(--pf-radius-pill); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .08s ease, background .15s ease, box-shadow .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pf-green); color: var(--pf-primary-ink); }
.btn-primary:hover { background: var(--pf-green-700); color: #fff; }
.btn-secondary { background: var(--pf-wheat); color: var(--pf-ink); }
.btn-secondary:hover { background: var(--pf-wheat-200); }
.btn-ghost { background: transparent; border-color: var(--pf-line); color: var(--pf-ink); }
.btn-ghost:hover { border-color: var(--pf-green); }
/* Focus ring: green reads >=4.7:1 on cream, paper, and the gold CTA (the old gold
   ring was 1.7:1 on cream — invisible). Light ring on dark green surfaces. */
:focus-visible { outline: 3px solid var(--pf-green); outline-offset: 2px; }
.site-footer :focus-visible, .btn-primary:focus-visible,
.calculator-band :focus-visible, .page-cta :focus-visible { outline-color: var(--pf-wheat-200); }

/* Cards */
.card { background: var(--pf-paper); border: 1px solid var(--pf-line); border-radius: var(--pf-radius-lg); box-shadow: var(--pf-shadow); overflow: hidden; }
.card-body { padding: var(--pf-5); }
.price { font-family: var(--pf-font-head); font-size: 1.5rem; color: var(--pf-green-700); }

/* Pills / badges */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600;
  background: var(--pf-green-200); color: var(--pf-green-700); padding: 4px 12px; border-radius: var(--pf-radius-pill); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--pf-cream) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--pf-line); }
.site-header .bar { display: flex; align-items: center; gap: var(--pf-5); padding-block: var(--pf-3); }
.site-header .brand { display: flex; align-items: center; gap: var(--pf-2); font-family: var(--pf-font-head); font-weight: 600; font-size: 1.25rem; color: var(--pf-ink); text-decoration: none; }
.brand-logo { height: 44px; width: auto; display: block; }
.brand-name { font-family: var(--pf-font-head); font-weight: 600; }
@media (max-width: 480px) { .brand-name { display: none; } } /* logo alone on tiny screens */
.site-header nav { margin-left: auto; display: flex; gap: var(--pf-5); align-items: center; }
.site-header nav a { color: var(--pf-ink); text-decoration: none; font-weight: 500; }
.site-header nav a:hover { color: var(--pf-green); }
.site-header nav a[aria-current="page"] { color: var(--pf-green-700); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--pf-wheat); text-decoration-thickness: 2px; text-underline-offset: 6px; }
/* Cart lives in the header bar (outside the nav) so it is never scrolled off-screen.
   Quiet pill treatment for tap affordance; badge anchors to the pill corner. */
.cart-link { position: relative; display: inline-flex; align-items: center;
  color: var(--pf-ink); text-decoration: none; font-weight: 500;
  padding: 6px 14px; border: 1px solid var(--pf-line); border-radius: var(--pf-radius-pill);
  background: var(--pf-paper); transition: border-color .15s ease, color .15s ease; }
.cart-link:hover { color: var(--pf-green); border-color: var(--pf-green-200); }
.cart-count { position: absolute; top: -8px; right: -8px; background: var(--pf-terracotta-700); color: #fff; font-size: .7rem; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.cart-count[hidden] { display: none; } /* author display would otherwise defeat the hidden attribute */
/* Responsive header — brand + cart stay on the top row; nav wraps to its own line
   and scrolls horizontally if needed, with a fade hint where it overflows. */
@media (max-width: 760px) {
  .site-header .bar { flex-wrap: wrap; gap: var(--pf-2) var(--pf-4); }
  .site-header .brand { font-size: 1.1rem; }
  .cart-link { margin-left: auto; }
  .site-header nav { margin-left: 0; gap: var(--pf-4); width: 100%; order: 3;
    overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
    scrollbar-width: none; }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { white-space: nowrap; font-size: .95rem; }
}
@media (max-width: 520px) {
  /* Links overflow here; fade the right edge as a "more to scroll" hint. */
  .site-header nav { -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent); }
}

/* Hero */
.hero { background: linear-gradient(180deg, var(--pf-wheat-200) 0%, var(--pf-cream) 70%); }
.hero .container { padding-block: var(--pf-9); }

/* Trust row */
.trust { display: flex; flex-wrap: wrap; gap: var(--pf-5); justify-content: center; padding-block: var(--pf-5);
  border-top: 1px solid var(--pf-line); border-bottom: 1px solid var(--pf-line); }
.trust span { display: inline-flex; align-items: center; gap: 8px; color: var(--pf-ink-soft); font-weight: 500; }

/* Footer — deep green with a whisper of prairie-grass texture behind it */
.site-footer { position: relative; isolation: isolate; background: var(--pf-green-700); color: #EAF0E8; margin-top: var(--pf-9); }
.site-footer::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../assets/img/brand/texture.webp") center/cover;
  opacity: .07; filter: saturate(.6); pointer-events: none; }
.site-footer .container { padding-block: var(--pf-8); }
.site-footer a { color: #EAF0E8; text-decoration: none; }
.site-footer a:hover { color: var(--pf-wheat-200); }
.footer-grid { display: grid; grid-template-columns: 1.35fr 1fr 1.1fr 1.15fr; gap: var(--pf-6); }
.footer-logo { height: 48px; width: 48px; display: block; margin-bottom: var(--pf-3); opacity: .95; }
.footer-trust { display: flex; flex-wrap: wrap; gap: var(--pf-4) var(--pf-6); justify-content: center;
  border-top: 1px solid rgba(255,255,255,.15); margin-top: 0; padding-block: var(--pf-5); }
.footer-trust span { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; color: #EAF0E8; }
.footer-trust svg { color: var(--pf-wheat-200); flex: 0 0 auto; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; gap: var(--pf-5); } }
.site-footer h4 { color: #fff; }
.site-footer .legal { border-top: 1px solid rgba(255,255,255,.15); margin-top: var(--pf-5); padding-top: var(--pf-4); font-size: .9rem; opacity: .85; }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: var(--pf-1); }
input, select, textarea { width: 100%; font: inherit; padding: var(--pf-3); border: 1px solid var(--pf-line);
  border-radius: var(--pf-radius); background: var(--pf-paper); color: var(--pf-ink); }
input:focus, select:focus, textarea:focus { border-color: var(--pf-green); outline: none; box-shadow: 0 0 0 3px var(--pf-green-200); }

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mt-0{margin-top:0}.mb-0{margin-bottom:0}

/* ============================================================================
   Shared page components (T-022). Canonical versions of the patterns pages
   previously re-declared inline. New/edited pages use these; per-page <style>
   may still override geometry (blob insets, hero column ratios).
   ========================================================================== */

/* The gold CTA — the owner-approved Phase-2 button. Use with .btn: class="btn btn-cta". */
.btn-cta { background: var(--pf-wheat); border-color: var(--pf-wheat); color: var(--pf-green-700);
  text-transform: uppercase; min-height: 48px; padding-inline: var(--pf-5);
  border-radius: var(--pf-radius-sm); font-weight: 700; letter-spacing: .02em; }
.btn-cta:hover { background: var(--pf-wheat-200); border-color: var(--pf-wheat-200); color: var(--pf-green-700); }

/* Signature page hero: cream→bloom gradient with organic sage shapes. */
.page-hero { position: relative; isolation: isolate; overflow: hidden;
  padding-block: var(--pf-8); background: linear-gradient(135deg, var(--pf-cream) 0%, var(--pf-bloom-200) 100%); }
.page-hero::before { content: ""; position: absolute; z-index: -1; inset: -30% 0 18% 50%;
  background: var(--pf-sage); border-bottom-left-radius: 72% 78%; opacity: .78; }
.page-hero::after { content: ""; position: absolute; z-index: -1; left: -18%; bottom: -44%;
  width: 58%; height: 64%; background: var(--pf-sage-200); border-radius: 56% 44% 0 0; opacity: .72; }
.page-hero h1 { font-family: var(--pf-font-body); color: var(--pf-green-700);
  font-size: clamp(2.4rem, 5vw, 3.5rem); font-weight: 800; line-height: 1;
  text-transform: uppercase; letter-spacing: 0; }
.page-hero .lead { max-width: 560px; color: var(--pf-ink); font-size: 1.15rem; }

/* Full-width deep-green CTA band (footer-adjacent call to action). */
.page-cta { background: var(--pf-green-700); color: var(--pf-paper); }
.page-cta h2, .page-cta p { color: inherit; }
.page-cta .container { display: flex; gap: var(--pf-5); align-items: center;
  justify-content: space-between; flex-wrap: wrap; }

/* Form status messaging (tokens from tokens.css; consumed by contact/checkout). */
.form-status { border-radius: var(--pf-radius-md); padding: var(--pf-3) var(--pf-4); font-weight: 500; }
.form-status.error { background: var(--pf-error-bg); color: var(--pf-error); border: 1px solid color-mix(in srgb, var(--pf-error) 30%, transparent); }
.form-status.success { background: var(--pf-success-bg); color: var(--pf-success); border: 1px solid color-mix(in srgb, var(--pf-success) 30%, transparent); }

/* --- Commerce feedback (hooks requested by Codex, T-111) --- */
/* Toast: stays mounted as an (empty) aria-live region; .is-visible slides it in. */
.cart-confirmation { position: fixed; z-index: 90; right: var(--pf-4); bottom: var(--pf-4);
  max-width: 340px; display: flex; align-items: center; gap: var(--pf-3);
  background: var(--pf-paper); border: 1px solid var(--pf-line); border-left: 4px solid var(--pf-green);
  border-radius: var(--pf-radius-md); box-shadow: var(--pf-shadow-lg); padding: var(--pf-3) var(--pf-4);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; }
.cart-confirmation.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.cart-confirmation a { color: var(--pf-green-700); font-weight: 600; white-space: nowrap; }
.cart-confirmation .toast-dismiss { background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--pf-ink-soft); line-height: 1; font-size: 1.1rem; }
@media (max-width: 520px) { .cart-confirmation { left: var(--pf-4); right: var(--pf-4); max-width: none; } }
@media (prefers-reduced-motion: reduce) { .cart-confirmation { transform: none; } }
/* Badge tick on add-to-cart. The global reduced-motion rule already disables it. */
.cart-count.is-bumping { animation: pf-badge-bump .35s ease; }
@keyframes pf-badge-bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* --- Quantity + pack-recommendation components (hooks requested by Codex, T-116) --- */
.qty-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--pf-line);
  border-radius: var(--pf-radius-md); overflow: hidden; background: var(--pf-paper); }
.qty-stepper button { min-width: 44px; min-height: 44px; border: 0; background: var(--pf-cream);
  color: var(--pf-green-700); font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.qty-stepper button:hover { background: var(--pf-green-200); }
.qty-stepper button:disabled { opacity: .4; cursor: default; background: var(--pf-cream); }
.qty-stepper input { width: 3.2em; border: 0; border-inline: 1px solid var(--pf-line); border-radius: 0;
  text-align: center; font-weight: 600; -moz-appearance: textfield; appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pack-size-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--pf-3); }
.pack-tile { display: grid; grid-template-columns: 56px 1fr; gap: var(--pf-3); align-items: center;
  background: var(--pf-paper); border: 1px solid var(--pf-line); border-radius: var(--pf-radius-md);
  padding: var(--pf-3); box-shadow: var(--pf-shadow); }
.pack-tile img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--pf-radius-sm); }
.pack-tile strong { color: var(--pf-green-700); }
.pack-total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--pf-3);
  border-top: 1px solid var(--pf-line); margin-top: var(--pf-3); padding-top: var(--pf-3);
  font-weight: 700; color: var(--pf-green-700); }
.bulk-recommendation { background: var(--pf-wheat-200); border: 1px solid var(--pf-wheat);
  border-radius: var(--pf-radius-md); padding: var(--pf-4) var(--pf-5); color: var(--pf-ink); }
.bulk-recommendation a { color: var(--pf-green-700); font-weight: 600; }

/* Policy sections: real h2 headings in scannable cards (shared by the 4 policy pages) */
.policy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--pf-4); }
.policy-item { background: var(--pf-paper); border: 1px solid var(--pf-line); border-left: 4px solid var(--pf-wheat);
  border-radius: var(--pf-radius-md); box-shadow: var(--pf-shadow); padding: var(--pf-5); }
.policy-item h2 { font-size: 1.15rem; color: var(--pf-green-700); margin-bottom: var(--pf-2); }
.policy-item p { margin: 0; color: var(--pf-ink-soft); }
.policy-grid .policy-cta { grid-column: 1 / -1; margin-top: var(--pf-2); }

/* Print: receipts and policies come out clean — no chrome, no ink-heavy bands. */
@media print {
  .site-header, .site-footer, .skip-link, .cart-link, .page-cta, .btn, video, iframe { display: none !important; }
  body { background: #fff; color: #000; }
  main { max-width: none; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
  section, .card { box-shadow: none !important; background: #fff !important; }
}
