/* Barcoe's Bites
   Palette taken from the packaging: the stone of the sticker, the kraft of the bag,
   the ink of the monogram, and the white of the product photos. */
@font-face {
  font-family: "Jost"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("fonts/jost-latin-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/jost-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/jost-latin-500-normal.woff2") format("woff2");
}

:root {
  --stone: #EAE3DD;
  --stone-deep: #DDD3CA;
  --kraft: #C9AC76;
  --kraft-deep: #A88A57;
  --ink: #221F1D;
  --cocoa: #5E4A36;
  --white: #FFFFFF;

  --font: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section: clamp(4rem, 10vw, 7.5rem);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.1; }
p { margin: 0 0 1em; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
b, strong { font-weight: 500; }

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

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--ink); color: var(--stone); padding: 0.6rem 1rem; border-radius: 999px;
}
.skip:focus { top: 1rem; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.75rem 1.6rem;
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--stone);
  font: inherit; font-weight: 500; letter-spacing: 0.02em; text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.button:hover { background: transparent; color: var(--ink); }
.button-light { background: var(--stone); color: var(--ink); border-color: var(--stone); }
.button-light:hover { background: transparent; color: var(--stone); }
.button-light:focus-visible { outline-color: var(--stone); }
.button-wide { width: 100%; }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Header */
.site-header {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.75rem var(--gutter);
  max-width: 76rem; margin: 0 auto;
}
.brand img { width: 112px; height: 112px; }
.site-header nav { display: flex; gap: 1.75rem; margin-left: auto; }
.site-header nav a { text-decoration: none; font-size: 0.95rem; letter-spacing: 0.04em; }
.site-header nav a:hover { text-decoration: underline; }
.header-cart {
  position: relative; display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; padding: 0;
  border: 1px solid var(--ink); border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer;
}
.header-cart svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.header-cart-count {
  position: absolute; top: -0.35rem; right: -0.35rem;
  min-width: 1.35rem; height: 1.35rem; padding: 0 0.3rem;
  border-radius: 999px; background: var(--ink); color: var(--stone);
  font-size: 0.75rem; font-weight: 500; line-height: 1.35rem; text-align: center;
}
.header-cart-count[data-empty="true"] { display: none; }

@media (max-width: 40rem) {
  .site-header nav { display: none; }
  .header-cart { margin-left: auto; }
}

/* Notice (after returning from checkout) */
.notice {
  max-width: 76rem; margin: 0 auto 1rem; padding: 1rem var(--gutter);
  background: var(--ink); color: var(--stone);
}

/* Hero */
.hero {
  display: grid; gap: clamp(2rem, 6vw, 5rem); align-items: center;
  max-width: 76rem; margin: 0 auto;
  padding: var(--section) var(--gutter);
}
@media (min-width: 52rem) {
  .hero { grid-template-columns: 1.1fr 0.9fr; }
}
.hero h2 {
  font-size: clamp(2.75rem, 8.5vw, 5.25rem);
  font-weight: 300;
  letter-spacing: -0.015em;
  line-height: 1.02;
  max-width: 9ch;
  margin-bottom: 1.75rem;
}
.hero .lead { font-size: clamp(1.2rem, 2.6vw, 1.45rem); max-width: 26rem; }
.hero-text p:not(.lead) { max-width: 26rem; color: var(--cocoa); margin-bottom: 0; }
.hero-photo img {
  width: 100%; max-width: 28rem; margin-inline: auto;
  border-radius: 6px;
}

/* Section heads */
.section-head { max-width: var(--measure); margin: 0 auto clamp(2.5rem, 6vw, 4rem); text-align: center; }
.section-head h2, .allergy h2 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 300; letter-spacing: -0.01em; margin-bottom: 0.75rem;
}

