:root {
  --cream: #FBF6EC; --paper: #FFFDF7;
  --brown: #6B4A2B; --chocolate: #3F2A1A;
  --caramel: #C08A4E; --blush: #E7B4B7; --blush-deep: #D2919A; --sage: #97A87B;
  --caramel-text: #9A6628; --blush-text: #A0565F; --caramel-ink: #33210F;
  --line: #EADDC8;
  --shadow: 0 10px 30px rgba(63,42,26,.08);
  --shadow-lg: 0 18px 50px rgba(63,42,26,.16);
  --radius: 18px; --radius-sm: 12px;
  --font-display: "Fraunces", Georgia, serif;
  --font-script: "Caveat", cursive;
  --font-body: "Nunito Sans", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--chocolate);
  background-color: var(--cream);
  background-image:
    radial-gradient(rgba(107,74,43,.05) 1px, transparent 1.3px),
    radial-gradient(rgba(192,138,78,.06) 1px, transparent 1.3px);
  background-size: 26px 26px, 42px 42px;
  background-position: 0 0, 13px 21px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--chocolate);
  margin: 0 0 .5em;
}

p { margin: 0 0 1em; }

a { color: var(--brown); }

::selection { background: var(--blush); color: var(--chocolate); }

:focus-visible { outline: 3px solid var(--caramel-text); outline-offset: 2px; }
.site-footer :focus-visible { outline-color: var(--cream); }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 20px;
  border: 2px solid var(--brown);
  border-radius: 999px;
  background: var(--paper);
  color: var(--brown);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-220%);
  transition: transform .18s ease;
}
.skip-link:focus { transform: none; }

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

.container { max-width: 1120px; margin-inline: auto; padding-inline: 20px; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

section[id], footer[id] { scroll-margin-top: 96px; }

.section { padding: 72px 0; }

.section-head { max-width: 660px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(30px, 4vw, 40px); margin-bottom: 0; }
.title-line::after {
  content: "";
  display: block;
  width: 58px;
  height: 3px;
  margin: 14px auto 0;
  border-radius: 2px;
  background: var(--blush);
}
.title-line.is-left::after { margin-left: 0; }
.section-sub { margin: 14px 0 0; color: var(--brown); font-size: 17.5px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: 700 16px/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--brown); color: var(--cream); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--brown); border-color: var(--brown); }
.btn-ghost:hover { background: rgba(107,74,43,.08); transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251,246,236,.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.site-header.scrolled {
  border-bottom-color: rgba(107,74,43,.28);
  box-shadow: 0 6px 20px rgba(63,42,26,.10);
}
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 76px; padding-block: 8px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .logo { width: 56px; height: 56px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--brown); }
.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a {
  position: relative;
  padding: 6px 2px;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--chocolate);
  text-decoration: none;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brown);
  transition: right .2s ease;
}
.site-nav a:hover::after, .site-nav a:focus-visible::after { right: 0; }
.cart-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--brown);
  font: 700 15px/1.2 var(--font-body);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cart-button:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--caramel); }
.cart-icon { width: 20px; height: 20px; flex: none; }
.cart-badge {
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--caramel);
  color: var(--caramel-ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}
.cart-badge:empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes badge-bounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
  }
  .cart-badge.bounce { animation: badge-bounce .35s ease; }
}

/* Hero */
.hero { padding: 64px 0 78px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(40px, 6.2vw, 62px); letter-spacing: -.5px; margin-bottom: 18px; }
.script-accent { position: relative; font-family: var(--font-script); font-style: normal; font-weight: 700; white-space: nowrap; }
.script-accent::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 5%;
  height: .16em;
  background: var(--blush);
  border-radius: 999px;
  transform: rotate(-1.5deg);
  z-index: -1;
}
.hero-tagline { max-width: 46ch; margin-bottom: 28px; font-size: 19px; color: var(--brown); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-art { position: relative; }
.hero-art::before {
  content: "";
  position: absolute;
  inset: -9% -11% -7% -13%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(231,180,183,.55), rgba(231,180,183,0) 62%),
    radial-gradient(circle at 72% 68%, rgba(151,168,123,.40), rgba(151,168,123,0) 60%);
}
.hero-art img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.4deg);
}

