/* Trish the Kitchen Witch
   Palette pulled from the logo (navy + gilt), set on aged parchment. */
/* P052 from the Kitchen Witch type kit (URW++, AGPL-3 with font exception; see fonts/LICENSE-P052.txt) */
@font-face { font-family: "P052"; src: url("fonts/P052-Roman.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "P052"; src: url("fonts/P052-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "P052"; src: url("fonts/P052-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "P052"; src: url("fonts/P052-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --ground: #ecdfc2;      /* aged parchment: page ground */
  --parchment: #f8f0dd;   /* a fresher sheet: cards, drawer, light text on navy */
  --sheet: rgba(250, 243, 227, .72); /* cards let the paper grain show through */
  --crust: #122d4f;       /* logo navy: text, primary */
  --cocoa: #0b1c33;       /* deep navy: footer */
  --gilt: #b98532;        /* logo gold: accents */
  --honey: #e8c57a;       /* light gold on dark */
  --sage: #6f7d5c;        /* herb notes */
  --line: #d6c49c;
  --muted: #4f5a70;

  --display: "P052", "Palatino Linotype", Palatino, Georgia, serif;  /* headlines, italic accents, bold subheads */
  --body: "Karla", system-ui, sans-serif;

  --radius: 14px;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--crust);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
/* Parchment: a fixed wash of warm color behind everything. Soft gradients only, so there are no tile edges. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(150, 105, 40, .2) 100%),
    radial-gradient(ellipse 45% 35% at 18% 22%, rgba(196, 150, 80, .16), transparent 70%),
    radial-gradient(ellipse 40% 45% at 82% 68%, rgba(190, 140, 70, .14), transparent 70%),
    radial-gradient(ellipse 35% 30% at 70% 12%, rgba(255, 248, 228, .45), transparent 70%),
    radial-gradient(ellipse 50% 40% at 30% 85%, rgba(255, 246, 224, .35), transparent 70%);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; letter-spacing: -.01em; margin: 0; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--gilt); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--crust); color: var(--parchment); padding: 10px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand-name { font-family: var(--display); font-size: .95rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.brand-name em { font-size: 1.1em; letter-spacing: .02em; text-transform: lowercase; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--gilt); }

.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 .95rem var(--body); color: var(--parchment);
  background: var(--crust); border: 0; border-radius: 999px;
  padding: 9px 10px 9px 16px; cursor: pointer;
}
.cart-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.cart-count {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--honey); color: var(--cocoa); font-weight: 700; font-size: .8rem;
}
.cart-count.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) var(--gutter) clamp(12px, 2vw, 24px);
  display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: clamp(24px, 5vw, 72px);
}
.hero-mark { position: relative; aspect-ratio: 1; }
.hero-mark::before {           /* soft sun of gold behind the knot */
  content: ""; position: absolute; inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--honey) 55%, transparent) 0%, transparent 68%);
}
.hero-knot { position: relative; width: 100%; animation: turn 90s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }

.hero-logo { width: min(100%, 520px); height: auto; margin-bottom: 20px; }
.hero-lede { font-size: 1.2rem; width: min(100%, 520px); color: var(--muted); } /* spans the width of the logo above it */
.hero-lede strong { color: var(--crust); }



/* ---------- Sections ---------- */
.menu, .ordering {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) var(--gutter);
}
.menu { padding-top: clamp(16px, 3vw, 40px); }
.section-head { max-width: 640px; margin-bottom: 32px; }
.eyebrow { font-family: var(--display); font-weight: 700; color: var(--gilt); font-size: .85rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 8px; }
.section-head h2 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.section-note { margin-top: 12px; color: var(--muted); }

/* ---------- The menu book ---------- */
.book { --board: #14294a; --page: #f6ecd3; --page-edge: #e4d3aa; --inset: 14px;
  position: relative; max-width: 1020px; margin: 8px auto 0; }
