Skip to content
VibeCodeBench
Back to the app

The code

Build-a-Box Bakery by Claude Fable 5.1

Exactly as the AI wrote it. Shown as text, so nothing runs on this page.

Try 1 · index.html

worksshown57.3 KB · 922 lines · no libraries
Download
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>Hollow Oak Bakehouse</title>
<meta name="description" content="A neighbourhood bakery on Alder Street. Build your own pastry box.">
<style>
:root{
  --cream:#fbf3e4;--paper:#f4e6cf;--ink:#3b2a1e;--ink-2:#6b5443;--terra:#c8553d;--terra-d:#a8432e;
  --green:#3f5d4a;--green-l:#dfe9d6;--gold:#e9a74a;--kraft:#d9b283;--kraft-d:#b78a5a;--white:#fffaf0;
  --shadow:0 10px 30px rgba(59,42,30,.12);--radius:18px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--ink);background:var(--cream);line-height:1.5;-webkit-tap-highlight-color:transparent;overflow-x:hidden}
h1,h2,h3{font-family:Georgia,"Times New Roman",serif;font-weight:600;line-height:1.15;margin:0;letter-spacing:-.01em}
p{margin:0}
.wrap{width:min(1100px,100% - 32px);margin-inline:auto}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
section{padding:56px 0}
.eyebrow{display:inline-block;font-size:.8rem;letter-spacing:.14em;text-transform:uppercase;color:var(--terra);font-weight:700;margin-bottom:8px}
h2{font-size:clamp(1.7rem,3.6vw,2.4rem);margin-bottom:8px}
.lead{color:var(--ink-2);max-width:60ch}

