:root {
  --bg: #F6D7C3;
  --bg-deep: #EEC3A8;
  --paper: #FFF6EF;
  --ink: #2E1D17;
  --ink-soft: #6B4E42;
  --plum: #84205C;
  --plum-dark: #5E1441;
  --coral: #EC7656;
  --leaf: #4F8A3C;
  --forest: #2F4A22;
  --pink: #F4A9C8;
  --font-display: "Patrick Hand SC", "Comic Sans MS", cursive;
  --font-body: "Aptos", "Figtree", system-ui, sans-serif;
  --gutter: 20px;
}

*, ::before, ::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

/* body is a flex column (footer at the bottom); keep centred mains full width */
body > main { width: 100%; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

p, h1, h2, h3, blockquote, dl, dd { margin: 0; }

.icon { flex-shrink: 0; width: 1em; height: 1em; }

:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }

/* ---------- Header ---------- */

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  row-gap: 10px;
  padding: 12px var(--gutter);
}

.brand-logo { width: 56px; height: auto; }

.nav {
  order: 3;
  display: flex;
  gap: 24px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 15px;
  font-weight: 500;
}

.nav a { white-space: nowrap; padding: 6px 0; }
.nav a:hover { color: var(--plum); }

.actions { display: flex; align-items: center; gap: 12px; }

.cart-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background: var(--paper);
  font-size: 22px;
}

.cart-badge {
  position: absolute;
  left: 30px;
  top: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.login-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 24px;
  background: var(--plum);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.login-button .icon { font-size: 18px; }
.login-button:hover, .cta:hover { background: var(--plum-dark); }

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 8px var(--gutter) 56px;
}

.hero-copy { display: flex; flex-direction: column; gap: 24px; }

.eyebrow {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 20px;
  background: #FFF6EF99;
  color: var(--forest);
  font-size: 14px;
  font-weight: 600;
}

.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); }

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-variant-caps: small-caps;
  font-size: clamp(52px, 13vw, 92px);
  line-height: 0.95;
}

.verse {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--coral);
  color: var(--ink-soft);
  font-size: 17px;
  font-style: italic;
}

.credits { display: flex; gap: 24px; }
.credits div { display: flex; flex-direction: column; gap: 2px; }
.credits dt { color: var(--ink-soft); font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.credits dd { font-size: 17px; font-weight: 600; }

.buy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding-top: 8px; }

.price { display: flex; flex-direction: column; }
.price-amount { color: var(--plum); font-size: 34px; font-weight: 800; }
.price-meta { color: var(--ink-soft); font-size: 13px; }

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 28px;
  border-radius: 32px;
  background: var(--plum);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.cta .icon { font-size: 20px; }

.gift-note {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 20px;
  background: var(--paper);
  font-size: 15px;
  font-weight: 600;
}

.gift-note .icon { flex: none; font-size: 18px; color: var(--coral); }
.gift-take { color: var(--plum); font-weight: 700; text-decoration: underline; }

.login-note { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.login-note .icon { font-size: 15px; margin-top: 2px; }

.hero-art {
  order: -1;
  position: relative;
  align-self: center;
  width: min(420px, 100%);
  aspect-ratio: 560 / 620;
}

.halo {
  position: absolute;
  left: 3.571%;
  top: 4.839%;
  width: 96.429%;
  height: 87.097%;
  border-radius: 50%;
  background: var(--bg-deep);
}

.book-cover {
  position: absolute;
  left: 14.286%;
  top: 6.452%;
  width: 71.429%;
  border-radius: 4px 10px 10px 4px;
  transform: rotate(3deg);
  transform-origin: 0 0;
  box-shadow: 0 24px 48px #5E144133, 0 4px 10px #2E1D1726;
}

.sticker {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  transform-origin: 0 0;
  box-shadow: 0 8px 16px #2E1D1740;
}

.sticker-slug { left: 1.786%; top: 70.968%; width: 23.214%; transform: rotate(-8deg); transform-origin: 50% 100%; }
.sticker-tractor { left: 76.786%; top: 68%; width: 19.643%; transform: rotate(6deg); z-index: 1; }

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .sticker-tractor, .sticker-slug {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: scroll(root block);
      animation-range: 0 65vh;
    }

    .hero { overflow-x: clip; }
    .sticker-tractor { animation-name: tractor-drive; }
    .sticker-slug { animation-name: slug-squash; }

    .event-ants {
      animation: ants-march linear both;
      animation-timeline: view();
      /* done once fully on screen — the section can sit too low on the page to ever reach the middle */
      animation-range: entry 0% entry 100%;
    }
  }
}

