/* An artist's shop: white page, a hand-painted wordmark, plain type, one large
   photograph with thumbnails, one black button. The book supplies the colour. */

:root {
  --page:      #ffffff;
  --ink:       #1c46cc;                    /* the blue of the S in the logo */
  --ink-soft:  rgba(28, 70, 204, 0.78);
  --ink-faint: rgba(28, 70, 204, 0.62);
  --ink-hover: #15379f;
  --navy:      #0f2a7a;                    /* darker shade of the same blue: headings */
  --pink:      #e97bad;                    /* the pink O in the logo: the current menu item */
  --rule:      #dfe5f7;
  --wash:      #f4f6fc;
  --alarm:     #b3261e;

  /* Text: IBM Plex Mono Light, a typewriter face with Cyrillic.
     Headings: Mona Sans; it has no Cyrillic, so Russian letters fall through to Onest. */
  --sans: "IBM Plex Mono", "PT Mono", "Courier New", monospace;
  --head: "Mona Sans", "Onest", "Helvetica Neue", Arial, sans-serif;

  --shell:  84rem;
  --gutter: clamp(1rem, 4vw, 3rem);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 300 0.95rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--page); padding: 0.6rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; top: 1rem; }

/* ------------------------------------------------------------ masthead */

.masthead {
  --nav-gap: clamp(1.25rem, 2.2vw, 2rem);
  --group-gap: calc(var(--nav-gap) * 1.5);
  --tool-gap: max(0.875rem, calc(var(--nav-gap) * 0.5));  /* never so tight the tally touches the picker */
  display: flex; align-items: center;
  padding: 1.1rem var(--gutter);
  max-width: calc(var(--shell) + 2 * var(--gutter)); margin: 0 auto;
}
.masthead__name { display: block; flex: none; padding: 0.3rem 0; }
.masthead__name img { height: clamp(0.8rem, 1.3vw, 1.05rem); width: auto; }
/* Two groups: the page links, then the tools (basket + language). Measured
   letter-to-icon, the tools sit half a step apart, the groups a step and a half.
   0.34rem is the empty side of the bag inside its icon box; 0.45rem and 0.2rem
   are the basket's room for its tally and the language picker's padding. */