/* buttons */
.btn{min-height:44px;min-width:44px;padding:10px 18px;border-radius:999px;border:2px solid var(--ink);background:var(--white);font:inherit;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;color:var(--ink);box-shadow:3px 3px 0 var(--ink);transition:transform .15s,box-shadow .15s,background .2s;text-decoration:none;user-select:none;touch-action:manipulation}
.btn:active{transform:translate(2px,2px);box-shadow:1px 1px 0 var(--ink)}
.btn.primary{background:var(--terra);color:#fff}
.btn.ghost{box-shadow:none;background:transparent}
.btn.icon{padding:0;width:44px;height:44px;border-radius:50%}
.btn[disabled]{opacity:.45;cursor:not-allowed;box-shadow:none;transform:none}
.btn:focus-visible,.pastry:focus-visible,.chip:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.btn svg{width:22px;height:22px}

/* header */
.top{position:sticky;top:0;z-index:20;background:rgba(251,243,228,.92);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:2px solid var(--ink)}
.top .wrap{display:flex;align-items:center;gap:14px;min-height:64px}
.brand{display:flex;align-items:center;gap:10px;font-family:Georgia,serif;font-weight:700;font-size:1.15rem;text-decoration:none;color:var(--ink);min-height:44px}
.brand svg{width:34px;height:34px}
.nav{display:flex;gap:4px;margin-left:auto}
.nav a{color:var(--ink);text-decoration:none;font-weight:600;padding:10px 12px;border-radius:10px;min-height:44px;display:inline-flex;align-items:center}
.nav a:active{background:var(--paper)}
.top .tools{display:flex;gap:8px;align-items:center;margin-left:auto}
.nav + .tools{margin-left:0}
@media(max-width:760px){.nav{display:none}}

/* hero */
.hero{padding:40px 0 30px;overflow:hidden}
.hero .wrap{display:grid;grid-template-columns:1.05fr 1fr;gap:32px;align-items:center}
.hero h1{font-size:clamp(2.3rem,6vw,4rem);line-height:1.02}
.hero h1 em{font-style:italic;color:var(--terra)}
.hero .story{margin:18px 0 22px;color:var(--ink-2);max-width:52ch}
.hero .cta{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.shop-wrap{position:relative}
.shop{width:100%;height:auto;display:block}
.shop text{user-select:none}
@media(max-width:860px){.hero .wrap{grid-template-columns:1fr}.shop-wrap{order:-1;max-width:520px;margin:0 auto}}

/* badge */
.badge{display:inline-flex;align-items:center;gap:8px;border-radius:999px;padding:6px 14px;font-weight:700;font-size:.9rem;border:2px solid var(--ink);background:var(--white);min-height:36px}
.badge .dot{width:10px;height:10px;border-radius:50%;background:#999;flex:none}
.badge.open{background:var(--green-l);color:var(--green)}
.badge.open .dot{background:#3f9a5a;animation:pulse 1.6s ease-in-out infinite}
.badge.closed{background:#f3dcd6;color:var(--terra-d)}
.badge.closed .dot{background:var(--terra)}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(63,154,90,.5)}60%{box-shadow:0 0 0 7px rgba(63,154,90,0)}}

/* today's bakes */
.bakes{background:var(--paper);border-top:2px solid var(--ink);border-bottom:2px solid var(--ink)}
.bake-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:16px;margin-top:24px}
.bake{background:var(--white);border:2px solid var(--ink);border-radius:16px;padding:14px;box-shadow:3px 3px 0 var(--ink);display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;transform:rotate(var(--tilt,0deg))}
.bake svg{width:96px;height:96px}
.bake h3{font-size:1.05rem}
.bake p{font-size:.85rem;color:var(--ink-2)}
.pill{display:inline-block;font-size:.72rem;font-weight:700;letter-spacing:.04em;background:var(--green);color:#fff;border-radius:999px;padding:3px 10px;margin-top:4px}

/* builder */
.builder{display:grid;grid-template-columns:1fr 420px;gap:28px;align-items:start;margin-top:24px}
.controls{display:flex;flex-direction:column;gap:14px;margin-bottom:18px}
.ctl-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.ctl-row .lbl{font-weight:700;min-width:84px}
.seg{display:inline-flex;border:2px solid var(--ink);border-radius:999px;overflow:hidden;background:var(--white);box-shadow:3px 3px 0 var(--ink)}
.seg button{font:inherit;font-weight:700;border:0;background:transparent;color:var(--ink);min-height:44px;min-width:56px;padding:0 16px;cursor:pointer;touch-action:manipulation}
.seg button + button{border-left:2px solid var(--ink)}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--cream)}
.chip{font:inherit;font-weight:700;border:2px solid var(--ink);background:var(--white);color:var(--ink);border-radius:999px;min-height:44px;padding:0 16px;cursor:pointer;display:inline-flex;align-items:center;gap:8px;touch-action:manipulation}
.chip .sw{width:16px;height:16px;border-radius:50%;border:2px solid var(--ink);background:transparent;flex:none}
.chip[aria-pressed="true"]{background:var(--green);color:#fff;border-color:var(--ink)}
.chip[aria-pressed="true"] .sw{background:#fff;border-color:#fff}
.legend{font-size:.8rem;color:var(--ink-2)}
.legend b{display:inline-block;border:1.5px solid var(--ink-2);border-radius:5px;padding:0 5px;font-size:.7rem;margin-right:2px}

.pastry-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:14px}
.pastry{background:var(--white);border:2px solid var(--ink);border-radius:16px;padding:10px 8px 12px;display:flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer;box-shadow:3px 3px 0 var(--ink);transform:rotate(var(--tilt));transition:transform .2s,opacity .25s,box-shadow .2s,filter .25s;font:inherit;color:inherit;text-align:center;touch-action:manipulation;position:relative}
.pastry:active{transform:rotate(var(--tilt)) scale(.94);box-shadow:1px 1px 0 var(--ink)}
.pastry svg{width:84px;height:84px}
.pastry .p-name{font-weight:700;font-size:.9rem;line-height:1.2}
.pastry .p-meta{display:flex;align-items:center;gap:6px;font-size:.85rem;color:var(--ink-2);flex-wrap:wrap;justify-content:center}
.pastry .price{font-weight:700;color:var(--terra-d)}
.tag{display:inline-block;border:1.5px solid var(--ink-2);border-radius:5px;padding:0 4px;font-size:.65rem;font-weight:800;line-height:1.4;color:var(--ink-2)}
.tag.v{color:#2f6b3f;border-color:#2f6b3f}.tag.nf{color:#8a5a12;border-color:#8a5a12}.tag.gf{color:#5a4a9a;border-color:#5a4a9a}
.pastry.dim{opacity:.32;filter:grayscale(.7);box-shadow:none}
.pastry .plus{position:absolute;top:6px;right:6px;width:22px;height:22px;border-radius:50%;background:var(--terra);color:#fff;font-weight:800;display:flex;align-items:center;justify-content:center;font-size:16px;line-height:1}
.pastry.dim .plus{background:#999}
.shake{animation:shake .4s}
@keyframes shake{0%,100%{transform:translateX(0) rotate(var(--tilt,0deg))}25%{transform:translateX(-6px) rotate(var(--tilt,0deg))}75%{transform:translateX(6px) rotate(var(--tilt,0deg))}}

.box-panel{background:var(--white);border:2px solid var(--ink);border-radius:var(--radius);box-shadow:4px 4px 0 var(--ink);padding:16px;position:sticky;top:80px}
.box-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:8px}
.box-head h3{font-size:1.15rem}
.count{font-weight:700;color:var(--ink-2);font-size:.9rem}
#boxSvg{width:100%;max-width:460px;height:auto;display:block;margin:0 auto;touch-action:manipulation}
.box-item{cursor:pointer}
.box-item:focus{outline:none}
.box-item:focus-visible .anim{filter:drop-shadow(0 0 4px var(--gold))}
.box-item .anim{transform-box:fill-box;transform-origin:center;animation:drop .6s cubic-bezier(.3,.9,.4,1.1) both}
.box-item.settle .anim{animation:none}
.box-item .anim.out{animation:popout .25s ease-in forwards}
@keyframes drop{0%{transform:translateY(-70px) scale(1.25);opacity:0}55%{transform:translateY(8px) scale(.92);opacity:1}76%{transform:translateY(-6px) scale(1.04)}100%{transform:translateY(0) scale(1)}}
@keyframes popout{to{transform:scale(0) rotate(25deg);opacity:0}}
.box-foot{margin-top:12px;display:flex;flex-direction:column;gap:10px}
.msg{min-height:22px;font-size:.9rem;color:var(--ink-2)}
.total-row{display:flex;justify-content:space-between;align-items:center;font-size:1.1rem}
.total-row strong{font-size:1.5rem;font-family:Georgia,serif}
.box-btns{display:flex;gap:10px}
.box-btns .btn{flex:1}
@media(max-width:880px){
  .builder{grid-template-columns:1fr;padding-bottom:70px}
  .box-panel{order:-1;position:static}
}

/* hours */
.hours{background:var(--paper);border-top:2px solid var(--ink);border-bottom:2px solid var(--ink)}
.hours .wrap{display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:start}
.hours table{width:100%;border-collapse:collapse;background:var(--white);border:2px solid var(--ink);border-radius:14px;overflow:hidden;box-shadow:3px 3px 0 var(--ink)}
.hours td{padding:10px 14px;border-bottom:1px solid #e6d6bb}
.hours tr:last-child td{border-bottom:0}
.hours td:last-child{text-align:right;font-weight:600}
.hours tr.today td{background:var(--green-l);font-weight:800}
.hours tr.today td:first-child::after{content:" (today)";font-weight:600;color:var(--green);font-size:.8rem}
.clock{font-size:.9rem;color:var(--ink-2);margin-top:10px}
@media(max-width:760px){.hours .wrap{grid-template-columns:1fr}}

/* footer */
footer{padding:36px 0 110px;color:var(--ink-2);font-size:.92rem}
footer .wrap{display:flex;flex-wrap:wrap;gap:18px 40px;justify-content:space-between;align-items:flex-start}
footer a{color:var(--ink);font-weight:600;text-decoration:none;display:inline-block;padding:8px 0;min-height:44px}
footer .col{display:flex;flex-direction:column}
@media(min-width:881px){footer{padding-bottom:40px}}

/* mini bar */
.minibar{position:fixed;left:12px;right:12px;bottom:12px;z-index:30;background:var(--ink);color:var(--cream);border-radius:999px;padding:6px 6px 6px 18px;display:none;align-items:center;justify-content:space-between;gap:10px;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.minibar .btn{box-shadow:none;border-color:transparent;min-height:44px}
@media(max-width:880px){.minibar.show{display:flex}}

/* drawer */
.overlay{position:fixed;inset:0;background:rgba(59,42,30,.45);opacity:0;pointer-events:none;transition:opacity .25s;z-index:40}
.overlay.show{opacity:1;pointer-events:auto}
.drawer{position:fixed;top:0;right:0;height:100%;width:min(430px,100%);background:var(--cream);z-index:50;transform:translateX(105%);transition:transform .32s cubic-bezier(.2,.8,.3,1),visibility .32s;visibility:hidden;display:flex;flex-direction:column;box-shadow:-10px 0 30px rgba(0,0,0,.18);border-left:2px solid var(--ink)}
.drawer.show{transform:none;visibility:visible}
.drawer header{display:flex;justify-content:space-between;align-items:center;padding:16px 18px;border-bottom:2px solid var(--ink)}
.drawer header h2{font-size:1.4rem;margin:0}
.drawer .body{padding:16px 18px;overflow:auto;flex:1}
.drawer .foot{padding:14px 18px calc(14px + env(safe-area-inset-bottom));border-top:2px solid var(--ink);display:flex;gap:10px;background:var(--paper)}
.drawer .foot .btn{flex:1}
.line{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px dashed var(--kraft-d)}
.line svg{width:46px;height:46px;flex:none}
.line .n{flex:1;font-weight:600}
.line .q{color:var(--ink-2);font-size:.85rem;display:block;font-weight:500}
.sum{display:flex;justify-content:space-between;padding:8px 0;font-size:1rem}
.sum.total{font-size:1.3rem;font-weight:800;border-top:2px solid var(--ink);margin-top:8px;padding-top:12px}
.note{background:var(--green-l);border:2px solid var(--green);color:var(--green);border-radius:12px;padding:12px;font-size:.88rem;margin-top:16px;line-height:1.45}
.drawer .mini-box{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 10px}
.drawer .mini-box svg{width:38px;height:38px}
@media(max-width:600px){.drawer{top:auto;bottom:0;height:auto;max-height:88vh;width:100%;border-radius:22px 22px 0 0;transform:translateY(105%);border-left:0;border-top:2px solid var(--ink)}}

/* demo */
.demo-cursor{position:fixed;left:50%;top:50%;z-index:100;width:48px;height:48px;margin:-8px 0 0 -8px;pointer-events:none;transition:left .5s cubic-bezier(.4,0,.2,1),top .5s cubic-bezier(.4,0,.2,1);display:none}
.demo-cursor.on{display:block}
.demo-cursor .ring{transform-box:fill-box;transform-origin:center;opacity:0}
.demo-cursor.tap .ring{animation:ring .5s ease-out}
@keyframes ring{0%{transform:scale(.3);opacity:.9}100%{transform:scale(1.6);opacity:0}}
.demo-banner{position:fixed;top:74px;left:50%;transform:translateX(-50%);z-index:90;background:var(--ink);color:var(--cream);border-radius:999px;padding:8px 16px;font-size:.85rem;font-weight:600;box-shadow:var(--shadow);white-space:nowrap}
.demo-banner[hidden]{display:none}

/* animations / quality */
.float{animation:float 5s ease-in-out infinite}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
.steam{animation:steam 4s ease-in-out infinite;transform-box:fill-box;transform-origin:center}
@keyframes steam{0%{transform:translateY(0) scale(.6);opacity:0}30%{opacity:.9}100%{transform:translateY(-60px) scale(1.3);opacity:0}}
.spark{animation:spark 3s ease-in-out infinite;transform-box:fill-box;transform-origin:center}
@keyframes spark{0%,100%{opacity:.25;transform:scale(.8)}50%{opacity:1;transform:scale(1.15)}}
.low-fx .rough{filter:none}
.low-fx .float,.low-fx .steam,.low-fx .spark,.low-fx .badge .dot{animation:none!important}
.low-fx .top{backdrop-filter:none;-webkit-backdrop-filter:none;background:var(--cream)}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .float,.steam,.spark,.badge .dot{animation:none!important}
  .box-item .anim{animation-duration:.01s}
}
</style>
</head>
<body>

<!-- ===== SVG symbol library (every pastry in one hand-drawn style) ===== -->
<svg width="0" height="0" style="position:absolute" aria-hidden="true" focusable="false">
  <defs>
    <symbol id="p-croissant" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="80" rx="34" ry="5" fill="rgba(74,46,26,.12)" stroke="none"/>
        <path d="M15 64C9 48 26 30 50 30s41 18 35 34c-3 7-12 6-14 0-5-11-11-16-21-16s-16 5-21 16c-2 6-11 7-14 0Z" fill="#e9a74a"/>
        <path d="M28 62c2-10 8-18 14-24M72 62c-2-10-8-18-14-24M50 30v18" fill="none"/>
        <path d="M24 50c5-7 12-12 20-15" fill="none" stroke="#fbe1a6" stroke-width="2"/>
      </g>
    </symbol>
    <symbol id="p-twist" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="78" rx="36" ry="5" fill="rgba(74,46,26,.12)" stroke="none"/>
        <rect x="12" y="34" width="76" height="30" rx="15" fill="#e5b36a"/>
        <path d="M30 34c7 10 7 20 0 30M50 34c7 10 7 20 0 30M70 34c7 10 7 20 0 30" fill="none"/>
        <path d="M22 40c4 7 4 11 0 18M43 40c4 7 4 11 0 18M63 40c4 7 4 11 0 18" fill="none" stroke="#4a2a14" stroke-width="6"/>
        <path d="M18 38c4-2 8-2 12-1" fill="none" stroke="#fbe1a6" stroke-width="2"/>
      </g>
    </symbol>
    <symbol id="p-knot" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="84" rx="32" ry="5" fill="rgba(74,46,26,.12)" stroke="none"/>
        <circle cx="50" cy="52" r="32" fill="#d9a05b"/>
        <path d="M50 52a4 4 0 1 1-1-5a9 9 0 1 1 2 13a15 15 0 1 1-3-21a21 21 0 1 1 4 29" fill="none" stroke="#8b4b1f" stroke-width="4"/>
        <path d="M26 44c8 6 18 6 26 0s16-6 22 0" fill="none" stroke="#fff8ea" stroke-width="3"/>
      </g>
    </symbol>
    <symbol id="p-tart" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="88" rx="34" ry="4" fill="rgba(74,46,26,.12)" stroke="none"/>
        <circle cx="50" cy="52" r="36" fill="#cf9552"/>
        <circle cx="50" cy="52" r="32" fill="none" stroke="#8b5a2b" stroke-width="2" stroke-dasharray="3 4"/>
        <circle cx="50" cy="52" r="27" fill="#f0c97c" stroke="#b97a3c"/>
        <g fill="#fbeedb" stroke="#b58a5c" stroke-width="1.5">
          <ellipse cx="42" cy="44" rx="7" ry="3" transform="rotate(-30 42 44)"/>
          <ellipse cx="58" cy="46" rx="7" ry="3" transform="rotate(20 58 46)"/>
          <ellipse cx="50" cy="58" rx="7" ry="3" transform="rotate(70 50 58)"/>
          <ellipse cx="38" cy="60" rx="6" ry="3" transform="rotate(15 38 60)"/>
          <ellipse cx="62" cy="60" rx="6" ry="3" transform="rotate(-50 62 60)"/>
        </g>
      </g>
    </symbol>
    <symbol id="p-muffin" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="88" rx="26" ry="4" fill="rgba(74,46,26,.12)" stroke="none"/>
        <path d="M30 56l4 30h32l4-30Z" fill="#e8d5b5"/>
        <path d="M38 58l2 26M50 58v26M62 58l-2 26" fill="none" stroke="#b9a07a" stroke-width="2"/>
        <path d="M28 58c-6-20 8-34 22-34s28 14 22 34c-8-4-14-4-22-4s-14 0-22 4Z" fill="#e7b96a"/>
        <g fill="#4b4a8a" stroke="#2f2e5a" stroke-width="1.5"><circle cx="40" cy="42" r="4"/><circle cx="56" cy="36" r="4"/><circle cx="62" cy="50" r="3.5"/><circle cx="48" cy="52" r="3"/></g>
        <path d="M34 40c3-6 8-10 14-12" fill="none" stroke="#fbe1a6" stroke-width="2"/>
      </g>
    </symbol>
    <symbol id="p-cookie" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="88" rx="32" ry="4" fill="rgba(74,46,26,.12)" stroke="none"/>
        <circle cx="50" cy="52" r="33" fill="#c98c4a"/>
        <path d="M30 40c4-4 8-6 12-4M60 32c4 0 8 2 10 6M64 62c-2 4-6 6-10 6M34 64c-2-4-2-8 0-12" fill="none" stroke="#a66a30" stroke-width="2"/>
        <g fill="#5a3320" stroke="none"><ellipse cx="42" cy="46" rx="4" ry="3"/><ellipse cx="58" cy="44" rx="4" ry="3" transform="rotate(30 58 44)"/><ellipse cx="50" cy="60" rx="4" ry="3" transform="rotate(-20 50 60)"/><ellipse cx="36" cy="58" rx="3" ry="2.5"/><ellipse cx="64" cy="58" rx="3" ry="2.5"/></g>
        <g fill="#f1d6a7" stroke="none"><circle cx="30" cy="52" r="1.8"/><circle cx="48" cy="34" r="1.8"/><circle cx="70" cy="50" r="1.8"/><circle cx="54" cy="72" r="1.8"/><circle cx="40" cy="36" r="1.5"/></g>
      </g>
    </symbol>
    <symbol id="p-danish" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="88" rx="34" ry="4" fill="rgba(74,46,26,.12)" stroke="none"/>
        <path d="M20 30q0-10 10-10h40q10 0 10 10v40q0 10-10 10H30q-10 0-10-10Z" fill="#e8bd74"/>
        <path d="M30 20l20 20 20-20M30 80l20-20 20 20M20 30l20 20-20 20M80 30L60 50l20 20" fill="none" stroke="#b78348" stroke-width="2"/>
        <circle cx="50" cy="50" r="15" fill="#c93d5a"/>
        <circle cx="45" cy="45" r="3" fill="#f7a9b9" stroke="none"/>
        <path d="M24 32c10 6 20 6 30 0s16-6 22 0" fill="none" stroke="#fff8ea" stroke-width="3"/>
      </g>
    </symbol>
    <symbol id="p-pistachio" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="88" rx="30" ry="4" fill="rgba(74,46,26,.12)" stroke="none"/>
        <circle cx="50" cy="56" r="30" fill="#d9a05b"/>
        <path d="M22 50c6-18 50-18 56 0 0 8-12 12-28 12S22 58 22 50Z" fill="#a9c97a"/>
        <g fill="#5e8f3a" stroke="#3d6a24" stroke-width="1.2"><ellipse cx="38" cy="48" rx="3.5" ry="2" transform="rotate(-20 38 48)"/><ellipse cx="50" cy="44" rx="3.5" ry="2" transform="rotate(30 50 44)"/><ellipse cx="60" cy="50" rx="3.5" ry="2"/><ellipse cx="46" cy="54" rx="3" ry="2" transform="rotate(60 46 54)"/></g>
        <path d="M34 72c6 4 26 4 32 0" fill="none" stroke="#a66a30" stroke-width="2"/>
      </g>
    </symbol>
    <symbol id="p-lemon" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="88" rx="34" ry="4" fill="rgba(74,46,26,.12)" stroke="none"/>
        <path d="M50 22L82 76a4 4 0 0 1-4 6H22a4 4 0 0 1-4-6Z" fill="#f2d05b"/>
        <path d="M22 78h56" fill="none" stroke="#d9a03c" stroke-width="5"/>
        <path d="M40 54c6-4 14-4 20 0s8 8 2 12-18 4-24 0-4-8 2-12Z" fill="#fffaf0" stroke="#d9c58a" stroke-width="1.5"/>
        <path d="M44 48c4-6 10-6 14 0" fill="none" stroke="#e5a21e" stroke-width="2"/>
        <path d="M34 62l-6 10M66 62l6 10" fill="none" stroke="#d9a03c" stroke-width="1.5"/>
      </g>
    </symbol>
    <symbol id="b-sourdough" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="84" rx="38" ry="4" fill="rgba(74,46,26,.12)" stroke="none"/>
        <ellipse cx="50" cy="52" rx="38" ry="28" fill="#c88a4e"/>
        <path d="M26 52c8 8 40 8 48 0" fill="none" stroke="#f1d8ae" stroke-width="4"/>
        <path d="M34 46l6 14M50 44v16M66 46l-6 14" fill="none" stroke="#8a4f22" stroke-width="2"/>
        <path d="M24 42c6-8 14-12 22-14" fill="none" stroke="#f1d8ae" stroke-width="2"/>
      </g>
    </symbol>
    <symbol id="b-rye" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="82" rx="38" ry="4" fill="rgba(74,46,26,.12)" stroke="none"/>
        <rect x="12" y="30" width="76" height="44" rx="22" fill="#8f5a35"/>
        <g fill="#f1d8ae" stroke="none"><circle cx="28" cy="44" r="2"/><circle cx="40" cy="38" r="2"/><circle cx="52" cy="46" r="2"/><circle cx="64" cy="38" r="2"/><circle cx="74" cy="48" r="2"/><circle cx="34" cy="58" r="2"/><circle cx="48" cy="62" r="2"/><circle cx="62" cy="58" r="2"/><circle cx="56" cy="34" r="1.6"/><circle cx="22" cy="54" r="1.6"/></g>
        <path d="M20 40c6-6 14-8 22-8" fill="none" stroke="#c48a5a" stroke-width="2"/>
      </g>
    </symbol>
    <symbol id="b-focaccia" viewBox="0 0 100 100">
      <g stroke="#4a2e1a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
        <ellipse cx="50" cy="86" rx="36" ry="4" fill="rgba(74,46,26,.12)" stroke="none"/>
        <rect x="14" y="22" width="72" height="56" rx="12" fill="#e1b35b"/>
        <g fill="#c88f3a" stroke="#a66a30" stroke-width="1.2"><circle cx="30" cy="36" r="3.5"/><circle cx="50" cy="34" r="3.5"/><circle cx="70" cy="40" r="3.5"/><circle cx="36" cy="54" r="3.5"/><circle cx="58" cy="52" r="3.5"/><circle cx="46" cy="66" r="3.5"/><circle cx="68" cy="64" r="3.5"/></g>
        <path d="M24 64l10-8M29 60l-2-6M29 60l6 1M60 30l8-6M64 27l-1-5M64 27l5 1" fill="none" stroke="#4f7a3a" stroke-width="2"/>
        <g fill="#d64a3a" stroke="#8a2a1e" stroke-width="1.2"><circle cx="22" cy="46" r="4"/><circle cx="76" cy="54" r="4"/></g>
      </g>
    </symbol>
  </defs>
</svg>

<header class="top">
  <div class="wrap">
    <a class="brand" href="#top" aria-label="Hollow Oak Bakehouse, back to top">
      <svg viewBox="0 0 40 40" aria-hidden="true"><path d="M20 4c8 6 12 12 12 18 0 7-5 12-12 14C13 34 8 29 8 22 8 16 12 10 20 4Z" fill="#6f8f4a" stroke="#3b2a1e" stroke-width="2.5" stroke-linejoin="round"/><path d="M20 12v22M20 20l-6-4M20 24l6-4" fill="none" stroke="#3b2a1e" stroke-width="2.5" stroke-linecap="round"/></svg>
      <span>Hollow Oak</span>
    </a>
    <nav class="nav" aria-label="Sections">
      <a href="#bakes">Today's bakes</a>
      <a href="#box">Build a box</a>
      <a href="#hours">Hours</a>
    </nav>
    <div class="tools">
      <button class="btn icon" id="muteBtn" type="button" aria-pressed="false" aria-label="Mute sounds" title="Sound on/off">
        <svg viewBox="0 0 24 24" aria-hidden="true"><path class="spk" d="M4 9v6h4l5 4V5L8 9H4Z" fill="currentColor"/><path class="wave" d="M16 9a4 4 0 0 1 0 6M18.5 6.5a8 8 0 0 1 0 11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path class="x" d="M16 9l5 6M21 9l-5 6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" style="display:none"/></svg>
      </button>
      <a class="btn primary" href="#box">Build a box</a>
    </div>
  </div>
</header>

<main id="top">
  <!-- ===== HERO ===== -->
  <section class="hero">
    <div class="wrap">
      <div>
        <span class="eyebrow">Alder Street, since 2014</span>
        <h1>Hollow Oak <em>Bakehouse</em></h1>
        <p class="story">We opened in the old hardware shop on the corner, named after the hollow oak out front where the neighbourhood kids still hide acorns. Two deck ovens, one sourdough starter called Mabel, and a house rule: whatever's left at closing walks down to the shelter on Pine.</p>
        <div class="cta">
          <a class="btn primary" id="heroCta" href="#box">Build your box</a>
          <a class="btn" href="#bakes">See today's bakes</a>
          <span class="badge" data-open-badge><span class="dot"></span><span class="t">Checking hours…</span></span>
        </div>
      </div>
      <div class="shop-wrap float">
        <svg class="shop" viewBox="0 0 600 420" role="img" aria-label="Hand-drawn illustration of the Hollow Oak Bakehouse shop front: a striped awning, a window full of bread and a red door">
          <defs>
            <filter id="rough" x="-2%" y="-2%" width="104%" height="104%">
              <feTurbulence type="fractalNoise" baseFrequency="0.035" numOctaves="2" seed="7" result="n"/>
              <feDisplacementMap in="SourceGraphic" in2="n" scale="2.6" xChannelSelector="R" yChannelSelector="G"/>
            </filter>
            <pattern id="stripes" width="40" height="40" patternUnits="userSpaceOnUse"><rect width="20" height="40" fill="#c8553d"/><rect x="20" width="20" height="40" fill="#fbf3e4"/></pattern>
            <pattern id="bricks" width="30" height="16" patternUnits="userSpaceOnUse"><rect width="30" height="16" fill="#f6e7cf"/><path d="M0 8h30M15 0v8M0 8v8M30 8v8" stroke="#e5d1b2" stroke-width="1.5" fill="none"/></pattern>
          </defs>
          <g class="rough" filter="url(#rough)" stroke="#3b2a1e" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
            <g id="sparkles" stroke="none"></g>
            <!-- oak tree -->
            <rect x="12" y="250" width="18" height="142" rx="4" fill="#7a4a2b"/>
            <path d="M21 300c-6-8-14-12-20-14" fill="none"/>
            <g fill="#6f8f4a"><circle cx="20" cy="236" r="40"/><circle cx="50" cy="222" r="30"/><circle cx="34" cy="196" r="28"/></g>
            <!-- chimney + steam -->
            <rect x="432" y="56" width="26" height="54" fill="#b2654a"/>
            <rect x="426" y="50" width="38" height="10" rx="3" fill="#8a4a36"/>
            <g class="steam-g" fill="#ffffff" stroke="none" opacity=".85">
              <circle class="steam" cx="446" cy="40" r="10" style="animation-delay:0s"/>
              <circle class="steam" cx="452" cy="32" r="8" style="animation-delay:1.3s"/>
              <circle class="steam" cx="440" cy="36" r="7" style="animation-delay:2.6s"/>
            </g>
            <!-- building -->
            <rect x="90" y="110" width="420" height="282" rx="4" fill="url(#bricks)"/>
            <rect x="78" y="96" width="444" height="20" rx="4" fill="#d9c3a3"/>
            <!-- sign -->
            <rect x="128" y="56" width="344" height="48" rx="8" fill="#3f5d4a"/>
            <path d="M152 80c4-10 10-14 16-12 4 2 4 10-2 12s-12-4-14 0" fill="#a9c97a" stroke-width="2"/>
            <text x="312" y="88" text-anchor="middle" font-family="Georgia,'Times New Roman',serif" font-size="24" font-style="italic" fill="#fbf3e4" stroke="none">Hollow Oak Bakehouse</text>
            <!-- awning -->
            <rect x="70" y="150" width="460" height="34" fill="url(#stripes)"/>
            <rect x="70" y="144" width="460" height="8" rx="3" fill="#a8432e"/>
            <g id="scallops"></g>
            <!-- window -->
            <rect x="120" y="205" width="200" height="150" rx="6" fill="#d5e8ee" stroke="#7a4a2b" stroke-width="5"/>
            <path d="M136 222l-10 42M152 216l-24 62" stroke="#fff" stroke-width="3" opacity=".7"/>
            <use href="#b-sourdough" x="132" y="214" width="62" height="62"/>
            <use href="#p-croissant" x="228" y="218" width="58" height="58"/>
            <use href="#b-focaccia" x="138" y="288" width="58" height="58"/>
            <use href="#p-knot" x="236" y="288" width="58" height="58"/>
            <path d="M220 205v150M120 280h200" fill="none" stroke="#7a4a2b" stroke-width="4"/>
            <!-- window box -->
            <rect x="112" y="356" width="216" height="20" rx="4" fill="#7a4a2b"/>
            <g stroke-width="2">
              <circle cx="140" cy="350" r="9" fill="#e86a7a"/><circle cx="170" cy="346" r="9" fill="#e9a74a"/><circle cx="200" cy="352" r="9" fill="#e86a7a"/><circle cx="230" cy="346" r="9" fill="#fbf3e4"/><circle cx="260" cy="351" r="9" fill="#e9a74a"/><circle cx="292" cy="347" r="9" fill="#e86a7a"/>
              <path d="M126 356c4-8 10-12 18-14M310 356c-4-8-10-12-18-14" fill="none" stroke="#4f7a3a"/>
            </g>
            <!-- door -->
            <rect x="360" y="210" width="110" height="182" rx="6" fill="#c8553d"/>
            <rect x="372" y="222" width="86" height="80" rx="4" fill="#d5e8ee" stroke-width="2.5"/>
            <rect x="372" y="314" width="86" height="64" rx="4" fill="#a8432e" stroke-width="2.5"/>
            <circle cx="452" cy="318" r="5" fill="#e9a74a" stroke-width="2"/>
            <path d="M415 222v10" stroke-width="2"/>
            <rect x="389" y="244" width="52" height="24" rx="4" fill="#fbf3e4" stroke-width="2"/>
            <text id="doorSign" x="415" y="261" text-anchor="middle" font-family="Georgia,serif" font-size="13" font-weight="700" fill="#3b2a1e" stroke="none">open</text>
            <!-- steps -->
            <path d="M348 392h134v-12H348Z" fill="#d9c3a3"/>
            <!-- chalkboard -->
            <path d="M526 392l8-74h40l8 74Z" fill="#d9c3a3"/>
            <path d="M530 384l6-62h36l6 62Z" fill="#3b2a1e" stroke-width="2"/>
            <text x="554" y="346" text-anchor="middle" font-family="Georgia,serif" font-size="11" fill="#fbf3e4" stroke="none" font-style="italic">today:</text>
            <text x="554" y="362" text-anchor="middle" font-family="Georgia,serif" font-size="11" fill="#fbf3e4" stroke="none">sourdough</text>
            <text x="554" y="376" text-anchor="middle" font-family="Georgia,serif" font-size="11" fill="#fbf3e4" stroke="none">+ knots</text>
            <!-- flower pot -->
            <path d="M40 392l6-36h40l6 36Z" fill="#c8553d"/>
            <circle cx="66" cy="338" r="24" fill="#6f8f4a"/>
            <g fill="#e86a7a" stroke-width="2"><circle cx="56" cy="330" r="5"/><circle cx="74" cy="326" r="5"/><circle cx="68" cy="346" r="5"/></g>
            <!-- ground -->
            <path d="M8 392c160-6 420-6 584 0" fill="none" stroke-width="4"/>
          </g>
        </svg>
      </div>
    </div>
  </section>

  <!-- ===== TODAY'S BAKES ===== -->
  <section class="bakes" id="bakes">
    <div class="wrap">
      <span class="eyebrow">Out of the oven</span>
      <h2>Today's bakes</h2>
      <p class="lead">Everything below is mixed, proved and baked on site, in this order, every morning. The chalkboard outside says the same thing, just with worse handwriting.</p>
      <div class="bake-grid" id="bakeGrid"></div>
    </div>
  </section>

  <!-- ===== BUILD YOUR BOX ===== -->
  <section id="box">
    <div class="wrap">
      <span class="eyebrow">The fun part</span>
      <h2>Build your box</h2>
      <p class="lead">Pick a box, tap pastries to drop them in, tap anything in the box to take it back out. Filters dim whatever doesn't suit you.</p>

      <div class="builder">
        <div class="picker">
          <div class="controls">
            <div class="ctl-row">
              <span class="lbl" id="sizeLbl">Box size</span>
              <div class="seg" role="group" aria-labelledby="sizeLbl" id="sizeSeg">
                <button type="button" data-size="4" aria-pressed="false">4</button>
                <button type="button" data-size="6" aria-pressed="true">6</button>
                <button type="button" data-size="12" aria-pressed="false">12</button>
              </div>
            </div>
            <div class="ctl-row">
              <span class="lbl" id="filterLbl">Filters</span>
              <div role="group" aria-labelledby="filterLbl" id="filters" style="display:flex;gap:8px;flex-wrap:wrap">
                <button class="chip" type="button" data-filter="vegan" aria-pressed="false"><span class="sw"></span>Vegan</button>
                <button class="chip" type="button" data-filter="nutFree" aria-pressed="false"><span class="sw"></span>Nut-free</button>
                <button class="chip" type="button" data-filter="glutenFree" aria-pressed="false"><span class="sw"></span>Gluten-free</button>
              </div>
            </div>
            <p class="legend"><b>V</b> vegan &nbsp; <b>NF</b> nut-free &nbsp; <b>GF</b> gluten-free</p>
          </div>
          <div class="pastry-grid" id="pastryGrid" aria-label="Pastries, tap to add to your box"></div>
        </div>

        <aside class="box-panel" aria-labelledby="boxTitle">
          <div class="box-head">
            <h3 id="boxTitle">Your box</h3>
            <span class="count" id="count">0 of 6 filled</span>
          </div>
          <svg id="boxSvg" viewBox="0 0 352 252" aria-label="Your pastry box, top-down view. Items inside are buttons; tap one to remove it." role="group"></svg>
          <div class="box-foot">
            <p class="msg" id="msg" aria-hidden="true">Tap a pastry to start.</p>
            <div class="total-row"><span>Total</span><strong id="total">$0.00</strong></div>
            <div class="box-btns">
              <button class="btn" type="button" id="resetBtn">Reset</button>
              <button class="btn primary" type="button" id="checkoutBtn" disabled>Checkout</button>
            </div>
          </div>
        </aside>
      </div>
    </div>
  </section>

  <!-- ===== HOURS ===== -->
  <section class="hours" id="hours">
    <div class="wrap">
      <div>
        <span class="eyebrow">Come by</span>
        <h2>Opening hours</h2>
        <p class="lead">The badge updates from your own clock, so it's right wherever you're reading this. We close when the shelves are empty, which on Saturdays is often before four.</p>
        <p style="margin-top:16px"><span class="badge" data-open-badge><span class="dot"></span><span class="t">Checking hours…</span></span></p>
        <p class="clock" id="clock"></p>
      </div>
      <table aria-label="Weekly opening hours"><tbody id="hoursBody"></tbody></table>
    </div>
  </section>
</main>

<footer>
  <div class="wrap">
    <div class="col">
      <strong style="color:var(--ink);font-family:Georgia,serif;font-size:1.1rem">Hollow Oak Bakehouse</strong>
      <span>14 Alder Street, by the hollow oak</span>
      <span>Cash and cards at the counter. No deliveries, just the walk.</span>
    </div>
    <div class="col">
      <a href="#bakes">Today's bakes</a>
      <a href="#box">Build a box</a>
      <a href="#hours">Opening hours</a>
    </div>
    <div class="col">
      <span>Made with flour, butter and a few hundred lines of SVG.</span>
      <span id="year"></span>
    </div>
  </div>
</footer>

<!-- mini bar (phones) -->
<div class="minibar" id="minibar" aria-hidden="true">
  <span id="miniText">0 items · $0.00</span>
  <button class="btn primary" type="button" id="miniCheckout" disabled>Checkout</button>
</div>

<!-- drawer -->
<div class="overlay" id="overlay"></div>
<aside class="drawer" id="drawer" role="dialog" aria-modal="true" aria-labelledby="drawerTitle" aria-hidden="true">
  <header>
    <h2 id="drawerTitle">Order summary</h2>
    <button class="btn icon" type="button" id="drawerClose" aria-label="Close summary"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" fill="none"/></svg></button>
  </header>
  <div class="body" id="drawerBody"></div>
  <div class="foot">
    <button class="btn" type="button" id="drawerKeep">Keep building</button>
    <button class="btn primary" type="button" id="drawerNew">Start a new box</button>
  </div>
</aside>

<!-- demo -->
<div class="demo-banner" id="demoBanner" hidden>Demo mode — tap or press anything to take over</div>
<svg class="demo-cursor" id="demoCursor" viewBox="0 0 48 48" aria-hidden="true">
  <circle class="ring" cx="16" cy="12" r="12" fill="none" stroke="#c8553d" stroke-width="3"/>
  <path d="M10 6l22 10-9 3 6 10-4 2-6-10-7 7Z" fill="#fffaf0" stroke="#3b2a1e" stroke-width="2.5" stroke-linejoin="round"/>
</svg>

<div class="sr" id="live" aria-live="polite" aria-atomic="true"></div>

<script>
(function(){
'use strict';
/* ---------- utilities ---------- */
function mulberry32(a){return function(){a|=0;a=a+0x6D2B79F5|0;let t=Math.imul(a^a>>>15,1|a);t=t+Math.imul(t^t>>>7,61|t)^t;return((t^t>>>14)>>>0)/4294967296}}
const SEED=20260930;
const $=s=>document.querySelector(s), $$=s=>Array.from(document.querySelectorAll(s));
const esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
const money=n=>'$'+n.toFixed(2);
const SVGNS='http://www.w3.org/2000/svg';
function svgEl(tag,attrs){const e=document.createElementNS(SVGNS,tag);for(const k in attrs)e.setAttribute(k,attrs[k]);return e}

/* ---------- data ---------- */
const PASTRIES=[
  {id:'croissant',name:'Butter Croissant',price:2.8,vegan:false,nutFree:true,glutenFree:false},
  {id:'twist',name:'Chocolate Twist',price:3.2,vegan:false,nutFree:true,glutenFree:false},
  {id:'knot',name:'Cinnamon Knot',price:3.0,vegan:true,nutFree:true,glutenFree:false},
  {id:'tart',name:'Almond Frangipane Tart',price:3.9,vegan:false,nutFree:false,glutenFree:false},
  {id:'muffin',name:'Blueberry Muffin',price:2.6,vegan:false,nutFree:true,glutenFree:true},
  {id:'cookie',name:'Oat & Raisin Cookie',price:2.2,vegan:true,nutFree:true,glutenFree:true},
  {id:'danish',name:'Raspberry Danish',price:3.4,vegan:false,nutFree:true,glutenFree:false},
  {id:'pistachio',name:'Pistachio Cardamom Bun',price:3.6,vegan:true,nutFree:false,glutenFree:false},
  {id:'lemon',name:'Lemon Polenta Slice',price:3.3,vegan:false,nutFree:false,glutenFree:true}
];
const byId={};PASTRIES.forEach(p=>byId[p.id]=p);
const BAKES=[
  {sym:'b-sourdough',name:'Country Sourdough',time:'7:00 am',note:'Mabel the starter, 36-hour cold rise, blistered crust.'},
  {sym:'b-rye',name:'Seeded Rye',time:'7:30 am',note:'Caraway, sunflower and linseed. Dense in the good way.'},
  {sym:'b-focaccia',name:'Rosemary Focaccia',time:'9:00 am',note:'Olive oil, flaky salt, rosemary from the yard.'},
  {sym:'p-croissant',name:'Butter Croissant',time:'7:00 am',note:'Twenty-seven layers, folded the night before.'},
  {sym:'p-knot',name:'Cinnamon Knot',time:'8:00 am',note:'Oat-milk dough and cardamom sugar. Vegan, nobody notices.'},
  {sym:'p-danish',name:'Raspberry Danish',time:'8:30 am',note:'Jam from last summer, pastry from this morning.'}
];
const LAYOUT={4:{cols:2,rows:2},6:{cols:3,rows:2},12:{cols:4,rows:3}};
const HOURS=[[8,13],null,[7,17],[7,17],[7,17],[7,17],[8,16]]; // Sun..Sat
const DAYS=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];

/* ---------- ready signal on first frame ---------- */
requestAnimationFrame(()=>requestAnimationFrame(()=>{try{parent.postMessage({vcb:'ready'},'*')}catch(e){}}));

/* ---------- quality: auto low-fx ---------- */
(function(){
  const root=document.documentElement;
  const nav=navigator;
  if((nav.deviceMemory&&nav.deviceMemory<=2)||(nav.hardwareConcurrency&&nav.hardwareConcurrency<=2)){root.classList.add('low-fx');return}
  const frames=[];let last=performance.now();
  function tick(t){frames.push(t-last);last=t;if(frames.length<90){requestAnimationFrame(tick)}else{const s=frames.slice(15).sort((a,b)=>a-b);const med=s[s.length>>1];if(med>27)root.classList.add('low-fx')}}
  requestAnimationFrame(tick);
})();

/* ---------- audio ---------- */
let actx=null,muted=false;
try{muted=localStorage.getItem('hob-muted')==='1'}catch(e){}
function unlockAudio(){
  if(!actx){try{actx=new (window.AudioContext||window.webkitAudioContext)()}catch(e){actx=null}}
  if(actx&&actx.state==='suspended'){actx.resume().catch(()=>{})}
}
window.addEventListener('pointerdown',unlockAudio,{passive:true});
const SOUNDS={plop:['sine',520,200,.16,.2],pop:['triangle',280,720,.12,.14],nope:['square',170,110,.18,.05],tick:['triangle',880,660,.06,.08],chime:['sine',660,990,.32,.12]};
function play(kind,delay){
  if(muted||!actx||actx.state!=='running')return;
  const d=SOUNDS[kind];if(!d)return;
  const t=actx.currentTime+(delay||0);
  const o=actx.createOscillator(),g=actx.createGain();
  o.type=d[0];o.frequency.setValueAtTime(d[1],t);o.frequency.exponentialRampToValueAtTime(d[2],t+d[3]);
  g.gain.setValueAtTime(0.0001,t);g.gain.exponentialRampToValueAtTime(d[4],t+.012);g.gain.exponentialRampToValueAtTime(0.0001,t+d[3]);
  o.connect(g);g.connect(actx.destination);o.start(t);o.stop(t+d[3]+.03);
}
const muteBtn=$('#muteBtn');
function renderMute(){
  muteBtn.setAttribute('aria-pressed',muted?'true':'false');
  muteBtn.setAttribute('aria-label',muted?'Unmute sounds':'Mute sounds');
  muteBtn.querySelector('.wave').style.display=muted?'none':'';
  muteBtn.querySelector('.x').style.display=muted?'':'none';
}
muteBtn.addEventListener('click',()=>{muted=!muted;try{localStorage.setItem('hob-muted',muted?'1':'0')}catch(e){}renderMute();if(!muted)play('tick')});
renderMute();

/* ---------- live region ---------- */
const live=$('#live'),msgEl=$('#msg');let msgTimer=null;
function announce(text,keep){
  live.textContent='';setTimeout(()=>{live.textContent=text},30);
  msgEl.textContent=text;clearTimeout(msgTimer);
  if(!keep)msgTimer=setTimeout(defaultMsg,2600);
}
function defaultMsg(){const n=filled();msgEl.textContent=n===0?'Tap a pastry to start.':n===size?'Box is full. Tap an item to remove it, or checkout.':'Tap an item in the box to remove it.'}

/* ---------- seeded decoration ---------- */
(function(){
  const r=mulberry32(SEED);
  // scallops under the awning (slightly wobbly)
  const sc=$('#scallops');
  for(let i=0;i<23;i++){
    const x=80+i*20;const red=i%2===0;
    sc.appendChild(svgEl('circle',{cx:x+(r()-.5)*2,cy:184+(r()-.5)*2,r:(9.5+r()*1.5).toFixed(1),fill:red?'#c8553d':'#fbf3e4'}));
  }
  // sparkles in the sky
  const sp=$('#sparkles');
  for(let i=0;i<9;i++){
    const x=60+r()*480,y=14+r()*36,s=2+r()*3;
    const p=svgEl('path',{d:`M${x} ${y-s*2}l${s*.6} ${s*1.4}l${s*1.4} ${s*.6}l-${s*1.4} ${s*.6}l-${s*.6} ${s*1.4}l-${s*.6}-${s*1.4}l-${s*1.4}-${s*.6}l${s*1.4}-${s*.6}Z`,fill:'#e9a74a',class:'spark'});
    p.style.animationDelay=(r()*3).toFixed(2)+'s';
    sp.appendChild(p);
  }
})();

/* ---------- today's bakes ---------- */
(function(){
  const r=mulberry32(SEED+1);
  $('#bakeGrid').innerHTML=BAKES.map(b=>`<article class="bake" style="--tilt:${((r()-.5)*2.4).toFixed(2)}deg">
    <svg viewBox="0 0 100 100" aria-hidden="true"><use href="#${b.sym}"/></svg>
    <h3>${esc(b.name)}</h3><p>${esc(b.note)}</p><span class="pill">Fresh at ${esc(b.time)}</span></article>`).join('');
})();

/* ---------- configurator state ---------- */
let size=6,slots=new Array(6).fill(null);
const filters={vegan:false,nutFree:false,glutenFree:false};
const filled=()=>slots.filter(Boolean).length;
const total=()=>slots.reduce((s,id)=>s+(id?byId[id].price:0),0);
const matches=p=>Object.keys(filters).every(k=>!filters[k]||p[k]);

/* pastry cards */
const grid=$('#pastryGrid');
(function(){
  const r=mulberry32(SEED+2);
  grid.innerHTML=PASTRIES.map(p=>{
    const tags=[p.vegan?'<span class="tag v" title="Vegan">V</span>':'',p.nutFree?'<span class="tag nf" title="Nut-free">NF</span>':'',p.glutenFree?'<span class="tag gf" title="Gluten-free">GF</span>':''].join('');
    const diet=[p.vegan?'vegan':'',p.nutFree?'nut-free':'',p.glutenFree?'gluten-free':''].filter(Boolean).join(', ');
    return `<button class="pastry" type="button" data-id="${p.id}" style="--tilt:${((r()-.5)*3).toFixed(2)}deg" aria-label="Add ${esc(p.name)}, ${money(p.price)}${diet?', '+diet:''}">
      <span class="plus" aria-hidden="true">+</span>
      <svg viewBox="0 0 100 100" aria-hidden="true"><use href="#p-${p.id}"/></svg>
      <span class="p-name">${esc(p.name)}</span>
      <span class="p-meta"><span class="price">${money(p.price)}</span>${tags}</span></button>`;
  }).join('');
})();
const card=id=>grid.querySelector(`.pastry[data-id="${id}"]`);
grid.addEventListener('click',e=>{const b=e.target.closest('.pastry');if(b)addItem(b.dataset.id)});

function applyFilters(){
  PASTRIES.forEach(p=>{const c=card(p.id),ok=matches(p);c.classList.toggle('dim',!ok);c.setAttribute('aria-disabled',ok?'false':'true')});
  $$('#filters .chip').forEach(ch=>ch.setAttribute('aria-pressed',filters[ch.dataset.filter]?'true':'false'));
}
$('#filters').addEventListener('click',e=>{
  const ch=e.target.closest('.chip');if(!ch)return;
  const k=ch.dataset.filter;filters[k]=!filters[k];applyFilters();play('tick');
  const on=Object.keys(filters).filter(k=>filters[k]);
  announce(on.length?'Showing '+on.map(k=>({vegan:'vegan',nutFree:'nut-free',glutenFree:'gluten-free'})[k]).join(', ')+' pastries.':'Filters cleared.');
});

function shake(el){if(!el)return;el.classList.remove('shake');void el.offsetWidth;el.classList.add('shake');setTimeout(()=>el.classList.remove('shake'),450)}

/* ---------- box drawing ---------- */
const boxSvg=$('#boxSvg');
const S=100,P=26;
let slotCenters=[];
function renderBox(){
  const {cols,rows}=LAYOUT[size];
  const W=cols*S+P*2,H=rows*S+P*2;
  boxSvg.setAttribute('viewBox',`0 0 ${W} ${H}`);
  while(boxSvg.firstChild)boxSvg.removeChild(boxSvg.firstChild);
  const r=mulberry32(SEED+size);
  boxSvg.appendChild(svgEl('rect',{x:8,y:12,width:W-16,height:H-16,rx:16,fill:'rgba(59,42,30,.18)'}));
  boxSvg.appendChild(svgEl('rect',{x:4,y:4,width:W-8,height:H-8,rx:16,fill:'#c79a63',stroke:'#3b2a1e','stroke-width':3}));
  boxSvg.appendChild(svgEl('rect',{x:14,y:14,width:W-28,height:H-28,rx:12,fill:'#e7c99b',stroke:'#9a7247','stroke-width':2}));
  // kraft speckles (seeded)
  const spk=svgEl('g',{fill:'none',stroke:'#b78a5a','stroke-width':1.5,'stroke-linecap':'round',opacity:.55});
  for(let i=0;i<Math.round(W*H/2200);i++){
    const x=18+r()*(W-36),y=18+r()*(H-36),l=2+r()*5,a=r()*Math.PI;
    spk.appendChild(svgEl('path',{d:`M${x.toFixed(1)} ${y.toFixed(1)}l${(Math.cos(a)*l).toFixed(1)} ${(Math.sin(a)*l).toFixed(1)}`}));
  }
  boxSvg.appendChild(spk);
  // fold lines
  boxSvg.appendChild(svgEl('path',{d:`M4 ${H/2}h10M${W-14} ${H/2}h10M${W/2} 4v10M${W/2} ${H-14}v10`,stroke:'#9a7247','stroke-width':2,'stroke-linecap':'round'}));
  // slots
  slotCenters=[];
  const sg=svgEl('g',{});
  for(let i=0;i<size;i++){
    const c=i%cols,rw=Math.floor(i/cols);
    const cx=P+c*S+S/2,cy=P+rw*S+S/2;slotCenters.push([cx,cy]);
    sg.appendChild(svgEl('circle',{cx,cy,r:42,fill:'#f3e2c6',stroke:'#b78a5a','stroke-width':2,'stroke-dasharray':'5 5'}));
    sg.appendChild(svgEl('circle',{cx,cy,r:34,fill:'none',stroke:'#d8bd93','stroke-width':1.5}));
  }
  boxSvg.appendChild(sg);
  const items=svgEl('g',{id:'items'});boxSvg.appendChild(items);
  slots.forEach((id,i)=>{if(id)renderSlotItem(i,id,false)});
}
function renderSlotItem(i,id,animate){
  const [cx,cy]=slotCenters[i];const p=byId[id];
  const g=svgEl('g',{class:'box-item'+(animate?'':' settle'),'data-i':i,role:'button',tabindex:'0',transform:`translate(${cx-42} ${cy-42})`,'aria-label':`Remove ${p.name} from slot ${i+1}`});
  const a=svgEl('g',{class:'anim'});
  a.appendChild(svgEl('circle',{cx:42,cy:42,r:43,fill:'rgba(255,255,255,0.01)'}));
  const u=svgEl('use',{width:84,height:84});u.setAttribute('href','#p-'+id);
  a.appendChild(u);g.appendChild(a);
  $('#items').appendChild(g);
}
boxSvg.addEventListener('click',e=>{const g=e.target.closest('.box-item');if(g)removeItem(+g.dataset.i)});
boxSvg.addEventListener('keydown',e=>{if(e.key==='Enter'||e.key===' '){const g=e.target.closest('.box-item');if(g){e.preventDefault();removeItem(+g.dataset.i)}}});

/* ---------- actions ---------- */
function addItem(id){
  const p=byId[id];if(!p)return;
  if(!matches(p)){announce(p.name+" doesn't match your filters.");shake(card(id));play('nope');return}
  const i=slots.indexOf(null);
  if(i<0){announce('Box is full. Remove one or pick a bigger box.');shake($('.box-panel'));play('nope');return}
  slots[i]=id;renderSlotItem(i,id,true);play('plop');update();
  announce(`${p.name} added to slot ${i+1}. ${filled()} of ${size} filled.`);
}
function removeItem(i){
  const id=slots[i];if(!id)return;
  const g=boxSvg.querySelector(`.box-item[data-i="${i}"]`);
  slots[i]=null;
  if(g){g.setAttribute('tabindex','-1');g.querySelector('.anim').classList.add('out');setTimeout(()=>g.remove(),260)}
  play('pop');update();announce(`${byId[id].name} removed. ${filled()} of ${size} filled.`);
}
function setSize(n){
  if(n===size){return}
  const old=slots.filter(Boolean);size=n;slots=new Array(n).fill(null);
  old.slice(0,n).forEach((id,i)=>slots[i]=id);
  const dropped=old.length-Math.min(old.length,n);
  $$('#sizeSeg button').forEach(b=>b.setAttribute('aria-pressed',+b.dataset.size===n?'true':'false'));
  renderBox();update();play('tick');
  announce(`Box of ${n}.`+(dropped?` ${dropped} item${dropped>1?'s':''} didn't fit and came out.`:''));
}
$('#sizeSeg').addEventListener('click',e=>{const b=e.target.closest('button');if(b)setSize(+b.dataset.size)});
function reset(){
  slots=new Array(size).fill(null);Object.keys(filters).forEach(k=>filters[k]=false);
  if(size!==6){size=6;slots=new Array(6).fill(null);$$('#sizeSeg button').forEach(b=>b.setAttribute('aria-pressed',b.dataset.size==='6'?'true':'false'))}
  applyFilters();renderBox();update();play('tick');announce('Box emptied. Fresh start.');
}
$('#resetBtn').addEventListener('click',reset);
function update(){
  const n=filled(),t=total();
  $('#count').textContent=`${n} of ${size} filled`;
  $('#total').textContent=money(t);
  $('#checkoutBtn').disabled=n===0;$('#miniCheckout').disabled=n===0;
  $('#miniText').textContent=`${n} item${n===1?'':'s'} · ${money(t)}`;
  boxSvg.setAttribute('aria-label',`Your pastry box, ${n} of ${size} slots filled. Items inside are buttons; tap one to remove it.`);
  if(!msgTimer)defaultMsg();
}

/* ---------- drawer ---------- */
const drawer=$('#drawer'),overlay=$('#overlay');let lastFocus=null;
function openDrawer(){
  if(filled()===0)return;
  const groups={};slots.forEach(id=>{if(id)groups[id]=(groups[id]||0)+1});
  const lines=Object.keys(groups).map(id=>{const p=byId[id],q=groups[id];return `<div class="line"><svg viewBox="0 0 100 100" aria-hidden="true"><use href="#p-${id}"/></svg><span class="n">${esc(p.name)}<span class="q">${q} × ${money(p.price)}</span></span><span>${money(p.price*q)}</span></div>`}).join('');
  const mini=slots.filter(Boolean).map(id=>`<svg viewBox="0 0 100 100" aria-hidden="true"><use href="#p-${id}"/></svg>`).join('');
  $('#drawerBody').innerHTML=`<p style="font-weight:700">Box of ${size} · ${filled()} filled</p><div class="mini-box" aria-hidden="true">${mini}</div>${lines}
    <div class="sum"><span>Items</span><span>${money(total())}</span></div>
    <div class="sum"><span>Box &amp; ribbon</span><span>on the house</span></div>
    <div class="sum total"><span>Total at the counter</span><span>${money(total())}</span></div>
    <p class="note">This is just a summary. Nothing is sent anywhere and there's nothing to pay here: show it at the counter, or read it out, and we'll pack it while you wait.</p>`;
  lastFocus=document.activeElement;
  drawer.classList.add('show');overlay.classList.add('show');drawer.setAttribute('aria-hidden','false');
  $('#minibar').classList.add('hide');
  play('chime');play('chime',.12);
  setTimeout(()=>$('#drawerClose').focus(),80);
}
function closeDrawer(){
  if(!drawer.classList.contains('show'))return;
  drawer.classList.remove('show');overlay.classList.remove('show');drawer.setAttribute('aria-hidden','true');
  if(lastFocus&&lastFocus.focus){try{lastFocus.focus()}catch(e){}}
}
$('#checkoutBtn').addEventListener('click',openDrawer);
$('#miniCheckout').addEventListener('click',openDrawer);
$('#drawerClose').addEventListener('click',closeDrawer);
$('#drawerKeep').addEventListener('click',closeDrawer);
$('#drawerNew').addEventListener('click',()=>{closeDrawer();reset()});
overlay.addEventListener('click',closeDrawer);
drawer.addEventListener('keydown',e=>{
  if(e.key==='Escape'){e.preventDefault();closeDrawer();return}
  if(e.key==='Tab'){
    const f=$$('#drawer button').filter(x=>!x.disabled);if(!f.length)return;
    const first=f[0],last=f[f.length-1];
    if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus()}
    else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus()}
  }
});

/* ---------- mini bar visibility (phones) ---------- */
(function(){
  const bar=$('#minibar'),sec=$('#box');
  if(!('IntersectionObserver' in window)){bar.classList.add('show');return}
  const io=new IntersectionObserver(en=>{en.forEach(x=>{bar.classList.toggle('show',x.isIntersecting);bar.setAttribute('aria-hidden',x.isIntersecting?'false':'true')})},{threshold:0.05});
  io.observe(sec);
})();

/* ---------- opening hours ---------- */
const fmtH=h=>{const ap=h<12?'am':'pm';return `${h%12||12}:00 ${ap}`};
function statusNow(d){
  const day=d.getDay(),mins=d.getHours()*60+d.getMinutes(),h=HOURS[day];
  if(h&&mins>=h[0]*60&&mins<h[1]*60)return{open:true,text:`Open now · closes ${fmtH(h[1])}`};
  if(h&&mins<h[0]*60)return{open:false,text:`Closed · opens today ${fmtH(h[0])}`};
  for(let i=1;i<=7;i++){const dd=(day+i)%7;if(HOURS[dd])return{open:false,text:`Closed · opens ${i===1?'tomorrow':DAYS[dd]} ${fmtH(HOURS[dd][0])}`}}
  return{open:false,text:'Closed'};
}
function renderHours(){
  const d=new Date(),st=statusNow(d);
  $$('[data-open-badge]').forEach(b=>{b.classList.toggle('open',st.open);b.classList.toggle('closed',!st.open);b.querySelector('.t').textContent=st.text});
  $('#doorSign').textContent=st.open?'open':'closed';
  $('#hoursBody').innerHTML=HOURS.map((h,i)=>`<tr class="${i===d.getDay()?'today':''}"><td>${DAYS[i]}</td><td>${h?fmtH(h[0])+' – '+fmtH(h[1]):'Closed (oven rest day)'}</td></tr>`).join('');
  $('#clock').textContent='Your local time: '+d.toLocaleTimeString([], {hour:'numeric',minute:'2-digit'})+', '+DAYS[d.getDay()];
}
renderHours();setInterval(renderHours,30000);
$('#year').textContent='© '+new Date().getFullYear()+' Hollow Oak Bakehouse. An invented bakery.';

/* ---------- init ---------- */
applyFilters();renderBox();update();

/* ---------- demo mode ---------- */
const demo={on:false,timer:null,resolve:null};
const cursor=$('#demoCursor'),banner=$('#demoBanner');
const sleep=ms=>new Promise(res=>{demo.resolve=res;demo.timer=setTimeout(()=>{demo.resolve=null;res()},ms)});
async function demoTap(el,pause){
  if(!demo.on||!el)return;
  if(el.disabled)return;
  el.scrollIntoView({block:'center',behavior:'smooth'});
  await sleep(380);if(!demo.on)return;
  const r=el.getBoundingClientRect();
  cursor.style.left=(r.left+r.width/2)+'px';cursor.style.top=(r.top+r.height/2)+'px';
  await sleep(540);if(!demo.on)return;
  cursor.classList.remove('tap');void cursor.getBoundingClientRect();cursor.classList.add('tap');
  el.click();
  await sleep(pause||600);
}
const sizeBtn=n=>$(`#sizeSeg button[data-size="${n}"]`),filterBtn=k=>$(`#filters .chip[data-filter="${k}"]`),boxItem=i=>boxSvg.querySelector(`.box-item[data-i="${i}"]`);
async function runDemo(){
  while(demo.on){
    reset();closeDrawer();window.scrollTo({top:0,behavior:'smooth'});
    cursor.style.left='50%';cursor.style.top='60%';
    await sleep(900);
    await demoTap($('#heroCta'),700);
    await demoTap(sizeBtn(6),500);
    for(const id of ['croissant','knot','danish','tart'])await demoTap(card(id),420);
    await demoTap(filterBtn('vegan'),900);
    await demoTap(card('pistachio'),500);
    await demoTap(card('croissant'),700);   // dimmed: shakes, not added
    await demoTap(filterBtn('vegan'),500);
    await demoTap(boxItem(1),800);          // remove from box
    await demoTap(sizeBtn(12),800);
    await demoTap(card('cookie'),420);
    await demoTap(card('muffin'),600);
    await demoTap($('#checkoutBtn'),2400);
    await demoTap($('#drawerKeep'),700);
    await demoTap($('#resetBtn'),1200);
  }
}
function startDemo(){
  if(demo.on)return;demo.on=true;banner.hidden=false;cursor.classList.add('on');
  ['pointerdown','keydown','wheel','touchstart'].forEach(ev=>window.addEventListener(ev,stopDemo,{capture:true,passive:true}));
  runDemo();
}
function stopDemo(){
  if(!demo.on)return;demo.on=false;banner.hidden=true;cursor.classList.remove('on','tap');
  clearTimeout(demo.timer);if(demo.resolve){const r=demo.resolve;demo.resolve=null;r()}
  ['pointerdown','keydown','wheel','touchstart'].forEach(ev=>window.removeEventListener(ev,stopDemo,{capture:true}));
}
if(location.hash==='#demo')startDemo();
window.addEventListener('hashchange',()=>{if(location.hash==='#demo')startDemo()});
})();
</script>
</body>
</html>

Try 2 · index.html

works42.4 KB · 656 lines · no libraries
Download
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>Marigold &amp; Rye — Neighborhood Bakery</title>
<meta name="description" content="Marigold & Rye, a small neighborhood bakery. See today's bakes and build your own pastry box.">
<style>
:root{
  --cream:#fbf4e8; --cream-2:#f3e6cf; --paper:#fffaf1;
  --ink:#4a2c17; --ink-soft:#7a5a42;
  --marigold:#e8a33d; --marigold-deep:#c9811f;
  --rye:#6b7a3b; --rye-deep:#4f5c29;
  --berry:#b84a5c; --sky:#dcecf1;
  --radius:16px; --shadow:0 10px 30px rgba(74,44,23,.12);
  --header-h:60px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{margin:0;background:var(--cream);color:var(--ink);font:16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;overflow-x:hidden}
h1,h2,h3{font-family:Georgia,"Times New Roman",serif;line-height:1.15;margin:0 0 .4em}
h1{font-size:clamp(2rem,6vw,3.4rem);font-style:italic}
h2{font-size:clamp(1.6rem,4vw,2.3rem)}
h3{font-size:1.1rem}
p{margin:0 0 1em}
a{color:var(--rye-deep)}
button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.wrap{width:100%;max-width:1100px;margin:0 auto;padding:0 16px}
.ink{stroke:var(--ink);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.sr{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

/* header */
.top{position:sticky;top:0;z-index:30;height:var(--header-h);background:rgba(251,244,232,.92);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:2px dashed rgba(74,44,23,.18)}
.top .wrap{display:flex;align-items:center;gap:10px;height:100%}
.brand{display:flex;align-items:center;gap:8px;font-family:Georgia,serif;font-style:italic;font-size:1.2rem;text-decoration:none;color:var(--ink);min-height:44px}
.brand svg{width:34px;height:34px}
.nav{display:none;gap:4px;margin-left:8px}
.nav a{text-decoration:none;color:var(--ink-soft);padding:10px 12px;border-radius:10px;min-height:44px;display:inline-flex;align-items:center}
.nav a:active{background:var(--cream-2)}
@media(min-width:760px){.nav{display:flex}}
.spacer{flex:1}
.icon-btn{display:inline-flex;align-items:center;gap:6px;min-height:44px;min-width:44px;padding:8px 12px;border-radius:12px;border:2px solid rgba(74,44,23,.2);background:var(--paper);font-size:.9rem;font-weight:600}
.icon-btn svg{width:20px;height:20px}
.icon-btn:active{transform:scale(.96)}
.icon-btn .lbl{display:none}
@media(min-width:480px){.icon-btn .lbl{display:inline}}

/* hero */
.hero{padding:32px 0 24px;position:relative;overflow:hidden}
.hero .wrap{display:grid;gap:20px;align-items:center}
@media(min-width:800px){.hero .wrap{grid-template-columns:1.1fr 1fr;gap:40px}.hero{padding:56px 0 40px}}
.shop{width:100%;height:auto;max-height:46vh;display:block;animation:bob 6s ease-in-out infinite}
@keyframes bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
.eyebrow{display:inline-block;background:var(--rye);color:var(--cream);font-size:.78rem;letter-spacing:.12em;text-transform:uppercase;padding:6px 12px;border-radius:999px;margin-bottom:12px;font-weight:700}
.lead{font-size:1.1rem;color:var(--ink-soft);max-width:48ch}
.cta-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:10px 20px;border-radius:14px;border:2px solid var(--ink);background:var(--marigold);color:var(--ink);font-weight:700;text-decoration:none;box-shadow:3px 3px 0 var(--ink);transition:transform .12s,box-shadow .12s}
.btn:active,.btn.pressed{transform:translate(2px,2px);box-shadow:1px 1px 0 var(--ink)}
.btn.ghost{background:var(--paper)}
.btn.rye{background:var(--rye);color:var(--cream)}
.btn[disabled]{opacity:.5;box-shadow:none;transform:none;cursor:not-allowed}

/* sections */
section{padding:40px 0}
@media(min-width:800px){section{padding:64px 0}}
.sec-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:8px;margin-bottom:20px}
.sec-head p{color:var(--ink-soft);margin:0}
.bakes{background:var(--paper);border-top:2px dashed rgba(74,44,23,.18);border-bottom:2px dashed rgba(74,44,23,.18)}
.cards{display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
.card{background:var(--cream);border:2px solid rgba(74,44,23,.15);border-radius:var(--radius);padding:14px;display:flex;flex-direction:column;gap:8px;position:relative}
.card .art{width:96px;height:96px;margin:0 auto;display:block}
.card h3{margin:0}
.card .desc{font-size:.92rem;color:var(--ink-soft);margin:0;flex:1}
.card .row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.price{font-weight:800;font-family:Georgia,serif;font-size:1.15rem}
.chips{display:flex;flex-wrap:wrap;gap:4px}
.chip{font-size:.7rem;font-weight:700;letter-spacing:.04em;padding:3px 7px;border-radius:999px;background:var(--cream-2);color:var(--ink-soft);border:1px solid rgba(74,44,23,.15)}
.chip.v{background:#e4ebcf;color:var(--rye-deep)}.chip.nf{background:#f8e3cf;color:#9a5a1f}.chip.gf{background:#fbe6d6;color:#8b3b2a}
.add-sm{min-height:44px;padding:6px 14px;border-radius:12px;border:2px solid var(--ink);background:var(--marigold);font-weight:700;box-shadow:2px 2px 0 var(--ink)}
.add-sm:active{transform:translate(1px,1px);box-shadow:1px 1px 0 var(--ink)}

/* configurator */
.builder{display:grid;gap:20px}
@media(min-width:860px){.builder{grid-template-columns:1fr 1fr;align-items:start}}
.box-panel{position:sticky;top:calc(var(--header-h) + 8px);z-index:5;background:var(--cream);border:2px solid var(--ink);border-radius:var(--radius);padding:12px;box-shadow:var(--shadow)}
@media(min-width:860px){.box-panel{order:2;padding:18px}}
.sizes{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:var(--cream-2);padding:6px;border-radius:14px;margin-bottom:10px}
.size{min-height:44px;border:2px solid transparent;border-radius:10px;background:transparent;font-weight:700;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.1}
.size small{font-weight:500;font-size:.72rem;color:var(--ink-soft)}
.size[aria-pressed="true"]{background:var(--paper);border-color:var(--ink);box-shadow:2px 2px 0 var(--ink)}
.boxsvg{width:100%;height:auto;max-height:34vh;display:block;margin:0 auto}
@media(min-width:860px){.boxsvg{max-height:52vh}}
.boxsvg .slot{cursor:pointer;outline:none}
.boxsvg .slot:focus-visible .ring{stroke:var(--berry);stroke-width:3;stroke-dasharray:none}
.boxsvg .slot.filled .ring{stroke-dasharray:none;stroke:rgba(74,44,23,.25)}
.boxsvg .item{transform-box:fill-box;transform-origin:50% 50%}
.boxsvg .item.drop{animation:drop .5s cubic-bezier(.34,1.56,.64,1) both}
@keyframes drop{0%{transform:translateY(-40px) scale(.6);opacity:0}60%{transform:translateY(4px) scale(1.08);opacity:1}80%{transform:translateY(-3px) scale(.97)}100%{transform:translateY(0) scale(1)}}
.boxsvg .item.gone{animation:gone .25s ease-in both}
@keyframes gone{to{transform:scale(0);opacity:0}}
.boxsvg.shake{animation:shake .4s}
@keyframes shake{20%{transform:translateX(-6px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(4px)}}
.totals{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;flex-wrap:wrap}
.totals .meta{font-size:.9rem;color:var(--ink-soft)}
.totals .sum{font-family:Georgia,serif;font-size:1.5rem;font-weight:800}
.hint{font-size:.85rem;color:var(--ink-soft);margin:6px 0 0}
.picker{display:flex;flex-direction:column;gap:12px}
.filters{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.filters .lab{font-size:.85rem;color:var(--ink-soft);font-weight:600;margin-right:4px}
.filt{min-height:44px;padding:6px 14px;border-radius:999px;border:2px solid rgba(74,44,23,.25);background:var(--paper);font-weight:700;font-size:.9rem;display:inline-flex;align-items:center;gap:6px}
.filt .dot{width:10px;height:10px;border-radius:50%;background:rgba(74,44,23,.2)}
.filt[aria-pressed="true"]{border-color:var(--ink);background:var(--cream-2);box-shadow:2px 2px 0 var(--ink)}
.filt[aria-pressed="true"] .dot{background:var(--rye)}
.palette{display:grid;gap:10px;grid-template-columns:repeat(auto-fill,minmax(104px,1fr))}
.tile{background:var(--paper);border:2px solid rgba(74,44,23,.18);border-radius:14px;padding:8px 6px 10px;display:flex;flex-direction:column;align-items:center;gap:4px;min-height:44px;transition:opacity .25s,transform .12s,border-color .2s;position:relative}
.tile svg{width:64px;height:64px}
.tile .n{font-size:.78rem;font-weight:700;text-align:center;line-height:1.15}
.tile .p{font-size:.78rem;color:var(--ink-soft)}
.tile:active,.tile.pressed{transform:scale(.95)}
.tile.dim{opacity:.32;filter:grayscale(.6)}
.tile .cnt{position:absolute;top:-6px;right:-6px;min-width:22px;height:22px;border-radius:11px;background:var(--berry);color:#fff;font-size:.75rem;font-weight:800;display:none;align-items:center;justify-content:center;padding:0 5px;border:2px solid var(--cream)}
.tile .cnt.on{display:inline-flex}

/* hours */
.hours .wrap{display:grid;gap:20px}
@media(min-width:800px){.hours .wrap{grid-template-columns:1fr 1fr;align-items:start}}
.badge{display:inline-flex;align-items:center;gap:10px;padding:10px 16px;border-radius:999px;border:2px solid var(--ink);font-weight:800;background:var(--paper);box-shadow:3px 3px 0 var(--ink)}
.badge .pulse{width:12px;height:12px;border-radius:50%;background:#888;box-shadow:0 0 0 0 rgba(0,0,0,.2)}
.badge.open .pulse{background:#4caf50;animation:pulse 2s infinite}
.badge.closed .pulse{background:var(--berry)}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(76,175,80,.5)}70%{box-shadow:0 0 0 10px rgba(76,175,80,0)}100%{box-shadow:0 0 0 0 rgba(76,175,80,0)}}
.badge small{font-weight:500;color:var(--ink-soft)}
table{width:100%;border-collapse:collapse;background:var(--paper);border:2px solid rgba(74,44,23,.15);border-radius:var(--radius);overflow:hidden}
td,th{padding:10px 14px;text-align:left;border-bottom:1px dashed rgba(74,44,23,.18)}
tr:last-child td{border-bottom:none}
tr.today td{background:#fbe9c4;font-weight:700}
.addr{background:var(--rye);color:var(--cream);border-radius:var(--radius);padding:18px;margin-top:14px}
.addr p{margin:0 0 .4em}

/* footer */
footer{background:var(--ink);color:var(--cream-2);padding:32px 0;font-size:.9rem}
footer .wrap{display:flex;flex-wrap:wrap;gap:14px;justify-content:space-between;align-items:center}
footer a{color:var(--marigold)}
footer .sm{opacity:.7}

/* drawer */
.backdrop{position:fixed;inset:0;background:rgba(74,44,23,.45);opacity:0;pointer-events:none;transition:opacity .3s;z-index:40}
.backdrop.show{opacity:1;pointer-events:auto}
.drawer{position:fixed;z-index:50;background:var(--paper);border:2px solid var(--ink);box-shadow:var(--shadow);display:flex;flex-direction:column;transition:transform .35s cubic-bezier(.2,.8,.2,1);left:0;right:0;bottom:0;max-height:85vh;border-radius:22px 22px 0 0;transform:translateY(105%)}
.drawer.show{transform:translateY(0)}
@media(min-width:760px){.drawer{left:auto;top:0;bottom:0;width:400px;max-height:none;border-radius:22px 0 0 22px;transform:translateX(105%)}.drawer.show{transform:translateX(0)}}
.drawer header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:2px dashed rgba(74,44,23,.18)}
.drawer header h2{margin:0;font-size:1.4rem}
.drawer .body{padding:14px 16px;overflow:auto;flex:1}
.drawer .line{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px dashed rgba(74,44,23,.15)}
.drawer .line svg{width:40px;height:40px;flex:none}
.drawer .line .nm{flex:1;font-weight:600}
.drawer .line .q{color:var(--ink-soft);font-size:.9rem}
.drawer .tot{display:flex;justify-content:space-between;font-family:Georgia,serif;font-size:1.3rem;font-weight:800;padding:12px 0}
.drawer .note{font-size:.85rem;color:var(--ink-soft);background:var(--cream-2);padding:10px 12px;border-radius:10px}
.drawer .foot{padding:12px 16px;border-top:2px dashed rgba(74,44,23,.18);display:flex;gap:8px}
.drawer .foot .btn{flex:1}
.empty{color:var(--ink-soft);text-align:center;padding:20px 0}

/* toast + demo pointer */
.toast{position:fixed;left:50%;bottom:20px;transform:translate(-50%,20px);background:var(--ink);color:var(--cream);padding:10px 16px;border-radius:12px;font-weight:600;opacity:0;transition:opacity .25s,transform .25s;z-index:60;pointer-events:none;max-width:90vw;text-align:center}
.toast.show{opacity:1;transform:translate(-50%,0)}
#demoPtr{position:fixed;left:0;top:0;width:34px;height:34px;margin:-17px 0 0 -17px;border-radius:50%;background:rgba(184,74,92,.35);border:3px solid var(--berry);z-index:70;pointer-events:none;display:none;transition:left .55s cubic-bezier(.3,.7,.3,1),top .55s cubic-bezier(.3,.7,.3,1)}
#demoPtr.tap{animation:tap .3s}
@keyframes tap{50%{transform:scale(.6);background:rgba(184,74,92,.8)}}
#demoTag{position:fixed;top:calc(var(--header-h) + 10px);left:50%;transform:translateX(-50%);background:var(--berry);color:#fff;padding:6px 14px;border-radius:999px;font-weight:700;font-size:.85rem;z-index:70;display:none}

/* low-fx / reduced motion */
.low-fx .shop,.low-fx .badge .pulse{animation:none}
.low-fx .box-panel,.low-fx .btn,.low-fx .drawer{box-shadow:none}
.low-fx .top{backdrop-filter:none;-webkit-backdrop-filter:none;background:var(--cream)}
@media(prefers-reduced-motion:reduce){.shop,.badge .pulse{animation:none}.boxsvg .item.drop{animation-duration:.01s}html{scroll-behavior:auto}}
</style>
</head>
<body>

<svg width="0" height="0" style="position:absolute" aria-hidden="true">
<defs>
  <symbol id="p-croissant" viewBox="0 0 64 64">
    <path class="ink" fill="#eaa94c" d="M10 38c-4-8 2-18 10-19 5-1 8 2 12 2s7-3 12-2c8 1 14 11 10 19-2 4-6 4-8 1-2 3-6 4-10 4-3 0-6-1-8-3-2 2-6 3-8 0-2 3-6 3-10-2z"/>
    <path class="ink" fill="none" d="M22 23c2 4 2 10 0 16M32 22v18M42 23c-2 4-2 10 0 16"/>
    <path stroke="#fff" stroke-width="3" stroke-linecap="round" fill="none" opacity=".45" d="M15 29c2-3 4-5 7-6"/>
  </symbol>
  <symbol id="p-painchoc" viewBox="0 0 64 64">
    <rect class="ink" x="10" y="18" width="44" height="28" rx="6" fill="#e3a04c"/>
    <path class="ink" fill="none" d="M10 28h44M10 37h44"/>
    <rect x="16" y="31" width="32" height="3.5" rx="1.75" fill="#5a3320"/>
    <path stroke="#fff" stroke-width="3" stroke-linecap="round" fill="none" opacity=".45" d="M16 23h10"/>
  </symbol>
  <symbol id="p-cinnamon" viewBox="0 0 64 64">
    <circle class="ink" cx="32" cy="32" r="21" fill="#d9924a"/>
    <path class="ink" fill="none" d="M32 32c0-4 4-6 7-3s2 8-3 9-10-2-10-8 5-11 11-11 13 6 13 13-6 15-15 15-17-8-17-17"/>
    <path stroke="#fff" stroke-width="3" stroke-linecap="round" fill="none" opacity=".8" d="M22 19c3-2 6-3 9-3M41 46c3-2 5-4 7-7"/>
  </symbol>
  <symbol id="p-tart" viewBox="0 0 64 64">
    <circle cx="32" cy="32" r="25" fill="none" stroke="#4a2c17" stroke-width="2.5" stroke-dasharray="3.5 3"/>
    <circle class="ink" cx="32" cy="32" r="22" fill="#e8b765"/>
    <circle class="ink" cx="32" cy="32" r="15" fill="#c98a3f"/>
    <g class="ink" fill="#f6e3b8" stroke-width="1.5"><ellipse cx="26" cy="27" rx="4" ry="2" transform="rotate(-30 26 27)"/><ellipse cx="38" cy="29" rx="4" ry="2" transform="rotate(20 38 29)"/><ellipse cx="32" cy="38" rx="4" ry="2" transform="rotate(-10 32 38)"/></g>
  </symbol>
  <symbol id="p-muffin" viewBox="0 0 64 64">
    <path class="ink" fill="#f2d6a0" d="M16 32h32l-4 22H20z"/>
    <path class="ink" fill="none" d="M24 34l-1 18M32 34v18M40 34l1 18"/>
    <path class="ink" fill="#d9a05a" d="M14 32c-2-12 8-20 18-20s20 8 18 20z"/>
    <g fill="#4b5aa6" stroke="#4a2c17" stroke-width="1"><circle cx="24" cy="24" r="2.5"/><circle cx="34" cy="19" r="2.5"/><circle cx="41" cy="27" r="2.5"/><circle cx="30" cy="28" r="2"/></g>
  </symbol>
  <symbol id="p-lemon" viewBox="0 0 64 64">
    <path class="ink" fill="#f3d35a" d="M12 50L32 12l20 38z"/>
    <path stroke="#fff" stroke-width="3" fill="none" stroke-linecap="round" opacity=".9" d="M25 42l7-12 7 12M21 47h22"/>
    <circle class="ink" cx="32" cy="45" r="3" fill="#e8c23a" stroke-width="1.5"/>
  </symbol>
  <symbol id="p-rye" viewBox="0 0 64 64">
    <ellipse class="ink" cx="32" cy="32" rx="22" ry="16" fill="#a86b3c"/>
    <path class="ink" fill="none" d="M19 26c8 5 18 5 26 0"/>
    <g fill="#f3e0b5" stroke="#4a2c17" stroke-width="1"><ellipse cx="24" cy="37" rx="2.6" ry="1.3" transform="rotate(-20 24 37)"/><ellipse cx="33" cy="40" rx="2.6" ry="1.3" transform="rotate(15 33 40)"/><ellipse cx="41" cy="35" rx="2.6" ry="1.3" transform="rotate(-35 41 35)"/><ellipse cx="29" cy="31" rx="2.6" ry="1.3" transform="rotate(30 29 31)"/></g>
  </symbol>
  <symbol id="p-brownie" viewBox="0 0 64 64">
    <rect class="ink" x="12" y="12" width="40" height="40" rx="4" fill="#5b3221"/>
    <path stroke="#3b1e12" stroke-width="2" stroke-linecap="round" fill="none" d="M18 30c6-4 10 6 16 2s8 4 12 0M20 42c4-3 8 2 12 0"/>
    <g class="ink" fill="#c98a4a" stroke-width="1.5"><circle cx="24" cy="24" r="4"/><circle cx="40" cy="22" r="4"/><circle cx="35" cy="41" r="4"/></g>
  </symbol>
  <symbol id="i-sound" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M4 9v6h4l5 4V5L8 9H4zM16 9a4 4 0 0 1 0 6M18.5 6.5a8 8 0 0 1 0 11"/></symbol>
  <symbol id="i-mute" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M4 9v6h4l5 4V5L8 9H4zM16 9l5 6M21 9l-5 6"/></symbol>
  <symbol id="i-reset" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M3 12a9 9 0 1 0 3-6.7M3 4v5h5"/></symbol>
</defs>
</svg>

<header class="top">
  <div class="wrap">
    <a class="brand" href="#top" aria-label="Marigold and Rye, back to top">
      <svg viewBox="0 0 40 40" aria-hidden="true"><circle cx="20" cy="20" r="17" fill="#e8a33d" stroke="#4a2c17" stroke-width="2.5"/><circle cx="20" cy="20" r="6" fill="#4a2c17"/><g stroke="#4a2c17" stroke-width="2.5" stroke-linecap="round"><path d="M20 3v6M20 31v6M3 20h6M31 20h6M8 8l4 4M28 28l4 4M8 32l4-4M28 12l4-4"/></g></svg>
      Marigold &amp; Rye
    </a>
    <nav class="nav" aria-label="Sections">
      <a href="#bakes">Today's bakes</a><a href="#box">Build your box</a><a href="#hours">Hours</a>
    </nav>
    <span class="spacer"></span>
    <button class="icon-btn" id="muteBtn" aria-pressed="false" aria-label="Sound on, tap to mute"><svg><use href="#i-sound"/></svg><span class="lbl">Sound on</span></button>
    <button class="icon-btn" id="resetBtn" aria-label="Reset page"><svg><use href="#i-reset"/></svg><span class="lbl">Reset</span></button>
  </div>
</header>

<main id="top">
<section class="hero" aria-labelledby="heroTitle">
  <div class="wrap">
    <div>
      <span class="eyebrow">Corner of Larkspur &amp; 9th</span>
      <h1 id="heroTitle">Marigold &amp; Rye</h1>
      <p class="lead">A four-oven bakery that started as a Saturday bread stall outside our flat. Nine years on, we still mix the rye at 4 a.m., still name the sourdough starter (Agnes), and still sell out of croissants before the first bus goes by.</p>
      <div class="cta-row">
        <a class="btn" href="#box">Build your box</a>
        <a class="btn ghost" href="#bakes">See today's bakes</a>
      </div>
    </div>
    <svg class="shop" viewBox="0 0 400 300" role="img" aria-labelledby="shopTitle">
      <title id="shopTitle">Hand-drawn shop front of Marigold and Rye with a striped awning, a display window and a wooden door</title>
      <g id="sparkles"></g>
      <path class="ink" fill="none" d="M8 266c80-5 300-5 384 0"/>
      <path class="ink" fill="#f7e7c8" d="M40 100c100-6 220-6 320 0v166H40z"/>
      <path class="ink" fill="none" d="M60 110v150M340 110v150" stroke-dasharray="6 8" opacity=".3"/>
      <rect class="ink" x="86" y="62" width="228" height="42" rx="10" fill="#6b7a3b"/>
      <text x="200" y="91" text-anchor="middle" font-family="Georgia,serif" font-size="22" font-style="italic" fill="#fbf4e8">Marigold &amp; Rye</text>
      <path class="ink" fill="#e8a33d" d="M58 118h284l16 36H42z"/>
      <path class="ink" fill="none" stroke="#fbf4e8" d="M90 118l-8 36M130 118l-5 36M170 118l-2 36M210 118l1 36M250 118l4 36M290 118l6 36M330 118l8 36"/>
      <path class="ink" fill="#e8a33d" d="M42 154c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0c5 12 15 12 20 0"/>
      <rect class="ink" x="68" y="176" width="150" height="78" rx="7" fill="#dcecf1"/>
      <path class="ink" fill="none" d="M68 214h150" opacity=".5"/>
      <rect x="74" y="206" width="138" height="4" fill="#a86b3c"/>
      <rect x="74" y="244" width="138" height="4" fill="#a86b3c"/>
      <use href="#p-croissant" x="78" y="180" width="30" height="30"/>
      <use href="#p-cinnamon" x="110" y="180" width="30" height="30"/>
      <use href="#p-tart" x="142" y="180" width="30" height="30"/>
      <use href="#p-muffin" x="176" y="180" width="30" height="30"/>
      <use href="#p-rye" x="80" y="216" width="30" height="30"/>
      <use href="#p-brownie" x="112" y="216" width="30" height="30"/>
      <use href="#p-lemon" x="144" y="216" width="30" height="30"/>
      <use href="#p-painchoc" x="176" y="216" width="30" height="30"/>
      <rect class="ink" x="250" y="170" width="72" height="96" rx="9" fill="#a86b3c"/>
      <rect class="ink" x="262" y="182" width="48" height="34" rx="4" fill="#dcecf1"/>
      <rect class="ink" x="266" y="190" width="40" height="16" rx="3" fill="#fbf4e8" stroke-width="1.5"/>
      <text id="shopSign" x="286" y="202" text-anchor="middle" font-family="system-ui,sans-serif" font-size="9" font-weight="700" fill="#4a2c17">OPEN</text>
      <circle class="ink" cx="310" cy="232" r="4" fill="#e8a33d" stroke-width="1.5"/>
      <path class="ink" fill="none" d="M262 226h20" opacity=".4"/>
      <path class="ink" fill="#c0653d" d="M44 244h30l-4 22H48z"/>
      <path class="ink" fill="#c0653d" d="M334 244h30l-4 22h-22z"/>
      <g class="ink" stroke-width="2" fill="#e8a33d"><circle cx="52" cy="236" r="6"/><circle cx="66" cy="232" r="6"/><circle cx="59" cy="226" r="6"/><circle cx="342" cy="236" r="6"/><circle cx="356" cy="232" r="6"/><circle cx="349" cy="226" r="6"/></g>
      <path class="ink" fill="none" stroke="#4f5c29" d="M59 240v-6M349 240v-6"/>
      <path class="ink" fill="none" d="M360 110v-14h18" />
      <path class="ink" fill="#fbf4e8" d="M370 96l-8 16h16z"/>
      <circle cx="378" cy="118" r="4" fill="#f3d35a" class="ink" stroke-width="1.5"/>
      <path class="ink" fill="none" opacity=".35" d="M30 120c-6 0-10-4-10-10s6-10 12-8c2-8 16-8 18 0 6-2 12 2 12 8s-4 10-10 10z"/>
    </svg>
  </div>
</section>

<section class="bakes" id="bakes" aria-labelledby="bakesTitle">
  <div class="wrap">
    <div class="sec-head">
      <div><h2 id="bakesTitle">Today's bakes</h2><p>Out of the ovens this morning, baked in small batches until they are gone.</p></div>
    </div>
    <div class="cards" id="cards"></div>
  </div>
</section>

<section id="box" aria-labelledby="boxTitle">
  <div class="wrap">
    <div class="sec-head">
      <div><h2 id="boxTitle">Build your box</h2><p>Pick a size, tap pastries to drop them in, tap anything in the box to take it out.</p></div>
    </div>
    <div class="builder">
      <div class="box-panel">
        <div class="sizes" role="group" aria-label="Box size">
          <button class="size" data-size="4" aria-pressed="false">4<small>Little box</small></button>
          <button class="size" data-size="6" aria-pressed="true">6<small>Half dozen</small></button>
          <button class="size" data-size="12" aria-pressed="false">12<small>Big box</small></button>
        </div>
        <svg class="boxsvg" id="boxSvg" role="group" aria-label="Your pastry box"></svg>
        <div class="totals">
          <div><div class="meta" id="slotMeta">0 of 6 slots filled</div><div class="sum" id="total">$0.00</div></div>
          <button class="btn rye" id="checkoutBtn" disabled>Checkout</button>
        </div>
        <p class="hint" id="liveHint" aria-live="polite">Your box is empty. Tap a pastry below to start.</p>
      </div>
      <div class="picker">
        <div class="filters" role="group" aria-label="Dietary filters">
          <span class="lab">Show only:</span>
          <button class="filt" data-filter="vegan" aria-pressed="false"><span class="dot"></span>Vegan</button>
          <button class="filt" data-filter="nf" aria-pressed="false"><span class="dot"></span>Nut-free</button>
          <button class="filt" data-filter="gf" aria-pressed="false"><span class="dot"></span>Gluten-free</button>
        </div>
        <div class="palette" id="palette"></div>
      </div>
    </div>
  </div>
</section>

<section class="hours" id="hours" aria-labelledby="hoursTitle">
  <div class="wrap">
    <div>
      <h2 id="hoursTitle">Opening hours</h2>
      <div class="badge" id="badge"><span class="pulse"></span><span id="badgeText">Checking the clock…</span></div>
      <p class="hint" style="margin-top:10px">Based on the time on your device.</p>
      <div class="addr">
        <p><strong>Marigold &amp; Rye</strong></p>
        <p>14 Larkspur Street, corner of 9th</p>
        <p>Pre-ordered boxes are ready from 8 a.m. at the counter.</p>
      </div>
    </div>
    <table aria-label="Opening hours by day"><tbody id="hoursBody"></tbody></table>
  </div>
</section>
</main>

<footer>
  <div class="wrap">
    <div><strong>Marigold &amp; Rye</strong> · Neighborhood bakery since 2017<br><span class="sm">Everything here is drawn and written for a fictional bakery. No orders are sent anywhere.</span></div>
    <div class="sm">Starter named Agnes · Ovens lit at 4 a.m.</div>
  </div>
</footer>

<div class="backdrop" id="backdrop"></div>
<aside class="drawer" id="drawer" role="dialog" aria-modal="true" aria-labelledby="drawerTitle" aria-hidden="true">
  <header><h2 id="drawerTitle">Your box</h2><button class="icon-btn" id="closeDrawer" aria-label="Close summary">Close</button></header>
  <div class="body" id="drawerBody"></div>
  <div class="foot">
    <button class="btn ghost" id="drawerEdit">Keep building</button>
    <button class="btn" id="drawerDone">Looks good</button>
  </div>
</aside>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<div id="demoPtr" aria-hidden="true"></div>
<div id="demoTag" aria-hidden="true">Demo — tap anywhere to take over</div>

<script>
(function(){
'use strict';
/* ---------- seeded randomness ---------- */
function mulberry32(a){return function(){a|=0;a=a+0x6D2B79F5|0;let t=Math.imul(a^a>>>15,1|a);t=t+Math.imul(t^t>>>7,61|t)^t;return((t^t>>>14)>>>0)/4294967296}}
const rnd=mulberry32(20261001);

/* ---------- data ---------- */
const PASTRIES=[
 {id:'croissant',name:'Butter Croissant',price:3.5,desc:'Laminated over three days, baked at dawn. Shatters when you look at it.',vegan:0,nf:1,gf:0},
 {id:'painchoc',name:'Pain au Chocolat',price:4,desc:'Two batons of dark chocolate tucked into croissant dough.',vegan:0,nf:1,gf:0},
 {id:'cinnamon',name:'Cinnamon Knot',price:3.75,desc:'Cardamom-cinnamon dough, twisted and glazed. Made with plant butter.',vegan:1,nf:1,gf:0},
 {id:'tart',name:'Almond Frangipane Tart',price:4.5,desc:'Crimped shortcrust, toasted almond cream, a few slivers on top.',vegan:0,nf:0,gf:0},
 {id:'muffin',name:'Blueberry Oat Muffin',price:3.25,desc:'Oat flour and wild blueberries. Our most-requested gluten-free bake.',vegan:1,nf:1,gf:1},
 {id:'lemon',name:'Lemon Polenta Slice',price:4.25,desc:'Sunny polenta cake soaked in lemon syrup, no wheat flour in sight.',vegan:0,nf:1,gf:1},
 {id:'rye',name:'Seeded Rye Roll',price:2.5,desc:'Dark rye with caraway and sunflower seeds. Named after the bakery, or vice versa.',vegan:1,nf:1,gf:0},
 {id:'brownie',name:'Hazelnut Brownie',price:3.75,desc:'Fudgy, flourless, studded with roasted hazelnuts.',vegan:0,nf:0,gf:1}
];
const byId={};PASTRIES.forEach(p=>byId[p.id]=p);
const HOURS=[[8,14],[7,18],[7,18],[7,18],[7,18],[7,19],[8,16]]; // Sun..Sat
const DAYS=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
const LAYOUT={4:{c:2,r:2},6:{c:3,r:2},12:{c:4,r:3}};

const state={size:6,slots:[],filters:{vegan:false,nf:false,gf:false},muted:false};
try{ if(localStorage.getItem('mr-muted')==='1') state.muted=true; }catch(e){}

const $=s=>document.querySelector(s);
const money=n=>'$'+n.toFixed(2);
const matches=p=>(!state.filters.vegan||p.vegan)&&(!state.filters.nf||p.nf)&&(!state.filters.gf||p.gf);

/* ---------- sound (Web Audio, starts after a tap) ---------- */
let actx=null;
function unlockAudio(){ if(actx) return; try{ actx=new (window.AudioContext||window.webkitAudioContext)(); }catch(e){actx=null;} }
function tone(f1,f2,dur,type,vol){
  if(state.muted||!actx) return;
  try{
    if(actx.state==='suspended') actx.resume();
    const o=actx.createOscillator(),g=actx.createGain(),t=actx.currentTime;
    o.type=type||'sine';o.frequency.setValueAtTime(f1,t);o.frequency.exponentialRampToValueAtTime(f2,t+dur);
    g.gain.setValueAtTime(0.0001,t);g.gain.exponentialRampToValueAtTime(vol||.15,t+.01);g.gain.exponentialRampToValueAtTime(0.0001,t+dur);
    o.connect(g).connect(actx.destination);o.start(t);o.stop(t+dur+.02);
  }catch(e){}
}
const sfx={drop:()=>tone(520,260,.14,'sine',.18),remove:()=>tone(240,480,.12,'triangle',.12),nope:()=>tone(180,120,.2,'square',.06),click:()=>tone(900,700,.05,'sine',.08),ding:()=>{tone(880,880,.3,'sine',.12);setTimeout(()=>tone(1320,1320,.35,'sine',.1),120)}};
document.addEventListener('pointerdown',unlockAudio,{passive:true});

const muteBtn=$('#muteBtn');
function renderMute(){
  muteBtn.setAttribute('aria-pressed',state.muted?'true':'false');
  muteBtn.setAttribute('aria-label',state.muted?'Sound off, tap to unmute':'Sound on, tap to mute');
  muteBtn.innerHTML='<svg><use href="#'+(state.muted?'i-mute':'i-sound')+'"/></svg><span class="lbl">'+(state.muted?'Sound off':'Sound on')+'</span>';
}
muteBtn.addEventListener('click',()=>{state.muted=!state.muted;try{localStorage.setItem('mr-muted',state.muted?'1':'0')}catch(e){}renderMute();sfx.click();});
renderMute();

/* ---------- toast ---------- */
let toastT=null;
function toast(msg){const t=$('#toast');t.textContent=msg;t.classList.add('show');clearTimeout(toastT);toastT=setTimeout(()=>t.classList.remove('show'),1800);}

/* ---------- press feedback via Pointer Events ---------- */
document.addEventListener('pointerdown',e=>{const b=e.target.closest('.tile,.btn');if(b){b.classList.add('pressed');}},{passive:true});
['pointerup','pointercancel','pointerleave'].forEach(ev=>document.addEventListener(ev,()=>{document.querySelectorAll('.pressed').forEach(el=>el.classList.remove('pressed'))},{passive:true}));

/* ---------- today's bakes cards ---------- */
function chips(p){
  let h='';
  if(p.vegan) h+='<span class="chip v">Vegan</span>';
  if(p.nf) h+='<span class="chip nf">Nut-free</span>';
  if(p.gf) h+='<span class="chip gf">Gluten-free</span>';
  return '<div class="chips">'+h+'</div>';
}
$('#cards').innerHTML=PASTRIES.map(p=>
 '<article class="card"><svg class="art" aria-hidden="true"><use href="#p-'+p.id+'"/></svg><h3>'+p.name+'</h3><p class="desc">'+p.desc+'</p>'+chips(p)+
 '<div class="row"><span class="price">'+money(p.price)+'</span><button class="add-sm" data-add="'+p.id+'" aria-label="Add '+p.name+' to box">Add to box</button></div></article>').join('');
$('#cards').addEventListener('click',e=>{
  const b=e.target.closest('[data-add]');if(!b) return;
  if(addItem(b.dataset.add,true)){ toast(byId[b.dataset.add].name+' added to your box'); }
});

/* ---------- palette ---------- */
const palette=$('#palette');
palette.innerHTML=PASTRIES.map(p=>
 '<button class="tile" data-id="'+p.id+'" aria-label="Add '+p.name+', '+money(p.price)+'"><span class="cnt" aria-hidden="true">0</span><svg aria-hidden="true"><use href="#p-'+p.id+'"/></svg><span class="n">'+p.name+'</span><span class="p">'+money(p.price)+'</span></button>').join('');
palette.addEventListener('click',e=>{const t=e.target.closest('.tile');if(t) addItem(t.dataset.id,false);});
function renderPalette(){
  palette.querySelectorAll('.tile').forEach(t=>{
    const p=byId[t.dataset.id],ok=matches(p);
    t.classList.toggle('dim',!ok);
    t.setAttribute('aria-disabled',ok?'false':'true');
    const n=state.slots.filter(s=>s===p.id).length,c=t.querySelector('.cnt');
    c.textContent=n;c.classList.toggle('on',n>0);
  });
}
document.querySelectorAll('.filt').forEach(b=>b.addEventListener('click',()=>{
  const k=b.dataset.filter;state.filters[k]=!state.filters[k];
  b.setAttribute('aria-pressed',state.filters[k]?'true':'false');sfx.click();renderPalette();
}));

/* ---------- box ---------- */
const boxSvg=$('#boxSvg');
let lastAdded=-1,pendingRemove=-1;
function addItem(id,fromCards){
  const p=byId[id];
  if(!matches(p)){ sfx.nope(); toast(p.name+' does not match your filters'); return false; }
  if(state.slots.length>=state.size){
    sfx.nope(); boxSvg.classList.remove('shake'); void boxSvg.offsetWidth; boxSvg.classList.add('shake');
    toast('Your box of '+state.size+' is full. Pick a bigger box or take something out.');
    if(fromCards) $('#box').scrollIntoView({block:'start'});
    return false;
  }
  state.slots.push(id);lastAdded=state.slots.length-1;sfx.drop();renderBox();
  return true;
}
function removeAt(i){
  if(i<0||i>=state.slots.length) return;
  const g=boxSvg.querySelector('[data-i="'+i+'"] .item');
  const done=()=>{state.slots.splice(i,1);lastAdded=-1;renderBox();};
  sfx.remove();
  if(g&&!document.documentElement.classList.contains('low-fx')){g.classList.add('gone');setTimeout(done,220);} else done();
}
function renderBox(){
  const L=LAYOUT[state.size],cell=76,pad=18,w=L.c*cell+pad*2,h=L.r*cell+pad*2;
  boxSvg.setAttribute('viewBox','0 0 '+w+' '+h);
  let s='<rect x="2" y="2" width="'+(w-4)+'" height="'+(h-4)+'" rx="12" fill="#d8b98b" stroke="#4a2c17" stroke-width="3"/>';
  s+='<rect x="'+(pad-8)+'" y="'+(pad-8)+'" width="'+(w-pad*2+16)+'" height="'+(h-pad*2+16)+'" rx="8" fill="#c9a371" stroke="#4a2c17" stroke-width="1.5" opacity=".9"/>';
  // paper liner texture, seeded
  const r2=mulberry32(7+state.size);
  for(let k=0;k<L.c*L.r*3;k++){const x=pad+r2()*(w-pad*2),y=pad+r2()*(h-pad*2);s+='<circle cx="'+x.toFixed(1)+'" cy="'+y.toFixed(1)+'" r="1.2" fill="#4a2c17" opacity=".12"/>';}
  for(let i=0;i<state.size;i++){
    const col=i%L.c,row=Math.floor(i/L.c),cx=pad+col*cell+cell/2,cy=pad+row*cell+cell/2,id=state.slots[i];
    if(id){
      const p=byId[id];
      s+='<g class="slot filled" data-i="'+i+'" tabindex="0" role="button" aria-label="Remove '+p.name+' from slot '+(i+1)+'">'+
         '<circle class="ring" cx="'+cx+'" cy="'+cy+'" r="31" fill="#f3e6cf" stroke="#4a2c17" stroke-width="2" stroke-dasharray="4 4"/>'+
         '<g class="item'+(i===lastAdded?' drop':'')+'"><use href="#p-'+id+'" x="'+(cx-30)+'" y="'+(cy-30)+'" width="60" height="60"/></g></g>';
    } else {
      s+='<g class="slot" data-i="'+i+'" aria-hidden="true"><circle class="ring" cx="'+cx+'" cy="'+cy+'" r="31" fill="rgba(255,250,241,.55)" stroke="#4a2c17" stroke-width="2" stroke-dasharray="4 4" opacity=".55"/>'+
         '<text x="'+cx+'" y="'+(cy+5)+'" text-anchor="middle" font-size="14" font-family="Georgia,serif" fill="#4a2c17" opacity=".35">'+(i+1)+'</text></g>';
    }
  }
  boxSvg.innerHTML=s;lastAdded=-1;
  const total=state.slots.reduce((a,id)=>a+byId[id].price,0),n=state.slots.length;
  $('#total').textContent=money(total);
  $('#slotMeta').textContent=n+' of '+state.size+' slots filled';
  $('#checkoutBtn').disabled=n===0;
  $('#liveHint').textContent=n===0?'Your box is empty. Tap a pastry below to start.':n===state.size?'Your box is full and ready for checkout.':(state.size-n)+' more '+(state.size-n===1?'slot':'slots')+' to fill, or checkout whenever you like.';
  renderPalette();
}
boxSvg.addEventListener('click',e=>{const g=e.target.closest('.slot.filled');if(g) removeAt(+g.dataset.i);});
boxSvg.addEventListener('keydown',e=>{if((e.key==='Enter'||e.key===' ')&&e.target.classList&&e.target.classList.contains('filled')){e.preventDefault();removeAt(+e.target.dataset.i);}});
document.querySelectorAll('.size').forEach(b=>b.addEventListener('click',()=>setSize(+b.dataset.size)));
function setSize(n){
  if(n===state.size) return;
  document.querySelectorAll('.size').forEach(x=>x.setAttribute('aria-pressed',+x.dataset.size===n?'true':'false'));
  if(state.slots.length>n){state.slots.length=n;toast('Trimmed to the first '+n+' pastries');}
  state.size=n;sfx.click();renderBox();
}

/* ---------- checkout drawer ---------- */
const drawer=$('#drawer'),backdrop=$('#backdrop');
let lastFocus=null;
function openDrawer(){
  const counts={};state.slots.forEach(id=>counts[id]=(counts[id]||0)+1);
  const total=state.slots.reduce((a,id)=>a+byId[id].price,0);
  let h='<p class="hint" style="margin:0 0 8px">Box of '+state.size+' · '+state.slots.length+' '+(state.slots.length===1?'pastry':'pastries')+'</p>';
  if(!state.slots.length) h+='<p class="empty">Nothing in the box yet.</p>';
  Object.keys(counts).forEach(id=>{const p=byId[id];h+='<div class="line"><svg aria-hidden="true"><use href="#p-'+id+'"/></svg><span class="nm">'+p.name+'<br><span class="q">'+counts[id]+' × '+money(p.price)+'</span></span><span class="price">'+money(p.price*counts[id])+'</span></div>';});
  h+='<div class="tot"><span>Total</span><span>'+money(total)+'</span></div>';
  h+='<p class="note">This is an order summary only. Nothing is sent and no payment is taken. Show it at the counter at 14 Larkspur Street and we will box it up fresh.</p>';
  $('#drawerBody').innerHTML=h;
  lastFocus=document.activeElement;
  drawer.classList.add('show');backdrop.classList.add('show');drawer.setAttribute('aria-hidden','false');
  sfx.ding();setTimeout(()=>$('#closeDrawer').focus(),350);
}
function closeDrawer(){
  if(!drawer.classList.contains('show')) return;
  drawer.classList.remove('show');backdrop.classList.remove('show');drawer.setAttribute('aria-hidden','true');sfx.click();
  if(lastFocus&&lastFocus.focus) lastFocus.focus();
}
$('#checkoutBtn').addEventListener('click',openDrawer);
$('#closeDrawer').addEventListener('click',closeDrawer);
$('#drawerEdit').addEventListener('click',closeDrawer);
$('#drawerDone').addEventListener('click',()=>{closeDrawer();toast('See you at the counter!');});
backdrop.addEventListener('click',closeDrawer);
document.addEventListener('keydown',e=>{if(e.key==='Escape') closeDrawer();});

/* ---------- reset ---------- */
function resetAll(){
  state.slots=[];state.filters={vegan:false,nf:false,gf:false};
  document.querySelectorAll('.filt').forEach(b=>b.setAttribute('aria-pressed','false'));
  document.querySelectorAll('.size').forEach(x=>x.setAttribute('aria-pressed',x.dataset.size==='6'?'true':'false'));
  state.size=6;closeDrawer();renderBox();
}
$('#resetBtn').addEventListener('click',()=>{resetAll();sfx.click();toast('Box emptied and filters cleared');});

/* ---------- hours + live badge ---------- */
function fmt(h){const hh=((h+11)%12)+1,m=h<12?'a.m.':'p.m.';return hh+':00 '+m;}
function renderHours(){
  const now=new Date(),d=now.getDay(),mins=now.getHours()*60+now.getMinutes();
  $('#hoursBody').innerHTML=HOURS.map((hr,i)=>'<tr'+(i===d?' class="today"':'')+'><th scope="row">'+DAYS[i]+'</th><td>'+fmt(hr[0])+' – '+fmt(hr[1])+'</td></tr>').join('');
  const [o,c]=HOURS[d],open=mins>=o*60&&mins<c*60,badge=$('#badge');
  badge.classList.toggle('open',open);badge.classList.toggle('closed',!open);
  let txt;
  if(open) txt='Open now <small>· closes at '+fmt(c)+'</small>';
  else if(mins<o*60) txt='Closed <small>· opens today at '+fmt(o)+'</small>';
  else txt='Closed <small>· opens '+(d===6?'Sunday':'tomorrow')+' at '+fmt(HOURS[(d+1)%7][0])+'</small>';
  $('#badgeText').innerHTML=txt;
  $('#shopSign').textContent=open?'OPEN':'CLOSED';
}
renderHours();setInterval(renderHours,30000);

/* ---------- hero sparkles (seeded) ---------- */
(function(){
  let s='';
  for(let i=0;i<14;i++){
    const x=20+rnd()*360,y=14+rnd()*50,r=1.5+rnd()*2.5;
    s+='<circle cx="'+x.toFixed(1)+'" cy="'+y.toFixed(1)+'" r="'+r.toFixed(1)+'" fill="#e8a33d" opacity="'+(.3+rnd()*.5).toFixed(2)+'"/>';
  }
  for(let i=0;i<10;i++){
    const x=30+rnd()*340,y=270+rnd()*16;
    s+='<ellipse cx="'+x.toFixed(1)+'" cy="'+y.toFixed(1)+'" rx="2.5" ry="1.2" fill="#a86b3c" opacity=".5" transform="rotate('+Math.round(rnd()*180)+' '+x.toFixed(1)+' '+y.toFixed(1)+')"/>';
  }
  $('#sparkles').innerHTML=s;
})();

/* ---------- performance probe ---------- */
(function(){
  let frames=0,t0=0;
  function probe(t){ if(!t0){t0=t;} frames++; if(t-t0>1500){ if(frames/((t-t0)/1000)<40) document.documentElement.classList.add('low-fx'); return; } requestAnimationFrame(probe); }
  requestAnimationFrame(probe);
})();

/* ---------- demo mode ---------- */
const demo={active:false,token:0};
const ptr=$('#demoPtr'),tag=$('#demoTag');
const sleep=ms=>new Promise(r=>setTimeout(r,ms));
async function demoTap(sel,token,wait){
  const el=typeof sel==='string'?document.querySelector(sel):sel;
  if(!el||token!==demo.token) return;
  el.scrollIntoView({block:'center',behavior:'smooth'});
  await sleep(550); if(token!==demo.token) return;
  const r=el.getBoundingClientRect();
  ptr.style.left=(r.left+r.width/2)+'px';ptr.style.top=(r.top+r.height/2)+'px';
  await sleep(600); if(token!==demo.token) return;
  ptr.classList.remove('tap');void ptr.offsetWidth;ptr.classList.add('tap');
  el.click();
  await sleep(wait||450);
}
async function runDemo(){
  const token=++demo.token;demo.active=true;ptr.style.display='block';tag.style.display='block';
  ptr.style.left='50%';ptr.style.top='50%';
  while(demo.active&&token===demo.token){
    resetAll();
    window.scrollTo({top:0,behavior:'smooth'});await sleep(900);
    await demoTap('.size[data-size="6"]',token);
    for(const id of ['croissant','cinnamon','tart','muffin','painchoc']) await demoTap('.tile[data-id="'+id+'"]',token,500);
    await demoTap('.filt[data-filter="vegan"]',token,800);
    await demoTap('.tile[data-id="rye"]',token,600);
    await demoTap('.filt[data-filter="vegan"]',token,500);
    await demoTap(boxSvg.querySelector('[data-i="2"]'),token,700);
    await demoTap('.size[data-size="12"]',token,700);
    await demoTap('#checkoutBtn',token,2200);
    await demoTap('#closeDrawer',token,600);
    await demoTap('#resetBtn',token,900);
  }
}
function stopDemo(){ if(!demo.active) return; demo.active=false;demo.token++;ptr.style.display='none';tag.style.display='none'; }
['pointerdown','keydown','wheel','touchstart'].forEach(ev=>window.addEventListener(ev,e=>{if(demo.active&&e.isTrusted) stopDemo();},{capture:true,passive:true}));

/* ---------- init ---------- */
renderBox();
if(location.hash==='#demo'){ setTimeout(runDemo,400); }
window.addEventListener('hashchange',()=>{ if(location.hash==='#demo'&&!demo.active) runDemo(); });
requestAnimationFrame(()=>requestAnimationFrame(()=>{ try{ parent.postMessage({vcb:'ready'},'*'); }catch(e){} }));
})();
</script>
</body>
</html>