/* ──────────────────────────────────────────────────────────
   Heritage Grooming · Products (shop.html)
   Builds on css/style.css: same tokens, type, buttons and fields.
   Grounds: ink (hero, counter, collect), paper (the whole shelf), the seal's green (which pomade).
   ────────────────────────────────────────────────────────── */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── nav: the bag ─────────────────────────────────────── */
.bagbtn {
  position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  color: var(--text); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .3s ease, color .3s ease, scale .16s var(--ease-out);
}
.bagbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.bagbtn__count {
  position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  display: grid; place-items: center; background: var(--brass); color: var(--ink);
  font: 600 .6875rem/1 var(--sans); font-variant-numeric: tabular-nums;
  transform: scale(0); transition: transform .4s var(--ease-out);
}
.bagbtn.has-items .bagbtn__count { transform: none; }
.bagbtn:active { scale: .94; }
@media (hover: hover) and (pointer: fine) { .bagbtn:hover { color: var(--brass-hi); box-shadow: inset 0 0 0 1px var(--brass); } }
.nav__bar { gap: 24px; }

/* ── hero: the shelf ──────────────────────────────────── */
main > .phero { background: var(--ink); }
.phero__inner {
  min-height: 100svh; display: flex; flex-direction: column; gap: clamp(18px, 3vh, 40px);
  padding: calc(var(--nav-h) + clamp(20px, 4vh, 56px)) 0 clamp(24px, 3.5vh, 44px);
}
.phero__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
.phero__head > :first-child { grid-column: 1 / 7; }
.phero__head > :last-child { grid-column: 7 / 13; padding-top: 4px; }
.phero__title { font: 400 clamp(2.6rem, 4.7vw, 5.25rem)/.98 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.phero__title em { font-style: normal; color: var(--brass); }
.phero__side { display: grid; gap: 28px; justify-items: start; }
.phero__lede { font-size: clamp(1.0625rem, 1.2vw, 1.1875rem); line-height: 1.55; color: #d9d3c5; max-width: 42ch; }

/* the bento: the four shelves and the pomade question as one board. Every window holds plain photos exactly as
   uploaded (cropped or contained by the window, never cut out or edited) on the photos' own cream.
   Motion is answered, never ambient: a tile lifts 2px, its window's next product wipes up from the shelf edge, the
   arrow passes through its ring; the hair chips swap the big window and its lowest price. Nothing loops. */
.bento {
  --bento-gap: clamp(12px, 1.25vw, 18px);
  flex: 1 1 auto; display: grid; gap: var(--bento-gap);
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 2fr);   /* hair | the other four, 2 x 2 */
  min-height: clamp(400px, 46svh, 640px);
}
.bento__rest { display: grid; gap: var(--bento-gap); grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); flex: 1 1 auto; min-width: 0; }
:is(.bento, .bento__rest) > li { display: flex; min-width: 0; min-height: 0; }
:is(.bento, .bento__rest) > li > :is(.tile, .bento__rest) { flex: 1 1 auto; }
.tile {
  --tile-r: 10px;
  position: relative; min-width: 0; min-height: 0; overflow: hidden; isolation: isolate;
  border-radius: var(--tile-r); background: var(--ink-2); color: var(--text);
  transition: translate .5s var(--ease-out), box-shadow .45s ease;
}
.tile::after {                                          /* the hairline sits over the photo too, so every edge is one line */
  content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .45s ease;
}
.tile__no { font: 500 .75rem/1.2 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--brass); }
.tile__name { display: block; font: 400 clamp(2.1rem, 3vw, 3.25rem)/.95 var(--serif); letter-spacing: -.02em; color: var(--text); }
.tile__from { display: flex; align-items: baseline; gap: 6px; font: 400 .8125rem/1 var(--sans); letter-spacing: .02em; color: var(--muted); white-space: nowrap; }
.tile__from i { font: 400 clamp(1.4rem, 1.7vw, 1.75rem)/1 var(--serif); font-style: normal; color: var(--brass-hi); font-variant-numeric: tabular-nums; }

