/* ==========================================================================
   Knead It! Bakery — one-page site
   Palette sampled from the logo. Type: Baloo 2 (display) / Nunito (body) /
   Caveat (handwritten accents).
   ========================================================================== */

:root {
  --paper: #FBF4E6;        /* warm flour */
  --paper-deep: #F4E3C8;   /* butter-pastry tint for alternating sections */
  --crust: #9B5C33;        /* brand brown, sampled from the logo */
  --crust-deep: #7A4523;
  --cocoa: #432B18;        /* body text */
  --butter: #F3C15F;       /* accent, used sparingly */
  --line: rgba(155, 92, 51, 0.28);
  --card: #FFFDF7;
  --radius: 22px;
  --shadow: 0 10px 24px -14px rgba(67, 43, 24, 0.35);
  --font-display: "Baloo 2", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  color: var(--crust-deep);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }

p { margin: 0 0 1em; }

a { color: var(--crust); }
a:hover { color: var(--crust-deep); }

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

/* Focus: chunky, warm, obvious */
:focus-visible {
  outline: 3px solid var(--crust);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--crust);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 0 0 12px 12px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ============ Buttons ============ */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--paper);
  background: var(--crust);
  border: none;
  border-radius: 999px;
  padding: 0.7em 1.6em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--crust-deep);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover, .btn:focus-visible {
  color: var(--paper);
  background: var(--crust-deep);
  transform: translateY(-2px) rotate(-0.5deg);
  box-shadow: 0 5px 0 var(--crust-deep);
}
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--crust-deep); }

.btn-ghost {
  background: transparent;
  color: var(--crust);
  box-shadow: inset 0 0 0 2.5px var(--crust);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--paper-deep);
  color: var(--crust-deep);
  box-shadow: inset 0 0 0 2.5px var(--crust-deep);
}

.btn-small { font-size: 0.95rem; padding: 0.45em 1.1em; }
.btn-big { font-size: 1.2rem; padding: 0.8em 2em; }

/* ============ Top bar ============ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px dashed var(--line);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--crust-deep);
}
.topbar-brand img { width: 44px; height: auto; }

.topbar nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.5vw, 1.6rem);
}
.topbar nav > a:not(.btn) {
  font-weight: 800;
  text-decoration: none;
  color: var(--cocoa);
}
.topbar nav > a:not(.btn):hover { color: var(--crust); }

/* ============ Hero ============ */

.hero {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) 1.25rem 3rem;
  text-align: center;
}

.hero-logo {
  width: clamp(220px, 40vw, 360px);
  margin: 0 auto 1.5rem;
  animation: settle 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes settle {
  from { opacity: 0; transform: translateY(14px) rotate(-3deg) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.hero-sub {
  font-size: 1.2rem;
  max-width: 34em;
  margin: 0 auto 1.6rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.hero-note {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--crust);
  margin: 0;
}

/* ============ Icing squiggle dividers (signature) ============ */

.squiggle {
  color: var(--crust);
  opacity: 0.85;
  line-height: 0;
}
.squiggle svg { width: 100%; height: 26px; display: block; }
.squiggle-butter { color: var(--butter); opacity: 1; }

/* ============ Sections ============ */

section { padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 3rem); }

.section-tint { background: var(--paper-deep); }

/* ============ About ============ */

.about-grid {
  max-width: 62rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow-hand {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  color: var(--crust);
  transform: rotate(-1.5deg);
  margin-bottom: 0.2em;
}

.about-text p { max-width: 36em; }

/* Taped polaroid */
.polaroid {
  margin: 0;
  background: var(--card);
  padding: 14px 14px 10px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  position: relative;
  transition: transform 0.25s ease;
}
.polaroid:hover { transform: rotate(0.5deg) scale(1.015); }
.polaroid::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 30px;
  transform: translateX(-50%) rotate(-2deg);
  background: color-mix(in srgb, var(--butter) 55%, transparent);
  border-left: 1px dashed rgba(67, 43, 24, 0.2);
  border-right: 1px dashed rgba(67, 43, 24, 0.2);
}
.polaroid img { border-radius: 3px; }
.polaroid figcaption {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  text-align: center;
  color: var(--cocoa);
  padding: 0.5rem 0 0.3rem;
}

/* ============ Menu ============ */

.menu { max-width: 68rem; margin: 0 auto; text-align: center; }

.menu-note { max-width: 42em; margin: 0 auto 2.2rem; }

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(1rem, 3vw, 1.8rem);
  text-align: left;
}

.photo-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 12px 1.2rem;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.25s ease;
}
.photo-card:nth-child(odd) { transform: rotate(-0.7deg); }
.photo-card:nth-child(even) { transform: rotate(0.6deg); }
.photo-card:hover { transform: rotate(0deg) translateY(-4px); }