.masthead__nav { display: flex; align-items: center; gap: var(--nav-gap); margin-left: auto; padding-left: 1.5rem; }
.masthead__tools { display: flex; align-items: center; margin-left: calc(var(--group-gap) - 0.34rem); }
.masthead__tools .lang { margin-left: calc(var(--tool-gap) - 0.34rem - 0.65rem); }
.menu { display: none; }
.navlink {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.75rem;
  font-family: var(--sans); font-weight: 300; font-size: 0.95rem; text-decoration: none;
}
.navlink:hover { color: var(--pink); }
.navlink[aria-current="page"] { color: var(--pink); font-weight: 600; }
.navlink--cart { position: relative; padding-right: 0.45rem; }
.basket-icon { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.tally {
  position: absolute; top: 0.25rem; left: 0.63rem; /* centred on the bag's top-right corner */
  min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem; border-radius: 999px;
  display: grid; place-items: center; font-size: 0.68rem; line-height: 1; font-weight: 500;
  font-variant-numeric: tabular-nums; background: var(--ink); color: var(--page);
  text-box: trim-both cap alphabetic; /* centre the digit itself, not the font's ascent/descent box */
}
.tally[data-filled="0"] { display: none; }
.navlink--cart[aria-current="page"] .basket-icon { stroke-width: 1.5; }
.navlink--cart[aria-current="page"] .tally { background: var(--pink); }
.tally.bump { animation: bump 0.45s ease; }
@keyframes bump { 40% { transform: scale(1.3); } }

.lang { position: relative; font-size: 0.9rem; letter-spacing: 0.04em; }
.lang summary {
  font-weight: 300; list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 2.75rem; padding: 0 0.2rem;
}
.lang summary::-webkit-details-marker { display: none; }
.lang__caret { width: 0.4rem; height: 0.4rem; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.15s; }
.lang[open] .lang__caret { transform: translateY(1px) rotate(-135deg); }
.lang__menu {
  position: absolute; right: 0; top: 100%; z-index: 30; margin: 0; padding: 0.35rem 0; list-style: none;
  min-width: 4.5rem; background: var(--page); border: 1px solid var(--rule); box-shadow: 0 10px 30px -12px rgba(28, 70, 204, 0.3);
}
.lang__menu a {
  display: block; padding: 0.5rem 1rem; text-align: center; text-decoration: none; letter-spacing: 0.06em;
}
.lang__menu a:hover { background: var(--wash); }
.lang__menu a[aria-current] { font-weight: 600; color: var(--pink); }

/* Phone: one slim bar that stays on top while scrolling — logo, basket,
   language, and a menu button that opens the page links as big tap targets. */
@media (max-width: 640px) {
  html { scroll-padding-top: 4rem; }
  .masthead {
    position: sticky; top: 0; z-index: 40; max-width: none;
    padding: 0.25rem calc(var(--gutter) - 0.6rem) 0.25rem var(--gutter);
    background: var(--page); border-bottom: 1px solid var(--rule);
  }
  .masthead__name img { height: 0.8rem; }
  .masthead__nav { display: none; }
  .masthead__tools { margin-left: auto; }
  .masthead__tools .lang { margin-left: 0.35rem; }
  .menu { display: block; }
  .menu summary {
    list-style: none; cursor: pointer; display: grid; place-items: center;
    width: 2.75rem; height: 2.75rem;
  }
  .menu summary::-webkit-details-marker { display: none; }
  .menu__icon, .menu__icon::before, .menu__icon::after {
    display: block; width: 1.15rem; height: 1px; background: var(--ink); transition: transform 0.2s, opacity 0.2s;
  }
  .menu__icon { position: relative; }
  .menu__icon::before, .menu__icon::after { content: ""; position: absolute; left: 0; }
  .menu__icon::before { top: -0.36rem; }
  .menu__icon::after { top: 0.36rem; }
  .menu[open] .menu__icon { background: transparent; }
  .menu[open] .menu__icon::before { transform: translateY(0.36rem) rotate(45deg); }
  .menu[open] .menu__icon::after { transform: translateY(-0.36rem) rotate(-45deg); }
  .menu__panel {
    position: absolute; left: 0; right: 0; top: 100%;
    display: grid; padding: 0.4rem var(--gutter) 0.8rem;
    background: var(--page); border-bottom: 1px solid var(--rule);
    box-shadow: 0 18px 30px -24px rgba(28, 70, 204, 0.35);
  }
  .menu__panel .navlink { min-height: 3.25rem; font-size: 1.1rem; border-bottom: 1px solid var(--rule); }
  .menu__panel .navlink:last-child { border-bottom: 0; }
}

/* ------------------------------------------------------------ notices */

.notice {
  max-width: var(--shell); width: calc(100% - 2 * var(--gutter)); margin: 0.5rem auto 0;
  padding: 0.8rem 1rem; background: var(--wash); border-left: 3px solid var(--ink);
}
.notice--bad { border-color: var(--alarm); color: var(--alarm); }

/* ------------------------------------------------------------ product */

.product {
  max-width: calc(var(--shell) + 2 * var(--gutter)); margin: 0 auto;
  padding: clamp(1.05rem, 2.8vw, 2.45rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.4rem, 3.5vw, 3.5rem); align-items: start;
}
@media (max-width: 900px) { .product { grid-template-columns: 1fr; padding-top: 0.5rem; } }

.gallery { position: sticky; top: 1.5rem; }
@media (max-width: 900px) { .gallery { position: static; margin-inline: calc(-1 * var(--gutter)); } }

.stage { position: relative; background: var(--wash); }
.stage__img { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.stage__img img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: opacity 0.2s; }
.stage__img img.swap { opacity: 0; }
.stage--empty { aspect-ratio: 1; display: grid; place-items: center; color: var(--ink-faint); background: var(--wash); }

/* small round buttons with a fine chevron; they surface when the photo is hovered */
.arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.5rem; height: 2.5rem; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.88); box-shadow: 0 1px 6px rgba(15, 42, 122, 0.12);
  opacity: 0; transition: opacity 0.2s, background 0.15s;
}
.arrow::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 0.45rem; height: 0.45rem;
  border-left: 1.25px solid var(--ink); border-bottom: 1.25px solid var(--ink);
  transform: translate(-35%, -50%) rotate(45deg);
}
.arrow--prev { left: 0.9rem; }
.arrow--next { right: 0.9rem; }
.arrow--next::before { transform: translate(-65%, -50%) rotate(-135deg); }
.stage:hover .arrow, .arrow:focus-visible { opacity: 1; }
.arrow:hover { background: #fff; }
@media (hover: none) { .arrow { opacity: 1; } }

/* desktop: a narrow column of thumbnails to the left of the photograph; the
   column takes the photograph's height and scrolls if there are more photos */
.gallery { display: grid; grid-template-columns: clamp(3.6rem, 6vw, 5.2rem) minmax(0, 1fr); gap: 0.7rem; }
.gallery > .stage { grid-column: 2; grid-row: 1; }
.thumbs {
  grid-column: 1; grid-row: 1; contain: size;
  display: flex; flex-direction: column; gap: 0.6rem;
  overflow-y: auto; scroll-snap-type: y proximity; scrollbar-width: none;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumbs .thumb { flex: none; }
.thumb[hidden] { display: none; }
@media (max-width: 900px) {
  .gallery { display: block; }
  .thumbs {
    contain: none; display: grid; grid-auto-flow: column;
    gap: 0.7rem; margin-top: 0.7rem; overflow-x: auto; scroll-snap-type: x proximity;
    scrollbar-width: thin; padding-bottom: 0.3rem;
  }
}
.thumb { display: block; scroll-snap-align: start; border: 1px solid transparent; padding: 2px; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; opacity: 0.8; transition: opacity 0.15s; }
.thumb:hover img { opacity: 1; }
.thumb[aria-current="true"] { border-color: var(--ink); }
.thumb[aria-current="true"] img { opacity: 1; }
@media (max-width: 900px) { .thumbs { grid-auto-columns: 22%; padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); } }

.product__info { padding-top: 0; }
.title {
  color: var(--navy);
  font-family: var(--head); font-weight: 600; font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.12;
  letter-spacing: -0.015em; margin: 0; text-wrap: balance;
}
/* The top of the capitals lines up with the top edge of the photograph (book and author pages). */
.product .title, .about .title { margin-top: -0.215em; }
/* fill the first line ("When the little seed / wakes up") rather than balancing the two */
.product .title { text-wrap: wrap; }
@supports (text-box-trim: trim-start) {
  .product .title, .about .title { margin-top: 0; text-box-trim: trim-start; text-box-edge: cap alphabetic; }
  /* Cyrillic is drawn by Onest, whose capitals stand a hair taller than Mona Sans's */
  .product .title:lang(ru), .product .title:lang(uk),
  .about .title:lang(ru), .about .title:lang(uk) { margin-top: -0.02em; }
}
.nobr { white-space: nowrap; }
.lede { margin: 1rem 0 0; max-width: 34rem; font-size: 1rem; line-height: 1.6; color: var(--ink); }
.credits { margin: 0.9rem 0 0; color: var(--ink-soft); }
.price { font-size: 1.6rem; margin: 1.4rem 0 0; font-variant-numeric: tabular-nums; }
.shipnote { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--ink-soft); }

