/* ============================================================
   Story Thyme Farms LLC — site-wide design system
   Palette + motifs sampled from the farm mark (icon.png):
   deep olive ring, moss field rows, parchment sky, butter sun.
   ============================================================ */

:root {
  --olive-deep: #3a431f;
  --olive: #55622e;
  --moss: #7a8450;
  --sage: #a9b183;
  --sage-soft: #cfd3b4;
  --cream: #f7f3e6;
  --parchment: #efe8d2;
  --paper: #fdfbf4;
  --gold: #dfaf4e;
  --gold-deep: #c2902f;
  --ink: #23281a;
  --ink-soft: #4c5240;
  --red-soil: #9c5b38;

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --font-label: "IBM Plex Mono", "Consolas", monospace;

  --measure: 62ch;
  --radius: 14px;
  --radius-lg: 26px;
  --shadow-soft: 0 10px 30px -12px rgba(35, 40, 26, 0.25);
  --shadow-lift: 0 18px 44px -16px rgba(35, 40, 26, 0.33);
  --wrap: min(1160px, calc(100% - 2.5rem));
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.12;
  margin: 0 0 0.6em;
  color: var(--olive-deep);
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5.4vw, 4.1rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }

p { margin: 0 0 1em; max-width: var(--measure); }

a { color: var(--olive); text-decoration-color: var(--sage); text-underline-offset: 3px; }
a:hover { color: var(--olive-deep); }

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

.wrap { width: var(--wrap); margin-inline: auto; }

/* ---- seed-packet label (utility eyebrow) ---- */
.label {
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--olive);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1rem;
}
.label::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--gold-deep);
}

/* ============ header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--olive-deep) 14%, transparent);
}
.nav {
  width: var(--wrap);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0.65rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  margin-right: auto;
}
.brand img { width: 44px; height: auto; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: 1.18rem;
  color: var(--olive-deep);
  line-height: 1.05;
}
.brand-name small {
  display: block;
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--moss);
  margin-top: 0.25em;
}
.nav-links {
  display: flex;
  gap: 1.35rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--olive-deep); }
.nav-links a[aria-current="page"] {
  color: var(--olive-deep);
  border-bottom-color: var(--gold);
}
.cart-btn {
  position: relative;
  border: 1.5px solid var(--olive-deep);
  background: transparent;
  color: var(--olive-deep);
  font: 600 0.9rem var(--font-body);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}
.cart-btn:hover { background: var(--parchment); }
.cart-count {
  position: absolute;
  top: -0.5rem; right: -0.5rem;
  min-width: 1.35rem; height: 1.35rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font: 700 0.72rem/1.35rem var(--font-body);
  text-align: center;
  padding-inline: 0.2rem;
  display: none;
}
.cart-count.show { display: block; }

.nav-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 1.6rem;
  color: var(--olive-deep);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

/* ============ buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font: 650 0.98rem var(--font-body);
  padding: 0.78rem 1.6rem;
  border-radius: 999px;
  border: 1.5px solid var(--olive-deep);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--olive-deep);
  color: var(--cream);
}
.btn-primary:hover {
  background: var(--olive);
  color: var(--cream);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.btn-ghost {
  background: transparent;
  color: var(--olive-deep);
}
.btn-ghost:hover { background: var(--parchment); }
.btn-gold {
  background: var(--gold);
  border-color: var(--gold-deep);
  color: var(--ink);
}
.btn-gold:hover { background: var(--gold-deep); transform: translateY(-1px); }

/* ============ field-row contour divider (signature) ============ */
.field-rows {
  display: block;
  width: 100%;
  height: clamp(46px, 8vw, 92px);
  color: var(--sage-soft);
}
.field-rows.dark { color: var(--moss); }
.field-rows.on-olive { color: color-mix(in srgb, var(--cream) 26%, transparent); }

/* ============ hero ============ */
.hero {
  position: relative;
  overflow: clip;
  background:
    radial-gradient(120% 90% at 78% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 55%),
    var(--cream);
}
.hero-inner {
  width: var(--wrap);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem);
}
.hero h1 em {
  font-style: italic;
  font-weight: 480;
  color: var(--olive);
}
.hero-kicker { margin-bottom: 1.2rem; }
.hero-lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.8rem;
}
.hero-art { position: relative; }
.hero-art img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
}
.hero-cutout {
  position: absolute;
  width: clamp(110px, 14vw, 190px);
  filter: drop-shadow(0 12px 18px rgba(35, 40, 26, 0.25));
  pointer-events: none;
}
.hero-cutout.c1 { left: -6%; bottom: -8%; transform: rotate(-8deg); }
.hero-cutout.c2 { right: -5%; top: -9%; transform: rotate(10deg); }