/* the windows: the photos' own cream, the photo, a faint shelf shade at the foot */
.tile__window { position: relative; display: block; overflow: hidden; background: var(--photo-bg, #efe5d1); }
.tile__window::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 22%; z-index: 3; pointer-events: none;
  background: linear-gradient(0deg, rgba(15, 23, 22, .1), rgba(15, 23, 22, 0));
}
.tile__img {
  --k: 1; --e: 1;
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 56%;
  scale: calc(var(--k) * var(--e)); transform-origin: 50% 60%;
  clip-path: inset(100% 0 0 0);                         /* waiting under the shelf edge */
  transition: clip-path 0s .8s, scale 1.2s var(--ease-out);
}
.tile__img.is-still { --k: 1.5; object-fit: contain; object-position: 50% 74%; transform-origin: 50% 78%; }
.tile__img.is-on { z-index: 2; clip-path: inset(0 0 0 0); transition: clip-path .8s var(--ease-in-out), scale 1.2s var(--ease-out); }
.tile__img.was-on { z-index: 1; clip-path: inset(0 0 0 0); transition: scale 1.2s var(--ease-out); }

/* ── the hair shelf: the big tile, window on top, plate below ── */
.tile--hair { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.tile--hair .tile__window { --photo-bg: #e6dac6; }
.tile--hair .tile__img:not(.is-still) {                 /* the whole pack, never cut at the cap: contained, its sides fading into the same cream */
  left: 50%; right: auto; width: auto; max-width: none; height: 100%; translate: -50% 0; --k: 1.3; transform-origin: 50% 58%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
}
.tile__plate {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 14px 16px;
  padding: clamp(20px, 2vw, 28px) clamp(20px, 2.2vw, 32px) clamp(20px, 2.2vw, 30px);
  border-top: 1px solid var(--line);
}
.tile__plate .tile__no { display: flex; gap: 12px; }
.tile__plate .tile__no span { color: var(--muted); letter-spacing: .14em; }
.tile__of { font-style: normal; }
.tile__plate .tile__name { grid-column: 1 / -1; font-size: clamp(2.6rem, 4vw, 4.25rem); }
.tile__kinds { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kind {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 10px;
  border-radius: 22px; font: 500 .9375rem/1 var(--sans); color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(233, 227, 213, .22);
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease, scale .16s var(--ease-out);
}
.kind small { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; transition: color .3s ease; }
.kind.is-on { box-shadow: inset 0 0 0 1px var(--brass); color: var(--brass-hi); }
.kind.is-on small { color: var(--brass); }
.kind:active { scale: .96; }
.tile__all { grid-column: 1 / -1; width: 100%; }

/* ── beard, shave, skin: words left, window right ── */
.tile--shelf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 43%); }
.tile__text { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: clamp(18px, 1.8vw, 26px); min-width: 0; }
.tile--shelf .tile__name { margin-top: 4px; transition: translate .5s var(--ease-out); }
.tile__line { font-size: .9375rem; line-height: 1.4; color: var(--muted); }
.tile__foot { margin-top: auto; align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; }
.tile__go {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; color: var(--brass);
  box-shadow: inset 0 0 0 1px var(--brass); transition: background-color .4s ease, color .4s ease;
}
.tile__go .arrow { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; transition: translate .5s var(--ease-out); }
.tile__go .arrow + .arrow { translate: -46px 0; }
.tile--shelf .tile__window { border-left: 1px solid var(--line); }
.tile--shelf .tile__img + .tile__img { clip-path: inset(100% 0 0 0); z-index: 2; transition: clip-path .7s var(--ease-in-out), scale 1.2s var(--ease-out); }

/* ── the pomade question: the brass tile ── */
.tile--ask {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: clamp(18px, 1.7vw, 24px);
  background: var(--brass); color: var(--ink);
}
.tile--ask::after { box-shadow: none; }
.tile--ask .tile__no { color: var(--ink); }
.tile__ask { font: 400 clamp(1.75rem, 2.3vw, 2.5rem)/1.02 var(--serif); letter-spacing: -.015em; max-width: 11ch; text-wrap: balance; }
.tile__q { margin-top: auto; font-size: .9375rem; line-height: 1.4; color: rgba(15, 23, 22, .8); max-width: 30ch; }
.tile__opts { align-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.opt-go {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px; border-radius: 6px;
  font: 600 .8125rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 22, .45);
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease, scale .16s var(--ease-out);
}
.opt-go:active { scale: .96; }
.opt-go:focus-visible { outline-color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .tile--shelf:hover, .tile--ask:hover, .tile--hair:has(.tile__window:hover) { translate: 0 -2px; box-shadow: 0 26px 44px -30px rgba(0, 0, 0, .95); }
  .tile--shelf:hover::after, .tile--hair:has(.tile__window:hover)::after { box-shadow: inset 0 0 0 1px rgba(198, 167, 102, .65); }
  .tile--shelf:hover .tile__img, .tile--hair .tile__window:hover .tile__img { scale: calc(var(--k) * var(--e) * 1.03); }
  .tile--shelf:hover .tile__name { translate: 4px 0; }
  .tile--shelf:hover .tile__go { background: var(--brass); color: var(--ink); }
  .tile--shelf:hover .tile__go .arrow { translate: 46px 0; }
  .tile--shelf:hover .tile__go .arrow + .arrow { translate: 0 0; }
  .kind:not(.is-on):hover { box-shadow: inset 0 0 0 1px rgba(198, 167, 102, .6); }
  .opt-go:hover { background: var(--ink); color: var(--cream); box-shadow: inset 0 0 0 1px var(--ink); }
}
/* keyboards get what the pointer gets */
.tile--shelf:focus-visible .tile__img + .tile__img { clip-path: inset(0 0 0 0); }
.tile--shelf:focus-visible .tile__go { background: var(--brass); color: var(--ink); }
.tile--shelf:focus-visible { outline-offset: 3px; }

/* ── find a product: the search in the hero ── */
.seek { position: relative; z-index: 3; display: grid; gap: 10px; width: min(100%, 460px); }
.no-js .seek { display: none; }
.seek__hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.seek__label { display: block; font: 500 .75rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--brass); }
.seek__label small { font-size: inherit; color: var(--muted); letter-spacing: .14em; }
.seek__field {
  position: relative; height: 56px; border-radius: 28px; background: rgba(233, 227, 213, .03);
  box-shadow: inset 0 0 0 1px rgba(233, 227, 213, .2); transition: box-shadow .3s ease, background-color .3s ease;
}
.seek__field:hover { box-shadow: inset 0 0 0 1px rgba(198, 167, 102, .5); }
.seek__field:focus-within { background: rgba(233, 227, 213, .05); box-shadow: inset 0 0 0 1px var(--brass), 0 0 0 4px rgba(198, 167, 102, .14); }
.seek__icon { position: absolute; left: 20px; top: 50%; width: 20px; height: 20px; margin-top: -10px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; pointer-events: none; transition: stroke .3s ease; }
.seek__field:focus-within .seek__icon { stroke: var(--brass); }
.seek__input {
  width: 100%; height: 100%; padding: 0 56px 0 52px; border: 0; border-radius: inherit; background: transparent; outline: none;
  font: 400 1rem/1 var(--sans); color: var(--text); -webkit-appearance: none; appearance: none;
}
.seek__input:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.seek__input::placeholder { color: rgba(155, 168, 162, .85); }
.seek__input::-webkit-search-cancel-button { display: none; }
.seek__key {
  position: absolute; right: 16px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(233, 227, 213, .2); font: 500 .8125rem/1 var(--sans); color: var(--muted);
  transition: opacity .25s ease;
}
.seek__field:focus-within .seek__key, .seek.has-q .seek__key { opacity: 0; }
.seek__list {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: min(388px, 52svh); overflow: auto; overscroll-behavior: contain;
  padding: 6px; border-radius: 16px; background: #121d1c; box-shadow: inset 0 0 0 1px var(--line), 0 34px 60px -24px rgba(0, 0, 0, .9);
  transform-origin: 50% 0; transition: opacity .22s ease, translate .32s var(--ease-out), scale .32s var(--ease-out);
}
.seek__list[hidden] { display: none; }
@starting-style { .seek__list { opacity: 0; translate: 0 -6px; scale: .985; } }
.seek__opt {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 60px; padding: 6px 12px 6px 6px;
  border-radius: 11px; cursor: pointer; transition: background-color .2s ease;
}
.seek__opt[aria-selected="true"] { background: rgba(198, 167, 102, .13); }
.seek__opt img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--photo-bg, #efe5d1); }
.seek__opt img.is-still { object-fit: contain; object-position: 50% 80%; scale: 1.25; }
.seek__thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--photo-bg, #efe5d1); }
.seek__name { display: block; font: 400 1.0625rem/1.15 var(--serif-text); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seek__meta { display: block; margin-top: 4px; font: 500 .6875rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seek__price { font: 400 1.125rem/1 var(--serif-text); color: var(--brass-hi); font-variant-numeric: tabular-nums; }
.seek__opt mark { background: none; color: var(--brass-hi); box-shadow: inset 0 -1px 0 var(--brass); }
.seek__empty { padding: 14px 12px; font-size: .9375rem; line-height: 1.45; color: var(--muted); }
.seek__try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 8px 8px; }
.seek__try > .seek__lab { width: 100%; padding: 2px 4px 6px; font: 500 .6875rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.seek__term {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 20px; cursor: pointer;
  font: 500 .875rem/1 var(--sans); color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(233, 227, 213, .2); transition: box-shadow .25s ease, color .25s ease, scale .16s var(--ease-out);
}
.seek__term[aria-selected="true"], .seek__term:hover { box-shadow: inset 0 0 0 1px var(--brass); color: var(--brass-hi); }
.seek__term:active { scale: .96; }

/* a product found from the hero or a hair chip: its card is marked in the grid until the next pick */
.card__media { transition: box-shadow .6s ease; }
.card.is-found .card__media { box-shadow: 0 0 0 2px var(--brass), 0 0 0 7px rgba(198, 167, 102, .2); }

/* ── on the counter ───────────────────────────────────── */
/* default = static (phones, reduced motion, no JS): each product with its still */
.counter { padding-block: var(--section); }
.counter__grid { display: grid; gap: clamp(36px, 5vw, 72px); }
.counter__title { font: 400 clamp(2.4rem, 4.6vw, 4.75rem)/1 var(--serif); letter-spacing: -.015em; }
.counter__title em { font-style: normal; color: var(--brass); }
.counter__index, .counter__stage { display: none; }
.counter__items { display: grid; gap: clamp(72px, 10vw, 140px); }

.item {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px clamp(32px, 6vw, 96px); align-items: center;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
/* the maker's photo exactly as generated (its own cream ground and 3:4), no frame, a soft shadow on the green */
.item__photo { margin: 0; aspect-ratio: 3 / 4; }
.item__photo img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 6px;
  box-shadow: 0 22px 40px -18px rgba(0, 0, 0, .6);
}
.item__text { display: grid; gap: 16px; justify-items: start; }
.item__cat { font: 500 .8125rem/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--brass); }
.item__name { font: 400 clamp(2.4rem, 4.6vw, 4.5rem)/.96 var(--serif); letter-spacing: -.02em; }
.item__desc { color: #c5cdc7; max-width: 44ch; font-size: clamp(1rem, 1.1vw, 1.0625rem); }
.item__specs { width: 100%; max-width: 520px; margin-top: 6px; border-bottom: 1px solid var(--line); }
.spec { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 48px; padding: 8px 0; border-top: 1px solid var(--line); }
.spec dt { font-size: .9375rem; color: var(--muted); }
.spec dd { text-align: right; color: var(--cream); font-size: .9375rem; }
.spec .link { padding-block: 10px; }
.pips { display: inline-flex; gap: 6px; }
.pips i { width: 22px; height: 6px; border-radius: 3px; background: rgba(233, 227, 213, .12); }
.pips i.on { background: var(--brass); }
.item__buy { display: flex; align-items: center; gap: 28px; margin-top: 10px; }
.item__price { font: 400 clamp(2rem, 2.8vw, 2.75rem)/1 var(--serif); color: var(--brass-hi); font-variant-numeric: tabular-nums; }

/* one-screen stage (JS adds .counter--stage on wide screens with motion on): no pin, the products turn by themselves
   every 6 s, the names above, a side mirror, a swipe or the controls move it by hand */
.counter--stage { padding-block: 0; }
.counter--stage .counter__pin { min-height: 100svh; display: flex; align-items: center; padding-block: calc(var(--nav-h) + 8px) 40px; }
.counter--stage .counter__grid {
  width: min(100% - 2 * var(--gutter), 1480px);
  grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(22px, 3.5vh, 40px) 24px; height: clamp(580px, calc(100svh - var(--nav-h) - 72px), 880px);
}
.counter--stage .counter__head { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 24px; }
.counter--stage .counter__title { grid-column: 1 / 6; font-size: clamp(2.4rem, 4.6vw, 4.75rem); }
.counter--stage .counter__index { grid-column: 6 / 13; display: flex; justify-content: space-between; gap: 12px; }
.pidx {
  position: relative; display: flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 10px 0; white-space: nowrap;
  font: 500 .875rem/1 var(--sans); letter-spacing: .02em; color: var(--muted); transition: color .35s ease;
}
.pidx small { font: 500 .6875rem/1 var(--sans); letter-spacing: .16em; color: inherit; transition: color .35s ease; }
.pidx::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: var(--brass);
  transform: scaleX(0); transform-origin: 100% 50%; transition: transform .5s var(--ease-out);
}
.pidx.is-on { color: var(--cream); }
.pidx.is-on small { color: var(--brass); }
.pidx.is-on::after { transform: scaleX(1); transform-origin: 0 50%; }
@media (hover: hover) and (pointer: fine) { .pidx:not(.is-on):hover { color: var(--text); } .pidx:not(.is-on):hover::after { transform: scaleX(.35); transform-origin: 0 50%; } }

/* the stage: a lit cabinet in a brass frame (the mirror frame of services.html and team.html) */
.counter--stage .counter__stage {
  --rim: clamp(6px, .5vw, 8px);
  grid-column: 1 / 7; grid-row: 2; margin-right: clamp(0px, 2vw, 32px); display: block; height: 100%; min-height: 0;
  position: relative; isolation: isolate; overflow: hidden; border-radius: clamp(20px, 2vw, 30px);
  background: radial-gradient(ellipse 80% 70% at 50% 38%, #24352f 0%, #172321 45%, #0f1716 80%);
  box-shadow: 0 0 0 .5px rgba(20, 12, 2, .7), 0 2px 3px rgba(0, 0, 0, .45), 0 22px 34px -16px rgba(0, 0, 0, .8);
  touch-action: pan-y; cursor: grab;
}
.counter__stage.is-dragging { cursor: grabbing; }
.counter__stage::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background: radial-gradient(ellipse 22% 7% at 50% 4%, rgba(255, 226, 160, .22), transparent 75%);
  box-shadow:
    inset 0 0 0 calc(var(--rim) * .1)  #3a2a10,
    inset 0 0 0 calc(var(--rim) * .26) #f1cf86,
    inset 0 0 0 calc(var(--rim) * .44) #d3a456,
    inset 0 0 0 calc(var(--rim) * .6)  #a8803c,
    inset 0 0 0 calc(var(--rim) * .72) #24180a,
    inset 0 0 0 calc(var(--rim) * .86) #d2a95c,
    inset 0 0 0 var(--rim)             #6e5226,
    inset 0 0 0 calc(var(--rim) + 1px) rgba(4, 4, 2, .9),
    inset 0 calc(var(--rim) * 1.6) calc(var(--rim) * 3.2) calc(var(--rim) * -.4) rgba(0, 0, 0, .55),
    inset 0 0 calc(var(--rim) * 5) rgba(0, 0, 0, .42);
}
/* the row of mirrors (js/shop.js builds it from the items' photos): arched barbershop mirrors, a brass edge each, the
   product's photo inside exactly as uploaded. The arch and the cream ground behind it make a white, cream or transparent
   maker's packshot read the same; the side mirrors stand back, smaller and dimmed. Positions come from the script. */
.mirrors { position: absolute; inset: 0; z-index: 1; }
.mirrors__m {
  --dim: 0;
  position: absolute; left: 50%; top: 50%;
  width: var(--mw, 300px); height: var(--mh, 400px);
  will-change: transform;
}
/* each maker's photo as generated, no frame of its own, on the green inside the one brass mirror;
   the ones off centre step back into the dark */
.mirrors__m img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%;
  opacity: calc(1 - var(--dim) * .9);
}
.mirrors__m:not(.is-on) { cursor: pointer; }
.counter--stage .counter__stage { cursor: grab; user-select: none; -webkit-user-select: none; }
.counter__count, .counter__hint {
  display: flex; align-items: center; gap: 12px;
  font: 500 .8125rem/1 var(--sans); letter-spacing: .14em; color: rgba(239, 232, 216, .8); font-variant-numeric: tabular-nums;
}
.counter__hint { position: absolute; z-index: 4; bottom: clamp(20px, 2.2vw, 30px); right: clamp(22px, 2.2vw, 34px); letter-spacing: .1em; text-transform: uppercase; font-size: .6875rem; color: rgba(239, 232, 216, .6); }
.counter__count b { color: var(--brass-hi); font-weight: 500; }
/* the line between the numbers is the 6 s timer: it fills while a product is shown, freezes while held */
.counter__count i { width: clamp(56px, 6vw, 96px); height: 1px; background: rgba(239, 232, 216, .25); overflow: hidden; }
.counter__count u { display: block; height: 100%; background: var(--brass-hi); transform: scaleX(0); transform-origin: 0 50%; }
.counter__hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.counter:not(.counter--stage) .counter__hint { display: none; }

/* where we are and the 6 s timer (JS shows it only while the rotation runs) */
.counter__ctl { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 22px); }
.counter__ctl[hidden] { display: none; }