/* tape strip on each card */
.photo-card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 84px;
  height: 22px;
  transform: translateX(-50%) rotate(-2deg);
  background: color-mix(in srgb, var(--butter) 50%, transparent);
  border-left: 1px dashed rgba(67, 43, 24, 0.18);
  border-right: 1px dashed rgba(67, 43, 24, 0.18);
}
.photo-card:nth-child(even)::before { transform: translateX(-50%) rotate(2.5deg); }

.photo-card img {
  border-radius: calc(var(--radius) - 8px);
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #fff;
}

.photo-card h3 { margin: 0.8rem 0.4rem 0.2rem; }
.photo-card p { margin: 0 0.4rem; font-size: 0.98rem; }

/* selects match the text inputs */
.field select {
  width: 100%;
  font: inherit;
  color: var(--cocoa);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.65em 0.9em;
  transition: border-color 0.15s ease;
  cursor: pointer;
}
.field select:hover { border-color: var(--crust); }
.field select:focus-visible {
  outline: 3px solid var(--crust);
  outline-offset: 1px;
  border-color: var(--crust);
}

/* ============ Order form ============ */

.order { max-width: 44rem; margin: 0 auto; }
.order h2, .order-note { text-align: center; }
.order-note { max-width: 38em; margin-left: auto; margin-right: auto; margin-bottom: 2rem; }

.order form {
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2.2rem);
  box-shadow: var(--shadow);
}

.field { margin-bottom: 1.2rem; }
.field label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--crust-deep);
}
.req { color: var(--crust); }
.opt { font-family: var(--font-body); font-weight: 400; font-size: 0.9em; color: rgba(67, 43, 24, 0.65); }

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--cocoa);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.65em 0.9em;
  transition: border-color 0.15s ease;
}
.field input:hover, .field textarea:hover { border-color: var(--crust); }
.field input:focus-visible, .field textarea:focus-visible {
  outline: 3px solid var(--crust);
  outline-offset: 1px;
  border-color: var(--crust);
}
.field textarea { resize: vertical; min-height: 7em; }
.field ::placeholder { color: rgba(67, 43, 24, 0.45); opacity: 1; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* honeypot: visually gone, still in the DOM for bots */
.visually-hidden-trap {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-error {
  background: #FBE3D6;
  border: 2px dashed var(--crust);
  border-radius: 14px;
  padding: 0.8em 1em;
  font-weight: 600;
}

.order-fineprint {
  font-size: 0.9rem;
  color: rgba(67, 43, 24, 0.65);
  margin: 0.9rem 0 0;
}

/* thank-you panel (revealed after AJAX submit) */
.order-thanks {
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  box-shadow: var(--shadow);
  text-align: center;
}
.order-thanks img { margin: 0 auto 0.8rem; width: 120px; }
.order-thanks h3 { font-size: 1.7rem; }
.thanks-signoff {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--crust);
  margin: 0;
}

/* ============ Footer ============ */

.footer {
  background: var(--cocoa);
  color: var(--paper);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 3rem) 1.5rem;
}
.footer a { color: var(--butter); }
.footer h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  color: var(--butter);
}

.footer-grid {
  max-width: 62rem;
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: auto 1fr 1.4fr;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: start;
}

.footer-logo {
  width: 90px;
  /* the logo is drawn in brand brown; lift it lighter for the dark footer */
  filter: brightness(2.1) saturate(0.75);
}
.footer-tag {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  margin: 0.6rem 0 0;
  color: var(--butter);
}

.footer-contact p { margin: 0 0 0.4rem; }

/* Instagram button: the glyph in brand brown on a paper chip
   (.footer prefix so it beats the generic .footer a link color) */
.footer .insta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-top: 0.35rem;
  background: var(--paper);
  color: var(--crust);
  border-radius: 14px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.footer .insta-btn:hover, .footer .insta-btn:focus-visible {
  color: var(--crust-deep);
  background: var(--butter);
  transform: translateY(-2px) rotate(-2deg);
}

.ph-flag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--butter);
  color: var(--cocoa);
  border-radius: 6px;
  padding: 0.1em 0.5em;
  margin-left: 0.4em;
  vertical-align: middle;
}

.legal-note {
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(251, 244, 230, 0.8);
  margin: 0;
}

.footer-fine {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(251, 244, 230, 0.65);
  margin: 0;
  padding-top: 1.2rem;
  border-top: 1px dashed rgba(251, 244, 230, 0.25);
}

/* ============ Responsive ============ */