.buy { margin-top: 1.8rem; display: grid; gap: 0.5rem; }
.buy .tabs { margin-bottom: 0.6rem; }
.fieldlabel { font-size: 0.9rem; color: var(--ink-soft); padding: 0; margin: 0 0 0.45rem; }
/* edition picker: bordered boxes, the chosen one outlined in blue */
.tabs { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.tabs__row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tab { position: relative; cursor: pointer; }
.tab input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tab span {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.9rem; padding: 0.5rem 1.2rem;
  border: 1px solid var(--rule); white-space: nowrap; transition: border-color 0.15s;
}
.tab:hover span { border-color: var(--ink-faint); }
.tab input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tab input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.tab small { font-size: 0.75rem; color: var(--alarm); }
.tab--off, .tab--off input { cursor: not-allowed; }
/* the locked edition: text, frame and badge all in one pale blue */
.tab--off span, .tab--off:hover span { color: var(--ink-faint); border-color: rgba(28, 70, 204, 0.28); border-style: dashed; }
.tab.tab--off sup { border-color: rgba(28, 70, 204, 0.28); }
.tab sup {
  font-size: 0.72rem; line-height: 1; letter-spacing: 0.02em;
  padding: 0.2rem 0.45rem; border: 1px solid currentColor; border-radius: 999px;
}

.buy__row { display: flex; gap: 0.8rem; align-items: stretch; }
.buy__row .btn--buy { flex: 1; }
/* what is already in the basket, under the buy button */
.tab__count {
  display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem;
  margin-left: 0.45rem; border-radius: 999px; background: var(--ink); color: var(--page);
  font-style: normal; font-size: 0.68rem; line-height: 1; vertical-align: 1px; font-variant-numeric: tabular-nums;
}
.buy-status { margin-top: 1rem; padding: 1rem 1.1rem; background: var(--wash); display: grid; gap: 0.7rem; font-size: 0.9rem; }
.buy-status__row { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 1rem; }
.buy-status b { font-weight: 500; color: var(--navy); }
.buy-status a { text-decoration: underline; text-underline-offset: 0.25em; }
.soldout { margin: 1.6rem 0 0; color: var(--ink-soft); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--ink); height: 3.4rem; background: var(--page); }
.stepper button { width: 2.9rem; height: 100%; border: 0; background: none; cursor: pointer; font-size: 1.25rem; color: var(--ink-soft); }
.stepper button:hover { color: var(--ink); }
.stepper input {
  width: 2.2rem; border: 0; background: none; text-align: center; font-size: 1rem;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 3.4rem; padding: 0.7rem 1.8rem;
  border: 1px solid var(--ink); border-radius: 0;
  background: var(--ink); color: var(--page);
  font-size: 1rem; font-weight: 400; letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn--buy[disabled] { background: var(--page); color: var(--ink); border-color: var(--ink); }
.btn--ghost { background: var(--page); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--page); }
.btn--quiet { background: none; border-color: transparent; color: var(--ink-soft); padding-inline: 0; }
.btn--quiet:hover { background: none; border-color: transparent; color: var(--ink); text-decoration: underline; }
.btn--small { min-height: 2.6rem; padding: 0.35rem 1rem; font-size: 0.92rem; }
.btn[disabled] { pointer-events: none; }
.linkish {
  background: none; border: 0; padding: 0.3rem 0; cursor: pointer; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 0.25em; font-size: 0.92rem;
}
.linkish:hover { color: var(--ink); }
.textlink { text-decoration: underline; text-underline-offset: 0.3em; }