/* on the stage the controls sit inside the brass mirror, over the cream of the photos: dark ink, walnut for the number */
.counter--stage .counter__ctl {
  grid-column: 1 / 7; grid-row: 2; align-self: end; justify-self: start; z-index: 4; position: relative;
  margin: 0 0 clamp(16px, 1.8vw, 24px) clamp(18px, 2vw, 30px);
}
.counter--stage .counter__count { color: rgba(15, 23, 22, .7); }
.counter--stage .counter__count b { color: var(--walnut); }
.counter--stage .counter__count i { background: rgba(15, 23, 22, .18); }
.counter--stage .counter__count u { background: var(--walnut); }
.counter--stage .counter__hint { color: rgba(15, 23, 22, .6); }

.counter--stage .counter__items { grid-column: 7 / 13; grid-row: 2; display: grid; align-self: stretch; gap: 0; min-height: 0; }
.counter--stage .item { grid-area: 1 / 1; display: block; visibility: hidden; align-self: center; }
.counter--stage .item.is-active { visibility: visible; }
.counter--stage .item__photo { display: none; }
.counter--stage .item__text { gap: 14px; }
.counter--stage .item__name { font-size: clamp(2.6rem, 4.4vw, 4.75rem); }
@media (max-height: 820px) {
  .counter--stage .spec { min-height: 42px; padding: 5px 0; }
  .counter--stage .item__desc { font-size: .9375rem; }
  .counter--stage .item__name { font-size: clamp(2.4rem, 3.8vw, 3.75rem); }
}

