/* ==========================================================================
   Salty Heifer Cookies and Snacks — "Farm Stand"
   Blocks: fonts → tokens → base → components (rail nav, buttons, section
   heads, consent) → sections (hero, rack, snacks, pickup, story, crate FAQ,
   box builder, fence footer) → pages (legal, 404) → utilities → motion → print
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: 'Rye';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/rye-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Arimo';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/arimo-latin-var.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  /* Palette: barn red, buttery cookie gold, pasture green, salt white */
  --salt: #fbf8f2;
  --cream: #f3ecdf;
  --ink: #2b1d16;
  --ink-soft: #5a4638;
  --barn: #a3291f;
  --barn-deep: #8f2219;
  --barn-dark: #6e1a13;
  --gold: #e8a93c;
  --gold-soft: #f6dfa8;
  --gold-bright: #f6c15a;
  --pasture: #2f5e35;
  --pasture-deep: #24492a;
  --pasture-night: #1f3f24;
  --sage: #c9d9b8;
  --kraft: #d8b98a;
  --wood: #c9955f;
  --wood-light: #d4a067;
  --wood-edge: #7a4d2b;
  --char: #3a1d10;
  --ember: #ff6a1f;
  --earth: #3b2a1e;
  --sand: #e9dcc6;
  --error: #b3261e;

  /* Type */
  --font-display: 'Rye', 'Georgia', serif;
  --font-body: 'Arimo', 'Helvetica Neue', Arial, sans-serif;
  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.4rem, 1.25rem + 0.75vw, 1.85rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.5vw, 2.7rem);
  --step-4: clamp(2.2rem, 1.6rem + 3vw, 4.4rem);

  /* Space */
  --space-s: 1rem;
  --space-m: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  --space-l: clamp(2rem, 1.5rem + 2vw, 3rem);
  --space-xl: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  --gutter: clamp(16px, 4vw, 40px);

  /* Shape and depth */
  --radius: 10px;
  --radius-s: 6px;
  --shadow: 0 2px 0 rgb(58 29 16 / 0.18), 0 10px 24px -12px rgb(58 29 16 / 0.45);
  --rail-h: 72px;
  --focus: 0 0 0 3px var(--salt), 0 0 0 6px var(--ink);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--rail-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--salt);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}

body.nav-open { overflow: hidden; }

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p,
li,
dd,
figcaption { text-wrap: pretty; }

p { margin: 0 0 1em; }

a {
  color: var(--barn);
  text-underline-offset: 0.18em;
}

a:hover { color: var(--barn-dark); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 4px;
}

[tabindex="-1"]:focus { outline: none; }

img,
svg { display: block; }

.container {
  width: min(100%, 1200px);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--salt);
  font-weight: 700;
  border-radius: var(--radius-s);
}

.skip-link:focus { top: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font: 700 var(--step-0) / 1.2 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-barn {
  background: var(--barn);
  color: var(--salt);
  box-shadow: 0 3px 0 var(--barn-dark);
}

.btn-barn:hover {
  background: var(--barn-dark);
  color: var(--salt);
}

.btn-barn:focus-visible { box-shadow: var(--focus); }

.btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--salt);
}