/* Flavours: kraft band with round stickers */
.flavours {
  padding: var(--section) var(--gutter);
  background-color: var(--kraft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .1 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.product-grid {
  list-style: none; margin: 0 auto; padding: 0;
  max-width: 68rem;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(3rem, 7vw, 4.5rem) clamp(1.5rem, 4vw, 3rem);
}
.product {
  flex: 0 1 18.5rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.sticker { position: relative; width: min(17rem, 78vw); aspect-ratio: 1; margin-bottom: 1.5rem; }
.sticker img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 0 rgba(90, 64, 25, 0.25), 0 14px 22px -14px rgba(70, 48, 16, 0.55);
}
.sticker-ring {
  position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px);
  overflow: visible; pointer-events: none;
}
.sticker-ring .ring { fill: none; stroke: var(--ink); stroke-width: 0.9; }
.sticker-ring .arc { fill: none; }
.sticker-ring text {
  fill: var(--ink);
  font-family: var(--font); font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.32em; text-transform: uppercase;
  text-anchor: middle;
}
.sticker-ring text.long { font-size: 9px; letter-spacing: 0.22em; }

.product .price { font-size: 1.2rem; font-weight: 500; margin-bottom: 0.5rem; }
.product .mix-note { font-size: 0.95rem; max-width: 17rem; margin-bottom: 0.5rem; }
.product .allergens { font-size: 0.9rem; line-height: 1.5; max-width: 17rem; margin-bottom: 1.25rem; }
.product .allergens span { font-weight: 400; }
.product .allergens b { font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }

/* Quantity control */
.qty { margin-top: auto; min-height: 3rem; display: flex; align-items: center; justify-content: center; }
.qty .button { min-width: 10rem; }
.stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--ink); border-radius: 999px; background: var(--stone);
}
.stepper button {
  width: 3rem; height: 3rem; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); font: inherit; font-size: 1.35rem; line-height: 1;
  cursor: pointer;
}
.stepper button:hover { background: var(--stone-deep); }
.stepper output { min-width: 4.5rem; text-align: center; font-weight: 500; }

/* Ordering */
.ordering { padding: var(--section) var(--gutter); max-width: 76rem; margin: 0 auto; }
.steps {
  list-style: none; margin: 0 auto; padding: 0; counter-reset: step;
  display: grid; gap: 2.5rem; max-width: 64rem;
}
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; position: relative; padding-top: 4.25rem; }
.steps li::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 3rem; height: 3rem; border: 1px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; font-size: 1.25rem; font-weight: 300;
}
.steps h3 { font-size: 1.35rem; font-weight: 500; margin-bottom: 0.5rem; }
.steps p { max-width: 22rem; color: var(--cocoa); }

.timings {
  margin: clamp(3rem, 7vw, 4.5rem) auto 0; max-width: 64rem;
  display: grid; gap: 0; border-top: 1px solid var(--ink);
}
@media (min-width: 52rem) { .timings { grid-template-columns: repeat(4, 1fr); } }
.timings div { padding: 1.1rem 0; border-bottom: 1px solid rgba(34, 31, 29, 0.25); }
@media (min-width: 52rem) {
  .timings div { padding: 1.25rem 1.5rem 0 0; border-bottom: 0; }
}
.timings dt { font-weight: 500; margin-bottom: 0.2rem; }
.timings dd { margin: 0; color: var(--cocoa); }

/* About */
.about {
  display: grid; gap: clamp(2rem, 6vw, 5rem); align-items: center;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) var(--section);
  background: var(--white);
}
@media (min-width: 52rem) {
  .about { grid-template-columns: minmax(0, 26rem) minmax(0, 30rem); justify-content: center; }
}
.about-photo img { width: 100%; max-width: 26rem; margin-inline: auto; border-radius: 13rem 13rem 6px 6px; }
.about-text p { max-width: var(--measure); color: var(--cocoa); font-size: 1.1rem; }

/* Allergies */
.allergy { max-width: var(--measure); margin: 0 auto; padding: var(--section) var(--gutter) calc(var(--section) * 0.75); text-align: center; }
.allergy p { color: var(--cocoa); }

/* Footer */
.site-footer {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 3rem var(--gutter) 8rem;
  border-top: 1px solid rgba(34, 31, 29, 0.25);
  font-size: 0.95rem;
}
.site-footer img { width: 128px; height: 128px; margin-bottom: 1rem; }
.site-footer p { margin-bottom: 0.35rem; }
.small { font-size: 0.85rem; color: var(--cocoa); }