/* the deck (JS adds .counter--deck below the stage, motion on): one product at a time on a native snap track, so the
   card follows the finger; it turns by itself every 6 s. The track runs edge to edge, each card keeps the gutter. */
.counter--deck .counter__grid { gap: 24px; }
.counter--deck .counter__ctl { justify-content: space-between; }
.counter--deck .counter__items {
  display: flex; align-items: flex-start; gap: 0;
  margin-inline: calc(var(--gutter) * -1);
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.counter--deck .counter__items::-webkit-scrollbar { display: none; }
.counter--deck .item {
  flex: 0 0 100%; min-width: 0; padding-inline: var(--gutter);
  scroll-snap-align: start; scroll-snap-stop: always;
}
.counter--deck .item__photo { width: 100%; max-width: 520px; aspect-ratio: 4 / 5; max-height: 56svh; }
@media (max-width: 599px) { .counter--deck .item__photo { aspect-ratio: 5 / 4; } }

/* ── the whole shelf (paper ground) ───────────────────── */
.shop-page .h2 { font-size: clamp(2.4rem, 4.6vw, 4.75rem); }
main > .range { background: var(--paper); color: var(--ink); min-height: 200svh; padding-block: calc(var(--nav-h) + 24px) 64px; }
.range .h2 em { color: var(--walnut); }
.range :focus-visible { outline-color: var(--walnut); }
.range__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px 40px; flex-wrap: wrap; margin-bottom: clamp(28px, 3vw, 40px); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 22px;
  font: 500 .9375rem/1 var(--sans); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-ink);
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease, scale .16s var(--ease-out);
}
.chip small { font-size: .75rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; transition: color .3s ease; }
.chip.is-on { background: var(--ink); color: var(--cream); box-shadow: none; }
.chip.is-on small { color: var(--brass); }
.chip:active { scale: .96; }
@media (hover: hover) and (pointer: fine) { .chip:not(.is-on):hover { box-shadow: inset 0 0 0 1px var(--walnut); } }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(28px, 2.2vw, 32px) clamp(16px, 2vw, 28px); }
/* a shelf whose photos are still to come */
.range__empty { max-width: 46ch; padding: clamp(40px, 6vw, 80px) 0; font: 400 clamp(1.25rem, 1.8vw, 1.625rem)/1.35 var(--serif-text); color: var(--ink-muted, #5d625c); }
.card { display: grid; grid-template-rows: auto 1fr; transition: translate .5s var(--ease-out); }
.card[hidden] { display: none; }
.card__media {
  position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 14px;
  background: radial-gradient(ellipse 75% 55% at 50% 66%, #f6f0e2 0%, #e2d7bf 70%, #d9cdb2 100%);
}
.card__media::after {                                    /* the brass shelf edge the product stands on */
  content: ""; position: absolute; left: 0; right: 0; bottom: 13%; height: 1px; background: rgba(142, 119, 72, .5);
}
.card__media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; padding: 6% 6% 0; margin-top: -2%; transition: scale .7s var(--ease-out); transform-origin: 50% 85%; }
/* the featured makers' cards: their own studio photo fills the square (it has its own cream ground and shadow) */
.card--maker .card__media::after { display: none; }
.card--maker .card__media img { object-fit: cover; object-position: 50% 62%; padding: 0; margin: 0; transform-origin: 50% 60%; }
.card__body { display: grid; align-content: start; gap: 6px; padding-top: 18px; }
.card__cat { font: 500 .75rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--walnut); }
.card__name { font: 400 clamp(1.5rem, 1.9vw, 1.875rem)/1.05 var(--serif); letter-spacing: -.015em; margin-top: 4px; }
.card__line { font-size: .9375rem; color: var(--ink-muted); }
.card__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line-ink); }
.card__price { font: 400 1.5rem/1 var(--serif-text); font-variant-numeric: tabular-nums; }
.card__price small { font: 400 .8125rem/1 var(--sans); color: var(--ink-muted); margin-left: 4px; }
.card__add {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px 0 14px; border-radius: var(--radius); overflow: hidden; isolation: isolate;
  font: 600 .75rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  transition: color .3s ease, scale .16s var(--ease-out);
}
.card__add::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: translateY(101%); transition: transform .45s var(--ease-out); }
.card__add svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; transition: rotate .45s var(--ease-out); }
.card__add:active { scale: .95; }
.card__add.is-added::before { transform: none; background: var(--walnut); }
.card__add.is-added { color: var(--cream); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { translate: 0 -2px; }
  .card:hover .card__media img { scale: 1.03; }
  .card__add:hover { color: var(--cream); }
  .card__add:hover::before { transform: none; }
  .card__add:hover svg { rotate: 90deg; }
}

