/* The Bag Room. Plain CSS, no build step.
   Motion rule for this page: only transform, opacity and the one blur on .scene are animated. */

@font-face {
  font-family: "Archivo";
  src: url("../vendor/fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --wall: #EFEEEB;
  --wall-hi: #F7F6F3;
  --ink: #161613;
  --grey: #8B8983;
  --line: #D4D2CC;
  --kraft: #C9A977;
  --optic: #D7F205;
  --spring: cubic-bezier(.2, .9, .25, 1.12);
  --out: cubic-bezier(.2, .8, .2, 1);
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* Small bold caps: every label on the page. */
.pill, .switch__opt, .link, .ticker, .label, .btn, .backbtn {
  font-weight: 660;
  font-stretch: 108%;
  font-size: 10px;
  line-height: 1;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ---------- Wordmark ---------- */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: center;
  padding: clamp(20px, 3.7svh, 34px) 16px 0;
  pointer-events: none;
}
.wordmark {
  margin: 0;
  font-weight: 800;
  font-stretch: 125%;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .26em;
  text-indent: .26em;
  text-transform: uppercase;
  transition: opacity .45s ease;
}
/* the wordmark steps aside while a bag is out, so the hook has the top of the screen to itself */
.top:has(+ main .stage.is-picked) .wordmark { opacity: 0; }

/* ---------- First screen ---------- */
.stage {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 540px;
  container-type: size;
  overflow: hidden; overflow: clip;
  touch-action: pan-y;
  -webkit-user-select: none; user-select: none;
  background: radial-gradient(82% 60% at 50% 30%, var(--wall-hi) 0%, rgba(247, 246, 243, 0) 74%);

  /* Where things sit, in shares of the first screen. */
  --rod-y: 24cqh;
  --rod-w: 72cqw;
  --rod-h: 7px;
  --cap-y: 81.8cqh;
  --pill-y: 86.3cqh;
  --hh: min(61cqh, 110cqw);        /* height of the picked bag's 2:3 frame */
  --hook-y: 8.3cqh;
  --name-y: 75.7cqh;
  --switch-y: 81.5cqh;
  --link-y: 88.9cqh;
  --tick-h: 36px;
}

/* The shared layer: rail and bags. It takes the one blur. */
.scene {
  position: absolute; inset: 0; z-index: 1;
  transition: filter .8s var(--out), opacity .8s var(--out);
}
.stage.is-picked .scene { filter: blur(14px); opacity: .45; pointer-events: none; }

.rod {
  position: absolute; top: var(--rod-y); left: 50%;
  width: var(--rod-w); height: var(--rod-h);
  translate: -50% -50%;
}
.rod > i { position: absolute; display: block; }
.rod__bar {
  inset: 0; border-radius: 99px;
  background: linear-gradient(180deg, #FFFFFF 0%, #E4E6E9 16%, #A7ABB1 44%, #7B7F86 60%, #CDD0D4 82%, #8B8F96 100%);
  box-shadow: 0 0 0 .5px rgba(58, 60, 64, .4);
}
.rod__cap {
  top: 50%; width: calc(var(--rod-h) + 3px); height: calc(var(--rod-h) + 7px);
  translate: 0 -50%; border-radius: 3px;
  background: linear-gradient(180deg, #FBFBFB 0%, #C5C8CC 22%, #8C9097 52%, #63676E 70%, #B9BCC1 100%);
  box-shadow: 0 0 0 .5px rgba(58, 60, 64, .45);
}
.rod__cap--l { left: -7px; }
.rod__cap--r { right: -7px; }
.rod__shadow {
  left: .6%; right: -1%; top: calc(var(--rod-h) + 9px); height: 16px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(70, 58, 34, 0) 0%, rgba(70, 58, 34, .11) 50%, rgba(70, 58, 34, 0) 100%);
}

/* Bags on the rail. js/main.js sets --bh (bag height) and --gap so the row fits the rod. */
.hang {
  position: absolute; left: 0; right: 0; top: var(--rod-y); height: 0;
  margin: 0; padding: 0; list-style: none;
  display: flex; justify-content: center;
  --bh: 30cqh; --gap: 0px;
}
.slot {
  position: relative; flex: none;
  /* --vl --vr --vt: where the bag sits inside its photo; --ax: where the strap meets it. */
  --vl: .2; --vr: .8; --vt: .03; --ax: .5;
  --axp: calc(var(--bh) * .66667 * (var(--ax) - var(--vl)));
  width: calc(var(--bh) * .66667 * (var(--vr) - var(--vl)));
  height: calc(var(--bh) * 1.05);
  margin-left: var(--gap);
  transform: translateX(var(--push, 0px));
  transition: transform .6s var(--spring), z-index 0s .3s;
}
.slot:first-child { margin-left: 0; }
.slot.is-pointed { z-index: 5; transition: transform .6s var(--spring), z-index 0s 0s; }

.bag {
  position: absolute; inset: 0; display: block;
  appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* the button is the hit area: the bag's own outline, not its see-through photo frame */
  transform-origin: var(--axp) 0;
  transition: transform .6s var(--spring);
}
.slot.is-pointed .bag { transform: scale(1.33); }
.bag:focus-visible { outline-offset: 8px; border-radius: 4px; }

.bag__sway {
  position: absolute; inset: 0; display: block; pointer-events: none;
  transform-origin: var(--axp) 0;
  animation: sway var(--sd, 3.6s) ease-in-out var(--sdl, 0s) infinite alternate;
}
.stage.is-picked .bag__sway { animation-play-state: paused; }
.slot.is-out .bag__sway { visibility: hidden; animation-play-state: paused; }

@keyframes sway {
  from { transform: perspective(900px) rotateZ(calc(var(--sz, 1deg) * -1)) rotateY(calc(var(--sy, 5deg) * -1)); }
  to   { transform: perspective(900px) rotateZ(var(--sz, 1deg)) rotateY(var(--sy, 5deg)); }
}

/* A rig is one strap plus one 2:3 photo frame, sized by --s. Rail bags and the picked bag share it. */
.rig { position: absolute; display: block; width: calc(var(--s) * .66667); height: var(--s); }
.slot .rig {
  --s: var(--bh);
  top: calc(var(--bh) * (.1 - var(--vt)));
  left: calc(var(--bh) * -.66667 * var(--vl));
  opacity: 0; transform: translateY(-14px);
  transition: opacity .5s ease calc(var(--k) * 70ms), transform .9s var(--out) calc(var(--k) * 70ms);
}
.stage.is-ready .slot .rig { opacity: 1; transform: none; }
.strap {
  position: absolute; display: block; overflow: visible;
  left: calc(var(--s) * (.66667 * var(--ax) - .03));
  top: calc(var(--s) * (var(--vt) - .1224));
  width: calc(var(--s) * .06); height: calc(var(--s) * .16);
  filter: drop-shadow(calc(var(--s) * .008) calc(var(--s) * .016) calc(var(--s) * .012) rgba(46, 38, 22, .22));
}
.art, .face { position: absolute; inset: 0; display: block; }
.face > img, .face > svg {
  display: block; width: 100%; height: 100%; object-fit: contain;
  /* the soft shadow each bag throws on the wall */
  filter: drop-shadow(calc(var(--s) * .014) calc(var(--s) * .03) calc(var(--s) * .028) rgba(46, 38, 22, .2));
}

/* ---------- Picked ---------- */
.veil { position: absolute; inset: 0; z-index: 2; display: none; }
.stage.is-picked .veil { display: block; cursor: zoom-out; }

.front { position: absolute; inset: 0; z-index: 3; pointer-events: none; --vl: .2; --vr: .8; --vt: .03; --ax: .5; }
.heroes { position: absolute; inset: 0; }
.hero {
  --s: var(--hh);
  top: calc(var(--hook-y) + var(--hh) * (.1 - var(--vt)));
  left: calc(50% - var(--hh) * .66667 * (var(--vl) + var(--vr)) / 2);
  transform-origin: 50% 0;
  z-index: 2;
}
/* only the bag itself stops a click; its see-through frame lets the click through to the background */
.hero::after {
  content: ""; position: absolute; pointer-events: auto;
  top: calc(100% * var(--vt)); bottom: calc(100% * var(--vt));
  left: calc(100% * var(--vl)); right: calc(100% * (1 - var(--vr)));
}
.hero.is-leaving { z-index: 1; }
.hero.is-leaving::after { pointer-events: none; }
.hero__turn { position: absolute; inset: 0; transform-origin: calc(100% * (var(--vl) + var(--vr)) / 2) 50%; }
.col { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease .28s; }
.col.is-on { opacity: 1; z-index: 1; transition: opacity .5s ease; }
.hero[data-side="front"] .face--back,
.hero[data-side="back"] .face--front { visibility: hidden; }

/* Swing tags */
.tags {
  position: absolute; z-index: 3; height: 0;
  --tw: 44px; --th: 94px; --cw: 30px; --ch: 64px; --tags-w: 118px; --tag-gap: 20px;
  top: calc(var(--hook-y) - 4px);
  left: min(calc(50% + var(--hh) * .66667 * (var(--vr) - var(--vl)) / 2 + var(--tag-gap)), calc(100% - var(--tags-w) - 8px));
  width: var(--tags-w);
  pointer-events: auto;
  transition: opacity .2s ease;
}
.stage:not(.is-picked) .tags { opacity: 0; pointer-events: none; }
.tagw {
  position: absolute; top: 0; left: var(--x, 0px);
  display: flex; flex-direction: column; align-items: center;
  transform-origin: 50% 0;
  filter: drop-shadow(1px 3px 3px rgba(46, 38, 22, .24));
  animation: tagdrop 1.15s both, tagidle var(--idle, 4.4s) ease-in-out infinite;
  animation-delay: calc(.36s + var(--i, 0) * .11s), calc(1.6s + var(--i, 0) * .11s);
}
@keyframes tagdrop {
  0%   { opacity: 0; transform: translateY(-34px) rotate(-16deg); }
  16%  { opacity: 1; }
  38%  { transform: translateY(0) rotate(9deg); }
  58%  { transform: translateY(0) rotate(-5deg); }
  76%  { transform: translateY(0) rotate(2.4deg); }
  90%  { transform: translateY(0) rotate(-.9deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0deg); }
}
@keyframes tagidle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(1.5deg); }
  75% { transform: rotate(-1.5deg); }
}
.tag__string { position: relative; z-index: 1; display: block; width: 1px; height: var(--len, 40px); background: #6B6862; }
.tag__string::before {
  content: ""; position: absolute; top: -2px; left: -2px; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFFFFF, #8B8F96 72%);
}
.tag {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: var(--w); min-height: var(--h);   /* a long colour name makes a longer tag */
  margin: -8px 0 0; padding: 16px 0 8px; border: 0;
  clip-path: polygon(30% 0, 70% 0, 100% 15%, 100% 100%, 0 100%, 0 15%);
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(0, 0, 0, .07)), var(--sw);
  color: var(--tink);
  font-weight: 700; font-stretch: 100%; line-height: 1; text-transform: uppercase;
}
.tag::before {
  content: ""; position: absolute; top: 6px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
  background: var(--wall); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28);
}
.tag--price { --w: var(--tw); --h: var(--th); --sw: var(--kraft); --tink: #33260F; font-size: 12.5px; letter-spacing: .04em; }
.tag--colour { --w: var(--cw); --h: var(--ch); font-size: 8px; letter-spacing: .12em; }
button.tag--colour { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tag__txt { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.tagw::after { content: ""; display: block; width: 5px; height: 5px; margin-top: 7px; border-radius: 50%; background: var(--ink); opacity: 0; transition: opacity .25s ease; }
.tagw.is-on::after { opacity: 1; }
.tagw:has(.tag:focus-visible) { outline: 2px solid var(--ink); outline-offset: 4px; }
.tag:focus-visible { outline: none; }

/* Small arrows */
.nav {
  position: absolute; z-index: 3; top: calc(var(--hook-y) + var(--hh) * .57);
  width: 40px; height: 40px; margin-top: -20px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(239, 238, 235, .55); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  opacity: 0; transition: opacity .3s ease;
}
.stage.is-picked .nav { opacity: 1; transition: opacity .5s ease .45s; }
.nav--prev { left: calc(50% - var(--hh) * .33333 - 92px); }
.nav--next { right: calc(50% - var(--hh) * .33333 - 92px); }

/* ---------- The name line, pill, switch and link ---------- */
.nameline {
  position: absolute; z-index: 4; left: 0; right: 0; top: var(--cap-y);
  margin: 0; padding: 0 20px; text-align: center; text-wrap: balance;
  font-weight: 520; font-stretch: 104%; font-size: 11px; line-height: 1.2;
  letter-spacing: .17em; text-transform: uppercase; color: var(--grey);
  pointer-events: none;
  opacity: 0; transition: opacity .17s ease;
}
.stage.is-ready .nameline { opacity: 1; }
.stage .nameline.is-swapping { opacity: 0; }
.nameline.is-picked {
  top: var(--name-y);
  font-weight: 780; font-stretch: 121%;
  font-size: clamp(15px, 1.36cqw, 21px);
  letter-spacing: .075em; color: var(--ink);
}

.railinfo, .detail { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.pill {
  position: absolute; top: var(--pill-y); left: 50%; translate: -50% 0;
  display: block; padding: 10px 19px; border: 1px solid var(--ink); border-radius: 99px;
  text-decoration: none; white-space: nowrap; pointer-events: auto;
  opacity: 0; transition: opacity .35s ease;
}
.stage.is-ready .pill { opacity: 1; transition-delay: .25s; }
.stage.is-picked .pill { opacity: 0; transition-delay: 0s; pointer-events: none; }
.pill:hover { background: var(--ink); color: var(--wall); }

.detail > * { opacity: 0; transform: translateY(9px); transition: opacity .25s ease, transform .25s ease; }
.stage.is-picked .detail > * { opacity: 1; transform: none; pointer-events: auto; transition: opacity .5s ease var(--d, .3s), transform .7s var(--out) var(--d, .3s); }

.switch {
  position: absolute; top: var(--switch-y); left: 50%; translate: -50% 0;
  display: grid; grid-template-columns: 1fr 1fr;
  width: 150px; height: 32px; padding: 3px; border-radius: 99px;
  background: rgba(255, 255, 255, .5); box-shadow: inset 0 0 0 1px var(--line);
  --d: .34s;
}
.switch__thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 99px;
  background: var(--ink); transition: transform .4s var(--out);
}
.switch[data-side="back"] .switch__thumb { transform: translateX(100%); }
.switch__opt {
  position: relative; z-index: 1; appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  border-radius: 99px; color: var(--grey); font-size: 9.5px;
  -webkit-tap-highlight-color: transparent;
}
.switch__opt[aria-pressed="true"] { color: var(--wall); }
.switch__opt:focus-visible { outline-offset: 3px; }

.link {
  position: absolute; top: var(--link-y); left: 50%; translate: -50% 0;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; white-space: nowrap;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
  --d: .42s;
}
.backbtn {
  position: absolute; top: 14px; right: 14px; padding: 10px 14px;
  border: 1px solid var(--ink); border-radius: 99px; background: var(--wall); cursor: pointer;
}
.stage.is-picked .backbtn:not(:focus-visible) { opacity: 0; pointer-events: none; }

/* ---------- Ticker ---------- */
.ticker {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: var(--tick-h);
  display: flex; align-items: center; overflow: hidden;
  background: var(--optic); color: #14140F;
  font-size: 10.5px; letter-spacing: .2em;
}
.ticker__track { display: flex; flex: none; white-space: nowrap; animation: tick 96s linear infinite; }
.ticker__track span { flex: none; padding-right: .62em; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- Below the first screen ---------- */
.below { padding: clamp(72px, 12vw, 148px) 20px clamp(64px, 9vw, 120px); }
.wrap { max-width: 860px; margin: 0 auto; }
.block + .block { margin-top: clamp(64px, 9vw, 112px); }
.label { margin: 0 0 22px; color: var(--grey); font-weight: 600; }
.rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 15em) 6.5em;
  align-items: baseline; gap: 16px; padding: 19px 0; border-bottom: 1px solid var(--line);
}
.row__name { font-weight: 760; font-stretch: 118%; font-size: 14px; letter-spacing: .07em; text-transform: uppercase; }
.row__colours { color: var(--grey); font-size: 14px; }
.row__price { text-align: right; font-size: 14px; font-weight: 560; font-variant-numeric: tabular-nums; }
.dot {
  display: inline-block; width: 9px; height: 9px; margin: 0 7px 0 0; border-radius: 50%;
  background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); vertical-align: -.02em;
}
.row__colours .dot:not(:first-child) { margin-left: 12px; }
.visit {
  margin: 0 0 34px;
  font-weight: 420; font-stretch: 104%; font-size: clamp(21px, 2.7vw, 31px); line-height: 1.32; letter-spacing: -.008em;
}
.btn {
  display: inline-block; padding: 16px 28px; border-radius: 99px;
  background: var(--ink); color: var(--wall); text-decoration: none; font-size: 11px;
}
.btn:hover { background: #2C2C27; }
.foot { padding: 26px 20px 34px; border-top: 1px solid var(--line); text-align: center; color: var(--grey); font-size: 12.5px; }
.foot p { margin: 0; }

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .stage {
    --rod-y: 29cqh;
    --rod-w: calc(100cqw - 30px);
    --rod-h: 5px;
    --cap-y: 66.8cqh;
    --pill-y: 71.4cqh;
    --hh: min(59cqh, 138cqw);
    --hook-y: 9.4cqh;
    --name-y: 74.2cqh;
    --switch-y: 79.2cqh;
    --link-y: 86.6cqh;
    --tick-h: 32px;
  }
  .wordmark { font-size: 11px; }
  .rod__cap--l { left: -5px; }
  .rod__cap--r { right: -5px; }
  .tags { --tw: 38px; --th: 82px; --cw: 27px; --ch: 56px; --tags-w: 82px; --tag-gap: 8px; }
  .tag--price { font-size: 11px; }
  .tag--colour { font-size: 7.5px; }
  .nav { width: 36px; height: 36px; margin-top: -18px; }
  .nav--prev { left: 8px; }
  .nav--next { right: 8px; }
  .switch { width: 164px; height: 38px; }
  .link { padding: 10px 4px; }
  .ticker { font-size: 9.5px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 16px 0; }
  .row__name { font-size: 13px; }
  .row__colours { grid-row: 2; grid-column: 1; font-size: 13px; }
  .row__price { grid-row: 1; grid-column: 2; }
}

/* ---------- Less motion: no sway, no ticker scroll, picking is a short fade ---------- */
@media (prefers-reduced-motion: reduce) {
  .bag__sway, .ticker__track { animation: none; }
  .tagw { animation: tagfade .25s ease both; animation-delay: .1s; }
  .scene { transition: opacity .25s ease; }
  .slot, .bag, .slot .rig, .switch__thumb, .col, .col.is-on { transition-duration: .01s; transition-delay: 0s; }
  .stage.is-picked .detail > * { transition: opacity .25s ease; transform: none; }
  .detail > * { transform: none; }
}
@keyframes tagfade { from { opacity: 0; } to { opacity: 1; } }