/* Menu (rendered by app.js — styles ready) */
.category { margin-top: 56px; }
.category:first-child { margin-top: 0; }
.category-head { display: flex; align-items: center; gap: 18px; }
.category-art {
  width: 96px;
  height: 96px;
  flex: none;
  object-fit: contain;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.category-head h3 { margin: 0 0 4px; font-size: 26px; }
.category-blurb { margin: 0; font-style: italic; color: var(--brown); }
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
  margin-top: 24px;
}
.item-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, opacity .5s ease-out var(--reveal-delay, 0ms), translate .5s ease-out var(--reveal-delay, 0ms);
}
.item-card:nth-child(4n+1) { transform: rotate(-.7deg); }
.item-card:nth-child(4n+3) { transform: rotate(.5deg); }
.item-card:hover, .item-card:focus-within { transform: translateY(-4px) rotate(0deg); box-shadow: var(--shadow-lg); z-index: 2; }
.item-card img {
  grid-column: 1 / -1;
  width: 118px;
  height: 118px;
  margin: 4px auto 6px;
}
.item-name {
  grid-column: 1;
  align-self: center;
  margin: 0;
  font-family: var(--font-display);
  font-size: 18.5px;
  font-weight: 600;
  line-height: 1.25;
}
.item-price {
  grid-column: 2;
  align-self: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--caramel-text);
  text-align: right;
  white-space: nowrap;
}
.item-desc { grid-column: 1 / -1; margin: 0; font-size: 15.5px; color: var(--brown); }
.item-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.tag {
  padding: 3px 10px;
  border: 1px solid rgba(151,168,123,.45);
  border-radius: 999px;
  background: rgba(151,168,123,.22);
  color: var(--brown);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.add-button {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, box-shadow .15s ease;
}
.item-card:hover .add-button, .item-card:focus-within .add-button { opacity: 1; transform: none; }
@media (hover: none) {
  .add-button { opacity: 1; transform: none; }
}

/* How it works */
.how-section { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 0; padding: 0; list-style: none; }
.step { padding: 28px 26px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); box-shadow: var(--shadow); }
.step-number { display: block; margin-bottom: 10px; font-family: var(--font-script); font-size: 64px; line-height: .9; color: var(--blush); }
.step h3 { margin-bottom: 8px; font-size: 21px; }
.step p { margin: 0; font-size: 15.5px; color: var(--brown); }

/* About */
.about-inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: center; }
.about-photo {
  justify-self: center;
  width: min(340px, 100%);
  padding: 12px 12px 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transform: rotate(-2deg);
}
.about-photo img { width: 100%; border-radius: 3px; }
.about-copy p { margin-bottom: 0; font-size: 17.5px; color: var(--brown); }

/* QR / share */
.qr-section { padding-bottom: 88px; }
.qr-card {
  max-width: 640px;
  margin-inline: auto;
  padding: 44px 36px 40px;
  border: 2px dashed var(--brown);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}
.qr-card h2 { font-size: clamp(28px, 3.4vw, 34px); }
.qr-card p { max-width: 46ch; margin: 0 auto; color: var(--brown); }
#qr-slot { display: grid; place-items: center; min-height: 190px; margin-top: 8px; }
#qr-slot:empty::before {
  content: "";
  width: 168px;
  height: 168px;
  border: 2px dashed var(--line);
  border-radius: 22px;
  background: var(--cream);
}
.qr-image {
  max-width: 220px;
  width: 100%;
  height: auto;
  padding: 12px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}

/* Footer */
.site-footer { padding: 56px 0 28px; background: var(--brown); color: var(--cream); }
.wheat-divider { display: flex; justify-content: center; margin-bottom: 36px; }
.wheat-divider svg { width: min(300px, 80%); height: auto; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 36px; align-items: start; }
.footer-logo { width: 88px; height: 88px; margin-bottom: 10px; }
.footer-name { margin: 0 0 2px; font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--cream); }
.footer-city { margin: 0; color: rgba(251,246,236,.85); font-weight: 600; letter-spacing: .4px; }
.footer-col h3 {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--cream);
}
.footer-contact { display: grid; gap: 8px; justify-items: start; }
#footer-contact a {
  width: fit-content;
  padding-bottom: 1px;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid rgba(251,246,236,.35);
}
#footer-contact a:hover { border-bottom-color: var(--cream); }
.footer-payment { margin: 0; color: var(--cream); }
.footer-copy {
  margin: 44px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(251,246,236,.18);
  text-align: center;
  font-size: 14px;
  color: rgba(251,246,236,.85);
}

/* Cart drawer */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(63,42,26,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .24s ease, visibility 0s linear .24s;
}
.cart-drawer.open { transform: none; visibility: visible; transition: transform .24s ease; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-title { margin: 0; font-size: 24px; }
.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--brown);
  font: 400 22px/1 var(--font-body);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.icon-button:hover { background: var(--cream); border-color: var(--caramel); }