/* ── which pomade (the seal's green) ──────────────────── */
main > .match { background: var(--green); min-height: 100svh; display: grid; align-content: center; padding-block: var(--nav-h) 32px; }
.match__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 32px 24px; align-items: start; }
.match__ask { grid-column: 1 / 6; grid-row: 1; display: grid; gap: 22px; align-content: start; }
.match__answer { display: contents; }
.match__answer > .pick-result { grid-column: 1 / 6; grid-row: 2; }
.match__answer > .match__chart { grid-column: 7 / 13; grid-row: 1 / 3; align-self: center; width: min(100%, 560px); }
.match__lede { color: #c9d1cc; max-width: 40ch; }
.ask { display: grid; gap: 14px; margin-top: 14px; }
.ask__q { font: 500 .8125rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--brass); margin-bottom: 14px; }
.ask__opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.opt span {
  display: grid; gap: 6px; height: 100%; padding: 16px 18px; border-radius: 10px;
  font: 400 1.25rem/1.1 var(--serif-text); background: rgba(15, 23, 22, .35); box-shadow: inset 0 0 0 1px rgba(233, 227, 213, .14);
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease, transform .16s var(--ease-out);
}
.opt small { font: 400 .8125rem/1.3 var(--sans); color: var(--muted); transition: color .3s ease; }
.opt input:checked + span { background: var(--brass); color: var(--ink); box-shadow: none; }
.opt input:checked + span small { color: rgba(15, 23, 22, .82); }
.opt input:focus-visible + span { outline: 2px solid var(--brass-hi); outline-offset: 3px; }
.opt:active span { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .opt:hover input:not(:checked) + span { box-shadow: inset 0 0 0 1px var(--brass); } }

.match__chart { aspect-ratio: 1; width: min(100%, 460px); justify-self: center; max-height: 70svh; }
.chart { width: 100%; height: 100%; overflow: visible; }
.chart__grid line { stroke: rgba(233, 227, 213, .1); stroke-width: 1; }
.chart__grid line:nth-child(-n+2) { stroke: rgba(198, 167, 102, .5); }
.chart__axis { font: 500 11px var(--sans); letter-spacing: .16em; text-transform: uppercase; fill: var(--muted); }
.chart__dot { cursor: pointer; outline: none; }
.chart__hit { fill: transparent; stroke: none; }
.chart__dot circle:not(.chart__hit) { fill: var(--green); stroke: var(--brass); stroke-width: 1.5; transition: fill .3s ease, r .35s var(--ease-out), stroke-width .2s ease; }
.chart__dot:focus-visible circle:not(.chart__hit) { stroke: var(--brass-hi); stroke-width: 3; }
.chart__dot.is-on circle:not(.chart__hit) { fill: var(--brass); r: 10; }
@media (hover: hover) and (pointer: fine) { .chart__dot:not(.is-on):hover circle:not(.chart__hit) { fill: rgba(198, 167, 102, .45); } }
/* the one name on the chart */
.chart__tag { pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.chart__tag.is-on { opacity: 1; }
.chart__tag rect { fill: var(--brass); }
.chart__tag text { font: 400 15px var(--serif-text); fill: var(--ink); }
.chart__tag line { stroke: var(--brass); stroke-width: 1; }
.chart__tag.is-peek rect { fill: var(--ink); stroke: rgba(198, 167, 102, .6); stroke-width: 1; }
.chart__tag.is-peek text { fill: var(--cream); }
.chart__you circle:first-child { fill: none; stroke: var(--brass-hi); stroke-width: 1.5; stroke-dasharray: 3 5; }
.chart__you circle:last-child { fill: var(--brass-hi); }

.pick-result {
  display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 24px; align-items: center;
  padding: clamp(18px, 2vw, 26px); border-radius: clamp(14px, 1.6vw, 22px); background: var(--card); color: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .5);
}
.pick-result :focus-visible { outline-color: var(--walnut); }
.pick-result__photo { margin: 0; aspect-ratio: 9 / 11; border-radius: 10px; background: radial-gradient(ellipse 80% 60% at 50% 70%, #fbf8f1, #e2d7bf); overflow: hidden; }
.pick-result__photo img { width: 100%; height: 100%; object-fit: cover; }
.pick-result__text { display: grid; gap: 8px; justify-items: start; }
.pick-result__for { font: 500 .75rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--walnut); }
.pick-result__name { font: 400 clamp(1.75rem, 2.4vw, 2.375rem)/1 var(--serif); letter-spacing: -.02em; }
.pick-result__why { font-size: .9375rem; color: #343b39; max-width: 46ch; }
.pick-result__alt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: .875rem; color: #343b39; }
.pick-result__alt[hidden] { display: none; }
.pick-result__alt span { font: 500 .6875rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--walnut); }
.pick-result__alt i { font-style: normal; color: rgba(15, 23, 22, .35); }
.pick-result__alt .link--btn { color: var(--ink); }
.pick-result__buy { display: flex; align-items: center; gap: 20px; margin-top: 6px; }
.pick-result__price { font: 400 1.625rem/1 var(--serif-text); color: var(--walnut); font-variant-numeric: tabular-nums; }
.pick-result .btn--line { --btn-fg: var(--ink); --btn-fill: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
@media (hover: hover) and (pointer: fine) { .pick-result .btn--line:hover { color: var(--cream); } }

/* ── collect at the counter ───────────────────────────── */
.collect { min-height: 100svh; display: grid; align-content: center; padding-block: calc(var(--nav-h) + 24px) 64px; }
.collect__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 48px 24px; align-items: start; }
.collect__photo { grid-column: 8 / 13; grid-row: 1; margin: 0; aspect-ratio: 1; }
.collect__photo picture { width: 100%; height: 100%; }
.collect__text { grid-column: 1 / 7; grid-row: 1; display: grid; gap: 28px; justify-items: start; }
.facts { width: 100%; border-bottom: 1px solid rgba(233, 227, 213, .12); }
.facts > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; padding: 16px 0; border-top: 1px solid rgba(233, 227, 213, .12); }
.facts dt { color: var(--muted); }
.facts dd { color: var(--cream); }
.collect__actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