.book-body {
  position: relative; height: 640px; perspective: 2600px;
  transition: transform 1s cubic-bezier(.4, .1, .2, 1);
}
.book-board {
  position: absolute; inset: 0; z-index: 1; border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 6% 94%, rgba(0, 0, 0, .25)),
    linear-gradient(90deg, #1a3560 0 48.6%, #0b1a33 49.3% 50.7%, #1a3560 51.4%);
  box-shadow: 0 34px 60px -30px rgba(60, 38, 8, .65), 0 10px 20px -10px rgba(60, 38, 8, .45);
  transition: clip-path 1s cubic-bezier(.4, .1, .2, 1);
}
.book-pages {
  position: absolute; inset: var(--inset); z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr;
  transition: clip-path 1s cubic-bezier(.4, .1, .2, 1);
  touch-action: pan-y;
}
.page { position: relative; overflow: hidden; background: var(--page); color: var(--crust); }
.page-left {
  border-radius: 5px 0 0 5px;
  background: linear-gradient(90deg, var(--page-edge) 0, var(--page) 4%, var(--page) 86%, #e6d6b0 100%);
  box-shadow: -2px 0 0 #efe4c8, -4px 0 0 #dccaa0;
}
.page-right {
  border-radius: 0 5px 5px 0;
  background: linear-gradient(270deg, var(--page-edge) 0, var(--page) 4%, var(--page) 86%, #e6d6b0 100%);
  box-shadow: 2px 0 0 #efe4c8, 4px 0 0 #dccaa0;
}
.page-inner {
  position: absolute; inset: 0 0 40px; padding: 28px 44px 6px;
  display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin;
}
.running { font: 700 .7rem var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--gilt); text-align: center; margin-bottom: 10px; }
.folio { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-family: var(--display); font-style: italic; color: var(--muted); font-size: .95rem; pointer-events: none; }

/* a recipe page: one bake */
.recipe { align-items: center; text-align: center; }
.chapter-mark { font-family: var(--display); font-style: italic; color: var(--sage); margin: -4px 0 4px; }
.recipe-glyph { width: 78px; height: 78px; color: var(--gilt); margin: 8px auto 10px; flex: none; }
.recipe-glyph svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.recipe-name { font-size: 2.1rem; line-height: 1.1; }
.recipe-unit { font-family: var(--display); font-style: italic; color: var(--muted); margin-top: 4px; }
.flourish { display: flex; align-items: center; gap: 12px; width: 58%; margin: 14px auto; color: var(--gilt); font-size: .8rem; }
.flourish::before, .flourish::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gilt), transparent); }
.recipe-desc { max-width: 34ch; }
.recipe .charm { border-top: 0; padding-top: 0; max-width: 34ch; }
.recipe-foot {
  margin-top: auto; width: 100%; padding: 14px 0 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px dashed var(--line);
}
.stamp {
  position: absolute; top: 36%; right: 12%; transform: rotate(-14deg);
  padding: 6px 14px; border: 3px double #a4342a; border-radius: 6px; color: #a4342a; opacity: .72;
  font: 700 1.2rem var(--display); letter-spacing: .16em; text-transform: uppercase; pointer-events: none;
}
.ribbon {
  position: absolute; top: 0; left: 26px; z-index: 1;
  padding: 18px 8px 16px; width: 44px; writing-mode: vertical-rl;
  background: linear-gradient(180deg, #c9953a, #a8741f); color: #fff8e6;
  font: 700 .72rem var(--body); letter-spacing: .12em; text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 12px), 0 100%);
  box-shadow: 0 4px 8px rgba(60, 38, 8, .25);
}

/* contents page */
.contents-title { text-align: center; font-size: 1.9rem; margin-bottom: 2px; }
.contents-chapter h4 { font: 700 .7rem var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--gilt); margin: 10px 0 1px; }
.contents-chapter ul { list-style: none; margin: 0; padding: 0; }
.contents-row {
  width: 100%; display: flex; align-items: baseline; gap: 8px; padding: 2px;
  border: 0; background: none; color: var(--crust); cursor: pointer; text-align: left;
  font: 400 .98rem/1.35 var(--display); border-radius: 4px;
}
.contents-row:hover .contents-name { color: var(--gilt); }
.leader { flex: 1; border-bottom: 1px dotted color-mix(in srgb, var(--crust) 45%, transparent); transform: translateY(-4px); min-width: 12px; }
.contents-price { font-family: var(--body); font-size: .9rem; }
.contents-page { font-style: italic; color: var(--muted); min-width: 2.2ch; text-align: right; }