/* Order bar */
.order-bar {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 20;
  transform: translateX(-50%);
  width: min(34rem, calc(100% - 2rem));
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  background: var(--ink); color: var(--stone); border-radius: 999px;
  box-shadow: 0 12px 30px -12px rgba(34, 31, 29, 0.6);
  animation: bar-in 0.35s cubic-bezier(.2, .8, .2, 1);
}
.order-bar[hidden] { display: none; }
.order-bar p { margin: 0; display: flex; gap: 1rem; font-weight: 500; }
.order-bar .button { min-height: 2.75rem; padding: 0.5rem 1.25rem; }
@keyframes bar-in { from { transform: translate(-50%, 140%); } to { transform: translate(-50%, 0); } }

/* Order sheet */
.order {
  width: min(32rem, 100%); max-width: 100%; max-height: 92dvh; overflow: auto;
  margin: auto auto 0; padding: 0;
  border: 0; border-radius: 22px 22px 0 0;
  background: var(--stone); color: var(--ink);
}
@media (min-width: 40rem) { .order { margin: auto; border-radius: 22px; } }
.order::backdrop { background: rgba(34, 31, 29, 0.55); }
.order[open] { animation: sheet-in 0.3s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.order-inner { padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom)); }
.order-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.order-head h2 { font-size: 1.75rem; font-weight: 300; }
.close {
  width: 2.75rem; height: 2.75rem; border: 1px solid var(--ink); border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.close svg { width: 1.1rem; height: 1.1rem; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; }
.empty { color: var(--cocoa); }

.lines { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.lines li {
  display: grid; grid-template-columns: 3.25rem 1fr auto; gap: 0.25rem 0.9rem; align-items: center;
  padding: 0.85rem 0; border-bottom: 1px solid rgba(34, 31, 29, 0.2);
}
.lines img { width: 3.25rem; height: 3.25rem; border-radius: 50%; grid-column: 1; grid-row: 1 / span 2; }
.lines .line-name { grid-column: 2; grid-row: 1; align-self: end; font-weight: 500; line-height: 1.25; }
.lines .line-price { grid-column: 2; grid-row: 2; align-self: start; color: var(--cocoa); font-size: 0.9rem; }
.lines .stepper { grid-column: 3; grid-row: 1 / span 2; }
.lines .stepper button { width: 2.5rem; height: 2.5rem; font-size: 1.15rem; }
.lines .stepper output { min-width: 1.75rem; }

.delivery { border: 0; margin: 0 0 1.25rem; padding: 0; }
.delivery legend { font-weight: 500; margin-bottom: 0.6rem; padding: 0; }
.delivery label {
  display: flex; gap: 0.85rem; align-items: flex-start;
  padding: 0.85rem 1rem; margin-bottom: 0.5rem;
  border: 1px solid rgba(34, 31, 29, 0.3); border-radius: 14px; cursor: pointer;
}
.delivery label:has(input:checked) { border-color: var(--ink); background: var(--white); }
.delivery input { margin-top: 0.3rem; accent-color: var(--ink); width: 1.1rem; height: 1.1rem; flex: none; }
.delivery strong { display: block; font-weight: 500; }
.delivery em { display: block; font-style: normal; font-size: 0.9rem; color: var(--cocoa); }

.totals { margin: 0 0 1.25rem; }
.totals div { display: flex; justify-content: space-between; padding: 0.2rem 0; }
.totals dt, .totals dd { margin: 0; }
.totals .grand { font-size: 1.2rem; font-weight: 500; border-top: 1px solid var(--ink); margin-top: 0.4rem; padding-top: 0.6rem; }

.checkout-message {
  padding: 0.85rem 1rem; margin-bottom: 1rem; border-radius: 14px;
  background: var(--kraft); font-size: 0.95rem;
}
.secure { text-align: center; margin: 0.85rem 0 0; }

/* Small screens: keep the bag photo and stickers from taking over the scroll */
@media (max-width: 40rem) {
  .hero-photo img { max-width: 22rem; }
  .sticker { width: min(15rem, 72vw); }
}

@media (max-width: 40rem) { .brand img { width: 96px; height: 96px; } }

/* Intro is the first thing on the page */
.about h1 { font-size: clamp(2.75rem, 8vw, 4.75rem); font-weight: 300; letter-spacing: -0.015em; line-height: 1.02; margin-bottom: 1.5rem; }
.about-text .button { margin-top: 1rem; }
.about-text p.follow { margin: 1.5rem 0 0; font-size: 1rem; }
.about-text p.follow a { color: var(--ink); font-weight: 500; }