@keyframes ants-march {
  0%   { clip-path: circle(0% at 92% 4%);   translate: 18% -6%; }
  100% { clip-path: circle(150% at 92% 4%); translate: 0 0; }
}

@keyframes tractor-drive {
  0%   { translate: 0 0;          rotate: 0deg; }
  20%  { translate: -90% 4%;      rotate: -3deg; }
  40%  { translate: -180% 8%;     rotate: 2deg; }
  58%  { translate: -262% 10%;    rotate: -2deg; }
  70%  { translate: -318% -6%;    rotate: 9deg; }
  82%  { translate: -372% -14%;   rotate: 2deg; }
  92%  { translate: -418% -2%;    rotate: -8deg; }
  100% { translate: -450% 12%;    rotate: -2deg; }
}

@keyframes slug-squash {
  0%   { translate: 0 0;   scale: 1 1; }
  58%  { translate: 10% 0; scale: 1 1; }
  70%  { translate: 10% 0; scale: 1.12 0.7; }
  82%  { translate: 10% 0; scale: 1.28 0.38; }
  92%  { translate: 10% 0; scale: 1.22 0.45; }
  100% { translate: 10% 0; scale: 1.06 0.82; }
}

/* ---------- Extras ---------- */

.extras {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 56px 0;
  background: var(--bg-deep);
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 0 var(--gutter);
}

.section-heading { display: flex; flex-direction: column; gap: 8px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-variant-caps: small-caps;
  font-size: clamp(40px, 10vw, 56px);
  line-height: 1;
}

.section-subtitle { color: var(--ink-soft); font-size: 17px; }

.bundle-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 20px;
  background: var(--paper);
  font-size: 15px;
  font-weight: 600;
}

.bundle-hint .icon { font-size: 18px; color: var(--coral); }
.bundle-hint:hover { background: var(--plum); color: #fff; }
.bundle-hint:hover .icon { color: #fff; }

.products {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 300px);
  gap: 16px;
  padding: 0 var(--gutter) 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 440px;
  border-radius: 20px;
  background: var(--paper);
  overflow: hidden;
  scroll-snap-align: start;
}

.product-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  padding: 24px;
}

.product-image img { width: 100%; height: 100%; object-fit: contain; }

.product-photo { padding: 0; }
.product-photo img { object-fit: cover; }

.product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 22px;
}

.product-info { display: flex; flex-direction: column; gap: 6px; }

.product-kind { color: var(--leaf); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

.product-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-variant-caps: small-caps;
  font-size: 30px;
  line-height: 1;
}

.product-desc { color: var(--ink-soft); font-size: 14px; line-height: 1.4; }

.product-footer { display: flex; align-items: center; justify-content: space-between; }

.product-price { color: var(--plum); font-size: 22px; font-weight: 800; }

.add-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: var(--plum);
  color: #fff;
  font-size: 20px;
}

.add-button:hover { background: var(--plum-dark); }

/* ---------- About ---------- */

.about {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 64px var(--gutter);
}

.photo-wrap {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 440 / 540;
}

.photo-backdrop, .author-photo {
  position: absolute;
  width: 93.636%;
  height: 94.815%;
  border-radius: 50% 50% 24px 24px / 40.234% 40.234% 24px 24px;
}

.photo-backdrop { left: 6.364%; top: 5.185%; background: var(--plum); }

.author-photo { left: 0; top: 0; object-fit: cover; }

.sticker-mouse { left: -4%; top: 84.63%; width: 25%; }

.about-book { padding-bottom: 0; }

.book-shot-wrap { position: relative; width: 100%; }

.book-shot { display: block; width: 100%; height: auto; border-radius: 24px; box-shadow: 0 24px 48px #5E144126; }

.author-copy { display: flex; flex-direction: column; gap: 20px; }

.kicker { color: var(--plum); font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }

.author-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-variant-caps: small-caps;
  font-size: clamp(44px, 11vw, 64px);
  line-height: 1;
}

.paragraph { color: var(--ink-soft); font-size: 17px; line-height: 1.6; }

.signature {
  padding-top: 8px;
  color: var(--plum);
  font-family: var(--font-display);
  font-variant-caps: small-caps;
  font-size: 32px;
}