/* the book's description: its own block under the buying controls */
.book-about { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.book-about .prose { margin-top: 0; }
.eyebrow {
  margin: 0 0 1rem; font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink);
}

/* ------------------------------------------------------------ text */

.prose { margin-top: 2.4rem; max-width: 38rem; font-size: 0.97rem; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1em; }
.prose .subhead { font-family: var(--head); font-weight: 500; color: var(--ink); font-size: 1.15rem; line-height: 1.45; }
.prose h2, .prose h3 { color: var(--navy); font-family: var(--head); font-size: 1.05rem; font-weight: 600; margin: 1.9em 0 0.6em; }
.prose strong { font-weight: 500; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { margin: 0.25em 0; }
.prose blockquote { margin: 1.6em 0; padding: 0 0 0 1.1em; border-left: 2px solid var(--ink); font-style: italic; }
.prose small { color: var(--ink-faint); }
.subhead { color: var(--ink-soft); font-size: 1.15rem; margin: 0.8rem 0 0; }

/* ------------------------------------------------------------ meet the author */

.meet {
  max-width: var(--shell); margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: auto minmax(0, 40rem); gap: clamp(1.4rem, 4vw, 3rem); align-items: center;
}
.meet__face { display: block; width: clamp(7rem, 16vw, 10rem); aspect-ratio: 1; overflow: hidden; border-radius: 50%; }
.meet__face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.meet__name { color: var(--navy); font-family: var(--head); font-weight: 600; font-size: 1.5rem; line-height: 1.2; margin: 0; }
.meet__lead { color: var(--ink-soft); margin: 0.5rem 0 0.9rem; }

/* ------------------------------------------------------------ about page */

.about {
  max-width: calc(var(--shell) + 2 * var(--gutter)); margin: 0 auto;
  padding: clamp(1.05rem, 2.8vw, 2.45rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: start;
}
.portrait { margin: 0; }
.portrait img { width: 100%; }
.portrait figcaption { font-size: 0.85rem; color: var(--ink-faint); margin-top: 0.5rem; }
.about__say .prose { margin-top: 1.6rem; }
.contact { margin: 1.4rem 0; }
.contact p { margin: 0; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

.paper-section { max-width: calc(var(--shell) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) clamp(3rem, 6vw, 5rem); }
.life { columns: 3 14rem; column-gap: 0.8rem; }
.life__item { margin: 0 0 0.8rem; break-inside: avoid; cursor: zoom-in; }

/* ------------------------------------------------------------ basket */

/* Two columns on wide screens: the books on the left, a summary with the one
   main action on the right that stays in view while scrolling. One column below. */
.basket { max-width: var(--shell); margin: 0 auto; padding: clamp(1.05rem, 2.8vw, 2.45rem) var(--gutter) clamp(3rem, 6vw, 5rem); }
.basket__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 1rem; }
.basket__head .title:focus { outline: none; }
.basket__count { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
/* on one column the summary comes straight after the books, before the extras */
.basket__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 23rem);
  grid-template-areas: "lines summary" "extra summary"; grid-template-rows: auto 1fr;
  column-gap: clamp(2rem, 5vw, 4.5rem); align-items: start; margin-top: clamp(1.4rem, 3vw, 2.2rem);
}
.lines { grid-area: lines; }
.summary { grid-area: summary; }
.basket__extra { grid-area: extra; }
@media (max-width: 860px) {
  .basket__grid { grid-template-columns: 1fr; grid-template-areas: "lines" "summary" "extra"; grid-template-rows: none; row-gap: 1.6rem; }
  .basket__extra .back { margin-top: -0.4rem; }
}
.basket-root.is-busy .line__sum, .basket-root.is-busy .summary__rows dd,
.basket-root.is-busy .summary__total strong { opacity: 0.45; transition: opacity 0.2s 0.1s; }

.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
/* one row, everything centred on the cover: cover | title, edition, remove | quantity | sum */
.line {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto 6rem;
  grid-template-areas: "thumb info qty sum";
  column-gap: 1.6rem; align-items: center;
  padding: 1.4rem 0; border-bottom: 1px solid var(--rule);
}
.line__thumb { grid-area: thumb; display: block; width: 6.5rem; aspect-ratio: 1; background: var(--wash); }
.line__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.line__info { grid-area: info; }
.line__title { font-family: var(--head); font-size: 1.1rem; font-weight: 500; line-height: 1.3; margin: 0; color: var(--navy); }
.line__title a { text-decoration: none; }
.line__title a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.line__meta { margin: 0.5rem 0 0; display: flex; }
.chip {
  display: inline-block; padding: 0.15rem 0.45rem; border: 1px solid var(--ink-faint); color: var(--ink);
  font-size: 0.75rem; line-height: 1.2; letter-spacing: 0.06em;
}
.line__qty { grid-area: qty; margin: 0; display: flex; align-items: center; gap: 0.6rem; }
.line__qty .stepper { height: 2.75rem; }
.line__qty .stepper button { width: 2.6rem; }
.line__sum { grid-area: sum; margin: 0; text-align: right; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--navy); }
.line__remove { margin: 0.2rem 0 -0.7rem; }
.remove {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.75rem; margin-left: -0.1rem;
  padding: 0 0.1rem; border: 0; background: none; cursor: pointer;
  color: var(--ink-faint); font: inherit; font-size: 0.85rem;
}
.remove:hover { color: var(--alarm); }
.remove:hover span { text-decoration: underline; text-underline-offset: 0.25em; }
.bin, .lock { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
/* phone: cover and text side by side, quantity and sum on one line beneath the text */
@media (max-width: 560px) {
  .line {
    grid-template-columns: 5.2rem minmax(0, 1fr) auto;
    grid-template-areas: "thumb info info" "thumb qty sum";
    column-gap: 1rem; row-gap: 0.9rem; align-items: center;
  }
  .line__thumb { width: 5.2rem; grid-row: 1 / 3; align-self: start; }
  .line__remove { margin-bottom: -0.6rem; }
}

.stepper button[disabled] { color: var(--rule); cursor: default; }

.back {
  display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: 1.2rem;
  color: var(--ink-soft); font-size: 0.92rem; text-decoration: none;
}
.back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.25em; }