/* ============ sections ============ */
.section { padding: clamp(2.6rem, 6vw, 5rem) 0; }
.section-tight { padding: clamp(1.8rem, 4vw, 3rem) 0; }
.section-olive {
  background: var(--olive-deep);
  color: var(--parchment);
}
.section-olive h2, .section-olive h3 { color: var(--cream); }
.section-olive .label { color: var(--sage); }
.section-olive p { color: color-mix(in srgb, var(--parchment) 88%, transparent); }
.section-parchment { background: var(--parchment); }
.section-paper { background: var(--paper); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.6rem, 3.5vw, 2.6rem);
}
.section-head p { margin: 0; color: var(--ink-soft); }

/* ============ cards ============ */
.card-grid {
  display: grid;
  gap: clamp(1.1rem, 2.4vw, 1.8rem);
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}
.card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--olive-deep) 10%, transparent);
  box-shadow: 0 3px 14px -8px rgba(35, 40, 26, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--parchment); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.card-body h3 { margin: 0; }
.card-body p { font-size: 0.95rem; color: var(--ink-soft); margin: 0; flex: 1; }
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.7rem;
}
.price {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: 1.18rem;
  color: var(--olive-deep);
}
.price small { font: 500 0.78rem var(--font-body); color: var(--ink-soft); }
.badge {
  font-family: var(--font-label);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--parchment);
  border: 1px solid var(--sage);
  color: var(--olive);
  border-radius: 999px;
  padding: 0.28em 0.85em;
}
.badge-gold { background: color-mix(in srgb, var(--gold) 28%, var(--paper)); border-color: var(--gold-deep); color: var(--gold-deep); }
.badge-photo { position: absolute; left: 0.7rem; top: 0.7rem; background: color-mix(in srgb, var(--paper) 88%, transparent); }

/* ============ print shop grid ============ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.8rem;
}
.chip {
  border: 1.5px solid var(--sage);
  background: var(--paper);
  color: var(--olive);
  font: 600 0.85rem var(--font-body);
  padding: 0.42rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { border-color: var(--olive); }
.chip.active {
  background: var(--olive-deep);
  border-color: var(--olive-deep);
  color: var(--cream);
}
.print-grid {
  display: grid;
  gap: 1.3rem;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}
.print-card {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--olive-deep) 10%, transparent);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.print-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.print-card figure { margin: 0; aspect-ratio: 1; background: var(--parchment); }
.print-card img { width: 100%; height: 100%; object-fit: cover; }
.print-card figcaption { padding: 0.8rem 1rem 1rem; }
.print-card .pc-name { font-family: var(--font-display); font-weight: 600; color: var(--olive-deep); }
.print-card .pc-sub {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.2rem;
}

/* variant swatches */
.swatches { display: inline-flex; gap: 0.35rem; }
.swatch {
  width: 0.95rem; height: 0.95rem;
  border-radius: 50%;
  border: 1.5px solid var(--sage);
}
.swatch.white { background: #fff; }
.swatch.black { background: #191919; }

/* ============ product / print detail modal ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(35, 40, 26, 0.55);
  backdrop-filter: blur(4px);
}
.modal.open { display: flex; }
.modal-panel {
  background: var(--paper);
  border-radius: var(--radius-lg);
  max-width: 980px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  box-shadow: var(--shadow-lift);
}
.modal-media {
  background: var(--parchment);
  min-height: 320px;
  position: sticky;
  top: 0;
}
.modal-media img { width: 100%; height: 100%; object-fit: contain; }
.modal-info { padding: clamp(1.4rem, 3vw, 2.2rem); }
.modal-close {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
  z-index: 5;
  width: 2.4rem; height: 2.4rem;
  border-radius: 50%;
  border: none;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.variant-toggle { display: flex; gap: 0.5rem; margin: 0.9rem 0; }
.size-select, .qty-input {
  font: 600 0.95rem var(--font-body);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--sage);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
}
.qty-input { width: 4.6rem; }
.modal-info .price { font-size: 1.55rem; }
.compare-at { text-decoration: line-through; color: var(--ink-soft); font-size: 0.95rem; margin-left: 0.5em; }
.modal-highlights { padding-left: 1.1rem; color: var(--ink-soft); font-size: 0.93rem; }
.modal-highlights li { margin-bottom: 0.3em; }

/* ============ cart drawer ============ */
.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  z-index: 100;
  background: var(--paper);
  box-shadow: -18px 0 44px -20px rgba(35, 40, 26, 0.45);
  transform: translateX(105%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: none; }
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--parchment);
}
.cart-head h3 { margin: 0; }
.cart-items { flex: 1; overflow: auto; padding: 1rem 1.3rem; }
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--sage-soft);
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.cart-item-name { font-weight: 650; font-size: 0.92rem; }
.cart-item-meta { font-size: 0.8rem; color: var(--ink-soft); }
.cart-item button { border: none; background: none; color: var(--red-soil); cursor: pointer; font-size: 0.8rem; }
.cart-foot { padding: 1.1rem 1.3rem 1.4rem; border-top: 1px solid var(--parchment); }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 0.9rem; }
.cart-note { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.7rem; }

