:root {
  --cocoa: #35170f;
  --crust: #733925;
  --rust: #9c4a26;
  --paper: #fffaf0;
  --honey: #f3c58f;
  --leaf: #2f6b43;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cocoa); color: var(--paper); font: 17px/1.5 Karla, system-ui, sans-serif; }
h1, h2, h3, .brand { font-family: "Young Serif", Georgia, serif; font-weight: 400; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

.top { position: fixed; inset: 0 0 auto; z-index: 5; height: 56px; display: flex; justify-content: space-between; align-items: center; padding: 0 5vw; background: var(--crust); }
.brand { font-size: 1.2rem; }
.brand em { font: 1.3rem Caveat, cursive; color: var(--honey); }

/* Opening */
#story { height: 320vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#cake { position: absolute; inset: 0; width: 100%; height: 100%; }
.words { position: absolute; left: 5vw; top: calc(50% + 28px); translate: 0 -50%; width: 46vw; }
h1 { margin: 0; font-size: clamp(2.2rem, min(4.4vw, 7.5vh), 4.4rem); line-height: 1.08; }
.line { font-size: 1.15rem; margin: 12px 0; }
.note { margin: 12px 0 0; font: 1.7rem Caveat, cursive; color: var(--honey); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.cta, .ghost { padding: 12px 22px; border-radius: 40px; font-weight: 700; text-decoration: none; }
.cta { background: var(--honey); color: var(--cocoa); }
.cta.small { padding: 6px 16px; font-size: .95rem; }
.ghost { border: 1.5px solid #fffaf099; }
#peek { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 620px; }
#peek a { text-decoration: none; text-align: center; font-size: .95rem; }
#peek img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; margin-bottom: 6px; border: 3px solid var(--paper); border-radius: 50% 50% 10px 10px; }
@media (max-width: 760px) {
  .words { left: 0; right: 0; width: auto; top: auto; bottom: 0; translate: none; padding: 90px 6vw 3vh; background: linear-gradient(transparent, #1d0b06e6 45%); }
  #peek { display: none; }
  .actions { gap: 8px; }
  .cta, .ghost { padding: 10px 16px; }
  .cta.small { padding: 6px 14px; }
}

/* Catalogue */
main { padding: 80px 4vw 130px; text-align: center; scroll-margin-top: 0; }
.hand { margin: 0; font: 1.8rem Caveat, cursive; color: var(--honey); }
main h2 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); }
#circles { display: flex; gap: 16px; overflow-x: auto; padding: 22px 0 14px; justify-content: safe center; }
#circles button { flex: none; width: 92px; padding: 0; border: 0; background: none; color: inherit; font-size: .85rem; line-height: 1.25; }
#circles img { display: block; width: 84px; height: 84px; margin: 0 auto 8px; object-fit: cover; border: 3px solid #fffaf066; border-radius: 50%; }
#circles button:hover img { border-color: var(--honey); }
#toolbar { position: sticky; top: 56px; z-index: 4; padding: 12px 0; background: var(--cocoa); }
#search { width: min(520px, 100%); padding: 11px 18px; border: 0; border-radius: 30px; }
#groups { display: flex; gap: 8px; overflow-x: auto; justify-content: safe center; margin-top: 10px; }
#groups button { flex: none; padding: 5px 14px; border: 1px solid #fffaf055; border-radius: 30px; background: none; color: inherit; font-size: .9rem; }
#groups button[aria-pressed="true"] { background: var(--paper); color: var(--cocoa); font-weight: 700; }
.disclaimer { font-size: .85rem; opacity: .75; }
#catalogue { max-width: 1160px; margin: auto; text-align: left; }
.category { scroll-margin-top: 170px; }
.category h3 { margin: 30px 0 4px; font-size: 1.6rem; color: var(--honey); }
.category .hint { margin: 0; font-size: .9rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-top: 12px; }
.product { display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; background: var(--paper); color: var(--cocoa); }
.product[hidden], .category[hidden] { display: none; }
.photo { position: relative; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.tag { position: absolute; left: 8px; bottom: 8px; padding: 1px 8px; border-radius: 20px; background: #1d0b06b3; color: #fff; font-size: .72rem; }
.info { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 12px; }
.info h4 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.sizes button { padding: 3px 10px; border: 1.5px solid #9c4a2666; border-radius: 20px; background: none; color: inherit; font-size: .85rem; }
.sizes button[aria-pressed="true"] { border-color: var(--rust); background: var(--rust); color: var(--paper); }
.buy { display: flex; justify-content: space-between; align-items: center; }
.cost { font-size: 1.15rem; }
.add { padding: 7px 18px; border: 0; border-radius: 8px; background: var(--cocoa); color: var(--paper); font-weight: 700; }
.add.done { background: var(--leaf); }
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .info { padding: 9px; }
  .info h4 { font-size: .92rem; }
  .buy { flex-direction: column; align-items: stretch; gap: 6px; }
}
footer { margin-top: 50px; }

/* Order box */
#bar { position: fixed; z-index: 6; left: 12px; right: 12px; bottom: 12px; max-width: 520px; margin: auto; padding: 14px; border: 0; border-radius: 10px; background: var(--leaf); color: var(--paper); font-weight: 700; box-shadow: 0 8px 22px #0008; }
#bar[hidden] { display: none; }
dialog { width: min(480px, 94vw); max-height: 90vh; padding: 22px; border: 0; border-radius: 10px; background: var(--paper); color: var(--cocoa); }
dialog::backdrop { background: #1d0b06cc; }
dialog h2 { margin: 0 0 10px; }
#lines { list-style: none; margin: 0; padding: 0; }
#lines li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 10px 0; border-bottom: 1px dashed #35170f44; }
#lines .name { flex: 1 1 100%; font-weight: 700; }
.qty { display: flex; align-items: center; gap: 10px; }
.qty button { width: 34px; height: 34px; border: 0; border-radius: 6px; background: var(--rust); color: var(--paper); }
.total { display: flex; justify-content: space-between; font-size: 1.2rem; }
label { display: block; margin-bottom: 10px; font-size: .9rem; }
input, textarea, select { font: inherit; color: inherit; padding: 7px; border: 1px solid #35170f55; border-radius: 6px; background: #fff; }
label input, textarea { display: block; width: 100%; margin-top: 3px; }
#send, #more { display: block; width: 100%; margin-top: 8px; padding: 13px; border-radius: 8px; text-align: center; font-weight: 700; }
#send { background: var(--leaf); color: var(--paper); text-decoration: none; }
#more { border: 1.5px solid var(--cocoa); background: none; color: var(--cocoa); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #story { height: 100vh; }
  .note { display: none; }
}