/* last page and blank pages */
.end { align-items: center; justify-content: center; text-align: center; gap: 10px; }
.end-knot { width: 110px; opacity: .9; }
.end h3 { font-size: 1.8rem; }
.end-list { font-family: var(--display); font-style: italic; color: var(--sage); max-width: 30ch; }
.is-blank { align-items: center; justify-content: center; }
.blank-knot { width: 42%; opacity: .1; }

/* page-turn leaves: a chain of hinged strips (see buildLeaf in app.js) */
.leaves { position: absolute; inset: var(--inset); z-index: 4; pointer-events: none; transform-style: preserve-3d; }
.leaf { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; }
.leaf-right { left: 50%; }
.leaf-left { left: 0; }
.strip { position: absolute; top: 0; bottom: 0; transform-style: preserve-3d; }
.leaf-right .strip { transform-origin: left center; }
.leaf-left .strip { transform-origin: right center; }
.strip-face { position: absolute; inset: 0; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.strip-back { transform: rotateY(180deg); }
.strip-face > .page { position: absolute; top: 0; box-shadow: none; border-radius: 0; }
.strip-shade { position: absolute; inset: 0; pointer-events: none; }

/* page-curl corners (mouse users); the buttons below the book do the same thing */
.turn {
  position: absolute; bottom: var(--inset); z-index: 4; width: 58px; height: 58px;
  border: 0; padding: 0; background: none; cursor: pointer;
}
.turn::before {
  content: ""; position: absolute; bottom: 0; width: 26px; height: 26px;
  transition: width .25s, height .25s;
  box-shadow: 0 0 6px rgba(60, 38, 8, .25);
}
.turn-next { right: var(--inset); }
.turn-next::before { right: 0; background: linear-gradient(315deg, #d9c89c 0 50%, #fbf4e2 50%, #e7d6ad 100%); border-radius: 8px 0 0 0; }
.turn-prev { left: var(--inset); }
.turn-prev::before { left: 0; background: linear-gradient(45deg, #d9c89c 0 50%, #fbf4e2 50%, #e7d6ad 100%); border-radius: 0 8px 0 0; }
.turn:hover::before { width: 44px; height: 44px; }
.turn:disabled { display: none; }

/* cover */
.book-cover {
  position: absolute; top: 0; bottom: 0; left: 50%; right: 0; z-index: 6;
  padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: left center; transform-style: preserve-3d;
  transition: transform .35s ease;
}
.book.is-closed .book-cover:hover { transform: rotateY(-7deg); }
.cover-front, .cover-back { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 4px 12px 12px 4px; }
.cover-front {
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .08), transparent 60%),
    linear-gradient(90deg, #0b1a33, #1c3a68 6%, #17305a 60%, #112646);
  box-shadow: inset 0 0 0 1px rgba(232, 197, 122, .25), inset 8px 0 14px -6px rgba(0, 0, 0, .5);
}
.cover-frame {
  position: absolute; inset: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border: 1px solid rgba(232, 197, 122, .6); outline: 1px solid rgba(232, 197, 122, .3); outline-offset: 5px; border-radius: 6px;
  color: var(--honey); text-align: center;
}
.cover-knot { width: 46%; max-width: 190px; }
.cover-title { font: italic 400 2.3rem/1.1 var(--display); color: #f0d493; }
.cover-sub { font: 700 .72rem var(--body); letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.cover-hint { position: absolute; bottom: 18px; font: 500 .85rem var(--body); opacity: .7; }
.cover-back { transform: rotateY(180deg); background: #1a3560; }
.cover-page { position: absolute; inset: var(--inset) 0 var(--inset) var(--inset); }

/* closed: only the right half (the cover) shows, centred */
.book.is-closed .book-body { transform: translateX(-25%); }
.book.is-closed .book-board, .book.is-closed .book-pages { clip-path: inset(0 0 0 50%); }
.book.is-closed .turn, .book.is-closed .book-nav > * { visibility: hidden; }

/* thumb-index tabs set into the outer edge of the right-hand page */
.book-tabs {
  position: absolute; top: calc(var(--inset) + 22px); right: var(--inset); z-index: 5;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.tab {
  --tab: #6b5a3a;
  display: flex; align-items: center; gap: 4px; writing-mode: vertical-rl;
  width: 28px; padding: 9px 0; border: 0; border-radius: 7px 0 0 7px; cursor: pointer;
  background: linear-gradient(90deg, var(--tab) 70%, color-mix(in srgb, var(--tab) 75%, #000));
  color: #fff6e2; font: 700 .66rem var(--body); letter-spacing: .07em; text-transform: uppercase;
  box-shadow: -2px 1px 4px rgba(60, 38, 8, .22);
  transition: width .2s, filter .2s;
}
.tab:hover { width: 32px; }
.tab[aria-current="true"] { width: 36px; filter: brightness(1.12); box-shadow: -3px 2px 7px rgba(60, 38, 8, .32); }
.tab[data-tab-color="fav"] { --tab: #b8862f; }
.tab[data-tab-color="bread"] { --tab: #7a5230; }
.tab[data-tab-color="sweet"] { --tab: #9a4f4a; }
.tab[data-tab-color="pastry"] { --tab: #5f7250; }
.tab[data-tab-color="cake"] { --tab: #6a4a73; }
.tab[data-tab-color="all"] { --tab: #2c4a78; }

.book-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; margin-top: 18px; }
.sound-btn {
  border: 0; background: none; padding: 6px 4px; cursor: pointer; color: var(--muted);
  font: 500 .82rem var(--body); text-decoration: underline; text-underline-offset: 3px;
}
.sound-btn[aria-pressed="false"] { opacity: .7; }
.book-status { font-family: var(--display); font-style: italic; color: var(--muted); min-width: 10ch; text-align: center; }
.btn-sm { padding: 7px 14px; font-size: .88rem; }
.btn-sm:disabled { opacity: .35; cursor: default; }
.btn-ghost:disabled:hover { background: transparent; color: var(--crust); }

.card-unit { font-size: .9rem; color: var(--muted); margin-top: 2px; }
.charm {
  margin-top: 14px; font-family: var(--display); font-style: italic; color: var(--sage); font-size: 1.05rem; line-height: 1.35;
}
.charm b { font-style: normal; font-weight: 700; color: var(--crust); }
.price { font-family: var(--display); font-size: 1.6rem; }

/* phones and small tablets: one page at a time, tabs along the top */
@media (max-width: 820px) {
  .book-body { height: clamp(540px, 76svh, 680px); }
  .book-board { background: linear-gradient(90deg, #0b1a33, #1a3560 5%, #1a3560 95%, #112646); }
  .book-pages { grid-template-columns: 1fr; inset: 10px 10px 10px 16px; }
  .book-pages [data-slot="left"] { display: none; }
  .leaves { inset: 10px 10px 10px 16px; }
  .leaf { width: 100%; }
  .leaf-right { left: 0; }
  .page-inner { padding: 24px 22px 44px; }
  .recipe-name { font-size: 1.8rem; }
  .recipe-glyph { width: 64px; height: 64px; }
  .ribbon { left: 16px; }
  .turn { display: none; }
  .book-cover { left: 0; }
  .book.is-closed .book-body { transform: none; }
  .book.is-closed .book-board, .book.is-closed .book-pages { clip-path: none; }
  .cover-title { font-size: 2rem; }
  .book-tabs { right: 10px; top: 28px; }
  .page-inner { padding-right: 40px; }
  .book-nav { gap: 8px; }
  .book-nav .btn-sm { padding: 8px 12px; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 700 .95rem var(--body); color: var(--parchment);
  background: var(--crust); border: 1px solid var(--crust); border-radius: 999px;
  padding: 10px 18px; cursor: pointer; text-decoration: none;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--cocoa); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-ghost { background: transparent; color: var(--crust); }
.btn-ghost:hover { background: var(--crust); color: var(--parchment); }
.btn-block { width: 100%; padding: 14px 18px; font-size: 1rem; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--crust); border-radius: 999px; }
.stepper button {
  width: 38px; height: 38px; border: 0; background: none; color: var(--crust);
  font: 700 1.2rem var(--body); cursor: pointer; border-radius: 999px;
}
.stepper button:hover { background: var(--ground); }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; }


/* ---------- Ordering ---------- */
.ordering { border-top: 1px solid var(--line); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.steps li { position: relative; padding: 26px 24px 24px; background: var(--sheet); border-radius: var(--radius); border: 1px solid var(--line); counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; top: -18px; left: 22px;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gilt); color: var(--parchment); font-family: var(--display); font-size: 1.2rem;
}
.step-day { display: block; font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sage); margin: 8px 0 6px; }
.steps h3 { font-weight: 700; font-size: 1.45rem; margin-bottom: 6px; }
.steps p { color: var(--muted); }

/* ---------- About ---------- */
.about {
  max-width: var(--maxw); margin: 0 auto clamp(56px, 8vw, 96px);
  padding: clamp(32px, 6vw, 72px) var(--gutter);
  display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(24px, 5vw, 64px); align-items: center;
}
.about-knot { width: 100%; max-width: 360px; justify-self: center; opacity: .95; }
.about-copy h2 { font-size: clamp(2.4rem, 5vw, 3.4rem); margin-bottom: 18px; }
.about-copy p + p { margin-top: 14px; }
.about-copy > p:not(.eyebrow):not(.signoff) { max-width: 58ch; }
.signoff { margin-top: 22px !important; font-family: var(--display); font-style: italic; font-size: 1.2rem; }
.signoff span { font-size: 2.2rem; color: var(--gilt); }

/* ---------- Footer ---------- */
.footer { background: var(--cocoa); color: #dfe3ec; padding: 64px var(--gutter) 32px; text-align: center; }
.footer-knot { width: 84px; margin: 0 auto 32px; }
.footer-cols { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; text-align: left; }
.footer h2 { font-weight: 700; color: var(--honey); font-size: 1.3rem; margin-bottom: 8px; }
.footer p { font-size: .95rem; line-height: 1.6; }
.footer a { color: var(--honey); overflow-wrap: anywhere; }
.footer-fine { margin-top: 48px !important; font-size: .85rem !important; opacity: .6; text-align: center; }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(16, 26, 51, .5); animation: fade .25s ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(440px, 100vw);
  display: flex; flex-direction: column;
  background: var(--parchment);
  box-shadow: -20px 0 50px -20px rgba(16, 26, 51, .5);
  animation: slide .3s cubic-bezier(.2, .8, .2, 1);
}
.scrim[hidden], .drawer[hidden] { display: none; }
@keyframes slide { from { transform: translateX(100%); } }
@keyframes fade { from { opacity: 0; } }

.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 2rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; cursor: pointer; color: var(--crust); display: grid; place-items: center; }
.icon-btn:hover { background: var(--ground); }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }

.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; }
.drawer-body[hidden] { display: none; }

.basket-list { list-style: none; margin: 0; padding: 0; }
.basket-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.basket-item h3 { font-size: 1.3rem; }
.basket-item .card-unit { grid-column: 1; }
.basket-item .line-price { grid-row: 1; grid-column: 2; text-align: right; font-family: var(--display); font-size: 1.25rem; }
.basket-item .stepper { grid-column: 2; justify-self: end; }
.basket-item .stepper button { width: 32px; height: 32px; font-size: 1rem; }
.remove { grid-column: 1; justify-self: start; background: none; border: 0; padding: 0; color: var(--muted); font: 500 .85rem var(--body); text-decoration: underline; cursor: pointer; }

.basket-empty, .done { text-align: center; padding-top: 48px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.basket-empty[hidden] { display: none; }
.done h3 { font-size: 2.2rem; }
.done p { color: var(--muted); max-width: 32ch; }

.drawer-foot { padding: 18px 24px 24px; border-top: 1px solid var(--line); background: var(--parchment); }
.drawer-foot[hidden] { display: none; }
.sub-row { display: flex; justify-content: space-between; color: var(--muted); font-size: .95rem; margin-bottom: 4px; }
.sub-row[hidden] { display: none; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; font-weight: 500; }
.total { font-family: var(--display); font-size: 1.8rem; }

.checkout { display: flex; flex-direction: column; gap: 16px; }
.back-link { align-self: flex-start; background: none; border: 0; padding: 8px 0 0; font: 500 .95rem var(--body); color: var(--muted); cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: .95rem; }
.opt { font-weight: 400; color: var(--muted); }
.hint { font-size: .85rem; color: var(--muted); }
.field input, .field select, .field textarea {
  font: 400 1rem var(--body); color: var(--crust);
  background: #fff; border: 1px solid #cfc7b8; border-radius: 10px; padding: 11px 12px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gilt); outline-offset: 0; border-color: var(--gilt); }
.field [aria-invalid="true"] { border-color: #a4342a; }
.pay-note { font-family: var(--display); font-style: italic; color: var(--sage); font-size: 1.1rem; }
.pay-choice { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.pay-choice legend { font-weight: 700; font-size: .95rem; margin-bottom: 8px; padding: 0; }
.pay-option {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.pay-option:has(input:checked) { border-color: var(--crust); box-shadow: inset 0 0 0 1px var(--crust); }
.pay-option input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--crust); flex: none; }
.pay-option b { display: block; }
.pay-option small { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.secure-note { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.secure-note svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.basket-note { margin: 12px 0 4px; padding: 10px 12px; border-radius: 10px; background: #f4e6c7; color: #6b4a10; font-weight: 500; }
.form-error { color: #a4342a; font-weight: 500; min-height: 1em; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--cocoa); color: var(--parchment); padding: 12px 20px; border-radius: 999px;
  font-weight: 500; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Extras: announcement, sold out, checkout bits ---------- */
.announce {
  background: var(--crust); color: var(--parchment); text-align: center;
  padding: 9px var(--gutter); font-size: .95rem; font-weight: 500;
}
.announce strong { color: var(--honey); }
.soldout { font-family: var(--display); font-style: italic; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--crust); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.paused-note { margin: -4px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--ground); font-weight: 500; }
.about-body p + p { margin-top: 14px; }
.about-body p { max-width: 58ch; }

/* page lock while the basket is open (keeps the reader's place on iOS) */
body.locked { position: fixed; left: 0; right: 0; overflow: hidden; }

/* Phones: sticky basket bar */
.basket-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30;
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--crust); color: var(--parchment); font: 500 1rem var(--body);
  box-shadow: 0 12px 30px -10px rgba(16, 26, 51, .55);
  animation: rise .3s cubic-bezier(.2, .8, .2, 1);
}
.basket-bar strong { color: var(--honey); }
@keyframes rise { from { transform: translateY(120%); } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 20px; gap: 12px; }
  .hero-mark { width: min(46vw, 220px); margin: 0 auto; order: -1; }
  .hero-logo { margin-inline: auto; }
  .hero-lede { margin-inline: auto; font-size: 1.05rem; }
  .steps { grid-template-columns: 1fr; gap: 30px; }
  .about { grid-template-columns: 1fr; }
  .about-knot { max-width: 160px; }
  .footer-cols { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 640px) {
  .topbar { gap: 12px; padding-top: 8px; padding-bottom: 8px; }
  .nav { display: none; }
  .brand img { width: 34px; height: 34px; }
  .brand-name { font-size: .8rem; letter-spacing: .07em; }
  .cart-btn { margin-left: auto; padding: 8px 8px 8px 12px; min-height: 44px; }
  .cart-label { display: none; }


  .section-head h2 { font-size: 2.3rem; }
  .stepper button { width: 44px; height: 44px; }

  .basket-bar:not([hidden]) { display: flex; }
  body.has-basket { padding-bottom: 84px; }
  body.has-basket .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }

  .drawer { width: 100vw; }
  .drawer-head { padding: 14px 16px; }
  .drawer-head h2 { font-size: 1.7rem; }
  .drawer-body { padding: 4px 16px 20px; }
  .drawer-foot { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
  .basket-item .stepper button { width: 40px; height: 40px; }
  .remove { padding: 8px 0; }
  .field input, .field select, .field textarea { font-size: 16px; padding: 13px 12px; } /* 16px stops iOS zooming in */
  .footer { padding-bottom: 40px; }
}

/* ---------- The familiar (3D knot that follows the page; see familiar.js) ---------- */
.has-familiar .hero-knot { visibility: hidden; }
.has-familiar .hero-mark::before { display: none; }
.familiar {
  position: fixed; left: 0; top: 0; z-index: 25;
  padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 50%; will-change: transform;
  perspective: 900px;
  transition: opacity .3s;
}
.familiar-body { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.familiar-img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.familiar-glow { position: absolute; inset: -6%; border-radius: 50%; pointer-events: none; will-change: transform, opacity; filter: blur(6px); }
.familiar[data-glow="halo"] .familiar-glow {
  background: radial-gradient(circle, rgba(242, 206, 128, .85) 0%, rgba(232, 197, 122, .45) 32%, rgba(232, 197, 122, 0) 66%);
}
.familiar[data-glow="moonlight"] .familiar-glow {
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 0%, rgba(201, 214, 245, .7) 30%, rgba(143, 166, 216, .25) 50%, rgba(143, 166, 216, 0) 68%);
}
.familiar[data-glow="ember"] .familiar-glow {
  background: radial-gradient(circle, rgba(255, 214, 140, .9) 0%, rgba(255, 159, 67, .5) 30%, rgba(224, 110, 40, .18) 50%, rgba(224, 110, 40, 0) 66%);
  filter: blur(9px);
}
.familiar[data-glow="aura"] .familiar-glow {
  inset: -22%; filter: blur(2px);
  background:
    radial-gradient(circle, rgba(255, 247, 222, .95) 0%, rgba(255, 238, 196, .55) 28%, rgba(255, 238, 196, 0) 48%),
    repeating-conic-gradient(from 0deg, rgba(255, 244, 212, .85) 0deg 4deg, rgba(212, 160, 62, .28) 4deg 7deg, rgba(255, 244, 212, 0) 7deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 28%, transparent 70%); mask: radial-gradient(circle, #000 28%, transparent 70%);
}
.familiar[data-glow="none"] .familiar-glow { display: none; }
.familiar.is-docked .familiar-glow { inset: -30%; }
.familiar.is-docked[data-glow="aura"] .familiar-glow { inset: -45%; }
.familiar-trail { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 24; pointer-events: none; }

/* effect picker: only rendered with ?fx in the address */
.fx-picker {
  position: fixed; left: 16px; bottom: 16px; z-index: 35; width: min(340px, calc(100vw - 32px));
  padding: 12px 14px; border-radius: 14px; background: rgba(11, 28, 51, .92); color: #fff;
  font: 500 .8rem var(--body); box-shadow: 0 12px 30px -10px rgba(11, 28, 51, .5);
}
.fx-title { font-weight: 700; margin: 0 24px 8px 0; }
.fx-title span { font-weight: 400; opacity: .6; margin-left: 4px; }
.fx-row { display: flex; flex-wrap: wrap; gap: 5px; }
.fx-row + .fx-row { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .12); }
.fx-row button { padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: none; color: #fff; font: inherit; cursor: pointer; }
.fx-row button[aria-pressed="true"] { background: var(--honey); border-color: var(--honey); color: var(--cocoa); }
.fx-close { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border: 0; background: none; color: #fff; font-size: 1.2rem; cursor: pointer; }
body.has-basket .fx-picker { bottom: calc(88px + env(safe-area-inset-bottom)); }
body.locked .familiar { opacity: 0; pointer-events: none; }

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