/* ── the bag ──────────────────────────────────────────── */
.bag {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; width: min(480px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  background: var(--card); color: var(--ink); overflow: hidden;
}
.bag::backdrop { background: rgba(6, 10, 10, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.bag :focus-visible { outline-color: var(--walnut); }
.bag__panel { height: 100%; display: flex; flex-direction: column; padding: 0 clamp(20px, 3vw, 32px); }
.bag__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0 18px; border-bottom: 1px solid var(--card-line); }
.bag__title { font: 400 2rem/1 var(--serif); letter-spacing: -.02em; }
.bag__close { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--card-line); transition: box-shadow .3s ease, rotate .45s var(--ease-out); }
.bag__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.bag__close:active { scale: .94; }
@media (hover: hover) and (pointer: fine) { .bag__close:hover { box-shadow: inset 0 0 0 1px var(--walnut); rotate: 90deg; } }
.bag__view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bag__view[hidden] { display: none; }
.bag__list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0; margin-inline: -4px; }
.line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--card-line); }
.line__img { grid-row: 1 / 3; width: 72px; aspect-ratio: 9 / 11; object-fit: contain; object-position: 50% 90%; border-radius: 8px; background: radial-gradient(ellipse 80% 60% at 50% 70%, #fbf8f1, #e2d7bf); }
.line__name { font: 400 1.1875rem/1.15 var(--serif-text); }
.line__meta { font-size: .8125rem; color: var(--card-muted); }
.line__price { font: 400 1.125rem/1 var(--serif-text); text-align: right; font-variant-numeric: tabular-nums; }
.qty { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qty__ctl { display: inline-flex; align-items: center; border-radius: 22px; box-shadow: inset 0 0 0 1px var(--card-line); }
.qty__ctl button { width: 44px; height: 40px; display: grid; place-items: center; border-radius: 22px; transition: background-color .2s ease, scale .16s var(--ease-out); }
.qty__ctl button:active { scale: .9; }
.qty__ctl svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.qty__ctl output { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.qty__remove { min-height: 40px; font-size: .8125rem; color: var(--card-muted); background: linear-gradient(currentColor, currentColor) 0 calc(100% - 10px) / 100% 1px no-repeat; transition: color .2s ease, background-size .4s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .qty__ctl button:hover { background: rgba(15, 23, 22, .06); }
  .qty__remove:hover { color: var(--card-error); background-size: 0 1px; }
}
.bag__empty { flex: 1; display: grid; align-content: center; justify-items: start; gap: 22px; color: var(--card-muted); }
.bag__empty[hidden], .bag__foot[hidden] { display: none; }
.bag__empty .btn--line { --btn-fg: var(--ink); --btn-fill: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
@media (hover: hover) and (pointer: fine) { .bag__empty .btn--line:hover, .bag__done .btn--line:hover { color: var(--cream); } }
.bag__foot { display: grid; gap: 16px; padding: 18px 0 max(22px, env(safe-area-inset-bottom)); border-top: 1px solid var(--card-line); margin-top: auto; }
.bag__foot .btn { width: 100%; }
.bag__total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.bag__total span { color: var(--card-muted); font-size: .9375rem; }
.bag__total b { font: 400 2.25rem/1 var(--serif); color: var(--walnut); font-variant-numeric: tabular-nums; font-weight: 400; }
.bag__form { overflow-y: auto; padding-top: 6px; }
.bag__sub { margin: 22px 0 12px; font: 500 .8125rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--walnut); }
.bag__form .fields { grid-template-columns: 1fr; gap: 16px; }
.bag__form .field__label { color: var(--ink); }
.bag__form .field__label small { color: var(--card-muted); }
.bag__form :is(.field input) { background: var(--card-field); color: var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.bag__form .field input:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--walnut); }
.bag__form .field [aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--card-error); }
.bag__form .field__error { color: var(--card-error); }
.bag__days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bag__days .day { width: auto; background: var(--card-field); box-shadow: inset 0 0 0 1px var(--card-line); color: var(--ink); }
.bag__days .day__dow, .bag__days .day__mon { color: var(--card-muted); }
.bag__days .day[aria-checked="true"] { background: var(--brass); box-shadow: none; }
.bag__days .day[aria-checked="true"] :is(.day__dow, .day__mon) { color: rgba(15, 23, 22, .82); }
@media (hover: hover) and (pointer: fine) { .bag__days .day:not([aria-checked="true"]):hover { box-shadow: inset 0 0 0 1px var(--walnut); } }
.bag__form .bag__foot { margin-top: 24px; }
.bag__nav { display: flex; align-items: center; gap: 16px; }
.bag__nav .btn { flex: 1; width: auto; }
.bag__nav .link--btn { color: var(--card-muted); min-height: 44px; }
.bag__done { justify-content: center; align-items: flex-start; gap: 18px; }
.bag__done .done__tick { stroke: var(--walnut); }
.bag__done .done__body { color: var(--card-muted); }
.bag__done .done__demo { background: var(--card-field); box-shadow: inset 0 0 0 1px var(--card-line); color: var(--walnut); }
.bag__done .btn--line { --btn-fg: var(--ink); --btn-fill: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* the packshot that flies into the bag */
.flyer { position: fixed; z-index: 260; left: 0; top: 0; pointer-events: none; object-fit: contain; will-change: transform; }
.bagbtn.is-bump { animation: bag-bump .6s var(--ease-out) 1; }
@keyframes bag-bump { 0% { scale: 1; } 30% { scale: 1.16; } 100% { scale: 1; } }

/* phone bag bar */
.bagbar { display: none; }

.footer__legal { justify-content: space-between; }

/* ── responsive ──────────────────────────────────────── */
@media (max-width: 1279px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .counter--stage .counter__index { flex-wrap: wrap; justify-content: flex-start; gap: 0 22px; }
  .counter--stage .pidx { min-height: 40px; padding: 8px 0; }
}
@media (max-width: 1099px) {
  .match__ask { grid-column: 1 / 8; }
  .match__answer > .pick-result { grid-column: 1 / 8; }
  .match__answer > .match__chart { grid-column: 8 / 13; }
  .collect__photo { grid-column: 8 / 13; }
}
@media (max-width: 899px) {
  .phero__head { grid-template-columns: 1fr; gap: 20px; }
  .phero__head > :first-child, .phero__head > :last-child { grid-column: 1 / -1; padding-top: 0; }
  .item { grid-template-columns: 1fr; }
  .item__photo { width: min(100%, 420px); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match__ask, .match__answer > .pick-result, .match__answer > .match__chart { grid-column: 1 / -1; grid-row: auto; }
  .match__answer > .match__chart { width: min(100%, 420px); }
  .collect__photo, .collect__text { grid-column: 1 / -1; grid-row: auto; }
  .collect__photo { aspect-ratio: 4 / 3; }
  .bagbar {
    display: inline-flex; position: fixed; left: 16px; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 100; min-height: 54px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    transform: translateY(160%); transition: transform .5s var(--ease-out), scale .16s var(--ease-out);
  }
  .bagbar.is-on { transform: none; }
}
@media (max-width: 599px) {
  .phero__inner { padding-top: calc(var(--nav-h) + 16px); gap: 18px; }
  .phero__lede { font-size: 1rem; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; width: 100%; }
  .chip { justify-content: space-between; }
  .item__buy { flex-direction: column; align-items: stretch; gap: 14px; width: 100%; }
  .item__buy .btn { width: 100%; }
  .range__head { gap: 22px; }
  .cards { gap: 28px 12px; }
  .card__name { font-size: 1.3125rem; }
  .card__line { font-size: .875rem; }
  .card__foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .card__add { justify-content: center; }
  .ask__opts { grid-template-columns: 1fr; }
  .opt span { grid-template-columns: auto 1fr; align-items: baseline; gap: 12px; padding: 14px 16px; }
  .opt small { justify-self: end; }
  .pick-result { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
  .pick-result__buy { flex-direction: column; align-items: stretch; gap: 12px; width: 100%; }
  .facts > div { grid-template-columns: 1fr; gap: 4px; }
  .collect__actions { flex-direction: column; align-items: stretch; gap: 14px; width: 100%; }
  .collect__actions .link { align-self: flex-start; }
  .footer__legal { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .tile::after, .tile__img, .tile__name, .tile__go, .tile__go .arrow, .kind, .opt-go, .seek__list, .seek__field, .pidx::after, .card, .card__media img, .card__add::before, .card__add svg, .chip, .opt span, .bagbtn__count, .bagbar, .bag__close { transition-duration: .01ms !important; }
  .bagbtn.is-bump { animation: none; }
}

/* phones: the product name stays a level under the h2; the All chip takes its own row so the four categories pair up */
@media (max-width: 600px) {
  .item__name, .counter--stage .item__name { font-size: 2rem; }
  .filters .chip:first-child { grid-column: 1 / -1; }
}

/* ── the bento below desktop ── */
@media (max-width: 1099px) {
  .bento { grid-template-columns: 1fr; min-height: 0; }
  .bento__rest { grid-template-rows: none; grid-auto-rows: minmax(250px, auto); }
  .tile--hair { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tile--hair .tile__window { min-height: 360px; }
  .tile--hair .tile__plate { border-top: 0; border-left: 1px solid var(--line); align-content: end; }
  .tile__kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .seek { width: 100%; }
}
@media (max-width: 699px) {
  .bento { --bento-gap: 12px; }
  .bento__rest { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .tile--hair { grid-template-columns: 1fr; }
  .tile--hair .tile__window { min-height: 0; height: clamp(168px, 46vw, 260px); }
  /* the main button comes up beside the name, so it is on the first screen; the kinds pair up under them */
  .tile--hair .tile__plate { border-left: 0; border-top: 1px solid var(--line); gap: 12px 16px; align-items: center; grid-template-areas: "no from" "name all" "kinds kinds"; }
  .tile__plate .tile__no { grid-area: no; white-space: nowrap; }
  .tile__of { display: none; }
  .tile__plate .tile__from { grid-area: from; }
  .tile__plate .tile__name { grid-area: name; font-size: 3rem; }
  .tile__plate .tile__all { grid-area: all; width: auto; min-height: 48px; padding: 0 18px; }
  .tile__kinds { grid-area: kinds; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile--shelf { grid-template-columns: minmax(0, 1fr) minmax(0, 38%); min-height: 176px; }
  .tile__text { gap: 6px; padding: 18px; }
  .tile--shelf .tile__name { font-size: 2rem; }
  .tile__line { font-size: .875rem; }
  .tile__foot { padding-top: 10px; }
  .tile__q { margin-top: 6px; }
  .tile__ask { max-width: none; }
}

/* the narrowest phones: no room for the button beside the name, so it takes its own row under it */
@media (max-width: 359px) {
  .tile--hair .tile__plate { grid-template-areas: "no from" "name name" "all all" "kinds kinds"; }
  .tile__plate .tile__all { width: 100%; }
}

/* ── the product sheet ─────────────────────────────────────
   A card's name (and the whole card through it) opens the product: its photo, the maker, the price, the words, the
   specs, how to use it, and four from the same shelf. Paper like the bag; a centred sheet on wide screens, a
   full-height sheet on phones with the buy row kept under the thumb. js/shop.js fills it. */
.card { position: relative; }
.card__link { color: inherit; outline: none; }
.card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 14px; }
.card__add { z-index: 2; }
.card:has(.card__link:focus-visible) .card__media { outline: 2px solid var(--walnut); outline-offset: 4px; }
.item__more { margin-top: -4px; color: var(--muted); }

.pdp {
  --pdp-pad: clamp(20px, 3vw, 40px);
  position: fixed; inset: 0; margin: auto; padding: 0; border: 0;
  width: min(1180px, calc(100vw - 48px)); max-width: none; height: min(860px, calc(100dvh - 48px)); max-height: none;
  border-radius: 18px; overflow: hidden;
  background: var(--card); color: var(--ink);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .7);
}
.pdp[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.pdp::backdrop { background: rgba(6, 10, 10, .66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: opacity .3s ease; }
.pdp[open]::backdrop { animation: pdp-fade .4s ease both; }
.pdp.is-closing::backdrop { opacity: 0; }
@keyframes pdp-fade { from { opacity: 0; } }
.pdp :focus-visible { outline: 2px solid var(--walnut); outline-offset: 3px; }

.pdp__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 14px 12px var(--pdp-pad); border-bottom: 1px solid var(--card-line);
}
.pdp__crumb { display: flex; align-items: baseline; gap: 14px; font: 500 .75rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--walnut); }
.pdp__pos { color: var(--card-muted); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.pdp__tools { display: flex; gap: 8px; }
.pdp__icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--card-line);
  transition: box-shadow .3s ease, rotate .45s var(--ease-out), scale .16s var(--ease-out);
}
.pdp__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pdp__icon:active { scale: .92; }
.pdp__icon:disabled { opacity: .3; cursor: default; }
.pdp__close { margin-left: 6px; background: var(--ink); color: var(--cream); box-shadow: none; }

.pdp__scroll { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.pdp__body {
  display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 10fr); gap: clamp(28px, 4vw, 64px);
  padding: var(--pdp-pad);
}
/* the packshot as generated (3:4, its own cream ground), held in view while the words scroll past */
.pdp__photo {
  position: sticky; top: var(--pdp-pad); align-self: start; justify-self: center; margin: 0;
  width: 100%; aspect-ratio: 3 / 4; max-height: calc(min(860px, 100dvh - 48px) - 2 * var(--pdp-pad) - 70px);
  border-radius: 14px; overflow: hidden; background: #e2d7bf;
}
.pdp__photo img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 60%; }
@media (hover: hover) and (pointer: fine) {
  .pdp__photo img { transition: scale .9s var(--ease-out); }
  .pdp__photo:hover img { scale: 1.03; }
}

.pdp__info { display: grid; align-content: start; gap: 26px; padding-top: 6px; min-width: 0; }
.pdp__head { display: grid; gap: 12px; }
.pdp__maker { font: 500 .8125rem/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--walnut); }
.pdp__name { font: 400 clamp(2.4rem, 4vw, 3.75rem)/.98 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.pdp__line { font: 400 1.1875rem/1.35 var(--serif-text); color: var(--card-muted); }
.pdp__price { display: flex; align-items: baseline; gap: 14px; font: 400 2.5rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.pdp__price small { font: 500 .9375rem/1 var(--sans); color: var(--card-muted); }
.pdp__desc { max-width: 48ch; font-size: 1.0625rem; line-height: 1.6; }

.pdp__buy { display: flex; align-items: stretch; gap: 12px; }
.pdp__qty { flex: none; background: var(--card-field); border-radius: var(--radius); }
.pdp__qty button { height: 58px; width: 48px; border-radius: var(--radius); }
.pdp__qty button:disabled { opacity: .3; cursor: default; }
@media (hover: hover) and (pointer: fine) { .pdp__qty button:not(:disabled):hover { background: rgba(15, 23, 22, .06); } }
.pdp__add { flex: 1; justify-content: space-between; --btn-bg: var(--ink); --btn-fg: var(--cream); --btn-fill: var(--walnut); }
.pdp__add-sum { font: 400 1.25rem/1 var(--serif-text); letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.pdp__add.is-added { --btn-bg: var(--walnut); }
.pdp__inbag { display: flex; align-items: center; gap: 12px; margin-top: -14px; font-size: .9375rem; color: var(--card-muted); }
.pdp__inbag[hidden] { display: none; }
.pdp__inbag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4f7a5a; }
.pdp__inbag .link--btn { color: var(--ink); min-height: 44px; }

.pdp__specs { border-bottom: 1px solid var(--card-line); }
.pdp__specs .spec { border-top-color: var(--card-line); }
.pdp__specs .spec dt { color: var(--card-muted); }
.pdp__specs .spec dd { color: var(--ink); max-width: 62%; }
.pdp__specs .pips i { background: rgba(15, 23, 22, .12); }
.pdp__specs .pips i.on { background: var(--walnut); }
.pdp__specs .link { color: var(--ink); }

.pdp__sub { margin-bottom: 10px; font: 500 .8125rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--walnut); }
.pdp__use p { max-width: 48ch; line-height: 1.6; }

.pdp__promise { display: grid; gap: 12px; padding: 20px; border-radius: 12px; background: var(--card-field); }
.pdp__promise li { display: flex; align-items: center; gap: 14px; font-size: .9375rem; }
.pdp__promise svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--walnut); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.pdp__more { padding: clamp(28px, 3vw, 40px) var(--pdp-pad) var(--pdp-pad); border-top: 1px solid var(--card-line); }
.pdp__more[hidden] { display: none; }
.pdp__related { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 8px; }
.rel { display: grid; gap: 12px; width: 100%; text-align: left; transition: translate .5s var(--ease-out); }
.rel__media { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e2d7bf; }
.rel__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; transform-origin: 50% 60%; transition: scale .7s var(--ease-out); }
.rel__name { font: 400 1.1875rem/1.15 var(--serif-text); }
.rel__meta { display: flex; justify-content: space-between; gap: 10px; font-size: .875rem; color: var(--card-muted); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) {
  .pdp__icon:not(:disabled):not(.pdp__close):hover { box-shadow: inset 0 0 0 1px var(--walnut); }
  .pdp__close:hover { rotate: 90deg; }
  .rel:hover { translate: 0 -2px; }
  .rel:hover .rel__media img { scale: 1.03; }
}

@media (max-width: 899px) {
  .pdp { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .pdp__bar { padding-left: 20px; padding-right: 10px; }
  .pdp__body { grid-template-columns: 1fr; gap: 24px; padding: 0 0 24px; }
  .pdp__photo { position: relative; top: 0; border-radius: 0; aspect-ratio: 4 / 5; max-height: 62dvh; }
  .pdp__info { padding: 0 20px; }
  .pdp__buy {
    position: sticky; bottom: 0; z-index: 2; margin-inline: -20px; padding: 12px 20px max(12px, env(safe-area-inset-bottom));
    background: var(--card); box-shadow: 0 -1px 0 var(--card-line);
  }
  .pdp__more { padding: 28px 20px 32px; }
  .pdp__related { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
}
@media (max-width: 380px) {
  .pdp__qty button { width: 40px; }
  .pdp__add { padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .pdp[open]::backdrop { animation: none; }
  .pdp__icon, .pdp__photo img, .rel, .rel__media img { transition-duration: .01ms !important; }
}