.summary { position: sticky; top: 1.5rem; padding: clamp(1.2rem, 2.5vw, 1.8rem); background: var(--wash); }
@media (max-width: 860px) { .summary { position: static; } }
.summary__title { margin: 0 0 1.1rem; font-family: var(--head); font-size: 1.15rem; font-weight: 600; color: var(--navy); }
.summary__rows { margin: 0; display: grid; gap: 0.55rem; }
.summary__rows div { display: flex; justify-content: space-between; gap: 1rem; }
.summary__rows dt { color: var(--ink-soft); }
.summary__rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  margin: 1.1rem 0 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--ink);
}
.summary__total span { font-size: 1.1rem; color: var(--navy); }
.summary__total strong { font-family: var(--head); font-size: 1.7rem; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.summary form { margin: 0; }
.btn--block { width: 100%; }
.summary .btn--buy[disabled] { background: var(--rule); border-color: var(--rule); color: var(--ink-faint); cursor: not-allowed; }
.summary__off { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--alarm); }
.summary__secure { margin: 0.9rem 0 0; justify-content: center; display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.78rem; line-height: 1.5; color: var(--ink-faint); }
.summary__secure .lock { margin-top: 0.15rem; }

.notice--undo { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; padding-block: 0.4rem; }
.notice--undo form { margin: 0; }
.notice--undo .linkish { min-height: 2.75rem; color: var(--ink); font-size: 0.95rem; }

