/* Aso Runway — a fashion store staged as a runway */
:root {
  --paper: #ffffff;
  --mist: #f4f2ef;
  --mist-2: #ebe7e1;
  --ink: #141210;
  --ink-2: #4f4a44;
  --ink-3: #6e675f;
  --line: #e3ded6;
  --line-2: #cfc7bb;
  --accent: #8a6417;
  --accent-ink: #ffffff;

  --serif: "Bodoni Moda", "Didot", Georgia, serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;

  --t-11: .6875rem;
  --t-12: .75rem;
  --t-14: .875rem;
  --t-16: 1rem;
  --t-20: 1.25rem;
  --t-28: 1.75rem;
  --t-40: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  --t-hero: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --gutter: clamp(16px, 3vw, 40px);
  --bar: 64px;
  --r: 0px;
  --r-pill: 999px;
  --shadow-panel: 0 24px 64px rgba(20, 18, 16, .14), 0 2px 8px rgba(20, 18, 16, .06);
  --ease: cubic-bezier(.65, .05, .25, 1);
  --walk: 1500ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-16);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s-4); top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: var(--s-2) var(--s-4); }
.skip:focus { top: var(--s-2); }

/* ---------- labels ---------- */
.eyebrow {
  font-size: var(--t-11);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}
.price { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30;
  height: var(--bar);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
}
.bar nav { display: flex; gap: var(--s-5); font-size: var(--t-12); letter-spacing: .14em; text-transform: uppercase; }
.bar nav a { text-decoration: none; padding: var(--s-2) 0; border-bottom: 1px solid transparent; }
.bar nav a:hover, .bar nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.wordmark {
  font-family: var(--serif); font-weight: 600; font-size: 1.375rem; letter-spacing: .02em;
  text-decoration: none; white-space: nowrap;
}
.wordmark small { font-family: var(--sans); font-weight: 400; font-size: .625rem; letter-spacing: .3em; margin-left: .5em; vertical-align: .25em; }
.bar .right { justify-self: end; display: flex; align-items: center; gap: var(--s-5); }
.bag-link { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; font-size: var(--t-12); letter-spacing: .14em; text-transform: uppercase; }
.bag-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill);
  display: inline-grid; place-items: center;
  background: var(--ink); color: var(--paper); font-size: var(--t-11); letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.bag-count.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.3); background: var(--accent); } }

/* ---------- the runway stage ---------- */
.stage {
  position: relative;
  height: calc(100svh - var(--bar));
  min-height: 560px;
  overflow: hidden;
  background: var(--paper);
}
.stage-head {
  position: absolute; left: var(--gutter); top: var(--s-5); z-index: 6;
  max-width: 22rem;
}
.stage-head h1 {
  font-family: var(--serif); font-weight: 500; font-size: var(--t-40);
  line-height: 1.02; letter-spacing: -.01em; margin: var(--s-2) 0 var(--s-3);
}
.stage-head p { margin: 0; color: var(--ink-2); font-size: var(--t-14); }

.runway { position: absolute; inset: 0; z-index: 1; }

.fig {
  --x: 110%; --s: .3; --b: 0px; --o: 0; --z: 0;
  position: absolute;
  bottom: 70px;
  left: var(--x);
  height: calc(min(100% - 150px, 48vw) * var(--s));
  aspect-ratio: var(--ar, .6);
  transform: translateX(calc(var(--cx, .5) * -100%));
  z-index: var(--z);
  opacity: var(--o);
  filter: blur(var(--b));
  will-change: left, height, filter;
  padding: 0; border: 0; background: none; cursor: pointer;
  pointer-events: none;
  transition:
    left var(--walk) var(--ease),
    height var(--walk) var(--ease),
    filter var(--walk) var(--ease),
    opacity var(--walk) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.fig img, .fig video, .fig canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  pointer-events: none; user-select: none;
}
.fig video, .fig canvas { opacity: 0; transition: opacity .25s linear; }
.fig video.source { visibility: hidden; }
.fig.playing video:not(.source), .fig.playing canvas { opacity: 1; }
.fig.blend.playing { mix-blend-mode: multiply; }
.fig.playing img { opacity: 0; transition: opacity .25s linear .1s; }
.fig .hit { position: absolute; pointer-events: auto; cursor: pointer; }
.fig[data-slot="0"] .hit { cursor: zoom-in; }
.fig[aria-hidden="true"] .hit { pointer-events: none; }
.fig:focus-visible { outline: none; }
.fig:focus-visible::after {
  content: ""; position: absolute; left: calc(var(--cx, .5) * 100% - 30%); right: auto; width: 60%; bottom: -14px; height: 2px; background: var(--accent);
}
.fig.gone { visibility: hidden; transition: none; }
/* the look leaving the stage fades fast, so it never ghosts over the new one in front */
.fig.exiting { transition: left var(--walk) var(--ease), height var(--walk) var(--ease), opacity .45s linear; }