/* ---------- Promo ---------- */

.promo { padding: 0 var(--gutter) 64px; }

.event-band {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 20px 20px;
  border-radius: 28px;
  background: var(--forest);
  overflow: clip;
}

.band-head { display: flex; align-items: center; justify-content: space-between; gap: 32px; }

.event-copy { display: flex; flex-direction: column; gap: 10px; }

.event-kicker { color: var(--pink); font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }

.event-title {
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 400;
  font-variant-caps: small-caps;
  font-size: clamp(32px, 8vw, 48px);
  line-height: 1.05;
}

.event-ants {
  position: absolute;
  right: -12px;
  top: 8px;
  width: 104px;
  border-radius: 50%;
  background: radial-gradient(closest-side, #FFF6EF14, #FFF6EF00);
  filter: brightness(1.4) drop-shadow(0 0 4px #FFF6EF26);
  pointer-events: none;
}

.events { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }

.event-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid #FFF6EF26;
  border-radius: 20px;
  background: #FFF6EF14;
}

.date-block {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 92px;
  border-radius: 16px;
  background: var(--paper);
}

.date-day { color: var(--plum); font-family: var(--font-display); font-size: 52px; line-height: 1; }
.date-block-month .date-day { font-variant-caps: small-caps; font-size: 26px; }

.date-month { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

.event-details { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.event-place { color: var(--paper); font-size: 18px; font-weight: 700; }

.event-line { display: flex; align-items: flex-start; gap: 8px; color: #FFF6EFD9; font-size: 15px; line-height: 1.35; }
.event-line .icon { font-size: 17px; color: var(--pink); margin-top: 1px; }

/* ---------- Footer ---------- */

.footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 32px var(--gutter);
  background: var(--plum-dark);
}

.footer-brand { display: flex; align-items: center; gap: 16px; color: #FFF6EFB3; font-size: 14px; }

.footer-logo { width: 56px; }

.footer-links { display: flex; flex-wrap: wrap; gap: 12px 28px; color: var(--paper); font-size: 14px; font-weight: 500; }
.footer-links a:hover { text-decoration: underline; }

/* ---------- Overlays ---------- */

body.locked { overflow: hidden; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #2E1D1766;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.scrim-blur { background: #2E1D1799; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.scrim.open { opacity: 1; pointer-events: auto; }

/* ---------- Cart drawer ---------- */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(440px, 100%);
  background: var(--paper);
  box-shadow: -20px 0 60px #2E1D1740;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

.drawer.open { transform: none; visibility: visible; transition: transform 0.3s ease; }

.drawer-body { display: flex; flex-direction: column; height: 100%; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
}

.drawer-title-group { display: flex; align-items: flex-end; gap: 10px; }

.drawer-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-variant-caps: small-caps;
  font-size: 40px;
  line-height: 1;
}

.drawer-count { color: var(--ink-soft); font-size: 14px; }

.drawer-close, .modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: var(--bg);
  font-size: 20px;
}

.drawer-items { flex: 1; overflow-y: auto; padding: 0 20px 20px; }

.lines { margin: 0; padding: 0; list-style: none; }

.line-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #2E1D171A;
}

.thumb { flex: 0 0 auto; width: 76px; height: 76px; padding: 8px; border-radius: 14px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }

.line-info { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }

.line-name { font-size: 15px; font-weight: 700; }

.qty { display: flex; align-items: center; border: 1px solid #2E1D1726; border-radius: 16px; }

.qty button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.qty button:disabled { opacity: 0.35; cursor: default; }

.qty-value { min-width: 12px; text-align: center; font-size: 14px; font-weight: 700; }

.line-price { color: var(--plum); font-size: 16px; font-weight: 700; white-space: nowrap; }

.upsell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg);
  font-size: 14px;
}

.upsell .icon { font-size: 18px; color: var(--coral); }
.upsell p { flex: 1 1 140px; }
.upsell button { flex: none; padding: 8px 14px; border-radius: 18px; background: var(--plum); color: #fff; font-weight: 700; white-space: nowrap; }
.line-gift .line-price { color: var(--leaf); }
.line-discount .thumb { display: grid; place-items: center; background: var(--bg); color: var(--coral); font-size: 22px; }
.line-discount .line-price { color: var(--leaf); }
.line-note { display: flex; align-items: center; gap: 6px; color: var(--leaf); font-size: 13px; font-weight: 600; }
.line-note .icon { font-size: 15px; }

.drawer-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 20px 24px;
  background: var(--bg);
}

.sums { display: flex; flex-direction: column; gap: 12px; }
.sums div { display: flex; align-items: center; justify-content: space-between; }
.sums dt { color: var(--ink-soft); font-size: 15px; }
.sums dd { font-size: 15px; font-weight: 600; }
.sum-total dt { color: var(--ink); font-size: 18px; font-weight: 700; }
.sum-total dd { color: var(--plum); font-size: 24px; font-weight: 800; }

.checkout, .submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border-radius: 28px;
  background: var(--plum);
  color: #fff;
  font-weight: 700;
}