/* ------------------------------------------------------------ checkout */

/* Same two columns as the basket. The form is three numbered steps, all open at
   once, so nothing has to be clicked through; on a phone the order summary sits
   folded on top and the form follows. */
.co-grid { grid-template-areas: "form summary"; grid-template-rows: auto; }
.co { grid-area: form; min-width: 0; }
.co-sum { grid-area: summary; }
@media (max-width: 860px) { .co-grid { grid-template-areas: "summary" "form"; } }

.co__step { padding: 0 0 2rem; margin: 0 0 2rem; border-bottom: 1px solid var(--rule); }
.co__step:last-child { border-bottom: 0; margin-bottom: 0; }
.co__title {
  display: flex; align-items: center; gap: 0.7rem; margin: 0 0 1.2rem;
  font-family: var(--head); font-size: 1.25rem; font-weight: 600; color: var(--navy);
}
.co__num {
  display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border: 1px solid var(--ink);
  font-family: var(--sans); font-size: 0.82rem; font-weight: 400; color: var(--ink); text-box: trim-both cap alphabetic;
}
/* Progressive steps (only once checkout.js has taken over): a folded step is just its
   title; it slides open to its natural height when the step before is complete. The
   0fr → 1fr grid row animates the height without measuring anything. */
.co.is-stepped .co__step { transition: padding 0.5s cubic-bezier(0.22, 0.8, 0.24, 1), margin 0.5s cubic-bezier(0.22, 0.8, 0.24, 1); }
.co.is-stepped .co__title { transition: margin 0.5s cubic-bezier(0.22, 0.8, 0.24, 1), color 0.3s; }
.co.is-stepped .co__body {
  display: grid; grid-template-rows: 1fr; grid-template-columns: minmax(0, 1fr); /* full width, so Stripe's form isn't squeezed */
  transition: grid-template-rows 0.55s cubic-bezier(0.22, 0.8, 0.24, 1), opacity 0.4s ease 0.12s, transform 0.55s cubic-bezier(0.22, 0.8, 0.24, 1);
}
.co.is-stepped .co__inner { min-height: 0; overflow: hidden; padding: 3px; margin: -3px; } /* room for focus rings */
.co.is-stepped .is-folded { padding-bottom: 1.3rem; margin-bottom: 1.3rem; }
.co.is-stepped .is-folded .co__title { margin-bottom: 0; color: var(--ink-faint); }
.co.is-stepped .is-folded .co__body { grid-template-rows: 0fr; opacity: 0; transform: translateY(-0.6rem); transition-delay: 0s; }
.co.is-stepped .is-folded .co__num { border-color: rgba(28, 70, 204, 0.3); color: var(--ink-faint); }
.co__num { position: relative; transition: background 0.3s, color 0.3s, border-color 0.3s; }
.co__num::after {
  content: ""; position: absolute; left: 50%; top: 45%; width: 0.32rem; height: 0.62rem;
  border-right: 1.5px solid var(--page); border-bottom: 1.5px solid var(--page);
  transform: translate(-50%, -50%) rotate(45deg) scale(0.4); opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
}
.co.is-stepped .is-done .co__num { background: var(--ink); border-color: var(--ink); color: transparent; }
.co.is-stepped .is-done .co__num::after { transform: translate(-50%, -50%) rotate(45deg) scale(1); opacity: 1; }
.co__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.co__row--zip { grid-template-columns: 10rem 1fr; }
@media (max-width: 560px) { .co__row { grid-template-columns: 1fr; } .co__row--zip { grid-template-columns: 8rem 1fr; } }
.co__field { margin: 0 0 1rem; min-width: 0; }
.co__field label, .co__point label, .co__methods legend {
  display: block; margin: 0 0 0.35rem; font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ink-soft);
}
.co input[type="text"], .co input[type="email"], .co input[type="tel"], .co select {
  width: 100%; min-height: 3rem; padding: 0.6rem 0.8rem; border: 1px solid rgba(28, 70, 204, 0.45); border-radius: 0;
  background: var(--page); color: var(--ink); font: inherit; font-size: 0.95rem;
}
.co select {
  appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 50%, calc(100% - 0.8rem) 50%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat;
}
.co input:focus, .co select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.co [aria-invalid="true"] { border-color: var(--alarm) !important; box-shadow: 0 0 0 1px var(--alarm); }
.co__err { margin: 0.35rem 0 0; font-size: 0.82rem; color: var(--alarm); }
.co__hint { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--ink-faint); }