/* caption of the look in front */
.caption {
  position: absolute; left: var(--gutter); bottom: 96px; z-index: 6;
  max-width: 20rem;
}
.caption .n { font-family: var(--serif); font-size: var(--t-28); line-height: 1; }
.caption h2 { font-family: var(--sans); font-weight: 500; font-size: var(--t-20); line-height: 1.25; margin: var(--s-2) 0 var(--s-1); }
.caption p { margin: 0 0 var(--s-4); color: var(--ink-2); font-size: var(--t-14); }
.caption-swap { animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* bottom rail: filters and stepping */
.rail {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  height: 72px; padding: 0 var(--gutter);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-4);
}
.rail .chips { justify-self: center; }
.rail .count { white-space: nowrap; min-width: 5.5em; font-size: var(--t-12); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chips {
  display: flex; gap: 2px; padding: 4px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-pill);
  box-shadow: 0 8px 24px rgba(20, 18, 16, .06);
  overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: 8px 14px; border-radius: var(--r-pill);
  font-size: var(--t-11); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip-sep { width: 1px; margin: 6px 4px; background: var(--line); flex: none; }
.steps { justify-self: end; display: flex; gap: var(--s-2); }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--paper);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5);
  border: 1px solid var(--ink); border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper);
  font-size: var(--t-12); font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.btn:hover { background: #2c2925; }
.btn:active { transform: translateY(1px); }
.btn.line { background: transparent; color: var(--ink); }
.btn.line:hover { background: var(--ink); color: var(--paper); }
.btn.small { min-height: 34px; padding: 0 var(--s-4); font-size: var(--t-11); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.added { background: var(--accent); border-color: var(--accent); }

/* ---------- the edit (side panel) ---------- */
.edit {
  position: fixed; z-index: 40;
  top: calc(var(--bar) + 12px); right: 16px; bottom: 16px;
  width: min(400px, calc(100vw - 32px));
  background: var(--paper); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-panel);
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + 32px));
  visibility: hidden;
  transition: transform .55s var(--ease), visibility 0s linear .55s;
}
.edit.open { transform: none; visibility: visible; transition: transform .55s var(--ease); }
.edit-head { padding: var(--s-5) var(--s-5) var(--s-4); border-bottom: 1px solid var(--line); position: relative; }
.edit-head h2 { font-family: var(--sans); font-weight: 600; font-size: var(--t-28); line-height: 1.1; letter-spacing: -.02em; margin: var(--s-2) 0 var(--s-1); }
.edit-head p { margin: 0; color: var(--ink-3); font-size: var(--t-12); }
.edit .close { position: absolute; top: var(--s-4); right: var(--s-4); width: 32px; height: 32px; border: 0; border-radius: var(--r-pill); background: var(--mist); cursor: pointer; display: grid; place-items: center; }
.edit .close:hover { background: var(--mist-2); }
.edit .close svg { width: 14px; height: 14px; }
.pieces { list-style: none; margin: 0; padding: 0 var(--s-5); overflow-y: auto; flex: 1; }
.piece {
  display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s-4); align-items: center;
  padding: var(--s-4) 0; border-bottom: 1px solid var(--line);
}
.piece:last-child { border-bottom: 0; }
.thumb {
  width: 64px; height: 80px; border-radius: 8px; background-color: var(--mist);
  background-repeat: no-repeat; overflow: hidden;
}
.piece h3 { font-size: var(--t-14); font-weight: 600; line-height: 1.3; margin: 2px 0; }
.piece .detail { font-size: var(--t-12); color: var(--ink-3); margin: 0 0 var(--s-1); }
.piece .price { font-size: var(--t-14); font-weight: 500; }
.edit-foot { padding: var(--s-4) var(--s-5) var(--s-5); border-top: 1px solid var(--line); }
.edit-foot .note { font-size: var(--t-11); color: var(--ink-3); margin: var(--s-3) 0 0; line-height: 1.5; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 92px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: var(--r-pill);
  font-size: var(--t-12); letter-spacing: .06em;
  transition: transform .35s var(--ease), opacity .35s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- lookbook (depth queue + piece rail) ---------- */
.book {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  height: calc(100svh - var(--bar)); min-height: 600px;
  border-top: 1px solid var(--line);
}
.book-stage { position: relative; overflow: hidden; background: linear-gradient(180deg, #fbfaf8, var(--paper) 70%); }
.book-stage .stage-head { top: var(--s-6); }
.book-stage .stage-head h1 { font-family: var(--sans); font-weight: 400; font-size: var(--t-28); letter-spacing: .18em; text-transform: uppercase; }
.book-stage .fig { bottom: 40px; height: calc(min(100% - 110px, 58vw) * var(--s)); }
.book-meta {
  position: absolute; left: var(--gutter); bottom: var(--s-6); z-index: 6;
  display: flex; align-items: flex-end; gap: var(--s-5);
}
.book-meta .n { font-family: var(--serif); font-size: var(--t-hero); line-height: .9; font-variant-numeric: tabular-nums; }
.book-meta h2 { font-family: var(--sans); font-size: var(--t-14); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 var(--s-1); }
.book-meta p { margin: 0; font-size: var(--t-12); color: var(--ink-3); }
.book-steps { position: absolute; right: var(--gutter); bottom: var(--s-6); z-index: 6; display: flex; gap: var(--s-2); }

.shelf { border-left: 1px solid var(--line); overflow-y: auto; background: var(--paper); }
.shelf-head { position: sticky; top: 0; background: rgba(255,255,255,.95); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; z-index: 2; }
.shelf-item { border-bottom: 1px solid var(--line); padding: var(--s-5); }
.shelf-item .thumb { width: 100%; height: auto; aspect-ratio: 4 / 3.4; border-radius: 0; background-color: #fbfaf8; }
.shelf-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); margin-top: var(--s-4); }
.shelf-row h3 { font-size: var(--t-12); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 2px; }
.shelf-row p { margin: 0; font-size: var(--t-12); color: var(--ink-3); }
.add-plus { width: 36px; height: 36px; flex: none; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--paper); cursor: pointer; display: grid; place-items: center; }
.add-plus:hover { border-color: var(--ink); }
.add-plus.added { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.add-plus svg { width: 14px; height: 14px; }
.shelf-swap .shelf-item { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }

/* ---------- bag ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: var(--s-7) var(--gutter) var(--s-9); }
.page h1 { font-family: var(--serif); font-weight: 500; font-size: var(--t-hero); line-height: 1; letter-spacing: -.01em; margin: var(--s-2) 0 var(--s-6); }
.bag-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s-8); align-items: start; }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.line-item { display: grid; grid-template-columns: 88px 1fr auto; gap: var(--s-5); padding: var(--s-5) 0; border-bottom: 1px solid var(--line); align-items: start; }
.line-item .thumb { width: 88px; height: 110px; }
.line-item h2 { font-size: var(--t-16); font-weight: 600; margin: 2px 0; }
.line-item .detail { font-size: var(--t-12); color: var(--ink-3); margin: 0 0 var(--s-3); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-pill); }
.qty button { width: 34px; height: 34px; border: 0; background: none; cursor: pointer; font-size: 1rem; }
.qty span { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; font-size: var(--t-14); }
.link-btn { border: 0; background: none; padding: 0; margin-left: var(--s-4); font-size: var(--t-12); color: var(--ink-3); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.empty { padding: var(--s-8) 0; border-top: 1px solid var(--ink); }
.empty h2 { font-family: var(--serif); font-weight: 500; font-size: var(--t-28); margin: 0 0 var(--s-2); }
.empty p { color: var(--ink-2); margin: 0 0 var(--s-5); }

.panel { background: var(--mist); padding: var(--s-6); position: sticky; top: calc(var(--bar) + 24px); }
.panel h2 { font-size: var(--t-12); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 var(--s-4); }
.sum { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2) var(--s-4); margin: 0 0 var(--s-5); font-size: var(--t-14); }
.sum dt { color: var(--ink-2); }
.sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sum .total { font-size: var(--t-20); font-weight: 600; color: var(--ink); padding-top: var(--s-3); border-top: 1px solid var(--line-2); }
.pay-note { font-size: var(--t-12); color: var(--ink-3); margin: var(--s-3) 0 0; }

.measure { margin-top: var(--s-7); }
.measure h2 { font-family: var(--serif); font-weight: 500; font-size: var(--t-28); margin: 0 0 var(--s-2); }
.measure > p { color: var(--ink-2); margin: 0 0 var(--s-5); max-width: 36rem; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.field label { display: block; font-size: var(--t-11); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: var(--s-2); }
.field .unit { position: relative; }
.field input, .field select {
  width: 100%; height: 46px; padding: 0 40px 0 14px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper);
  font: inherit; font-size: var(--t-16); font-variant-numeric: tabular-nums;
}
.field select { padding-right: 14px; }
.field .unit::after { content: attr(data-unit); position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: var(--t-12); color: var(--ink-3); pointer-events: none; }
.field input:hover, .field select:hover { border-color: var(--ink-2); }
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(138, 100, 23, .18); }
.field input[aria-invalid="true"] { border-color: #a3341f; }
.field .err { font-size: var(--t-12); color: #a3341f; margin: var(--s-1) 0 0; min-height: 1.2em; }
.field.span-2 { grid-column: span 2; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: var(--s-5) var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); font-size: var(--t-12); color: var(--ink-3); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .book { grid-template-columns: 1fr; height: auto; }
  .book-stage { height: 72svh; min-height: 480px; }
  .shelf { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .shelf-list { display: grid; grid-template-columns: 1fr 1fr; }
  .shelf-item { border-right: 1px solid var(--line); }
  .bag-grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .panel { position: static; }
}
@media (max-width: 720px) {
  .bar { grid-template-columns: auto 1fr auto; gap: var(--s-3); }
  .bar .left { display: none; }
  .wordmark { justify-self: start; font-size: 1.125rem; }
  .wordmark small { display: none; }
  .bar .right { gap: var(--s-4); }
  .stage { min-height: 520px; }
  .stage-head { top: var(--s-4); right: var(--gutter); max-width: none; }
  .stage-head h1 { font-size: 1.75rem; }
  .stage-head p { display: none; }
  .caption { left: var(--gutter); right: var(--gutter); bottom: 118px; max-width: none; }
  .caption-swap { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 12px; }
  .caption .n { font-size: 1.5rem; }
  .caption h2 { font-size: var(--t-14); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .caption p { display: none; }
  .caption .btn { min-height: 36px; padding: 0 14px; }
  .fig { bottom: 182px; height: calc(min(100% - 270px, 150vw) * var(--s)); }
  .rail { height: auto; bottom: 0; padding: var(--s-3) var(--gutter) var(--s-4); grid-template-columns: 1fr auto; row-gap: var(--s-3); }
  .rail .chips { grid-column: 1 / -1; grid-row: 1; justify-self: stretch; }
  .rail .count { grid-row: 2; }
  .steps { grid-row: 2; }
  .edit { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 78svh; transform: translateY(calc(100% + 24px)); }
  .book-meta .n { font-size: 2.75rem; }
  .book-steps { bottom: var(--s-5); }
  .book-meta { bottom: var(--s-5); }
  .shelf-list { grid-template-columns: 1fr 1fr; }
  .shelf-item { padding: var(--s-4); }
  .fields { grid-template-columns: 1fr 1fr; }
  .line-item { grid-template-columns: 72px 1fr; }
  .line-item .thumb { width: 72px; height: 90px; }
  .line-item .price { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --walk: 1ms; }
  .fig, .edit, .toast { transition-duration: 1ms !important; }
  .caption-swap, .shelf-swap .shelf-item, .bag-count.bump { animation: none !important; }
}

/* lookbook: text and controls sit above the queue of looks */
.book-stage .stage-head, .book-meta, .book-steps { z-index: 70; }