.btn-wide { width: 100%; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

/* ---------- Wooden rail header with burned brand marks ---------- */
.rail {
  position: sticky;
  top: 0;
  z-index: 60;
  background-color: var(--wood);
  background-image:
    linear-gradient(180deg, rgb(255 255 255 / 0.16), transparent 35%, rgb(58 29 16 / 0.1) 75%, rgb(58 29 16 / 0.22)),
    repeating-linear-gradient(180deg, transparent 0 7px, rgb(122 77 43 / 0.14) 7px 8px, transparent 8px 15px, rgb(122 77 43 / 0.08) 15px 17px);
  border-bottom: 4px solid var(--wood-edge);
  box-shadow: 0 6px 16px -10px rgb(58 29 16 / 0.7);
}

.rail-inner {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1.25rem);
  width: min(100%, 1320px);
  min-height: var(--rail-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  color: var(--char);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover { color: var(--char); }

.brand-mark {
  width: 46px;
  height: 46px;
  flex: none;
}

.brand-word {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1;
}

.brand-word small {
  margin-top: 0.25rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brands { margin-left: auto; }

.brands-title { display: none; }

.brands ul {
  display: flex;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brands a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-s);
  color: var(--char);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.burn {
  width: 28px;
  height: 28px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: color 0.25s ease, filter 0.25s ease, transform 0.25s ease;
}

.brands a:hover { background: rgb(58 29 16 / 0.1); }
.brands a:hover .burn { transform: rotate(-8deg) scale(1.08); }

/* The section in view: its brand glows like a hot iron. */
.brands a[aria-current] {
  background: rgb(58 29 16 / 0.14);
  text-shadow: 0 0 8px rgb(255 106 31 / 0.45);
}

.brands a[aria-current] .burn {
  color: var(--ember);
  filter: drop-shadow(0 0 2px rgb(255 106 31 / 0.8)) drop-shadow(0 0 5px rgb(255 160 60 / 0.5));
}

.rail-cta { flex: none; }

.barn-door { display: none; }

/* Below 1100px the brands move into a hayloft panel behind a barn-door button. */
@media (max-width: 1099.98px) {
  .rail-cta { margin-left: auto; }

  .barn-door {
    position: relative;
    display: block;
    flex: none;
    width: 52px;
    height: 48px;
    padding: 0;
    overflow: hidden;
    border: 3px solid var(--salt);
    border-radius: 4px 4px 2px 2px;
    background: var(--gold-soft);
    cursor: pointer;
  }

  /* The X that is revealed when the doors slide open. */
  .barn-door::before,
  .barn-door::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: var(--char);
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .barn-door::after { transform: translate(-50%, -50%) rotate(-45deg); }

  .door {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    width: 50%;
    background:
      linear-gradient(to top right, transparent calc(50% - 1.5px), var(--salt) calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px)),
      linear-gradient(to bottom right, transparent calc(50% - 1.5px), var(--salt) calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px)),
      var(--barn);
    transition: transform 0.35s cubic-bezier(0.5, 0, 0.2, 1);
  }

  .door-l {
    left: 0;
    border-right: 1px solid var(--barn-dark);
  }

  .door-r {
    right: 0;
    border-left: 1px solid var(--barn-dark);
  }

  .barn-door[aria-expanded="true"] .door-l { transform: translateX(-100%); }
  .barn-door[aria-expanded="true"] .door-r { transform: translateX(100%); }

  .brands {
    position: fixed;
    inset: calc(var(--rail-h) + 4px) 0 0;
    z-index: 55;
    margin: 0;
    padding: var(--space-m) var(--gutter) var(--space-l);
    overflow-y: auto;
    background-color: var(--char);
    background-image: repeating-linear-gradient(90deg, transparent 0 88px, rgb(0 0 0 / 0.25) 88px 90px);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .brands.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .brands-title {
    display: block;
    width: min(100%, 520px);
    margin: 0 auto var(--space-s);
    color: var(--gold-soft);
    font-family: var(--font-display);
    font-size: var(--step-1);
  }

  .brands ul {
    flex-direction: column;
    gap: 0.6rem;
    width: min(100%, 520px);
    margin-inline: auto;
  }

  .brands a {
    min-height: 60px;
    padding: 0.6rem 1rem;
    border-bottom: 4px solid var(--wood-edge);
    border-radius: var(--radius-s);
    background-color: var(--wood-light);
    font-size: var(--step-1);
  }

  .brands a:hover { background-color: var(--wood); }
  .brands a[aria-current] { background-color: var(--wood); }
  .burn { width: 34px; height: 34px; }
}

@media (max-width: 479.98px) {
  :root { --rail-h: 64px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-word { font-size: 1.05rem; }
  .brand-word small { font-size: 0.6rem; letter-spacing: 0.1em; }
  .rail-cta { min-height: 44px; padding: 0.5rem 0.9rem; font-size: 0.92rem; }
  .barn-door { width: 46px; height: 44px; }
}

@media (max-width: 379.98px) {
  .brand { gap: 0.35rem; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-word { font-size: 0.95rem; }
  .brand-word small { display: none; }
  .rail-inner { gap: 0.4rem; }
  .rail-cta { padding-inline: 0.65rem; font-size: 0.85rem; }
  .barn-door { width: 44px; }
}

/* ---------- Section heads: a branding iron above each title ---------- */
.sec-head {
  max-width: 760px;
  margin-bottom: var(--space-l);
}

.sec-head-center {
  margin-inline: auto;
  text-align: center;
}

.sec-iron {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: var(--wood);
  color: var(--char);
  box-shadow: inset 0 0 0 3px var(--wood-edge), inset 0 -6px 10px rgb(58 29 16 / 0.25);
}

.sec-iron svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sec-kicker {
  margin-bottom: 0.4rem;
  color: var(--barn);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sec-intro {
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.55;
}

.sec-head-light h2 { color: var(--salt); }
.sec-head-light .sec-kicker { color: var(--gold-soft); }
.sec-head-light .sec-intro { color: var(--sand); }

/* ---------- Hero: heifer over the fence at sunrise ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fdf3dc 0%, #fbe7bd 55%, #f7d498 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 1080px);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 4rem) var(--gutter) 0;
  text-align: center;
}

.hero h1 {
  margin-bottom: 0.35em;
  color: var(--ink);
  font-size: clamp(2.1rem, 1.4rem + 3.3vw, 4.1rem);
}

.hero-lede {
  max-width: 680px;
  margin: 0 auto 1.6rem;
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.hero-scene {
  position: relative;
  height: clamp(280px, 34vw, 480px);
  margin-top: clamp(-1rem, -2vw, 0rem);
}

.scene {
  width: 100%;
  height: 100%;
}

/* Feed-sack print hanging on the fence: the location device. */
.feed-sack {
  position: absolute;
  right: calc(50% + clamp(110px, 12vw, 150px));
  bottom: 9%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  margin: 0;
  padding: 1.6rem 1.2rem 1.1rem;
  white-space: nowrap;
  border-radius: 6px 6px 14px 14px;
  background-color: var(--kraft);
  background-image:
    repeating-linear-gradient(0deg, rgb(122 77 43 / 0.1) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(90deg, rgb(122 77 43 / 0.1) 0 2px, transparent 2px 5px);
  box-shadow: inset 0 0 0 1px rgb(122 77 43 / 0.35), 0 12px 20px -12px rgb(58 29 16 / 0.7);
  color: var(--ink);
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-3deg);
  transform-origin: 50% 0;
}

/* Twine tie at the neck of the sack. */
.feed-sack::before {
  content: '';
  position: absolute;
  top: 9px;
  left: 18%;
  right: 18%;
  height: 4px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, #8a6a3d 0 4px, #b8955c 4px 8px);
}

.sack-name {
  color: var(--barn-deep);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  line-height: 1.1;
  text-transform: none;
}

.sack-line {
  margin: 0.3rem 0 0.45rem;
  padding: 0.15rem 0.6rem;
  border-block: 2px solid var(--barn-deep);
  color: var(--barn-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.sack-place {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.sack-small {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

@media (max-width: 719.98px) {
  .hero-scene { height: clamp(240px, 62vw, 340px); }

  .feed-sack {
    position: relative;
    right: auto;
    bottom: auto;
    margin: -2.5rem auto var(--space-l);
  }
}

/* ---------- Cookie rack ---------- */
.rack-section { padding-block: var(--space-xl); }

.rack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rack-item {
  position: relative;
  flex: 0 0 25%;
  padding: 0 clamp(0.75rem, 1.5vw, 1.25rem) var(--space-l);
  text-align: center;
}

/* Each item sits on a strip of cooling rack; strips meet into one rack per row. */
.rack-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 150px;
  z-index: -1;
  border-block: 4px solid #a69d8e;
  background-color: var(--cream);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 17px, #c4bbac 17px 19px),
    repeating-linear-gradient(0deg, transparent 0 34px, #b3aa9b 34px 37px);
}

.rack { position: relative; z-index: 0; }

.cookie-art {
  width: 118px;
  height: 118px;
  margin: 16px auto 1.6rem;
  filter: drop-shadow(0 8px 6px rgb(58 29 16 / 0.35));
  transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.rack-item:hover .cookie-art { transform: rotate(-10deg) scale(1.05); }

.rack-item h3 { margin-bottom: 0.35rem; }

.rack-item h3 small {
  display: block;
  margin-top: 0.3rem;
  color: var(--barn);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rack-note {
  margin-bottom: 0.6rem;
  color: var(--ink-soft);
}

.rack-allergens {
  margin: 0;
  font-size: var(--step--1);
}

.rack-allergens span {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 1023.98px) { .rack-item { flex-basis: 33.333%; } }
@media (max-width: 759.98px) { .rack-item { flex-basis: 50%; } }
@media (max-width: 479.98px) {
  .rack-item {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    column-gap: 1rem;
    flex-basis: 100%;
    padding: 0 0 var(--space-m);
    text-align: left;
  }

  .rack-item::before {
    width: 108px;
    height: 108px;
    border: 3px solid #a69d8e;
    border-radius: var(--radius-s);
  }

  .cookie-art {
    grid-row: 1 / span 3;
    width: 82px;
    height: 82px;
    margin: 13px auto 0;
  }
}

/* Kraft price tags on a string */
.price-tags {
  position: relative;
  margin-top: var(--space-m);
  padding-top: var(--space-m);
  text-align: center;
}

.price-tags-title {
  font-family: var(--font-display);
  font-size: var(--step-2);
}

.price-tags ul {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  margin: 0 0 var(--space-m);
  padding: 1.25rem 0 0;
  list-style: none;
}

/* The string the tags hang from. */
.price-tags ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 22px;
  border-top: 2px dashed #8a6a3d;
  border-radius: 50%;
}

.price-tags li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 200px;
  padding: 1.8rem 1rem 1.1rem;
  border-radius: 8px 8px 8px 8px;
  background: var(--kraft);
  clip-path: polygon(18% 0, 82% 0, 100% 14%, 100% 100%, 0 100%, 0 14%);
  box-shadow: var(--shadow);
}

.price-tags li:nth-child(odd) { transform: rotate(-2deg); }
.price-tags li:nth-child(even) { transform: rotate(2deg); }

/* Punched hole */
.price-tags li::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--salt);
  box-shadow: inset 0 0 0 2px #8a6a3d;
}

.tag-size {
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tag-price {
  color: var(--barn-deep);
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.1;
}

.tag-note { font-size: var(--step--1); }

.price-tags-fine {
  max-width: 560px;
  margin-inline: auto;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

/* ---------- Snack sacks and party trays ---------- */
.snack-section {
  padding-block: var(--space-xl);
  background-color: var(--pasture-deep);
  background-image: radial-gradient(ellipse at 80% 0%, rgb(255 255 255 / 0.06), transparent 60%);
  color: var(--salt);
}

.sacks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
  margin: 0 0 var(--space-xl);
  padding: 0;
  list-style: none;
}

.sack {
  position: relative;
  padding: 2.6rem 1.25rem 1.5rem;
  border-radius: 0 0 10px 10px;
  background-color: var(--kraft);
  background-image: linear-gradient(90deg, rgb(58 29 16 / 0.08), transparent 12%, transparent 88%, rgb(58 29 16 / 0.08));
  color: var(--ink);
  box-shadow: 0 18px 24px -16px rgb(0 0 0 / 0.6);
}

/* Rolled-down top of the paper sack. */
.sack::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: linear-gradient(180deg, #c7a574, #b9955f);
  clip-path: polygon(0 0, 6% 100%, 12% 0, 18% 100%, 24% 0, 30% 100%, 36% 0, 42% 100%, 48% 0, 54% 100%, 60% 0, 66% 100%, 72% 0, 78% 100%, 84% 0, 90% 100%, 96% 0, 100% 60%, 100% 0);
}

.sack-label {
  display: flex;
  flex-direction: column;
  margin: 0 0 1rem;
  padding: 0.7rem 0.8rem;
  border: 2px solid var(--barn-deep);
  outline: 1px solid var(--barn-deep);
  outline-offset: 3px;
  background: var(--salt);
  text-align: center;
  transform: rotate(-1.5deg);
}

.sack:nth-child(even) .sack-label { transform: rotate(1.5deg); }

.sack-title {
  color: var(--barn-deep);
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.2;
}

.sack-weight {
  margin-top: 0.25rem;
  font-size: var(--step--1);
  font-weight: 700;
}

.sack-allergens {
  margin: 0;
  font-size: var(--step--1);
  font-weight: 700;
}

@media (max-width: 1023.98px) { .sacks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559.98px) { .sacks { grid-template-columns: 1fr; } }

/* A white-painted barn sign with red trim */
.tray-board {
  max-width: 920px;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border: 8px solid var(--barn);
  border-radius: 4px;
  background: var(--salt);
  color: var(--ink);
  box-shadow: 0 0 0 3px var(--salt), 0 20px 30px -18px rgb(0 0 0 / 0.7);
}

.tray-title {
  font-size: var(--step-3);
  text-align: center;
}

.tray-intro {
  max-width: 620px;
  margin: 0 auto var(--space-m);
  color: var(--ink-soft);
  text-align: center;
}

.tray-list { margin: 0 0 var(--space-m); }

.tray-row {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) auto;
  gap: 0.25rem 1.25rem;
  align-items: baseline;
  padding-block: 0.9rem;
  border-bottom: 2px dashed #d6c7ad;
}

.tray-row dt {
  font-family: var(--font-display);
  font-size: var(--step-1);
}

.tray-row dd { margin: 0; }

.tray-what { color: var(--ink-soft); }

.tray-price {
  color: var(--barn);
  font-weight: 700;
  white-space: nowrap;
}

.tray-fine {
  margin: 0;
  font-size: var(--step--1);
  text-align: center;
}

@media (max-width: 639.98px) {
  .tray-row { grid-template-columns: 1fr auto; }
  .tray-what { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Pickup: gates and the stand board ---------- */
.pickup-section {
  padding-block: var(--space-xl);
  background: var(--cream);
}

.pickup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.gates {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gate {
  padding: 0 0 var(--space-m) 0;
  margin-bottom: var(--space-m);
  border-bottom: 3px double #d4c3a5;
}

.gate:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.gate h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gate-no {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--gold);
  color: var(--char);
  font-size: 1.15rem;
  box-shadow: inset 0 0 0 3px var(--salt), 0 0 0 2px var(--gold);
}

.gate p {
  margin: 0;
  color: var(--ink-soft);
}

.stand-board {
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 6px;
  background-color: var(--barn-deep);
  background-image: repeating-linear-gradient(90deg, transparent 0 96px, rgb(0 0 0 / 0.08) 96px 98px);
  color: var(--salt);
  box-shadow: inset 0 0 0 4px var(--barn-dark), 0 22px 30px -20px rgb(58 29 16 / 0.8);
}

.board-title {
  margin-bottom: 0.75rem;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: var(--step-2);
  text-align: center;
}

.board-week {
  width: 100%;
  border-collapse: collapse;
}

.board-week thead th {
  padding: 0 0 0.5rem;
  border-bottom: 2px solid rgb(251 248 242 / 0.6);
  color: var(--gold-soft);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
}

.board-week tbody th,
.board-week td {
  padding: 0.7rem 0;
  border-bottom: 1px dashed rgb(251 248 242 / 0.45);
  text-align: left;
  vertical-align: top;
}

.board-week tbody th {
  width: 7.5rem;
  padding-right: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

.board-week .is-key th,
.board-week .is-key td { color: var(--gold-bright); font-weight: 700; }

.board-fine {
  margin: 1rem 0 0;
  font-size: var(--step--1);
}

.state-line {
  max-width: 860px;
  margin: var(--space-l) auto 0;
  padding: 1rem 1.25rem;
  border-left: 6px solid var(--pasture);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: var(--salt);
}

@media (max-width: 859.98px) {
  .pickup-grid { grid-template-columns: 1fr; }
}

/* ---------- Story and the sample label ---------- */
.story-section { padding-block: var(--space-xl); }

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.story-copy .sec-head { margin-bottom: var(--space-m); }

.story-points {
  margin: var(--space-m) 0 0;
  padding: 0;
  list-style: none;
}

.story-points li {
  position: relative;
  padding: 0 0 0.75rem 2rem;
}

/* A tiny salt crystal as the bullet. */
.story-points li::before {
  content: '';
  position: absolute;
  top: 0.45em;
  left: 0.2rem;
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid var(--barn);
  background: var(--salt);
  transform: rotate(45deg);
}

.label-specimen {
  margin: 0;
}

.specimen {
  padding: 1.5rem 1.4rem;
  border: 2px dashed #b9aa90;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
  font-size: var(--step--1);
  line-height: 1.5;
  transform: rotate(1.5deg);
}

.specimen-name {
  margin-bottom: 0.1rem;
  color: var(--barn);
  font-family: var(--font-display);
  font-size: var(--step-2);
}

.specimen-sub {
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
}

.specimen-row { margin-bottom: 0.5rem; }

.specimen-notice {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--ink);
  font-weight: 700;
}

.label-specimen figcaption {
  margin-top: 1.4rem;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

@media (max-width: 859.98px) {
  .story-grid { grid-template-columns: 1fr; }
}

/* ---------- FAQ: milk-bottle caps in a crate ---------- */
.faq-section {
  padding-block: var(--space-xl);
  background: var(--gold-soft);
}

.crate {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.6rem, 1.2vw, 1rem);
  margin: 0;
  padding: clamp(0.6rem, 1.2vw, 1rem);
  border-radius: 18px;
  background: var(--pasture);
  box-shadow: inset 0 0 0 4px #26502b, 0 26px 40px -26px rgb(31 63 36 / 0.9);
  list-style: none;
}

/* Without JavaScript every answer is simply shown under its question. */
.cap {
  position: relative;
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--salt);
}

.cap-disc { display: none; }

.cap-q { font-size: var(--step-1); }

.cap-a p { margin: 0; }

/* With JavaScript each cell holds a round cap that flips to reveal its answer. */
.js .cap {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  background: #26502b;
  perspective: 900px;
}

.js .cap-q {
  position: absolute;
  inset: 7%;
  z-index: 1;
  margin: 0;
}

.cap-toggle {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  height: 100%;
  padding: 0 21%;
  border: 0;
  border-radius: 50%;
  background-color: var(--salt);
  box-shadow: inset 0 0 0 6px var(--barn), inset 0 0 0 9px var(--salt), inset 0 0 0 11px var(--barn), 0 8px 0 #1c3b20, 0 14px 18px -8px rgb(0 0 0 / 0.6);
  color: var(--ink);
  font: 400 clamp(1rem, 0.9rem + 0.45vw, 1.2rem) / 1.25 var(--font-display);
  text-align: center;
  cursor: pointer;
  transition: background-color 0s linear 0.3s, box-shadow 0.2s ease;
}

.cap-toggle:hover { box-shadow: inset 0 0 0 6px var(--barn), inset 0 0 0 9px var(--salt), inset 0 0 0 11px var(--barn), 0 10px 0 #1c3b20, 0 18px 22px -8px rgb(0 0 0 / 0.6); }
.cap-toggle:focus-visible { box-shadow: inset 0 0 0 6px var(--barn), 0 0 0 4px var(--gold-bright), 0 0 0 7px var(--ink); }

/* The printed rim text sits between the cap's paint and its lettering. */
.js .cap-disc {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
}

.js .cap-disc svg {
  width: 100%;
  height: 100%;
  color: var(--barn);
  fill: currentColor;
  font: 700 10.5px var(--font-body);
  letter-spacing: 0.08em;
}

.cap-label,
.cap-hint { transition: opacity 0s linear 0.3s; }

.cap-hint {
  color: var(--barn);
  font: 700 0.75rem / 1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.js .cap-a {
  position: absolute;
  inset: 7%;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0 17%;
  color: var(--ink);
  font-size: clamp(0.86rem, 0.8rem + 0.2vw, 0.95rem);
  line-height: 1.42;
  text-align: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}

/* A flip is a quarter turn out, a swap of faces, and a quarter turn back. */
.cap.has-turned .cap-toggle { animation: cap-turn-back 0.6s ease-in-out; }
.cap.has-turned .cap-a { animation: cap-face-out 0.3s ease-in; }

.cap.is-flipped .cap-toggle {
  background-color: var(--gold-soft);
  animation: cap-turn-over 0.6s ease-in-out;
}

.cap.is-flipped .cap-label,
.cap.is-flipped .cap-hint { opacity: 0; }

.cap.is-flipped .cap-a {
  visibility: visible;
  opacity: 1;
  animation: cap-face-in 0.6s ease-out;
}

@media (max-width: 1023.98px) { .crate { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 599.98px) {
  .crate { grid-template-columns: 1fr; }
  .js .cap { width: min(100%, 360px); justify-self: center; }
}

/* ---------- Order: the cookie-box builder ---------- */
.order-section {
  padding-block: var(--space-xl);
  background-color: var(--barn-deep);
  background-image: repeating-linear-gradient(90deg, transparent 0 118px, rgb(0 0 0 / 0.14) 118px 121px);
  color: var(--salt);
}

.builder {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

.builder-steps {
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border-radius: var(--radius);
  background: var(--salt);
  color: var(--ink);
  box-shadow: 0 24px 40px -24px rgb(0 0 0 / 0.7);
}

.form-intro {
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.step {
  margin: 0 0 var(--space-m);
  padding: 0 0 var(--space-m);
  border: 0;
  border-bottom: 2px dashed #ddd0b9;
}

.step:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.step legend {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
}

.step-no {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--barn);
  color: var(--salt);
  font-size: 1rem;
}

.req { color: var(--barn); }

.optional {
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.choice,
.flavor {
  position: relative;
  display: block;
  cursor: pointer;
}

.choice input,
.flavor input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.choice-face {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 64px;
  height: 100%;
  padding: 0.65rem 0.8rem;
  border: 2px solid #cbbda5;
  border-radius: var(--radius-s);
  background: #fffdf8;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice-face small {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.choice input:checked + .choice-face {
  border-color: var(--barn);
  background: #fbeae4;
  box-shadow: inset 0 0 0 1px var(--barn);
}

.choice input:focus-visible + .choice-face,
.flavor input:focus-visible + span { box-shadow: var(--focus); }

.choice:hover .choice-face,
.flavor:hover span { border-color: var(--ink-soft); }

.flavor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.flavor span {
  position: relative;
  display: block;
  min-height: 48px;
  height: 100%;
  padding: 0.7rem 0.8rem 0.7rem 2.6rem;
  border: 2px solid #cbbda5;
  border-radius: 999px;
  background: #fffdf8;
  line-height: 1.25;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.flavor small { color: var(--ink-soft); }

/* The check mark is a little cookie that fills in. */
.flavor span::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: -0.6rem;
  border: 2px solid var(--ink-soft);
  border-radius: 50%;
  background: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.flavor input:checked + span {
  border-color: var(--barn);
  background: #fbeae4;
}

.flavor input:checked + span::before {
  border-color: var(--barn-dark);
  background: radial-gradient(circle at 35% 35%, var(--char) 0 12%, transparent 13%), radial-gradient(circle at 65% 62%, var(--char) 0 12%, transparent 13%), var(--gold);
}

.field-hint {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.field-error {
  margin: 0.35rem 0 0;
  color: var(--error);
  font-size: var(--step--1);
  font-weight: 700;
}

.field-error:empty { display: none; }

.field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  margin-top: 1rem;
}

.field-full { grid-column: 1 / -1; }

.field label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.8rem;
  border: 2px solid #b9aa90;
  border-radius: var(--radius-s);
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--ink);
  box-shadow: var(--focus);
}

.field .field-hint { margin: 0.35rem 0 0; }

[aria-invalid="true"] { border-color: var(--error); }
.choice input[aria-invalid="true"] + .choice-face,
.flavor input[aria-invalid="true"] + span { border-color: var(--error); }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The live box preview */
.box-panel {
  position: sticky;
  top: calc(var(--rail-h) + 20px);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: var(--radius);
  background: var(--pasture-night);
  color: var(--salt);
  box-shadow: 0 24px 40px -24px rgb(0 0 0 / 0.7);
}

.kraft-box {
  margin-bottom: 1rem;
  perspective: 800px;
}

.kraft-lid {
  display: grid;
  place-items: center;
  height: 46px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #c7a574, #b9955f);
  color: var(--barn-dark);
  font-family: var(--font-display);
  font-size: 1.1rem;
  transform: rotateX(28deg);
  transform-origin: 50% 100%;
}

.kraft-tray {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 6px;
  padding: 12px;
  border-radius: 0 0 10px 10px;
  background: var(--kraft);
  box-shadow: inset 0 0 0 4px #b9955f, inset 0 10px 14px -8px rgb(58 29 16 / 0.5);
}

.slot {
  aspect-ratio: 1;
  border: 2px dashed rgb(58 29 16 / 0.35);
  border-radius: 50%;
}

.slot.is-filled {
  border: 0;
  background:
    radial-gradient(circle at 34% 36%, rgb(58 29 16 / 0.55) 0 8%, transparent 9%),
    radial-gradient(circle at 64% 58%, rgb(58 29 16 / 0.55) 0 8%, transparent 9%),
    radial-gradient(circle at 44% 72%, rgb(58 29 16 / 0.45) 0 6%, transparent 7%),
    var(--dough, var(--gold));
  box-shadow: 0 3px 3px rgb(58 29 16 / 0.35);
  animation: drop-in 0.3s ease;
}

.box-summary {
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.box-estimate {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  color: var(--sage);
}

.box-estimate strong {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 400;
}

.box-fine {
  color: var(--sage);
  font-size: var(--step--1);
}

.form-legal {
  margin: 0.9rem 0 0;
  color: var(--sage);
  font-size: var(--step--1);
}

.form-legal a,
.form-status a { color: var(--gold-soft); }
.form-legal a:hover,
.form-status a:hover { color: var(--salt); }

.form-status:empty { display: none; }

.form-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-s);
  font-size: var(--step--1);
}

.form-status.is-success {
  background: var(--pasture);
  box-shadow: inset 4px 0 0 var(--gold-bright);
}

.form-status.is-error {
  background: var(--barn-dark);
  box-shadow: inset 4px 0 0 var(--gold-bright);
}

@media (max-width: 959.98px) {
  .builder { grid-template-columns: 1fr; }
  .box-panel { position: static; }
}

@media (max-width: 559.98px) {
  .choice-row,
  .flavor-grid,
  .field-pair { grid-template-columns: 1fr; }
}

/* ---------- Footer: pasture, fence rails, ground ---------- */
.site-footer { color: var(--salt); }

.footer-pasture {
  padding-block: var(--space-l) var(--space-m);
  background: var(--pasture-night);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.brand-footer { color: var(--salt); }
.brand-footer:hover { color: var(--gold-soft); }

.footer-line {
  max-width: 520px;
  margin: 0;
  color: var(--sage);
}

/* Fence: posts are drawn as a repeating background; each rail is a board of links. */
.fence-rows {
  display: grid;
  gap: 14px;
  padding: 30px 0 18px;
  background-color: var(--pasture-night);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 13px), #7a4d2b calc(25% - 13px) calc(25% - 11px), #b07a48 calc(25% - 11px) calc(25% + 11px), #7a4d2b calc(25% + 11px) calc(25% + 13px), transparent calc(25% + 13px) 25%);
}

.fence-rail {
  border-block: 2px solid var(--wood-edge);
  background-color: var(--wood-light);
  background-image: repeating-linear-gradient(180deg, transparent 0 6px, rgb(122 77 43 / 0.12) 6px 7px);
  box-shadow: 0 6px 8px -6px rgb(0 0 0 / 0.6);
}

.fence-rail ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 clamp(1rem, 3vw, 2.5rem);
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 0.35rem var(--gutter);
  list-style: none;
}

.fence-rail li {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--char);
  font-weight: 700;
}

.fence-rail a,
.fence-rail .link-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--char);
  font-weight: 700;
}

.fence-rail a:hover,
.fence-rail .link-button:hover { color: var(--barn-dark); }

.footer-ground {
  padding-block: var(--space-m) var(--space-l);
  background: var(--earth);
  color: var(--sand);
  font-size: var(--step--1);
  text-align: center;
}

.footer-ground p { margin-bottom: 0.4rem; }

/* ---------- Consent banner and dialog: a hand-lettered stand sign ---------- */
.consent {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 100;
  width: min(440px, calc(100% - 2 * var(--gutter)));
  max-height: calc(100vh - var(--rail-h) - 2 * var(--gutter));
  overflow-y: auto;
  padding: 1.25rem 1.25rem 1.1rem;
  border: 4px solid var(--barn);
  border-radius: var(--radius);
  background: var(--salt);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--salt), 0 24px 40px -16px rgb(0 0 0 / 0.6);
}

.consent-title {
  margin-bottom: 0.4rem;
  font-size: var(--step-1);
}

.consent-text {
  font-size: var(--step--1);
  line-height: 1.5;
}

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.consent-btn {
  min-height: 46px;
  padding: 0.6rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--salt);
  font: 700 0.95rem / 1.2 var(--font-body);
  cursor: pointer;
}

.consent-btn:hover {
  background: var(--barn);
  border-color: var(--barn);
}

.consent-link {
  grid-column: 1 / -1;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--barn);
  font: 700 0.95rem / 1.2 var(--font-body);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.consent-link:hover { color: var(--barn-dark); }

.consent-dialog {
  width: min(560px, calc(100% - 2 * var(--gutter)));
  max-height: calc(100vh - 2 * var(--gutter));
  padding: 0;
  border: 4px solid var(--barn);
  border-radius: var(--radius);
  background: var(--salt);
  color: var(--ink);
}

.consent-dialog::backdrop { background: rgb(31 63 36 / 0.7); }

.consent-dialog-inner { padding: 1.5rem; }

.consent-categories {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.consent-category {
  padding: 0.9rem 0;
  border-bottom: 2px dashed #ddd0b9;
}

.consent-category p {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.consent-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.consent-category-head h3 {
  margin: 0;
  font-size: var(--step-0);
}

.consent-always {
  color: var(--pasture);
  font-size: var(--step--1);
  font-weight: 700;
}

.consent-switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 44px;
  flex: none;
  cursor: pointer;
}

.consent-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.consent-switch-track {
  position: absolute;
  top: 9px;
  left: 0;
  width: 56px;
  height: 26px;
  border-radius: 999px;
  background: #8c7d6c;
  transition: background-color 0.2s ease;
}

.consent-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--salt);
  transition: transform 0.2s ease;
}

.consent-switch input:checked + .consent-switch-track { background: var(--pasture); }
.consent-switch input:checked + .consent-switch-track::after { transform: translateX(30px); }
.consent-switch input:focus-visible + .consent-switch-track { box-shadow: var(--focus); }

.consent-btn-save {
  grid-column: 1 / -1;
  background: var(--barn);
  border-color: var(--barn);
}

.consent-btn-save:hover {
  background: var(--barn-dark);
  border-color: var(--barn-dark);
}

/* ---------- Legal pages ---------- */
.legal-hero {
  padding-block: var(--space-l);
  background: var(--cream);
  border-bottom: 3px double #d4c3a5;
}

.legal-sign {
  display: inline-block;
  max-width: 100%;
  padding: 1.1rem clamp(1.25rem, 4vw, 2rem);
  border-radius: 6px;
  background-color: var(--wood-light);
  background-image: repeating-linear-gradient(180deg, transparent 0 7px, rgb(122 77 43 / 0.12) 7px 8px);
  box-shadow: inset 0 0 0 3px var(--wood-edge), var(--shadow);
  color: var(--char);
  transform: rotate(-1deg);
}

.legal-sign h1 {
  margin: 0;
  font-size: var(--step-3);
}

.legal-updated {
  margin: 0.3rem 0 0;
  font-weight: 700;
}

.legal-lede {
  max-width: 720px;
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  font-size: var(--step-1);
}

.legal-body { padding-block: var(--space-l) var(--space-xl); }

.prose { max-width: 820px; }

.prose h2 {
  margin-top: 2.2rem;
  font-size: var(--step-2);
}

.prose h3 {
  margin-top: 1.5rem;
  font-family: var(--font-body);
  font-size: var(--step-1);
  font-weight: 700;
}

.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }

.prose address {
  margin-bottom: 1rem;
  font-style: normal;
}

.callout {
  padding: 1rem 1.25rem;
  border-left: 6px solid var(--barn);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: var(--cream);
}

.table-wrap { margin: 1.25rem 0; }

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.table-wrap th,
.table-wrap td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #ddd0b9;
  text-align: left;
  vertical-align: top;
}

.table-wrap thead th {
  background: var(--pasture-night);
  color: var(--salt);
}

/* Narrow screens: every row becomes a stack of label/value pairs. */
@media (max-width: 719.98px) {
  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .table-wrap tr {
    display: block;
    margin-bottom: 1rem;
    border: 2px solid #ddd0b9;
    border-radius: var(--radius-s);
  }

  .table-wrap td {
    position: relative;
    display: block;
    padding-left: 7.5rem;
  }

  .table-wrap td::before {
    content: attr(data-label);
    position: absolute;
    top: 0.65rem;
    left: 0.75rem;
    font-weight: 700;
  }

  .table-wrap tr td:last-child { border-bottom: 0; }
}

/* ---------- 404: the empty pasture ---------- */
.lost {
  padding-block: var(--space-xl) 0;
  background: linear-gradient(180deg, #fdf3dc 0%, #f7d498 100%);
  text-align: center;
}

.lost-code {
  margin-bottom: 0.25rem;
  color: var(--barn);
  font-family: var(--font-display);
  font-size: clamp(4rem, 3rem + 6vw, 8rem);
  line-height: 1;
}

.lost p { color: var(--ink-soft); }

.lost-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.lost-fence {
  width: 100%;
  height: clamp(120px, 16vw, 200px);
  margin-top: var(--space-l);
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Motion ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

.sun { animation: sunrise 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

.heifer-head {
  animation: peek 1.4s cubic-bezier(0.3, 1.3, 0.5, 1) 0.4s both;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.ear {
  transform-box: fill-box;
  animation: ear-flick 6s ease-in-out 2s infinite;
}

.ear-l { transform-origin: 100% 50%; }
.ear-r { transform-origin: 0% 50%; animation-delay: 2.4s; }

@keyframes sunrise {
  from { transform: translateY(90px); }
  to { transform: none; }
}

@keyframes peek {
  from { transform: translateY(60px); }
  to { transform: none; }
}

@keyframes ear-flick {
  0%, 90%, 100% { transform: rotate(0deg); }
  93% { transform: rotate(-9deg); }
  96% { transform: rotate(5deg); }
}

@keyframes cap-turn-over {
  0%, 100% { transform: none; }
  50% { transform: rotateY(90deg); }
}

@keyframes cap-turn-back {
  0%, 100% { transform: none; }
  50% { transform: rotateY(90deg); }
}

@keyframes cap-face-in {
  0%, 50% { transform: rotateY(90deg); }
  100% { transform: none; }
}

@keyframes cap-face-out {
  from { transform: none; }
  to { transform: rotateY(90deg); }
}

@keyframes drop-in {
  from { transform: translateY(-8px) scale(0.85); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- Print ---------- */
@media print {
  .rail,
  .hero-scene,
  .site-footer .fence-rows,
  .consent,
  .box-panel .kraft-box { display: none; }

  body { background: #fff; }

  .js .cap-a {
    position: static;
    visibility: visible;
    opacity: 1;
  }
}