.co__methods { margin: 0.6rem 0 0; padding: 0; border: 0; min-width: 0; }
.co__methods [data-methods] { display: grid; gap: 0.5rem; }
.co__method {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.8rem;
  min-height: 3.4rem; padding: 0.6rem 1rem; border: 1px solid rgba(28, 70, 204, 0.3); cursor: pointer; background: var(--page);
}
.co__method:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--wash); }
.co__method input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--ink); }
.co__method-name { color: var(--navy); }
.co__method-days { display: block; margin-top: 0.15rem; font-size: 0.8em; opacity: 0.7; }
.co__method-price { font-variant-numeric: tabular-nums; color: var(--navy); }
.co__point { margin-top: 1rem; }
.co__point[hidden] { display: none; }
.co__point select { font-size: 0.88rem; }

.co__card { min-height: 1rem; margin-bottom: 1rem; }
.co__alert { margin: 0 0 1rem; padding: 0.75rem 1rem; border-left: 3px solid var(--alarm); background: #fdf3f2; color: var(--alarm); font-size: 0.9rem; }
.co .btn--buy[disabled] { background: var(--rule); border-color: var(--rule); color: var(--ink-faint); cursor: not-allowed; }
.co .summary__off { margin: 0 0 1rem; }

/* the summary: on wide screens a plain card, on phones a fold-out receipt */
.co-sum__box > .co-sum__toggle { display: none; }
.co-sum__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.1rem; }
.co-sum__head .summary__title { margin: 0; }
.co-sum__edit { font-size: 0.85rem; color: var(--ink-soft); }
.co-items { list-style: none; margin: 0 0 1.2rem; padding: 0 0 1.2rem; border-bottom: 1px solid var(--rule); display: grid; gap: 0.9rem; }
.co-item { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) auto; gap: 0.9rem; align-items: center; }
.co-item__thumb { position: relative; display: block; width: 3.6rem; aspect-ratio: 1; background: var(--page); }
.co-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.co-item__qty {
  position: absolute; top: -0.45rem; right: -0.45rem; min-width: 1.3rem; height: 1.3rem; padding: 0 0.3rem; border-radius: 999px;
  display: grid; place-items: center; background: var(--ink); color: var(--page); font-style: normal; font-size: 0.72rem;
  text-box: trim-both cap alphabetic;
}
.co-item__body { display: grid; gap: 0.35rem; justify-items: start; }
.co-item__title { font-family: var(--head); font-weight: 500; font-size: 0.95rem; line-height: 1.3; color: var(--navy); }
.co-item__price { font-variant-numeric: tabular-nums; color: var(--navy); }
@media (max-width: 860px) {
  .co-sum { padding: 0; }
  .co-sum__box > .co-sum__toggle {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 3.4rem;
    padding: 0 1.1rem; cursor: pointer; list-style: none; color: var(--navy);
  }
  .co-sum__toggle::-webkit-details-marker { display: none; }
  .co-sum__toggle span::after {
    content: ""; display: inline-block; width: 0.4rem; height: 0.4rem; margin-left: 0.6rem; vertical-align: 0.2em;
    border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); transition: transform 0.15s;
  }
  .co-sum__box[open] .co-sum__toggle span::after { transform: translateY(0.2rem) rotate(-135deg); }
  .co-sum__toggle strong { font-family: var(--head); font-size: 1.15rem; }
  .co-sum__box[open] > :not(summary) { margin-inline: 1.1rem; }
  .co-sum__box[open] > .summary__total { margin-bottom: 1.1rem; }
  .co-sum__box[open] .co-sum__head { justify-content: flex-end; margin-bottom: 0.4rem; padding-top: 0.8rem; border-top: 1px solid var(--rule); }
  .co-sum__head .summary__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ------------------------------------------------------------ empty / thanks / errors */