@media (max-width: 760px) {
  .topbar nav > a:not(.btn) { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .polaroid { max-width: 420px; margin: 0.5rem auto 0; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============ Reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-logo { animation: none; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ============ Shop ============ */

.shop { max-width: 68rem; margin: 0 auto; text-align: center; }
.shop-note { max-width: 42em; margin: 0 auto 2.2rem; }
.shop-grid { text-align: left; }

.product-card { display: flex; flex-direction: column; }
.product-price {
  margin: 0.1rem 0.4rem 0.6rem;
  font-size: 1.05rem;
}
.product-price strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--crust-deep);
}
.product-price .unit { color: rgba(67, 43, 24, 0.7); font-size: 0.92rem; }

.product-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.4rem;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.25rem;
}
.qty button {
  font: inherit;
  font-weight: 800;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--crust);
  cursor: pointer;
}
.qty button:hover { background: var(--paper-deep); }
.qty-num {
  min-width: 1.3rem;
  text-align: center;
  font-weight: 800;
}

/* ============ Cart button ============ */

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--crust-deep);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.cart-btn:hover { background: var(--butter); transform: translateY(-1px); }
.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--crust);
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2em;
}

/* ============ Cart drawer ============ */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(67, 43, 24, 0.35);
  z-index: 90;
}
/* the hidden attribute must win over display:flex below */
.cart-drawer[hidden], .cart-overlay[hidden] { display: none; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(24rem, 92vw);
  background: var(--paper);
  border-left: 3px dashed var(--line);
  z-index: 95;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.2rem 1.4rem;
  overflow-y: auto;
  box-shadow: -12px 0 30px -18px rgba(67, 43, 24, 0.5);
}
.cart-open-body { overflow: hidden; }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.cart-head h3 { margin: 0; font-size: 1.5rem; }
.cart-close {
  font: inherit;
  font-weight: 800;
  border: none;
  background: var(--paper-deep);
  color: var(--crust-deep);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
}
.cart-close:hover { background: var(--butter); }

.cart-items { list-style: none; margin: 0; padding: 0; }
.cart-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0;
  border-bottom: 1.5px dashed var(--line);
}
.cart-item-info { display: flex; flex-direction: column; min-width: 0; }
.cart-item-name { font-weight: 800; font-size: 0.95rem; line-height: 1.25; }
.cart-item-unit { font-size: 0.8rem; color: rgba(67, 43, 24, 0.7); }
.cart-item-line { font-weight: 800; min-width: 2.6rem; text-align: right; }
.cart-remove {
  font: inherit;
  border: none;
  background: transparent;
  color: var(--crust);
  cursor: pointer;
  font-weight: 800;
  padding: 0.2rem;
}
.cart-remove:hover { color: var(--crust-deep); }

.cart-empty { color: rgba(67, 43, 24, 0.7); }

.cart-foot { margin-top: auto; padding-top: 1rem; }
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--crust-deep);
  margin-bottom: 0.3rem;
}
.cart-pickup-note {
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: var(--crust);
  margin-bottom: 0.9rem;
}
.cart-checkout { width: 100%; }
.cart-fallback {
  margin-top: 0.9rem;
  background: rgba(243, 193, 95, 0.25);
  border: 2px dashed var(--butter);
  border-radius: 12px;
  padding: 0.7em 0.9em;
  font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) {
  .cart-drawer { transition: none; }
}

/* flows naturally for any number of products */
.shop-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
@media (max-width: 560px) { .shop-grid { grid-template-columns: minmax(0, 1fr); } }

/* product blurb on each shop card */
.product-desc {
  margin: 0 0.4rem 0.5rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(67, 43, 24, 0.85);
}

/* ingredient list, greatest to least amount used — collapsed by default,
   click/tap "Ingredients" to expand — sits between the blurb and the price */
.product-ingredients {
  margin: 0 0.4rem 0.6rem;
  font-size: 0.82rem;
}
.product-ingredients summary {
  cursor: pointer;
  list-style: none;
  color: var(--crust-deep);
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  user-select: none;
}
.product-ingredients summary::-webkit-details-marker { display: none; }
.product-ingredients summary::before {
  content: "▸";
  display: inline-block;
  font-size: 0.72rem;
  transition: transform 0.15s ease;
}
.product-ingredients[open] summary::before { transform: rotate(90deg); }
.product-ingredients summary:hover,
.product-ingredients summary:focus-visible { color: var(--crust); }
.product-ingredients p {
  margin: 0.35rem 0 0;
  line-height: 1.45;
  color: rgba(67, 43, 24, 0.7);
}

/* helper text under a form field */
.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(67, 43, 24, 0.7);
}
