:root {
  --sand: #ece3d3;
  --dot: rgb(74 56 38 / .2);
  --ink: #241d17;
  --ink-soft: #5b4d40;
  --rust: #9c4326;
  --bone: #f6f0e6;
  --accent: var(--rust);          /* set per category by app.js */
  --accent-ink: var(--rust);      /* accent dark enough for text and focus rings */
  --h: min(56vh, 600px, calc((100vw - 64px) / 1.65));    /* garment frame size; 1.65 h = rack + padding, so it always fits the width */
  --side: calc(var(--h) * .15);   /* slot width, side-on */
  --front: calc(var(--h) * .66);  /* slot width, facing */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --turn: cubic-bezier(.65, 0, .35, 1);  /* matches the canvas turn (easeInOutCubic) */
  --turn-ms: 1000ms;
  --gutter: clamp(16px, 4vw, 48px);
  --sans: 'Archivo', system-ui, sans-serif;
  --black: 'UnifrakturCook', serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* our display rules must never resurrect hidden UI */
html { scroll-behavior: smooth; }
html, body { margin: 0; }

body {
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --rule: rgb(36 29 23 / .16);
  min-height: 100dvh;
  background-color: var(--sand);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px);
  background-size: 22px 22px;
  color: var(--fg);
  font: 400 15px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: color .5s var(--ease);
}
/* a dark world flips the foreground to bone */
body[data-world="dark"] { --fg: var(--bone); --fg-soft: #d8cebf; --rule: rgb(246 240 230 / .2); }
body[data-world="dark"] .logo .mark, body[data-world="dark"] .cat-title svg { fill: var(--fg); }   /* a rust star vanishes on a rust world */
body[data-world="dark"] .bag-count { background: var(--bone); color: var(--ink); }
body[data-world="dark"] .cats a[aria-current]::after, body[data-world="dark"] .lang [aria-current]::after { background: var(--fg); }

button, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
.pill { -webkit-user-select: none; user-select: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 2px; }
body[data-world="dark"] :focus-visible { outline-color: var(--bone); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 5; padding: 10px 14px; background: var(--ink); color: var(--bone); border-radius: 6px; }
.skip:focus { top: 12px; }

/* ---- intro ------------------------------------------------------------- */
.intro {
  position: fixed; inset: 0; z-index: 4;
  display: grid; place-items: center;
  background: var(--sand);
  transition: opacity .6s var(--ease), visibility 0s .6s;
}
.intro-star { width: 34px; height: 34px; fill: var(--accent); animation: spin 1.1s var(--turn) infinite; }
@keyframes spin { to { transform: rotate(180deg); } }
body:not(.is-loading) .intro { opacity: 0; visibility: hidden; }

/* ---- worlds: the page becomes the hovered piece's world ------------------ */
.worlds { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.world { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity .6s var(--ease); }
.world.is-on { opacity: 1; transition-duration: .7s; }
.world-tile {
  position: absolute; inset: -220px;
  scale: 1.06;
  transition: scale 1.4s var(--ease);
  animation: drift 40s ease-in-out infinite alternate paused;
}
.world.is-on .world-tile { scale: 1; animation-play-state: running; }
@keyframes drift { to { translate: 160px 90px; } }
.world-name {
  position: absolute; left: 50%; top: 48%;
  translate: -50% -50%;
  font: 700 clamp(120px, 21vw, 340px)/1 var(--black);
  white-space: nowrap;
  opacity: 0; scale: .96;
  transition: opacity .9s var(--ease) .1s, scale 1.4s var(--ease);
}
.world.is-on .world-name { opacity: 1; scale: 1; }

/* ---- header ------------------------------------------------------------ */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; row-gap: 4px;
  padding: 16px var(--gutter) 0;
}
.top-l { justify-self: start; }
/* language switch: same voice as the category links, a star under the current one */
.lang { display: flex; align-items: center; }
.lang a, .lang [aria-current] {
  position: relative; padding: 8px 6px;
  font-size: 12px; font-weight: 500; letter-spacing: .16em;
  text-decoration: none; color: var(--fg-soft); transition: color .3s;
}
.lang a:hover, .lang [aria-current] { color: var(--fg); }
.lang [aria-current]::after {
  content: ''; position: absolute; left: calc(50% - .08em); bottom: 1px; width: 5px; height: 5px; translate: -50% 0;
  background: var(--accent);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.top-r { justify-self: end; display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); }
.link {
  position: relative;
  background: none; border: 0; padding: 8px 2px;
  font-weight: 500; letter-spacing: .02em; color: var(--fg);
}
.link::after {
  content: ''; position: absolute; left: 2px; right: 2px; bottom: 4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.link:hover::after { transform: scaleX(1); transform-origin: left; }
.bag-btn { display: inline-flex; align-items: center; gap: 7px; }
.duffel { width: 19px; height: 19px; margin-right: -2px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.duffel .d-seam { opacity: .45; }
.duffel .d-mouth { transform-box: fill-box; transform-origin: 50% 100%; }
.bag-count {
  display: inline-grid; place-items: center;
  min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px;
  background: var(--accent-ink); color: var(--bone);
  font-size: 12px; font-weight: 600;
}
/* odometer: numbers roll instead of swapping */
.bag-count { position: relative; overflow: hidden; }
.bag-count span { display: block; }
.bag-count .odo-in { animation: odo-in .5s var(--ease) both; }
.bag-count .odo-out { position: absolute; inset: 0; display: grid; place-items: center; animation: odo-out .4s var(--ease) both; }
@keyframes odo-in { from { transform: translateY(110%); } }
@keyframes odo-out { to { transform: translateY(-110%); } }

.logo {
  display: flex; align-items: center; gap: .16em;
  font: 700 clamp(30px, 4.4vw, 52px)/1 var(--black);
  letter-spacing: .01em; text-decoration: none; color: var(--fg);
}
.logo .mark { width: .42em; height: .42em; fill: var(--accent); transition: transform 1.2s var(--ease); }
.logo:hover .mark { transform: rotate(180deg); }

.cats { grid-column: 1 / -1; justify-self: center; display: flex; gap: clamp(14px, 3vw, 30px); }
.cats a {
  position: relative; padding: 6px 2px;
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; color: var(--fg-soft);
  transition: color .3s;
}
.cats a:hover, .cats a[aria-current] { color: var(--fg); }
.cats a[aria-current]::after {
  content: ''; position: absolute; left: 50%; bottom: -3px; width: 6px; height: 6px; translate: -50% 0;
  background: var(--accent);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

/* ---- hero -------------------------------------------------------------- */
.hero {
  min-height: calc(100dvh - 104px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  padding: 12px 16px 48px;
  overflow-x: clip;   /* a swinging canvas never widens the page */
}
.cat-title {
  margin: 0 0 6px;
  display: flex; align-items: center; gap: .32em;
  font: 700 clamp(30px, 3.6vw, 46px)/1 var(--black);
}
.cat-title svg { width: .36em; height: .36em; fill: var(--accent); }
.cat-title .place {
  font: 500 12px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--fg-soft);
}

.rackwrap { position: relative; padding: 0 calc(var(--h) * .12); }
.rack {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: center;
  width: calc(5 * var(--side) + var(--front));   /* widest state: rail never changes length */
}
.slot {
  position: relative;
  flex: 0 0 var(--side);
  height: calc(var(--h) * 1.02);
  transition: flex-basis var(--turn-ms) var(--turn);
}
.slot.is-active { flex-basis: var(--front); }
.rack, .detail-fig { touch-action: pan-y; }   /* sideways finger moves are ours: scrub the rail, swipe the piece */
.slot canvas {
  position: absolute; top: 0; left: 50%;
  width: var(--h); height: var(--h);
  margin-left: calc(var(--h) / -2);
  pointer-events: none;
  transform-origin: 50% 3.4%;   /* the hook */
  opacity: 0;
}
body.is-ready .slot canvas { opacity: 1; }
.slot button {
  position: absolute; inset: calc(var(--h) * .07) 0 0;
  width: 100%; background: none; border: 0; padding: 0; border-radius: 6px;
}

/* men: chrome rail */
.rail {
  position: absolute; left: 0; right: 0; top: calc(var(--h) * .034);
  display: flex; align-items: center;
  transform: scaleX(0); transition: transform 1s var(--ease);
}
body.is-ready .rail { transform: none; }
.rail .bar {
  flex: 1; height: 9px; border-radius: 9px;
  background: linear-gradient(#fdfdfd 0%, #c9cbcd 30%, #8d9094 58%, #d4d6d8 80%, #9fa2a6 100%);
  box-shadow: 0 6px 10px -4px rgb(40 30 20 / .35);
}
.rail .cap { width: 16px; height: 16px; border-radius: 3px; background: linear-gradient(#e9eaeb, #8b8e92); box-shadow: 0 4px 8px -3px rgb(40 30 20 / .4); }

/* women: rope drying line between two posts */
.display-line .line {
  position: absolute; left: 6px; right: 6px; top: calc(var(--h) * .034 - 4px);
  width: calc(100% - 12px); height: 60px; overflow: visible;
  fill: none; stroke-linecap: round;
  clip-path: inset(0 100% 0 0); transition: clip-path 1.2s var(--ease);
}
body.is-ready .display-line .line { clip-path: inset(-20px 0 -20px 0); }
.line-shade { stroke: #6f5b3e; stroke-width: 4.2; }
.line-rope { stroke: #c9b48a; stroke-width: 2.4; stroke-dasharray: 3.2 2.4; }
.post {
  position: absolute; left: 0; top: calc(var(--h) * .02); width: 12px; height: calc(var(--h) * .5);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #8a6a45, #b08c5e 45%, #7a5b38);
  box-shadow: 0 10px 18px -8px rgb(40 30 20 / .45);
}
.post.r { left: auto; right: 0; }

/* kids: low wooden peg rail, smaller frames, bigger swing */
.display-pegs { --h: min(46vh, 470px, calc((100vw - 64px) / 1.79)); --side: calc(var(--h) * .17); --front: calc(var(--h) * .7); }
.pegrail {
  position: absolute; left: 0; right: 0; top: calc(var(--h) * .012); height: 20px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / .06) 0 2px, transparent 2px 23px),
    linear-gradient(#c79a62, #a87a45 55%, #8d6334);
  box-shadow: 0 8px 14px -6px rgb(40 30 20 / .45);
  transform: scaleX(0); transition: transform 1s var(--ease);
}
body.is-ready .pegrail { transform: none; }
.display-pegs .slot::before {   /* a peg under every hook */
  content: ''; position: absolute; left: 50%; top: calc(var(--h) * .02); width: 12px; height: 12px; translate: -50% 0;
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e0b884, #94683a);
  box-shadow: 0 2px 3px rgb(40 30 20 / .4);
}

/* shoes: two oak shelf planks, three pairs each, anchored at the sole */
.display-shelf { --h: min(29vh, 270px, calc((100vw - 64px) / 3.44)); padding: 0 calc(var(--h) * .1); margin-bottom: 18px; }
.display-shelf .rack {
  width: auto; display: grid; grid-template-columns: repeat(3, calc(var(--h) * 1.08)); row-gap: 34px;
}
.display-shelf .slot { flex: none; height: var(--h); transition: none; }
.display-shelf .slot canvas { transform-origin: 50% 98%; }
.display-shelf .slot button { inset: 10% 6% 0; }
.display-shelf .slot::after {
  content: ''; position: absolute; left: -1px; right: -1px; bottom: -14px; height: 16px;
  background:
    repeating-linear-gradient(90deg, rgb(60 35 15 / .12) 0 1px, transparent 1px 37px),
    linear-gradient(#d0a875, #b48552 60%, #8f6436);
  box-shadow: 0 12px 16px -10px rgb(40 30 20 / .55);
}
.display-shelf .slot:nth-child(3n + 1)::after { border-radius: 4px 0 0 4px; }
.display-shelf .slot:nth-child(3n)::after { border-radius: 0 4px 4px 0; }

/* caption: old line slides up and out, new line rises in */
.caption {
  position: relative; display: grid;
  min-height: 1.6em; min-width: 18ch; overflow: hidden;
  margin-top: 6px;
  font-size: 16px; font-weight: 500; text-align: center;
}
.cap-line { grid-area: 1 / 1; animation: cap-in .55s var(--ease) both; }
.cap-line.out { animation: cap-out .35s var(--ease) both; }
.cap-line .p { color: var(--fg-soft); font-weight: 400; }
@keyframes cap-in { from { transform: translateY(100%); opacity: 0; } }
@keyframes cap-out { to { transform: translateY(-100%); opacity: 0; } }

.hero-actions { display: flex; align-items: center; gap: 22px; }
.text-link {
  padding: 0; border: 0; background: none; cursor: pointer;   /* also used on <button>: no browser chrome */
  font-family: var(--sans);
  font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px;
  color: var(--fg);
}
.text-link:hover { text-decoration-color: var(--accent); }

.pill {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 24px;
  border: 1px solid var(--fg); border-radius: 999px;
  background: transparent; color: var(--fg);
  font: 500 13px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none;
  transition: color .45s var(--ease), border-color .45s var(--ease);
}
.pill::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--fg);
  transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.pill:hover { color: var(--sand); }
body[data-world="dark"] .pill:hover { color: var(--ink); }
.pill:hover::before { transform: scaleX(1); transform-origin: left; }
.pill.solid { color: var(--bone); background: var(--ink); border-color: var(--ink); }
.pill.solid::before { background: var(--accent-ink); }
.pill.solid:hover { color: var(--bone); border-color: var(--accent-ink); }

/* ---- catalogue ------------------------------------------------------------ */
.catalog, .more { max-width: 1240px; margin: 0 auto; padding: 72px var(--gutter) 24px; }
.catalog-head {
  display: flex; justify-content: space-between; align-items: end; gap: 12px 32px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--rule);
}
.catalog-head h2 { margin: 0; font: 600 clamp(28px, 3vw, 40px)/1.1 var(--sans); letter-spacing: -.02em; }
.blurb { margin: 0; max-width: 46ch; color: var(--fg-soft); }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px 32px; padding: 20px 0 30px; }
.f-group { border: 0; margin: 0; padding: 0; }
.f-group legend, .f-sort, .sizes legend {
  padding: 0; margin-bottom: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-soft);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .chips label {
  position: relative;
  min-width: 44px; height: 40px; padding: 0 12px;
  display: inline-grid; place-items: center;
  border: 1px solid color-mix(in oklab, currentColor 30%, transparent); border-radius: 6px;
  background: transparent; font-weight: 500; cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s;
}
.chip:hover, .chips label:hover { border-color: currentColor; }
.chip[aria-pressed="true"], .chips label:has(input:checked) { background: var(--fg); color: var(--sand); border-color: var(--fg); }
body[data-world="dark"] .chip[aria-pressed="true"] { color: var(--ink); }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips label:has(input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.chips label.out { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.chips label.out input { cursor: not-allowed; }

.swatches { display: flex; gap: 10px; }
.swatch {
  width: 32px; height: 32px; border-radius: 50%; padding: 0;
  background: var(--c); border: 1px solid rgb(36 29 23 / .25);
  box-shadow: 0 0 0 0 var(--fg);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--sand), 0 0 0 4px var(--fg); }

.f-sort { display: grid; gap: 0; margin: 0; }
.f-sort select {
  height: 40px; padding: 0 34px 0 12px;
  border: 1px solid color-mix(in oklab, currentColor 30%, transparent); border-radius: 6px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b4d40' stroke-width='1.5'/%3E%3C/svg%3E") right 12px center / 11px no-repeat;
  appearance: none; color: var(--fg);
  font-size: 14px; letter-spacing: 0; text-transform: none;
}
.f-count { margin: 0 0 10px auto; font-size: 14px; color: var(--fg-soft); }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 34px 22px; }
.card-btn {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0;
  border: 0; border-radius: 8px; overflow: hidden;
  background: rgb(255 253 248 / .5);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.card-world {
  position: absolute; inset: 0;
  background-color: var(--wbg);
  background-image: var(--tile, none);
  background-size: var(--tile-size, auto);
  opacity: 0; transition: opacity .55s var(--ease);
}
.card-world-name {
  position: absolute; left: 12px; bottom: 6px;
  font: 700 54px/1 var(--black); white-space: nowrap;
  color: rgb(0 0 0 / .08);
}
.card.dark .card-world-name { color: rgb(255 255 255 / .1); }
.card-btn:hover .card-world, .card-btn:focus-visible .card-world { opacity: 1; }
.card-btn img {
  position: absolute; left: 10%; top: 5%; width: 80%; height: 92%;
  object-fit: contain; object-position: 50% 0;
  filter: drop-shadow(0 10px 12px rgb(40 30 20 / .18));
  transition: transform .7s var(--ease);
  transform-origin: 50% 0;
}
body[data-cat="shoes"] .card-btn img { object-position: 50% 60%; transform-origin: 50% 100%; }
.card-btn:hover img { transform: rotate(-1.6deg) translateY(-3px); }
body[data-cat="shoes"] .card-btn:hover img { transform: translateY(-8px) rotate(-3deg); }
.card-info { padding: 12px 2px 0; }
.card-info h3 { margin: 0 0 4px; font-size: 15px; font-weight: 500; }
.card-info p { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-soft); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgb(36 29 23 / .2); }
.card-price { margin-left: auto; color: var(--fg); font-weight: 500; font-size: 14px; }
.empty { padding: 40px 0 10px; text-align: center; color: var(--fg-soft); }
.empty p { margin: 0 0 16px; }

/* other categories: an index of rows, not cards */
.more { padding-bottom: 80px; }
.more-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.more-list a {
  display: grid; grid-template-columns: minmax(170px, auto) 1fr auto 28px; align-items: center; gap: 24px;
  padding: 18px 8px; border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background-color .4s var(--ease);
}
.more-list a:hover { background: color-mix(in oklab, var(--c-accent) 9%, transparent); }
.more-title { transition: transform .5s var(--ease); }
.more-list a:hover .more-title { transform: translateX(10px); }
.more-title { display: flex; align-items: center; gap: .3em; font: 700 clamp(32px, 4vw, 48px)/1 var(--black); }
.more-title svg { width: .32em; height: .32em; fill: var(--c-accent); }
.more-place { font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-soft); }
.more-thumbs { display: flex; }
.more-thumbs img { width: 52px; height: 66px; object-fit: contain; margin-left: -8px; transition: transform .5s var(--ease); }
.more-list a:hover .more-thumbs img { transform: translateY(-4px); }
.more-list a:hover .more-thumbs img:nth-child(2) { transition-delay: .04s; }
.more-list a:hover .more-thumbs img:nth-child(3) { transition-delay: .08s; }
.more-arrow { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
.more-list a:hover .more-arrow { transform: translateX(4px); }

/* ---- footer: rope + ticker -------------------------------------------- */
.foot { display: grid; }
.rope {
  width: 100%; height: 14px; display: block;
  fill: none; stroke: var(--fg); stroke-width: 1.1; stroke-linecap: round; opacity: .7;
  clip-path: inset(0 100% 0 0); transition: clip-path 1.6s var(--ease) .4s;
}
body.is-ready .rope { clip-path: inset(0); }
.ticker {
  background: var(--accent-ink); color: var(--bone);
  overflow: hidden; white-space: nowrap;
  font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  padding: 10px 0;
}
.ticker-track { display: inline-flex; align-items: center; animation: tick 48s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { padding: 0 1.6em; }
.ticker-track svg { width: 9px; height: 9px; fill: currentColor; }
@keyframes tick { to { transform: translateX(-50%); } }
/* studio credit: in the HTML itself (crawlers that run no JS read it); it closes the ticker bar */
.foot { position: relative; }
.credit {
  position: absolute; inset: 14px 0 0 auto; display: flex; align-items: center; gap: .6em;
  margin: 0; padding: 0 var(--gutter) 0 1.6em; white-space: nowrap;
  background: var(--accent-ink); color: var(--bone); border-left: 1px solid rgb(246 240 230 / .3);
  font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
}
.credit a { padding: 3px 0; text-underline-offset: 4px; }
.credit a:focus-visible { outline-color: var(--bone); }

.grain {
  position: fixed; inset: 0; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .24 0 0 0 0 .17 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- dialogs ----------------------------------------------------------- */
dialog { border: 0; padding: 0; color: var(--ink); }
dialog::backdrop { background: rgb(236 227 211 / .6); backdrop-filter: blur(12px) saturate(.8); }
dialog[open]::backdrop { animation: fade .45s var(--ease); }
@keyframes fade { from { opacity: 0; } }

.close {
  position: absolute; top: 18px; right: var(--gutter);
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 8px 2px; font-weight: 500;
}
.close svg, .arrow svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.close svg { width: 14px; height: 14px; transition: transform .5s var(--ease); }
.close:hover svg { transform: rotate(90deg); }

/* detail: backdrop takes the piece's world */
.detail { width: 100vw; height: 100dvh; max-width: none; max-height: none; background: transparent; }
.detail::backdrop { background: color-mix(in oklab, var(--world, #ece3d3) 90%, transparent); }
.detail.on-dark { color: var(--bone); }
.detail-body {
  height: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(280px, 360px);
  align-items: center; gap: clamp(8px, 2vw, 32px);
  padding: 72px var(--gutter) 40px;
}
.detail-fig { position: relative; margin: 0; height: 100%; display: grid; place-items: center; min-height: 0; }
.detail-fig img {
  width: auto; height: auto; max-height: min(78dvh, 820px); max-width: 100%;
  filter: drop-shadow(0 22px 26px rgb(20 14 8 / .28));
  transform-origin: 50% 2%;
}
body[data-cat="shoes"] .detail-fig img { max-height: min(60dvh, 620px); transform-origin: 50% 100%; }
.detail[open] .detail-fig img.swing { animation: swing 1.3s var(--ease) both; }
@keyframes swing {
  0%   { transform: translateX(calc(var(--dir, 1) * 60px)) rotate(calc(var(--dir, 1) * -10deg)); opacity: 0; }
  30%  { transform: rotate(calc(var(--dir, 1) * 5deg)); opacity: 1; }
  55%  { transform: rotate(calc(var(--dir, 1) * -2.2deg)); }
  78%  { transform: rotate(calc(var(--dir, 1) * .8deg)); }
  100% { transform: none; }
}
.arrow {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid color-mix(in oklab, currentColor 30%, transparent);
  background: color-mix(in oklab, currentColor 6%, transparent);
  display: grid; place-items: center;
  transition: background-color .3s, border-color .3s;
}
.arrow svg { width: 20px; height: 20px; transition: transform .4s var(--ease); }
.arrow:hover { border-color: currentColor; }
#prev:hover svg { transform: translateX(-3px); }
#next:hover svg { transform: translateX(3px); }

.detail-info { align-self: center; }
.detail-info h2 { margin: 6px 0 4px; font: 600 clamp(26px, 2.6vw, 36px)/1.1 var(--sans); letter-spacing: -.02em; text-wrap: balance; }
.count { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .14em; opacity: .75; }
.price { margin: 0 0 16px; font-size: 18px; font-weight: 600; color: var(--accent-ink); }
.detail.on-dark .price { color: inherit; }
.desc { margin: 0 0 22px; max-width: 40ch; opacity: .82; }
.sizes { border: 0; margin: 0 0 20px; padding: 0; }
.detail .sizes legend { color: inherit; opacity: .75; }
.detail .chips label:has(input:checked) { background: currentColor; }
.detail .chips label:has(input:checked) { color: var(--bone); background: var(--ink); border-color: var(--ink); }
.detail.on-dark .chips label:has(input:checked) { color: var(--ink); background: var(--bone); border-color: var(--bone); }
.specs { margin: 0 0 24px; display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 14px; }
.specs dt { opacity: .7; }
.specs dd { margin: 0; }
.d-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.detail .text-link { color: inherit; }
.detail.on-dark .pill.solid { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.detail.on-dark .pill.solid:hover { color: var(--bone); }
.d-note { min-height: 1.5em; margin: 12px 0 0; font-size: 14px; }
.d-note.warn { font-weight: 600; }

/* bag drawer */
.bag {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(440px, 100vw); height: 100dvh; max-width: none; max-height: none;
  padding: 64px 28px 24px;
  display: none; flex-direction: column; gap: 16px;
  background: var(--bone);
  box-shadow: -30px 0 60px -30px rgb(40 30 20 / .45);
}
.bag[open] { display: flex; animation: drawer .55s var(--ease); }
@keyframes drawer { from { transform: translateX(40px); opacity: 0; } }
.bag .close { right: 22px; }
.bag h2 { margin: 0; font: 700 34px/1 var(--black); }
.ship p { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.ship-bar { height: 4px; border-radius: 4px; background: rgb(36 29 23 / .1); overflow: hidden; }
.ship-bar span { display: block; height: 100%; background: var(--accent-ink); transform-origin: left; transition: transform .6s var(--ease); }
.bag-lines { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.bag-lines:empty { display: none; }
.bag-lines li { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgb(36 29 23 / .12); }
.bag-lines img { width: 64px; height: 80px; object-fit: contain; }
.bl-name { margin: 0; font-weight: 500; }
.bl-meta { margin: 2px 0 8px; font-size: 13px; color: var(--ink-soft); }
.qty { display: inline-flex; align-items: center; border: 1px solid rgb(36 29 23 / .25); border-radius: 6px; }
.qty button { width: 34px; height: 32px; border: 0; background: none; font-size: 16px; }
.qty span { min-width: 22px; text-align: center; font-weight: 500; }
.bl-side { display: grid; justify-items: end; align-content: space-between; }
.bl-price { margin: 0; font-weight: 600; }
.bl-remove { border: 0; background: none; padding: 4px 0; font-size: 13px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.bag-empty p { margin: 8px 0 14px; color: var(--ink-soft); }
.bag-cats { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.bag-cats a { font: 700 26px/1 var(--black); text-decoration: none; }
.bag-cats a:hover { color: var(--accent-ink); }
.bag-foot { border-top: 1px solid rgb(36 29 23 / .16); padding-top: 16px; display: grid; gap: 12px; }
.subtotal { margin: 0; display: flex; justify-content: space-between; font-size: 17px; font-weight: 600; }
.fine { margin: 0; font-size: 12px; color: var(--ink-soft); text-align: center; }

.panel {
  width: min(440px, calc(100vw - 32px));
  padding: 56px 32px 32px;
  background: var(--bone); border-radius: 6px;
  box-shadow: 0 24px 60px -20px rgb(40 30 20 / .4);
}
.panel .close { top: 12px; right: 18px; }
.panel, .bag { --fg: var(--ink); --fg-soft: var(--ink-soft); --sand: var(--bone); color: var(--ink); }   /* panels stay light over any world */

/* Ask the crew */
.ask { width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 48px 28px 26px; }
.ask h2 { display: flex; align-items: center; gap: .28em; margin-bottom: 6px; }
.ask h2 svg { width: .36em; height: .36em; fill: var(--accent); }
.ask-sub { margin: 0 0 18px !important; font-size: 14px; }
.nowrap { white-space: nowrap; }
#ask-form { display: grid; gap: 16px; }
.ask-piece { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 8px; background: rgb(36 29 23 / .05); }
.ask-thumb { position: relative; flex: none; }
.ask-thumb img { display: block; width: 44px; height: 56px; object-fit: contain; }
.ask-thumb::after {
  content: ''; position: absolute; right: -5px; bottom: 0; width: 14px; height: 14px;
  border-radius: 46% 54% 50% 48% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 36% 32%, color-mix(in oklab, var(--seal) 70%, white), var(--seal) 60%, color-mix(in oklab, var(--seal) 70%, black));
  box-shadow: 0 2px 3px rgb(20 14 8 / .35);
}
.ask-name { margin: 0 !important; font-weight: 600; color: var(--ink) !important; }
.ask-meta { margin: 2px 0 0 !important; font-size: 13px; }
.ask .chips { gap: 6px; }
.ask .chips label, .ask .chip { height: 34px; min-width: 40px; padding: 0 10px; font-size: 13px; }
.ask .chips label:has(input:checked) { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.field { display: grid; gap: 6px; position: relative; }
.field > span:first-child { font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.field em { font-style: normal; letter-spacing: .04em; text-transform: none; opacity: .8; }
.field textarea, .field input {
  width: 100%; padding: 11px 12px; border-radius: 6px;
  border: 1px solid rgb(36 29 23 / .28); background: rgb(255 255 255 / .55);
  font: 400 15px/1.45 var(--sans); color: var(--ink); resize: vertical;
  transition: border-color .25s, box-shadow .25s;
}
.field textarea:focus, .field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent-ink) 22%, transparent); }
.counter { justify-self: end; font-size: 12px; color: var(--ink-soft); }
.ask-err { min-height: 1.2em; margin: -6px 0 -4px !important; font-size: 14px; font-weight: 600; color: #8f2a14 !important; }
.wa { gap: 10px; width: 100%; }
.wa svg { position: relative; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.ask.sent .wa { pointer-events: none; }
.ask.sent .wa::before { transform: scaleX(1); transform-origin: left; }
.panel h2 { margin: 0 0 12px; font: 700 34px/1 var(--black); }
.panel p { margin: 0 0 12px; color: var(--ink-soft); }
.panel[open] { animation: rise .5s var(--ease); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }

/* ---- "Stowed aboard": the add-to-bag moment ------------------------------- */
.stow {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: none; overflow: visible; pointer-events: none;
}

/* the packing table: one 3D scene, textures pre-rendered (assets/ui/kraft.png), nothing filtered per frame */
.pack { position: absolute; transform-style: preserve-3d; perspective: 2400px; will-change: transform; }
.pack > *, .sheet > *, .topper > * { position: absolute; }
.tshadow { opacity: 0; background: radial-gradient(closest-side, rgb(35 22 10 / .32), rgb(35 22 10 / .12) 55%, transparent); }
.sheet { inset: 0; transform-style: preserve-3d; }
.paper {
  --k: url("assets/ui/kraft.png") 0 0 / 192px;
  background: var(--k);
  box-shadow: inset 0 0 0 1px rgb(92 60 26 / .28);
}
.paper.base { box-shadow: inset 0 0 0 1px rgb(92 60 26 / .3), 0 14px 22px -12px rgb(30 18 8 / .55); }
/* each flap darkens toward its hinge (the crease) and catches light at its free edge */
.flap.l { background: linear-gradient(to left, rgb(70 42 16 / .26), transparent 16%), linear-gradient(to right, rgb(255 236 200 / .18), transparent 8%), var(--k); }
.flap.r { background: linear-gradient(to right, rgb(70 42 16 / .26), transparent 16%), linear-gradient(to left, rgb(255 236 200 / .18), transparent 8%), var(--k); }
.flap.b { background: linear-gradient(rgb(70 42 16 / .26), transparent 22%), var(--k); clip-path: polygon(0 0, 100% 0, 86% 100%, 14% 100%); }
.flap.t { background: linear-gradient(to top, rgb(70 42 16 / .26), transparent 22%), var(--k); clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%); }
.shade { position: absolute; inset: 0; background: #2a1a0b; opacity: 0; pointer-events: none; }

/* the garment, cut into strips that fold in 3D; shades are masked by the cloth itself */
.fold { transform-style: preserve-3d; transform: translateZ(2px); }
.row { position: absolute; left: 0; width: 100%; transform-style: preserve-3d; }
.row.b { transform-origin: 50% 0; }
.strip { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; }
.strip.l { transform-origin: 100% 50%; }
.strip.r { transform-origin: 0 50%; }
.face, .face .shade {
  background-image: var(--img); background-size: var(--size); background-position: var(--pos); background-repeat: no-repeat;
}
.face { position: absolute; inset: 0; backface-visibility: hidden; }
.face .shade {
  background: #1d1208;
  -webkit-mask: var(--img) var(--pos) / var(--size) no-repeat;
  mask: var(--img) var(--pos) / var(--size) no-repeat;
}
.face.back {
  display: none;
  /* plain fabric in the garment colour, soft volume, cut to the cloth silhouette */
  background:
    linear-gradient(rgb(0 0 0 / .22), transparent 9%),                                  /* shade along the fold */
    radial-gradient(110% 70% at 35% 30%, rgb(255 255 255 / .2), transparent 62%),       /* soft light across the cloth */
    linear-gradient(transparent 70%, rgb(0 0 0 / .16)),
    repeating-linear-gradient(135deg, rgb(255 255 255 / .05) 0 1px, transparent 1px 4px), /* twill weave */
    repeating-linear-gradient(45deg, rgb(0 0 0 / .05) 0 1px, transparent 1px 5px),
    var(--cloth);
  -webkit-mask: var(--img) var(--pos) / var(--size) no-repeat;
  mask: var(--img) var(--pos) / var(--size) no-repeat;
}
.strip.l .back, .strip.r .back { display: block; transform: rotateY(180deg); }
.row.b .strip.c .back { display: block; transform: rotateX(180deg); -webkit-mask: none; mask: none; border-radius: 3px 3px 10px 10px; }   /* the folded hem: a clean panel
.hanger { left: 0; top: 0; background-repeat: no-repeat; background-position: 0 0; }

/* shoes: kraft box on the table, tissue, lid with a stamped mark */
.shoebox {
  background: url("assets/ui/kraft.png") 0 0 / 192px; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgb(80 50 20 / .35), 0 16px 24px -12px rgb(30 18 8 / .55);
}
.shoebox .floor {
  position: absolute; inset: 7%; border-radius: 2px;
  background: linear-gradient(rgb(60 36 14 / .5), rgb(60 36 14 / .2) 30%, rgb(60 36 14 / .28)), url("assets/ui/kraft.png") 40px 40px / 192px;
  box-shadow: inset 0 6px 10px rgb(40 24 8 / .45), inset 0 0 0 1px rgb(60 36 14 / .3);
}
.tissue {
  /* thin, see-through, crinkled; the edge that drapes over the box wall sits in shade */
  background:
    repeating-linear-gradient(112deg, rgb(110 90 70 / .06) 0 3px, transparent 3px 9px),
    repeating-linear-gradient(68deg, rgb(110 90 70 / .05) 0 2px, transparent 2px 8px),
    linear-gradient(95deg, transparent 30%, rgb(255 255 255 / .45) 42%, transparent 55%),
    rgb(250 247 240 / .74);
  clip-path: polygon(0 3%, 9% 0, 22% 2%, 38% 0, 55% 3%, 71% 1%, 86% 3%, 100% 0, 99% 24%, 100% 47%, 98% 70%, 100% 100%, 84% 97%, 66% 100%, 49% 97%, 31% 100%, 14% 98%, 0 100%, 2% 76%, 0 52%, 1% 27%);
}
.tissue-bed {
  position: absolute; inset: 4%;
  background: repeating-linear-gradient(112deg, rgb(110 90 70 / .06) 0 3px, transparent 3px 9px), rgb(250 247 240 / .55);
  clip-path: polygon(0 4%, 20% 0, 50% 3%, 80% 0, 100% 4%, 98% 50%, 100% 96%, 75% 100%, 45% 97%, 18% 100%, 0 96%, 2% 50%);
}
.tissue.l { background-image: linear-gradient(to left, rgb(70 50 30 / .22), transparent 14%), repeating-linear-gradient(112deg, rgb(110 90 70 / .06) 0 3px, transparent 3px 9px), linear-gradient(95deg, transparent 30%, rgb(255 255 255 / .45) 42%, transparent 55%); }
.tissue.r { background-image: linear-gradient(to right, rgb(70 50 30 / .22), transparent 14%), repeating-linear-gradient(68deg, rgb(110 90 70 / .05) 0 2px, transparent 2px 8px), linear-gradient(95deg, transparent 45%, rgb(255 255 255 / .45) 57%, transparent 70%); }
.shoe { left: 0; top: 0; background-repeat: no-repeat; filter: drop-shadow(0 8px 8px rgb(30 18 8 / .3)); }
.lid {
  background:
    linear-gradient(rgb(255 236 200 / .16), transparent 10%, transparent 88%, rgb(70 42 16 / .2)),
    url("assets/ui/kraft.png") 90px 30px / 192px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgb(80 50 20 / .4), 0 18px 26px -12px rgb(30 18 8 / .55);
}
.lid-mark {
  position: absolute; left: 8%; top: 11%;
  display: flex; align-items: center; gap: 4px;
  font: 700 15px/1 var(--black); color: rgb(72 42 14 / .55);
  text-shadow: 0 1px 0 rgb(255 236 200 / .35);
}
.lid-mark svg { width: 7px; height: 7px; fill: currentColor; }

/* twine, bow, wax, tag and hook: one layer above the wrapped paper */
.topper { inset: 0; transform: translateZ(14px); transform-style: preserve-3d; }
.twine-set { pointer-events: none; }
.twine { position: absolute; display: block; box-shadow: 0 1px 1.5px rgb(50 30 10 / .45); }
.twine.v {
  left: 50%; top: -2px; bottom: -2px; width: 3px; transform: translateX(-50%) scaleY(0);
  background:   /* darker where it turns under the edges */
    linear-gradient(rgb(70 45 18 / .7) 0 3px, transparent 3px calc(100% - 3px), rgb(70 45 18 / .7) calc(100% - 3px)),
    repeating-linear-gradient(35deg, #f1e4c6 0 2px, #c4aa7e 2px 3.4px);
}
.twine.h {
  top: 50%; left: -2px; right: -2px; height: 3px; transform: translateY(-50%) scaleX(0);
  background:
    linear-gradient(to right, rgb(70 45 18 / .7) 0 3px, transparent 3px calc(100% - 3px), rgb(70 45 18 / .7) calc(100% - 3px)),
    repeating-linear-gradient(-55deg, #f1e4c6 0 2px, #c4aa7e 2px 3.4px);
}
.bow { overflow: visible; }
.bow path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.bow .tw-under { stroke: rgb(125 96 56 / .7); stroke-width: 4.8; transform: translate(.8px, 1.4px); }
.bow .tw { stroke: #ecdcb8; stroke-width: 3.2; }
.bow .knot { fill: #e2cfa6; stroke: #7d6038; stroke-width: 1.2; transform-box: fill-box; transform-origin: center; transform: scale(0); }

.wax {
  display: grid; place-items: center; transform: scale(0);
  border-radius: 47% 53% 44% 56% / 55% 44% 56% 45%;
  background:
    radial-gradient(circle at 34% 30%, color-mix(in oklab, var(--seal) 55%, white), transparent 34%),
    radial-gradient(circle at 50% 55%, var(--seal), color-mix(in oklab, var(--seal) 62%, black) 92%);
  box-shadow: 0 3px 5px rgb(20 12 4 / .45), inset 0 -2px 3px rgb(0 0 0 / .28), inset 0 2px 2px rgb(255 255 255 / .18);
}
.wax::before {   /* the stamped ring */
  content: ''; position: absolute; inset: 16%; border-radius: 50%;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / .4), 0 1px 0 rgb(255 255 255 / .18);
}
.wax svg { width: 44%; height: 44%; opacity: 0; fill: color-mix(in oklab, var(--seal) 58%, black); filter: drop-shadow(0 1px 0 rgb(255 255 255 / .28)); }
.press { opacity: 0; border-radius: 50%; background: radial-gradient(closest-side, rgb(25 15 5 / .6), transparent); }

.tag { width: 0; height: 0; opacity: 0; transform-origin: 0 0; }
.tag-str {
  position: absolute; left: 0; top: 0; width: 1.6px; height: var(--str);
  background: #cdb488; transform: rotate(-35deg); transform-origin: top;
}
.tag-card {
  position: absolute;
  left: calc(var(--str) * .574 - var(--tw) * .18); top: calc(var(--str) * .819 - var(--th) * .2);
  width: var(--tw); height: var(--th);
  display: grid; align-content: center; justify-items: center; gap: 1px;
  padding-top: calc(var(--th) * .14);
  transform: rotate(-7deg); transform-origin: 18% 20%;
  background: linear-gradient(rgb(255 240 210 / .35), transparent), url("assets/ui/kraft.png") 20px 60px / 140px;
  clip-path: polygon(12% 0, 88% 0, 100% 22%, 100% 100%, 0 100%, 0 22%);
  filter: drop-shadow(0 2px 2px rgb(30 18 8 / .35));
  color: #2b1d10;
}
.tag-card::before {   /* punched hole where the string goes through */
  content: ''; position: absolute; left: 18%; top: 20%; width: calc(var(--th) * .14); height: calc(var(--th) * .14);
  translate: -50% -50%; border-radius: 50%; background: rgb(60 36 14 / .55); box-shadow: inset 0 1px 1px rgb(0 0 0 / .4);
}
.tag-card b { font: 700 calc(var(--th) * .34)/1 var(--black); }
.tag-card small { font: 600 calc(var(--th) * .15)/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; opacity: .75; }

.burst { position: absolute; width: 11px; height: 11px; }

/* receipt toast under the bag */
.toast {
  position: fixed; inset: auto var(--gutter) auto auto; margin: 0;
  width: min(300px, calc(100vw - 32px));
  padding: 16px 18px 14px 18px;
  border: 0; border-radius: 8px;
  background: var(--ink); color: var(--bone);
  box-shadow: 0 22px 40px -18px rgb(20 14 8 / .6);
  animation: toast-in .55s var(--ease) both;
  overflow: visible;
}
.toast::before {   /* little notch pointing at the bag */
  content: ''; position: absolute; right: 26px; top: -6px; width: 12px; height: 12px;
  background: inherit; transform: rotate(45deg); border-radius: 2px;
}
.toast.out { animation: toast-out .38s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }
.toast p { margin: 0; }
.t-head { display: flex; align-items: center; gap: 8px; font: 700 22px/1.1 var(--black); }
.t-head svg { width: 11px; height: 11px; fill: var(--seal); }
.t-name { margin-top: 6px !important; font-weight: 500; }
.t-no { margin-top: 2px !important; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #cbbfae; }
.toast .text-link { margin-top: 12px; color: var(--bone); }

/* bag lines: a small wax seal and the run number */
.bl-pic { position: relative; }
.bl-seal {
  position: absolute; right: -4px; bottom: 2px; width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 46% 54% 50% 48% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 36% 32%, color-mix(in oklab, var(--seal) 70%, white), var(--seal) 60%, color-mix(in oklab, var(--seal) 70%, black));
  box-shadow: 0 2px 3px rgb(20 14 8 / .35);
}
.bl-seal svg { width: 10px; height: 10px; fill: color-mix(in oklab, var(--seal) 55%, black); }
.bl-no { margin: 1px 0 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }

/* free passage boat */
.ship { position: relative; }
.boat {
  position: absolute; left: 0; bottom: -2px; width: 30px; height: 22px; opacity: 0;
  fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round;
}
/* the rope above the order button */
.tie { width: 100%; height: 12px; display: block; overflow: visible; fill: none; stroke: #8a7350; stroke-width: 1.3; transform-origin: center; }

@media (max-width: 760px) {
  .credit { position: static; justify-content: center; padding: 6px var(--gutter) 8px; border-left: 0; border-top: 1px solid rgb(246 240 230 / .3); }
  :root { --h: min(60vh, calc((100vw - 40px) / 1.06)); --side: calc(var(--h) * .1); --front: calc(var(--h) * .5); }
  .display-pegs { --h: min(52vh, calc((100vw - 40px) / 1.22)); --side: calc(var(--h) * .12); --front: calc(var(--h) * .56); }
  .display-shelf { --h: calc((100vw - 40px) / 3.44); }
  .rackwrap { padding: 0 calc(var(--h) * .03); }
  .display-pegs { padding: 0 calc(var(--h) * .06); }
  .top { padding-top: 12px; }
  .bag { padding: 60px 20px 20px; }
  .top-r { gap: 10px; }
  /* phones: the switch shows only the other language, the bag keeps its icon and count (its aria-label names it) */
  .lang [aria-current], .bag-word { display: none; }
  .lang a { padding-inline: 6px; }
  .top-r [data-open="contact"] { display: none; }   /* contact lives in About on phones */
  .logo { font-size: 28px; }
  .top .link { font-size: 14px; }
  .hero { min-height: 0; padding: 40px 16px 24px; }
  .hero-actions { flex-direction: column; gap: 12px; }
  .filters { gap: 14px 20px; }
  .f-count { margin-left: 0; width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
  .card-world-name { font-size: 36px; }
  .more-list a { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .more-place { grid-column: 1; }
  .more-thumbs { display: none; }
  .more-arrow { grid-row: 1 / 3; grid-column: 2; }
}

/* stacked detail: phones and tablets held upright */
@media (max-width: 900px) and (min-height: 521px), (max-width: 900px) and (orientation: portrait) {
  .detail-body {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-content: start;
    padding: 60px 16px 28px; gap: 8px; overflow-y: auto; overscroll-behavior: contain;
  }
  .detail-fig { height: auto; min-height: auto; }   /* keep its full height: the info scrolls under it */
  .detail-info { grid-column: 1 / -1; text-align: center; max-width: 520px; justify-self: center; }
  .desc { margin-inline: auto; }
  .detail .chips, .d-actions { justify-content: center; }
  .specs { justify-content: center; text-align: left; }
  .detail-fig img { max-height: min(46dvh, 560px); }
  body[data-cat="shoes"] .detail-fig img { max-height: min(34dvh, 420px); }
  .arrow { width: 44px; height: 44px; }
}

/* phones on their side: the rack on the left, the words on the right, all in one screen */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --h: min(74dvh, calc((50vw - 40px) / 1.12)); --side: calc(var(--h) * .11); --front: calc(var(--h) * .52); }
  .display-pegs { --h: min(68dvh, calc((50vw - 40px) / 1.28)); --side: calc(var(--h) * .12); --front: calc(var(--h) * .56); }
  .display-shelf { --h: min(31dvh, calc((52vw - 40px) / 3.44)); }
  .rackwrap { padding: 0 calc(var(--h) * .04); }
  .top { padding-top: 8px; }
  .logo { font-size: 26px; }
  .cats a { padding-block: 2px; }
  .hero {
    min-height: calc(100dvh - 76px);
    display: grid; grid-template-columns: auto minmax(0, 300px);
    grid-template-rows: 1fr auto auto 1fr;
    justify-content: center; align-items: center; column-gap: clamp(24px, 5vw, 64px); row-gap: 12px;
    padding: 8px 16px 16px;
  }
  .hero > .rackwrap { grid-column: 1; grid-row: 1 / -1; }
  .hero > .cat-title { grid-column: 2; grid-row: 2; margin: 0; }
  .hero > .caption { grid-column: 2; grid-row: 3; justify-items: start; text-align: left; margin: 0; }
  .hero > .hero-actions { grid-column: 2; grid-row: 4; align-self: start; flex-direction: row; flex-wrap: wrap; gap: 12px 20px; }
  .detail-body { padding: 52px var(--gutter) 20px; overflow-y: auto; overscroll-behavior: contain; align-items: start; }
  .detail-fig { height: calc(100dvh - 72px); position: sticky; top: 0; }
  .detail-fig img, body[data-cat="shoes"] .detail-fig img { max-height: 78dvh; }
  .detail .arrow { align-self: center; position: sticky; top: 40%; }
  .detail-info { padding-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::backdrop { animation: none !important; transition: none !important; }
  .intro { display: none; }
  html { scroll-behavior: auto; }
}
.d-note .text-link { margin-left: 8px; font-size: 12px; }
/* every packing piece starts out of sight; its own animation brings it in */
.sheet .paper, .shoebox, .tissue, .lid { opacity: 0; }
.pack.flat, .pack.flat * { transform-style: flat !important; }
.pack.flat { perspective: none; }
.wax, .press, .tag, .twine, .bow { will-change: transform; }   /* own layers: they move, the parcel under them does not repaint */
.detail .detail-info, .detail .arrow, .detail .close { transition: opacity .45s var(--ease); }
.detail.packing .detail-info, .detail.packing .arrow, .detail.packing .close { opacity: .1; }

/* ---- the gantry crane ---------------------------------------------------- */
.c-rail, .c-trolley, .c-rope, .c-hook { position: absolute; left: 0; top: 0; will-change: transform; }
.c-rail {
  height: 4px; margin-top: -2px; border-radius: 2px;
  background:
    radial-gradient(circle, #5b5f64 0 1px, transparent 1.4px) 0 50% / 16px 4px repeat-x,
    linear-gradient(#eef0f1, #b9bdc1 45%, #7c8085);
  box-shadow: 0 3px 4px -1px rgb(30 20 10 / .35);
}
.c-trolley {
  width: 30px; height: 12px; margin: -4px 0 0 -15px; border-radius: 3px;
  background: linear-gradient(#f0f1f2, #a4a8ad 60%, #7d8185);
  box-shadow: 0 3px 5px rgb(30 20 10 / .35), inset 0 0 0 1px rgb(60 62 66 / .35);
}
.c-trolley .wheel {
  position: absolute; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f4f5f6, #7a7e83 70%);
  box-shadow: 0 0 0 1px rgb(60 62 66 / .5);
}
.c-trolley .wheel:first-child { left: 3px; }
.c-trolley .wheel:last-child { right: 3px; }
.c-rope { width: 1.8px; height: 100px; margin-left: -.9px; transform-origin: 50% 0; background: linear-gradient(90deg, #6f5a3a, #b49a6b 50%, #6f5a3a); }
.c-hook { width: 16px; height: 30px; margin-left: -8px; transform-origin: 50% 0; opacity: 0; }
.c-hook svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: #b08d4a; stroke-width: 2.6; stroke-linecap: round; }

/* ---- empty bag, confirm, undo, line exits ------------------------------------ */
.bag-tools { display: flex; align-items: center; min-height: 26px; }
.text-link.quiet { color: var(--ink-soft); font-size: 11px; text-decoration-color: rgb(36 29 23 / .3); }
.text-link.quiet:hover { color: var(--ink); text-decoration-color: currentColor; }
.confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink); animation: rise .35s var(--ease); }
.confirm .text-link { font-size: 11px; }
#confirm-yes { color: #8f2a14; }
.undo { display: flex; align-items: center; gap: 12px; margin: 0 0 14px !important; padding: 10px 12px; border-radius: 6px; background: rgb(36 29 23 / .06); color: var(--ink) !important; font-size: 14px; animation: rise .4s var(--ease); }
.undo .text-link { font-size: 11px; }
.bag-lines li { overflow: hidden; }