.checkout { height: 56px; font-size: 17px; }
.checkout .icon { font-size: 18px; }
.checkout:hover, .submit:hover { background: var(--plum-dark); }

.stripe-note { color: var(--ink-soft); font-size: 12px; text-align: center; }
.shop-soon { margin-top: 4px; color: var(--plum); font-size: 18px; font-weight: 700; line-height: 1.35; text-align: center; }

.cart-clear { display: flex; align-items: center; gap: 6px; margin: 12px 0 0 auto; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.cart-clear:hover { color: var(--plum); }
.cart-clear .icon { width: 14px; height: 14px; }
.line-zero .thumb, .line-zero .line-name, .line-zero .line-price { opacity: 0.45; }
.checkout[aria-disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Login modal ---------- */

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 40px 24px 28px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 30px 60px #2E1D1759;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -46%);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%); transition: opacity 0.25s ease, transform 0.25s ease; }

.modal-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; background: none; color: var(--ink-soft); }

.modal-logo { width: 84px; }

.modal-heading { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 15px; line-height: 1.45; text-align: center; }

.modal-title {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  font-variant-caps: small-caps;
  font-size: 40px;
  line-height: 1;
}

.login-form { display: flex; flex-direction: column; gap: 22px; width: 100%; }

.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; }

.input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  border: 2px solid var(--plum);
  border-radius: 14px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 18px;
}

.input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; }

.submit { height: 54px; font-size: 16px; }
.submit .icon { font-size: 18px; }

.login-sent { color: var(--forest); font-size: 14px; text-align: center; }

.divider { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--ink-soft); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #2E1D1722; }

.google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  border: 1.5px solid #2E1D1733;
  border-radius: 28px;
  font-size: 15px;
  font-weight: 600;
}

/* provider buttons: icon box and label start at the same left edge in every button */
.google { justify-content: flex-start; gap: 14px; padding: 0 clamp(20px, 16%, 64px); }
.provider-icon { display: flex; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px; }
.provider-icon .icon { width: 20px; height: 20px; font-size: 20px; }
.provider-label { text-align: left; }

.password-link { color: var(--ink-soft); font-size: 13px; text-decoration: underline; }

.logout { display: contents; }

.fine-print { color: var(--ink-soft); font-size: 12px; text-align: center; }

@media (max-width: 420px) {
  .cta { flex: 1 1 100%; }
}

@media (min-width: 640px) {
  .products {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    overflow: visible;
  }
}

@media (min-width: 760px) {
  .events { flex-direction: row; gap: 20px; }
  .event-card { flex: 1; }
}

