/* ─────────────────────────────────────────────────────────────────────────
   Baked by Betsy — one ink, warm parchment, line-drawn bread.
   The whole palette is two browns + cream, with a single terracotta accent
   reserved only for "act now" moments (grab / reserve / the stamp).
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --cream:      #f4ecd8;
  --cream-deep: #ede2c8;
  --card:       #faf4e6;
  --ink:        #4a3826;   /* primary brown — text & lines            */
  --ink-soft:   #7a6549;   /* secondary ink — captions, faded loaves   */
  --ink-faint:  #c9b896;   /* hairlines, empty slots, sold-out ghosts  */
  --accent:     #b5542d;   /* terracotta — act now, only here          */
  --accent-deep:#933f1f;
  --shadow:     rgba(74, 56, 38, 0.14);

  --script: "Pinyon Script", cursive;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  background-color: var(--cream);
  /* faint paper grain, kept to a whisper so text stays crisp */
  background-image:
    radial-gradient(rgba(122, 101, 73, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(122, 101, 73, 0.04) 1px, transparent 1px);
  background-size: 22px 22px, 32px 32px;
  background-position: 0 0, 11px 16px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.wrap { max-width: 940px; margin: 0 auto; padding: 0 20px; }

/* ── type ─────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; }
.script { font-family: var(--script); font-weight: 400; }
.eyebrow {
  font-family: var(--body); text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 0.7rem; color: var(--ink-soft); font-weight: 600;
}
.muted { color: var(--ink-soft); }

/* ── the seal (re-lettered from one config line) ──────────────────────── */
.seal {
  width: var(--seal, 150px); height: var(--seal, 150px);
  border: 2px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; position: relative; color: var(--ink);
  background: radial-gradient(circle at 50% 40%, var(--card), var(--cream-deep));
}
.seal::before {
  content: ""; position: absolute; inset: 7px; border: 1px solid var(--ink);
  border-radius: 50%; opacity: 0.55;
}
.seal .seal-inner { text-align: center; width: 78%; }
.seal .seal-top {
  font-family: var(--display); font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; font-size: calc(var(--seal, 150px) * 0.12); line-height: 1;
}
.seal .seal-loaf { width: 46%; margin: 4px auto 2px; color: var(--ink); }
.seal .seal-bot { font-family: var(--script); font-size: calc(var(--seal,150px) * 0.16); margin-top: -2px; }
.seal .seal-wheat { position: absolute; bottom: 18%; width: 12%; color: var(--ink); opacity: 0.8; }
.seal .seal-wheat.l { left: 16%; transform: rotate(-18deg); }
.seal .seal-wheat.r { right: 16%; transform: rotate(18deg) scaleX(-1); }

/* ── top bar ──────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--ink-faint);
}
.topbar.shop { justify-content: center; }   /* the shop masthead reads as a centered sign */
.topbar .brand { font-family: var(--display); font-size: 1.4rem; letter-spacing: 0.04em; }
.topbar .brand b { font-weight: 700; }
.topbar a { color: var(--ink-soft); text-decoration: none; font-size: 0.85rem; letter-spacing: 0.04em; }
.topbar a:hover { color: var(--accent); }

/* ── hero ─────────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 40px 0 26px; }
.hero .seal { margin: 0 auto 18px; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 3.6rem); line-height: 1.04; }
.hero .script-name { font-family: var(--script); font-size: clamp(2.8rem, 9vw, 4.4rem); color: var(--ink); display: block; margin-top: -6px; }
.hero p { max-width: 30rem; margin: 12px auto 0; color: var(--ink-soft); }
/* Betsy's hello — a touch larger and warmer than a caption */
.hero .hero-voice { max-width: 33rem; font-size: 1.04rem; line-height: 1.6; color: var(--ink-soft); margin-top: 16px; }

/* the closed-banner when Betsy turns the oven off */
.closed-banner {
  text-align: center; background: var(--cream-deep); border: 1px dashed var(--accent);
  color: var(--accent-deep); border-radius: 12px; padding: 14px 18px; margin: 8px 0 0;
  font-family: var(--display); font-size: 1.2rem;
}

/* ── section headers w/ wheat divider ─────────────────────────────────── */
.section { padding: 34px 0 8px; }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.section-head h2 { font-size: 1.9rem; }
.section-head .sub { color: var(--ink-soft); font-size: 0.9rem; }
.wheat-rule { display: flex; align-items: center; gap: 6px; color: var(--ink-faint); margin: 10px 0 22px; }
.wheat-rule .line { flex: 1; height: 1px; background: var(--ink-faint); }
.wheat-rule svg { width: 16px; height: 22px; }

/* ── THE SHELF ────────────────────────────────────────────────────────── */
/* Loaves aren't products in boxes — they sit out on a little wooden ledge,
   right on the parchment. No cards, just bread on a shelf. */
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 30px 16px; }
.loaf-tile {
  background: transparent; border: none; border-radius: 0; overflow: visible;
  padding: 6px 8px 10px; text-align: center; position: relative;
  display: flex; flex-direction: column;
}
.loaf-tile .art { width: 84px; height: 84px; margin: 2px auto 0; color: var(--ink); transition: transform .16s ease; }