/* ============ socials / elsewhere ============ */
.elsewhere-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.elsewhere-card {
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--olive-deep) 12%, transparent);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.elsewhere-card h3 { margin: 0; display: flex; align-items: center; gap: 0.55rem; }
.elsewhere-card .code {
  font-family: var(--font-label);
  font-size: 0.8rem;
  background: var(--parchment);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  display: inline-block;
  width: max-content;
}

/* ============ journal / updates ============ */
.journal { display: grid; gap: 1.6rem; max-width: 760px; }
.entry {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--olive-deep) 10%, transparent);
  padding: 1.6rem 1.8rem;
}
.entry time {
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--moss);
}
.entry h3 { margin: 0.4rem 0 0.5rem; }

/* ============ footer ============ */
.site-footer {
  background: var(--ink);
  color: var(--sage-soft);
  padding: 3rem 0 2rem;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  margin-bottom: 2rem;
}
.site-footer h4 { color: var(--cream); font-size: 1rem; margin-bottom: 0.7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.site-footer a { color: var(--sage-soft); text-decoration: none; }
.site-footer a:hover { color: var(--cream); text-decoration: underline; }
.footer-brand { display: flex; align-items: flex-start; gap: 0.9rem; }
.footer-brand img { width: 52px; }
.footer-legal {
  border-top: 1px solid color-mix(in srgb, var(--sage-soft) 25%, transparent);
  padding-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--sage-soft) 75%, transparent);
}

/* ============ hero entrance + ambient motion ============ */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes drift {
  from { transform: translateY(0) rotate(var(--tilt, 0deg)); }
  to { transform: translateY(-9px) rotate(var(--tilt, 0deg)); }
}
.hero-kicker, .hero h1, .hero-lede, .hero-actions {
  animation: rise-in 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.hero h1 { animation-delay: 0.1s; }
.hero-lede { animation-delay: 0.22s; }
.hero-actions { animation-delay: 0.34s; }
.hero-art { animation: rise-in 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) 0.15s both; }
.hero-cutout.c1 { --tilt: -8deg; transform: rotate(-8deg); animation: drift 5.5s ease-in-out 1s infinite alternate; }
.hero-cutout.c2 { --tilt: 10deg; transform: rotate(10deg); animation: drift 6.5s ease-in-out 1.4s infinite alternate; }

/* ============ wide store cards ============ */
.card-wide { flex-direction: row; }
.card-wide .card-media {
  aspect-ratio: auto;
  flex: 0 0 42%;
  min-height: 240px;
}
.card-wide .card-body { padding: 1.5rem 1.7rem 1.6rem; }
@media (max-width: 720px) {
  .card-wide { flex-direction: column; }
  .card-wide .card-media { flex: none; aspect-ratio: 4 / 3; min-height: 0; }
}

/* ============ print-card variant flip on hover ============ */
.pc-flip { position: relative; }
.pc-flip .alt {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.print-card:hover .pc-flip .alt,
.print-card:focus-visible .pc-flip .alt { opacity: 1; }

/* print shop toolbar */
.print-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}
.print-search {
  flex: 1 1 240px;
  max-width: 340px;
  font: 500 0.95rem var(--font-body);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--sage);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
}
.print-search::placeholder { color: var(--moss); }

/* cart qty stepper */
.qty-step {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
}
.qty-step button {
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  border: 1.5px solid var(--sage);
  background: var(--paper);
  color: var(--olive-deep);
  font: 700 0.85rem/1 var(--font-body);
  cursor: pointer;
}
.qty-step button:hover { border-color: var(--olive); background: var(--parchment); }
.qty-step .qty-val { font: 600 0.85rem var(--font-body); min-width: 1.2em; text-align: center; }

/* ============ helpers ============ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.in { opacity: 1; transform: none; }
.notice {
  background: color-mix(in srgb, var(--gold) 18%, var(--paper));
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  font-size: 0.92rem;
  max-width: none;
}
.two-col {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3.4rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
}
.two-col img { border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }

/* skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--gold);
  color: var(--ink);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 200;
}
.skip-link:focus { left: 0.5rem; }

/* ============ responsive ============ */
@media (max-width: 900px) {
  .hero-inner, .two-col { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .modal-panel { grid-template-columns: 1fr; }
  .modal-media { position: relative; max-height: 46vh; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--parchment);
    box-shadow: var(--shadow-soft);
    display: none;
    padding: 0.5rem 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 0.8rem 1.4rem; border-bottom: none; }
  .nav-toggle { display: block; }
  .brand-name { font-size: 0.98rem; white-space: nowrap; }
  .brand img { width: 36px; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .brand-name small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .print-card, .btn { transition: none; }
  .hero-kicker, .hero h1, .hero-lede, .hero-actions, .hero-art, .hero-cutout.c1, .hero-cutout.c2 {
    animation: none;
  }
}