@media (min-width: 1200px) {
  .products { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Desktop ---------- */

@media (min-width: 900px) {
  :root { --gutter: max(64px, calc((100% - 1312px) / 2)); }

  .header { flex-wrap: nowrap; padding: 20px var(--gutter); }
  .brand-logo { width: 72px; }
  .nav { order: 0; width: auto; gap: 36px; font-size: 16px; }

  .hero {
    flex-direction: row;
    align-items: center;
    gap: 72px;
    padding: 48px var(--gutter) 88px;
  }

  .hero-copy { flex: 1; gap: 28px; }
  .verse { font-size: 18px; }
  .hero-art { order: 0; flex: 0 0 auto; width: min(560px, 42vw); }

  .extras { gap: 40px; padding: 88px 0; }
  .section-head { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .section-subtitle { font-size: 18px; }
  .product-card { min-height: 480px; }
  .product-image { height: 240px; }

  .about { flex-direction: row; gap: 88px; padding: 104px var(--gutter); }
  .about-book { flex-direction: row-reverse; padding-bottom: 0; }
  .book-shot-wrap { flex: 0 0 auto; width: min(560px, 44vw); }
  .photo-wrap { flex: 0 0 auto; width: min(440px, 36vw); }
  .sticker-mouse { left: -8.409%; }
  .author-copy { flex: 1; gap: 24px; }
  .paragraph { font-size: 18px; }

  .promo { padding-bottom: 104px; }
  .event-band { gap: 32px; padding: 48px 56px; }
  .event-copy { flex: 1; }
  .event-ants { position: static; flex: 0 0 auto; width: 160px; }
  .event-card { gap: 20px; padding: 16px; }
  .date-block { width: 112px; height: 104px; }
  .date-day { font-size: 56px; }
  .date-block-month .date-day { font-size: 30px; }
  .event-place { font-size: 19px; }

  .footer { flex-direction: row; align-items: center; justify-content: space-between; padding: 40px var(--gutter); }

  .drawer-head { padding: 28px 28px 20px; }
  .drawer-items { padding: 0 28px 20px; }
  .drawer-summary { padding: 24px 28px 28px; }
  .modal { padding: 40px 40px 32px; }
}

/* ---------- Legal pages ---------- */

.legal-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: min(100%, 760px);
  margin-inline: auto;
  padding: 24px clamp(20px, 5vw, 56px) 0;
}

.legal-header.wide { width: min(100%, 980px); padding-inline: 20px; }

.back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: var(--plum);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.back-link:hover { color: var(--plum-dark); }
.back-link:hover span { text-decoration: underline; }

.icon-flip { transform: scaleX(-1); }

@media (max-width: 479px) { .back-more { display: none; } }

.legal {
  width: 100%;
  max-width: 760px;
  margin: 24px auto 64px;
  padding: 40px clamp(20px, 5vw, 56px);
  border-radius: 24px;
  background: var(--paper);
  font-size: 16px;
  line-height: 1.6;
}

.legal h1 { font-family: var(--font-display); font-weight: 400; font-variant-caps: small-caps; font-size: 44px; line-height: 1.05; }
.legal h2 { margin: 32px 0 8px; font-size: 19px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--plum); text-decoration: underline; }
.legal-meta { color: var(--ink-soft); font-size: 14px; }

/* ---------- Checkout & order ---------- */

/* max-width boxes take a plain 20px inset: --gutter is for full-bleed sections */
.checkout-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  max-width: 980px;
  margin: 24px auto 64px;
  padding: 0 20px;
  align-items: start;
}

.checkout-form, .checkout-summary {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px clamp(20px, 4vw, 40px);
  border-radius: 24px;
  background: var(--paper);
}

.checkout-form h1, .checkout-summary h2, .order-page h1 {
  font-family: var(--font-display); font-weight: 400; font-variant-caps: small-caps; font-size: 38px; line-height: 1;
}
.checkout-summary h2 { font-size: 30px; }

.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.field-error { color: var(--plum); font-size: 13px; font-weight: 500; }
.input:has([aria-invalid]) { border-color: var(--coral); }

.textarea {
  width: 100%; padding: 12px 16px; border: 2px solid var(--plum); border-radius: 14px;
  background: #fff; color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; resize: vertical;
}

.r1 summary { cursor: pointer; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.r1[open] { display: flex; flex-direction: column; gap: 16px; }

.terms { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 20px; }
.terms input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--plum); }
.terms a, .order-page a { color: var(--plum); text-decoration: underline; }