/* the wooden ledge each loaf rests on */
.loaf-tile .ledge {
  width: 84%; height: 11px; margin: -4px auto 12px; border-radius: 2px 2px 3px 3px;
  background:
    repeating-linear-gradient(90deg, rgba(74,56,38,0.06) 0 6px, transparent 6px 13px),
    linear-gradient(180deg, #cda372 0%, #b1834d 55%, #946d3c 100%);
  box-shadow: 0 7px 9px -5px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.28);
}
/* lift the loaf gently on hover, like picking it up off the shelf */
.loaf-tile:hover .loaf-photo, .loaf-tile:hover .art { transform: translateY(-4px); }

/* a real photo, framed like the wax seal: dark outer ring + a cream mat */
.loaf-tile .loaf-photo {
  position: relative; width: 112px; height: 112px; margin: 2px auto 0;
  border-radius: 50%; overflow: hidden;
  border: 2px solid var(--ink);
  background: radial-gradient(circle at 50% 40%, var(--card), var(--cream-deep));
  box-shadow: 0 6px 12px -4px var(--shadow);
  transition: transform .16s ease;
}
.loaf-tile .loaf-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
  /* a whisper of warmth so phone photos join the parchment world */
  filter: sepia(0.12) saturate(1.03) contrast(1.02) brightness(1.02);
}
.loaf-tile .loaf-photo::after {           /* inner hairline mat, echoing the seal */
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  border: 1.5px solid rgba(244, 236, 216, 0.85); pointer-events: none;
}
.loaf-tile .loaf-photo .art.under {       /* line drawing waiting behind the photo */
  position: absolute; inset: 0; width: auto; height: auto;
  display: grid; place-items: center; padding: 22px; margin: 0; color: var(--ink-soft);
}
.loaf-tile .loaf-photo .art.under svg { width: 100%; height: 100%; }
.loaf-tile.sold .loaf-photo img { filter: grayscale(0.5) brightness(1.05) opacity(0.7); }
.loaf-tile h3 { font-size: 1.15rem; line-height: 1.1; }
.loaf-tile .price { font-family: var(--display); font-weight: 700; color: var(--ink); margin: 2px 0; }
.loaf-tile .blurb { font-size: 0.78rem; color: var(--ink-soft); flex: 1; margin: 4px 0 10px; }
.loaf-tile .count { font-size: 0.74rem; letter-spacing: 0.04em; color: var(--ink-soft); margin-bottom: 10px; }
.loaf-tile .count b { color: var(--accent-deep); }

/* sold out: ghost the loaf, leave a gap on the shelf */
.loaf-tile.sold { opacity: 0.62; }
.loaf-tile.sold .art { color: var(--ink-faint); }
.loaf-tile.sold .blurb, .loaf-tile.sold .price { color: var(--ink-faint); }