.empty { max-width: 44rem; margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter); }
.empty .lead { color: var(--ink-soft); font-size: 1.1rem; margin: 1rem 0 0; }
.empty__say .btn { margin-top: 1.8rem; }
.receipt { margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1.4rem; margin: 0; }
.receipt dt { color: var(--ink-soft); }
.receipt dd { margin: 0; }

/* ------------------------------------------------------------ footer */

.colophon {
  max-width: calc(var(--shell) + 2 * var(--gutter)); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; align-items: center;
  padding: 1.6rem var(--gutter) calc(1.6rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule); font-size: 0.88rem; color: var(--ink-soft);
}
.colophon a { text-decoration: none; }
.colophon a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ lightbox */

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(255, 255, 255, 0.98); display: grid; grid-template-rows: 1fr auto; }
.lightbox[hidden] { display: none; }
.lightbox__stage { display: grid; place-items: center; padding: 1.2rem; min-height: 0; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox__bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom)); }
.lightbox__cap { flex: 1; font-size: 0.9rem; color: var(--ink-soft); }
.lightbox__count { font-size: 0.85rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.lbx-btn { width: 2.9rem; height: 2.9rem; border: 1px solid var(--ink); background: var(--page); cursor: pointer; font-size: 1.05rem; }
.lbx-btn:hover { background: var(--ink); color: var(--page); }
@media (max-width: 600px) { .meet { grid-template-columns: 1fr; justify-items: start; } }
/* no double gap at the foot of a checkout step: the step's own padding is enough */
.co__inner > .co__field:last-child, .co__inner > .co__row:last-child > .co__field:last-child { margin-bottom: 0; }
@media (min-width: 561px) { .co__inner > .co__row:last-child > .co__field { margin-bottom: 0; } }
.co__inner > .co__row--zip:last-child > .co__field { margin-bottom: 0; }