.checkout:disabled { opacity: 0.5; cursor: not-allowed; }
.notice { padding: 12px 16px; border-radius: 12px; background: #F4A9C855; font-size: 14px; }

.order-lines { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.order-lines li { display: flex; justify-content: space-between; gap: 12px; }
.order-lines li > :last-child, .sums dd { white-space: nowrap; }
.order-lines .gift-line { color: var(--leaf); }
.order-page .sums { margin: 20px 0; padding-top: 16px; border-top: 1px solid #2E1D1722; }
.order-address { color: var(--ink-soft); }

.delivery { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; border: 0; }
.delivery legend { margin-bottom: 8px; font-weight: 700; }
.delivery-option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px solid #2E1D1726; border-radius: 16px; cursor: pointer; }
.delivery-option:has(input:checked) { border-color: var(--plum); background: #84205C0D; }
.delivery-option input { accent-color: var(--plum); }
.delivery-label { flex: 1; font-weight: 600; }
.delivery-price { font-weight: 700; white-space: nowrap; }
.locker { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 4px 4px 0; }
.locker[hidden] { display: none; }
.locker-chosen:empty { display: none; }
.locker-chosen { margin: 0; font-weight: 600; }
.locker-button { padding: 10px 18px; border: 2px solid var(--plum); border-radius: 22px; color: var(--plum); font-weight: 700; }
.locker-button:hover { background: var(--plum); color: #fff; }
.pay-choice { display: flex; flex-direction: column; gap: 10px; }
.wallet { display: flex; flex-direction: column; gap: 8px; }
.wallet #wallet { min-height: 52px; }
.wallet.unavailable #wallet { display: none; }
.wallet-missing { display: none; padding: 12px 16px; border-radius: 12px; background: #F4A9C855; font-size: 14px; text-align: center; }
.wallet.unavailable .wallet-missing { display: block; }
#wallet-status:empty { display: none; }
.checkout.secondary { border: 2px solid var(--plum); background: transparent; color: var(--plum); }
.checkout.secondary:hover { background: var(--plum); color: #fff; }
.checkout:disabled:hover { background: var(--plum); }
.checkout.secondary:disabled:hover { background: transparent; color: var(--plum); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pay-box { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; padding: 20px; border: 2px solid var(--bg-deep); border-radius: 20px; background: var(--paper); }
.pay-box h2, .pay-box p { margin: 0; }
.pay-box h2 { font-size: 20px; }
.hub3 { width: 100%; max-width: 380px; margin: 0 auto; }
.hub3 img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.pay-box .save-barcode { align-self: center; text-decoration: none; padding: 10px 22px; border: 2px solid var(--plum); border-radius: 22px; color: var(--plum); font-weight: 700; }
.pay-box .save-barcode:hover { background: var(--plum); color: #fff; }
.pay-data { display: grid; gap: 8px; margin: 0; font-size: 15px; }
.pay-data div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pay-data dt { color: var(--ink-soft); }
.pay-data dd { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.copy { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; color: var(--plum); }
.copy:hover { background: var(--bg); }
.copy .icon { width: 16px; height: 16px; }
.copy.copied { background: var(--leaf); color: #fff; }

/* two columns need room for the form next to the 340px summary */
@media (max-width: 1023px) {
  .checkout-page { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
  .legal-header.wide { width: min(100%, 640px); }
  .checkout-summary { order: -1; }
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
  /* label above the value, the value with its copy button below */
  .pay-data { gap: 14px; }
  .pay-data div { flex-direction: column; align-items: stretch; gap: 2px; }
  .pay-data dd { justify-content: space-between; text-align: left; }
}

/* ---------- Account pages ---------- */

.auth-page { display: flex; justify-content: center; margin: 24px auto 64px; padding: 0 var(--gutter); }
.auth-card {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  width: 100%; max-width: 460px; padding: 40px clamp(20px, 6vw, 48px);
  border-radius: 28px; background: var(--paper); text-align: center;
  box-shadow: 0 20px 50px -30px #2E1D1755;
}
.auth-sticker { width: 140px; height: auto; margin-top: -8px; }
.auth-card h1 { font-family: var(--font-display); font-weight: 400; font-variant-caps: small-caps; font-size: 42px; line-height: 1; }
.auth-lead { color: var(--ink-soft); font-size: 16px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 14px; width: 100%; text-align: left; }
.auth-card .fine-print a, .auth-alt a, .auth-lead a { color: var(--plum); text-decoration: underline; }
.auth-alt { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; width: 100%; padding-top: 16px; border-top: 1px solid #2E1D1714; font-size: 15px; }
.auth-alt a { font-weight: 700; }

/* ---------- Admin ---------- */

.admin-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 20px 20px 0; }
.admin-header .brand-logo { width: 72px; }
.admin-home { justify-self: end; color: var(--plum); font-weight: 700; }
.admin { max-width: 1080px; margin: 16px auto 64px; padding: 0 20px; }
.admin h1 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; font-family: var(--font-display); font-weight: 400; font-variant-caps: small-caps; font-size: 40px; }
.admin h2 { margin-bottom: 12px; font-size: 18px; }
.admin a { color: var(--plum); }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.admin-tabs a { padding: 8px 16px; border-radius: 20px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; }
.admin-tabs a[aria-current] { background: var(--plum); color: #fff; }
.admin-table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 16px; background: var(--paper); font-size: 15px; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #2E1D1714; }
.admin-table th { color: var(--ink-soft); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-table .num { text-align: right; white-space: nowrap; }
.admin-table td a { font-weight: 700; }
.admin-empty { padding: 32px; border-radius: 16px; background: var(--paper); color: var(--ink-soft); }
.status { padding: 3px 10px; border-radius: 12px; background: #2E1D1714; font-family: var(--font-body); font-size: 13px; font-weight: 700; font-variant-caps: normal; white-space: nowrap; }
.status-paid { background: #F7EDC6; color: #7A5A00; }
.status-shipped { background: #DCEAF1; color: #1F4E66; }
.status-delivered { background: #DCEFD2; color: var(--forest); }
.status-canceled, .status-refunded { background: #F4A9C855; color: var(--plum-dark); }
.status-pending { background: #FBE3D5; color: #9A4A1F; }
.admin-table tr.overdue td { background: #F4A9C833; }
.admin-table tr.overdue td:last-child { color: var(--plum-dark); font-weight: 700; }
.admin-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.admin-actions .fine-print { text-align: left; }
.admin-boxnow { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; padding-bottom: 12px; border-bottom: 1px solid #2E1D1714; }
.admin-boxnow p { margin: 0; font-size: 14px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.admin-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: 20px; background: var(--paper); line-height: 1.5; }
.admin-facts { display: grid; gap: 6px; margin: 0; font-size: 14px; }
.admin-facts div { display: flex; justify-content: space-between; gap: 12px; }
.admin-facts dt { color: var(--ink-soft); }
.admin-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.admin-error, .admin-warning { margin-bottom: 16px; padding: 14px 18px; border-radius: 14px; background: #F4A9C855; color: var(--plum-dark); }
.admin-warning { display: flex; flex-direction: column; gap: 8px; }
.admin-warning p { margin: 0; }
.admin-warning-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-warning-row .admin-form { margin: 0; }
.admin-warning-row .checkout { height: 40px; padding: 0 16px; font-size: 14px; }
.admin-more { margin-top: 8px; padding-top: 12px; border-top: 1px solid #2E1D1714; }
.admin-more summary { cursor: pointer; color: var(--plum); font-weight: 700; }
.admin-card h2 { margin: 0; }
.admin-history, .admin-receipts { margin-top: 20px; }
.history { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.history li { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.history-at { min-width: 140px; color: var(--ink-soft); }
.history-by { color: var(--ink-soft); }
.history-bad { color: var(--plum-dark); font-weight: 700; }
.unclaimed { color: var(--ink-soft); }
.mail-alert { color: var(--plum-dark); font-size: 13px; font-weight: 700; white-space: nowrap; }
.admin-form select { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); }
@media (max-width: 760px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-table th:nth-child(2), .admin-table td:nth-child(2), .admin-table th:nth-child(4), .admin-table td:nth-child(4) { display: none; }
}

/* fiscal receipts on the order page and in admin */
.receipt { background: #fff; border: 1px solid var(--bg-deep); border-radius: 16px; padding: 20px 24px; margin: 24px 0; }
.receipt h2 { margin: 0 0 4px; font-size: 22px; }
.receipt-seller { font-size: 14px; color: var(--ink-soft); margin: 8px 0 12px; }
.receipt-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin: 0 0 16px; font-size: 14px; }
.receipt-facts dt { color: var(--ink-soft); font-size: 12px; }
.receipt-facts dd { margin: 0; }
.receipt-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.receipt-lines th, .receipt-lines td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid #eee; }
.receipt-lines td:nth-child(n+2), .receipt-lines th:nth-child(n+2) { text-align: right; white-space: nowrap; }
.receipt-lines tfoot th { border-bottom: 0; font-size: 16px; }
.receipt-codes { display: flex; gap: 16px; align-items: center; margin-top: 12px; font-size: 13px; }
.receipt-codes code { word-break: break-all; }
.receipt-qr { flex: none; width: 2.6cm; height: 2.6cm; image-rendering: pixelated; }
.receipt-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; font-size: 14px; }
.receipt-list li { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 560px) {
  .receipt { padding: 16px; }
  .receipt-lines th:nth-child(3), .receipt-lines td:nth-child(3) { display: none; }
}
.receipt .fine-print { text-align: left; }