/* the special wears a small terracotta tag instead of a card ribbon */
.special-flag {
  display: inline-block; margin: 0 auto 2px; align-self: center;
  font-family: var(--body); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-deep);
  border: 1px solid var(--accent); border-radius: 999px; padding: 2px 10px;
}
/* the monthly special(s) get a little gallery of their own */
.special-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.special-row .loaf-tile { width: 220px; }

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--body); font-weight: 600; font-size: 0.86rem; letter-spacing: 0.03em;
  border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  padding: 9px 18px; cursor: pointer; transition: all .14s ease;
}
.btn:hover { background: var(--ink); color: var(--cream); }
.btn.accent { border-color: var(--accent); color: var(--cream); background: var(--accent); }
.btn.accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ghost { border-color: var(--ink-faint); color: var(--ink-soft); }
.btn.sm { padding: 5px 12px; font-size: 0.78rem; }

/* ── THE OVEN ─────────────────────────────────────────────────────────── */
.oven {
  background: linear-gradient(180deg, var(--card), var(--cream-deep));
  border: 2px solid var(--ink); border-radius: 18px; padding: 6px; position: relative;
  box-shadow: inset 0 -30px 50px -30px rgba(181, 84, 45, 0.35); /* warmth at the base */
}
.oven-days { display: grid; gap: 0; }
.rack {
  display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 14px;
  padding: 16px 16px; border-bottom: 1px dashed var(--ink-faint);
}
.rack:last-child { border-bottom: none; }
.rack .when .day { font-family: var(--display); font-weight: 700; font-size: 1.15rem; line-height: 1; }
.rack .when .meta { font-size: 0.72rem; color: var(--ink-soft); margin-top: 3px; }
.rack .when .closed-tag { color: var(--accent-deep); font-weight: 600; }