.cart-lines { flex: 1; overflow-y: auto; align-content: start; display: grid; gap: 14px; padding: 20px; }
.cart-empty { padding: 28px 8px; margin: 0; text-align: center; font-style: italic; color: var(--brown); }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cart-line-name { font-weight: 700; font-size: 15.5px; }
.cart-line-price { font-size: 14px; color: var(--brown); }
.stepper { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: inline-flex; align-items: center; gap: 10px; }
.stepper button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--brown);
  font: 700 18px/1 var(--font-body);
  cursor: pointer;
}
.stepper button:hover { border-color: var(--caramel); background: var(--cream); }
.stepper-qty { min-width: 1.6em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-line-total { grid-column: 2; grid-row: 3; align-self: center; text-align: right; font-weight: 700; font-size: 15px; }
.cart-remove {
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
  align-self: center;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--brown);
  font: 400 17px/1 var(--font-body);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.cart-remove:hover { border-color: var(--caramel); background: var(--cream); color: var(--blush-text); }
.drawer-foot { padding: 18px 20px 22px; border-top: 1px solid var(--line); background: var(--cream); }
.subtotal-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; font-weight: 700; }
#cart-subtotal { font-family: var(--font-display); font-size: 22px; color: var(--chocolate); }

/* Checkout modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(63,42,26,.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s ease, visibility 0s linear .24s;
}
.modal.open { opacity: 1; visibility: visible; transition: opacity .24s ease; }
.modal-card {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.98);
  transition: transform .24s ease;
}
.modal.open .modal-card { transform: none; }
.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.modal-head h2 { margin: 0; font-size: 24px; }
.modal-body { padding: 22px; }
.checkout-summary {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
}
.checkout-summary:empty { display: none; }
.checkout-form { display: grid; gap: 16px; }
.form-field { display: grid; gap: 6px; }
.form-row { display: grid; gap: 16px; }
label { font-size: 14.5px; font-weight: 700; color: var(--brown); }
.label-optional { font-weight: 400; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--chocolate);
  font: 400 16px/1.4 var(--font-body);
}
input:focus, select:focus, textarea:focus { border-color: var(--caramel); }
textarea { min-height: 88px; resize: vertical; }
.pickup-fieldset { display: grid; gap: 12px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pickup-fieldset legend { padding: 0 8px; font-size: 15px; font-weight: 700; color: var(--brown); }
.field-hint { margin: 0; font-size: 13.5px; color: var(--brown); }
.field-hint:empty { display: none; }
.field-error { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--blush-text); }
#confirmation-view { display: grid; gap: 14px; text-align: center; }
.confirm-script { margin: 0; font-family: var(--font-script); font-size: 52px; line-height: 1; color: var(--brown); }
.confirm-note { margin: 0; color: var(--brown); }
.summary-line, .summary-total { display: flex; justify-content: space-between; gap: 12px; }
.summary-total { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; }
.summary-payment { margin: 10px 0 0; font-size: 13.5px; color: var(--brown); }
.confirm-title { margin: 0; font-family: var(--font-script); font-size: 44px; line-height: 1; color: var(--brown); }
.confirm-lines { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.confirm-subtotal { margin: 0; font-weight: 700; }
#confirm-back { margin-top: 6px; }
#submit-error { margin: 0; }
#fallback-email { margin-top: -8px; }

/* Demo banner (injected by app.js when config.demoMode) */
#demo-banner {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--brown);
  color: var(--cream);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* Responsive */
@media (max-width: 899px) {
  .hero { padding: 40px 0 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { width: min(440px, 100%); margin-inline: auto; }
}
@media (max-width: 860px) {
  .about-inner { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 779px) {
  .header-inner { gap: 10px; min-height: auto; }
  .brand .logo { width: 48px; height: 48px; }
  .brand-name { display: none; }
  .cart-button { margin-left: auto; }
  .cart-label { display: none; }
  .site-nav {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 18px;
    padding-bottom: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .section { padding: 56px 0; }
  .qr-card { padding: 36px 22px 32px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 480px) {
  .cart-drawer { width: 100%; }
}
@media (min-width: 480px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; translate: 0 16px; }
  .reveal:not(.item-card) { transition: opacity .5s ease-out var(--reveal-delay, 0ms), translate .5s ease-out var(--reveal-delay, 0ms); }
  .reveal.revealed { opacity: 1; translate: 0 0; }
}

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