/* the slots — little drawn loaves that appear as the oven fills */
.slots { display: flex; flex-wrap: wrap; gap: 7px; }
.slot {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  border: 1.5px dashed var(--ink-faint); color: var(--ink-faint);
}
.slot.filled { border-style: solid; border-color: var(--ink); color: var(--ink); background: rgba(74,56,38,0.05); }
.slot svg { width: 20px; height: 20px; }
.slot.pop { animation: pop .42s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes pop { 0% { transform: scale(0) rotate(-12deg); } 100% { transform: scale(1) rotate(0); } }

.rack .left-note { font-size: 0.78rem; color: var(--ink-soft); text-align: right; }
.rack .left-note b { font-family: var(--display); font-size: 1.5rem; color: var(--accent-deep); display: block; line-height: 1; }
.rack.full .left-note b { color: var(--ink-soft); }

/* ── about ────────────────────────────────────────────────────────────── */
.about { display: grid; grid-template-columns: 150px 1fr; gap: 26px; align-items: center; }
.about .portrait { color: var(--ink-soft); }
.about p { color: var(--ink-soft); }

/* ── footer ───────────────────────────────────────────────────────────── */
footer { text-align: center; padding: 40px 0 60px; color: var(--ink-soft); font-size: 0.85rem; }
footer a { color: var(--ink-soft); }
footer .social { display: flex; gap: 18px; justify-content: center; margin: 12px 0; }

/* ── modal + the STAMP ────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; background: rgba(40, 28, 16, 0.45); display: grid; place-items: center;
  z-index: 50; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.modal-back.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--card); border: 2px solid var(--ink); border-radius: 18px;
  padding: 26px; width: 100%; max-width: 380px; position: relative; transform: translateY(8px);
  transition: transform .2s ease;
}
.modal-back.show .modal { transform: translateY(0); }
.modal h3 { font-size: 1.5rem; margin-bottom: 2px; }
.modal label { display: block; font-size: 0.74rem; letter-spacing: 0.04em; color: var(--ink-soft); margin: 12px 0 4px; text-transform: uppercase; }
.modal input, .modal select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--ink-faint); border-radius: 10px;
  background: var(--cream); font-family: var(--body); font-size: 0.95rem; color: var(--ink);
}
.modal input:focus, .modal select:focus { outline: none; border-color: var(--accent); }
.modal .row { display: flex; gap: 10px; margin-top: 20px; }
.modal .row .btn { flex: 1; }
.warn { background: #f6e7d6; border: 1px solid var(--accent); color: var(--accent-deep); border-radius: 8px; padding: 8px 10px; font-size: 0.78rem; margin-top: 12px; }

/* the vintage stamp that thunks down on success */
.stamp {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.stamp .mark {
  border: 4px double var(--accent); color: var(--accent); border-radius: 50%;
  width: 150px; height: 150px; display: grid; place-items: center; text-align: center;
  font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 1.1rem; transform: scale(2.4) rotate(-16deg); opacity: 0;
  background: rgba(244, 236, 216, 0.35);
}
.stamp.go .mark { animation: thunk .5s cubic-bezier(.2,1.3,.3,1) forwards; }
@keyframes thunk {
  0% { transform: scale(2.4) rotate(-16deg); opacity: 0; }
  60% { transform: scale(0.92) rotate(-12deg); opacity: 1; }
  100% { transform: scale(1) rotate(-12deg); opacity: 1; }
}

/* ── loaf photo medallion: tappable, with a little "view" badge ─────────── */
.loaf-photo.has-photos { cursor: pointer; }
.loaf-photo .photo-badge {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  background: rgba(74, 56, 38, 0.82); color: var(--cream);
  font-size: 0.56rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  opacity: 0; transition: opacity .16s ease; pointer-events: none;
}
.loaf-tile:hover .loaf-photo .photo-badge { opacity: 1; }

/* a touch of organic life: loaves sit a hair off-true, like hand-placed */
.shelf-grid .loaf-tile:nth-child(3n+1) .loaf-photo,
.shelf-grid .loaf-tile:nth-child(3n+1) .art { transform: rotate(-1.4deg); }
.shelf-grid .loaf-tile:nth-child(3n+2) .loaf-photo,
.shelf-grid .loaf-tile:nth-child(3n+2) .art { transform: rotate(1.1deg); }
.shelf-grid .loaf-tile:nth-child(3n) .loaf-photo,
.shelf-grid .loaf-tile:nth-child(3n) .art { transform: rotate(-0.5deg); }
.shelf-grid .loaf-tile:hover .loaf-photo,
.shelf-grid .loaf-tile:hover .art { transform: translateY(-4px) rotate(0deg); }

/* ── the photo gallery overlay ─────────────────────────────────────────── */
.gallery-back {
  position: fixed; inset: 0; z-index: 70; padding: 18px;
  background: rgba(40, 28, 16, 0.74); display: none; place-items: center;
  opacity: 0; transition: opacity .2s ease;
}
.gallery-back.show { display: grid; opacity: 1; }
.gallery {
  background: var(--card); border: 2px solid var(--ink); border-radius: 18px;
  padding: 16px; width: min(560px, 94vw); position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.gallery .g-close {
  position: absolute; top: 8px; right: 12px; z-index: 2;
  background: none; border: none; font-size: 1.8rem; line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.g-stage {
  position: relative; aspect-ratio: 1 / 1; width: 100%; max-height: 64vh;
  border-radius: 14px; overflow: hidden; background: var(--cream-deep);
  display: grid; place-items: center;
}
.g-stage img { width: 100%; height: 100%; object-fit: cover; display: block;
  filter: sepia(0.1) saturate(1.03) contrast(1.02); }
.g-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(244, 236, 216, 0.85); color: var(--ink); font-size: 1.5rem; line-height: 1;
  box-shadow: 0 2px 8px var(--shadow);
}
.g-nav.prev { left: 10px; } .g-nav.next { right: 10px; }
.g-dots { display: flex; justify-content: center; gap: 7px; margin: 12px 0 4px; }
.g-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); cursor: pointer; }
.g-dots span.on { background: var(--accent); }
.g-info { display: flex; align-items: center; gap: 14px; padding: 8px 4px 4px; }
.g-info .g-art { width: 54px; height: 54px; flex: none; color: var(--ink); }
.g-info h3 { font-size: 1.3rem; }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .rack { grid-template-columns: 1fr; gap: 8px; }
  .rack .left-note { text-align: left; }
  .rack .left-note b { display: inline; font-size: 1.1rem; }
  .about { grid-template-columns: 1fr; text-align: center; }
  .about .portrait { width: 120px; margin: 0 auto; }
}
