:root {
  --bg: #0e1012;
  --ink: #ece8e2;
  --ink-2: #b9b5ae;
  --muted: #80848a;
  --line: rgba(236, 232, 226, .12);
  --line-2: rgba(236, 232, 226, .22);
  --sale: #d2b48c;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --sans: 'Jost', 'Futura', 'Century Gothic', system-ui, sans-serif;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --gutter: clamp(16px, 3.2vw, 48px);
  --panel-w: clamp(300px, 26vw, 380px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  letter-spacing: .01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; border-radius: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Room ---------- */
.room { position: fixed; inset: 0; overflow: hidden; }
.room__wall {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, #3b4147 0%, #2a2f34 34%, #1a1d21 64%, #101214 100%);
}
.room__spot {
  position: absolute; left: 0; top: -20vh; width: 90vw; height: 120vh;
  background: radial-gradient(closest-side, rgba(214, 222, 230, .22), rgba(214, 222, 230, .07) 55%, transparent);
  transform: translate3d(calc(var(--spot-x, 38vw) - 45vw), 0, 0);
  will-change: transform;
}
.room__floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 30vh;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(6,7,8,.35) 40%, rgba(4,5,6,.7) 100%);
}
.room__floor::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.05) 30%, rgba(255,255,255,.05) 70%, transparent);
}
.room__grain {
  position: absolute; inset: -50%;
  opacity: .07; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Header ---------- */
.top {
  position: fixed; z-index: 30; left: var(--gutter); right: var(--gutter); top: 0;
  height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 500; font-size: 17px; letter-spacing: .34em; color: var(--ink); text-decoration: none; justify-self: start; }
.tabs { display: flex; gap: 28px; }
.tab { position: relative; font-size: 13px; letter-spacing: .08em; color: var(--muted); padding: 6px 0; transition: color .4s; }
.tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transition: transform .6s var(--ease); }
.tab:hover { color: var(--ink-2); }
.tab.is-active { color: var(--ink); }
.tab.is-active::after { transform: scaleX(1); }
.bag-btn { justify-self: end; display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .06em; }
.bag-btn b { font-weight: 400; color: var(--muted); min-width: 1ch; display: inline-block; transition: transform .5s var(--ease), color .3s; }
.bag-btn.bump b { transform: scale(1.6); color: var(--ink); transition-duration: .12s; }
.offer {
  position: fixed; z-index: 30; top: 68px; left: 0; right: 0; margin: 0; text-align: center;
  padding: 10px var(--gutter); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.offer span { color: var(--sale); }
.offer b { font-weight: 400; white-space: pre; }

/* ---------- Stage ---------- */
.stage { position: fixed; inset: 0; touch-action: pan-y; cursor: grab; }
.stage.is-dragging { cursor: grabbing; }
.scene {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity 1s var(--ease-io), transform 1.2s var(--ease-io), visibility 0s 1.2s;
  transform: translate3d(0, 6vh, 0);
}
.scene.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: .25s, .25s, 0s; }
.scene.is-leaving { opacity: 0; visibility: visible; transform: translate3d(0, -8vh, 0); transition-delay: 0s; }
.track { position: absolute; inset: 0; perspective: 1500px; }

.rail {
  position: absolute; left: 0; right: 0; top: var(--rail-y, 26vh); height: 7px; margin-top: -3px;
  transform-origin: 0 50%;
}
.rail i {
  position: absolute; inset: 0; border-radius: 4px;
  background: linear-gradient(to bottom, #2b2f33 0%, #e6eaed 28%, #fafbfc 38%, #9399a0 62%, #3d4146 82%, #1b1d20 100%);
  box-shadow: 0 10px 22px rgba(0,0,0,.55), 0 2px 3px rgba(0,0,0,.6);
}
.rail i::after { /* odlesk světla na tyči */
  content: ''; position: absolute; top: 1px; height: 2px; width: 40vw; border-radius: 2px;
  left: calc(var(--spot-x, 38vw) - 20vw);
  background: radial-gradient(closest-side, rgba(255,255,255,.95), transparent);
}

.item {
  position: absolute; left: 0; top: var(--rail-y, 26vh);
  transform-origin: 50% 0; will-change: transform, filter;
  display: block; cursor: pointer;
}
.item__body { display: block; position: relative; }
.item__img {
  display: block; height: var(--h); width: auto; max-width: none;
  pointer-events: none; -webkit-user-drag: none;
  filter: drop-shadow(0 26px 30px rgba(0,0,0,.45)) drop-shadow(0 4px 6px rgba(0,0,0,.35));
}
[data-scene="shoes"] .item__img { width: var(--w); height: auto; }
/* háček ramínka z fotky obejme tyč: posun nahoru o vnitřek oblouku háčku */
[data-scene="clothes"] .item__img { margin-top: calc(var(--h) * -0.028); }

.shadow {
  position: absolute; left: 0; top: var(--floor-y, 84vh); width: 300px; height: 42px; margin: -21px 0 0 -150px;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.72), rgba(0,0,0,.35) 55%, transparent);
  filter: blur(6px); will-change: transform, opacity;
}

/* intro: kusy dopadnou na tyč */
.is-intro [data-scene="clothes"] .item__body { animation: drop 1.15s var(--ease) both; animation-delay: calc(var(--n) * 90ms + .2s); }
.is-intro [data-scene="clothes"] .rail { animation: rail 1.3s var(--ease-io) both; }
@keyframes drop { from { transform: translate3d(0, -115vh, 0); } }
@keyframes rail { from { transform: scaleX(0); } }
.is-intro [data-scene="shoes"] .item__body { animation: rise 1.2s var(--ease) both; animation-delay: calc(var(--n) * 90ms + .3s); }
@keyframes rise { from { transform: translate3d(0, 40px, 0); opacity: 0; } }

.plinth {
  position: absolute; left: 0; right: 0; top: var(--floor-y, 84vh); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(236,232,226,.25) 25%, rgba(236,232,226,.25) 60%, transparent);
}
.plinth::after {
  content: ''; position: absolute; left: 10%; right: 30%; top: 0; height: 80px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(214,222,230,.07), transparent);
}

/* ---------- Panel ---------- */
.panel {
  position: fixed; z-index: 20; right: calc(var(--gutter) + 2vw); top: 50%;
  width: var(--panel-w); transform: translateY(-46%);
}
.panel::before {
  content: ''; position: absolute; inset: -18vh -12vw -18vh -8vw; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(14,16,18,.78), rgba(14,16,18,.45) 60%, transparent);
}
.panel__inner > * { transition: opacity .55s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
.panel__inner.is-out > * { opacity: 0; transform: translate3d(0, 10px, 0); transition-duration: .18s; transition-delay: 0s; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .08em; color: var(--muted); margin-bottom: 18px; transition: color .3s; }
.crumb:hover { color: var(--ink); }
.crumb svg { width: 12px; height: 12px; }
.p-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.p-name { margin: 0; font-weight: 400; font-size: clamp(24px, 2.1vw, 32px); line-height: 1.1; letter-spacing: -.005em; }
.p-price { white-space: nowrap; font-size: 15px; text-align: right; }
.p-price s { display: block; color: var(--muted); font-size: 12px; }
.p-price.is-sale span { color: var(--sale); }
.p-color { display: flex; align-items: center; gap: 9px; margin: 12px 0 0; font-size: 12px; color: var(--ink-2); }
.p-color i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px var(--line-2); }
.p-tag { display: inline-block; margin-top: 14px; padding: 3px 8px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--sale); border: 1px solid rgba(210,180,140,.35); }
.p-desc { margin: 18px 0 26px; color: var(--ink-2); font-size: 13px; line-height: 1.65; max-width: 34ch; }
.p-sizehead { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 10px; }
.p-sizehead span:last-child { color: var(--muted); }
.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); border: 1px solid var(--line); }
.size { height: 40px; font-size: 11px; letter-spacing: .06em; color: var(--ink-2); border-right: 1px solid var(--line); transition: background .3s, color .3s; }
.size:last-child { border-right: 0; }
.size:hover { background: rgba(236,232,226,.05); color: var(--ink); }
.size.is-on { background: var(--ink); color: #111; }
.sizes.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }
.add {
  position: relative; overflow: hidden; width: 100%; height: 48px; margin-top: 12px; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line-2); background: rgba(236,232,226,.03); font-size: 12px; letter-spacing: .06em; color: var(--ink-2);
  transition: color .45s var(--ease), border-color .45s;
}
.add::before { content: ''; position: absolute; inset: 0; background: var(--ink); transform: translateY(101%); transition: transform .55s var(--ease); z-index: -1; }
.add.is-ready { color: var(--ink); border-color: var(--ink); }
.add.is-ready:hover { color: #111; }
.add.is-ready:hover::before { transform: none; }
.add { z-index: 0; }
.acc { border-bottom: 1px solid var(--line); margin-top: 22px; }
.acc + .acc { margin-top: 0; }
.acc summary { list-style: none; display: flex; justify-content: space-between; padding: 14px 0; font-size: 12px; cursor: pointer; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary b { font-weight: 300; transition: transform .4s var(--ease); }
.acc[open] summary b { transform: rotate(45deg); }
.acc ul, .acc p { margin: 0 0 16px; padding: 0; list-style: none; color: var(--ink-2); font-size: 12px; line-height: 1.9; }
.acc li::before { content: '—  '; color: var(--muted); }

/* ---------- Controls ---------- */
.controls { position: fixed; z-index: 20; right: var(--gutter); bottom: 26px; display: flex; align-items: center; gap: 22px; color: var(--muted); }
.counter { display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .1em; }
.counter b { font-weight: 400; color: var(--ink); }
.bar { position: relative; width: 70px; height: 1px; background: var(--line-2); overflow: hidden; }
.bar i { position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%; transform: scaleX(.2); transition: transform .8s var(--ease); }
.arrows { display: flex; gap: 6px; }
.ctl { display: inline-flex; align-items: center; gap: 6px; padding: 6px; font-size: 11px; letter-spacing: .1em; transition: color .3s; }
.ctl:hover { color: var(--ink); }
.ctl svg { width: 15px; height: 15px; }
.hint { position: fixed; z-index: 20; left: var(--gutter); bottom: 28px; margin: 0; font-size: 11px; letter-spacing: .12em; color: var(--muted); transition: opacity 1s; }
.hint.is-gone { opacity: 0; }
.credit { position: fixed; z-index: 20; left: 50%; bottom: 28px; transform: translateX(-50%); margin: 0; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgba(128,132,138,.6); }
.credit b { font-weight: 500; color: var(--muted); }

/* ---------- Bag ---------- */
.veil { position: fixed; inset: 0; z-index: 40; background: rgba(5,6,7,.55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .6s var(--ease); }
.bag {
  position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(420px, 100vw);
  display: flex; flex-direction: column; background: #15181b; border-left: 1px solid var(--line);
  transform: translate3d(102%, 0, 0); transition: transform .8s var(--ease); user-select: text;
}
.bag-open .veil { opacity: 1; pointer-events: auto; }
.bag-open .bag { transform: none; }
.bag__head { display: flex; justify-content: space-between; align-items: center; padding: 22px 28px; border-bottom: 1px solid var(--line); }
.bag__head h2 { margin: 0; font-weight: 400; font-size: 13px; letter-spacing: .3em; text-transform: uppercase; }
.bag__list { flex: 1; overflow: auto; padding: 8px 28px; }
.bag__empty { margin-top: 30vh; text-align: center; color: var(--muted); font-size: 13px; }
.bag__empty em { display: block; font: italic 28px var(--serif); color: var(--ink-2); margin-bottom: 8px; }
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); animation: lineIn .6s var(--ease) both; }
@keyframes lineIn { from { opacity: 0; transform: translateX(20px); } }
.line__img { width: 72px; height: 88px; display: grid; place-items: center; background: radial-gradient(closest-side, #2a2f34, #1a1d21); }
.line__img img { max-width: 62px; max-height: 78px; }
.line h3 { margin: 0 0 3px; font-weight: 400; font-size: 13px; }
.line p { margin: 0; font-size: 11px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 12px; border: 1px solid var(--line); padding: 2px 8px; }
.qty button { width: 16px; color: var(--ink-2); }
.line__right { text-align: right; font-size: 13px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.line__right button { font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.bag__foot { padding: 20px 28px 26px; border-top: 1px solid var(--line); }
.bag__offer { font-size: 11px; color: var(--sale); letter-spacing: .04em; margin: 0 0 14px; }
.sum { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin: 6px 0; }
.sum.total { font-size: 15px; color: var(--ink); margin-top: 12px; }
.checkout { width: 100%; height: 50px; margin-top: 18px; background: var(--ink); color: #111; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; transition: opacity .3s; }
.checkout:hover { opacity: .88; }

.toast {
  position: fixed; z-index: 50; left: 50%; top: 96px; transform: translate3d(-50%, -12px, 0);
  padding: 11px 18px; background: rgba(236,232,226,.95); color: #111; font-size: 12px; letter-spacing: .04em;
  opacity: 0; pointer-events: none; transition: opacity .4s var(--ease), transform .6s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate3d(-50%, 0, 0); }
.fly { position: fixed; z-index: 60; pointer-events: none; transform-origin: 0 0; will-change: transform, opacity; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .top { height: 58px; }
  .offer { top: 58px; font-size: 10px; letter-spacing: .1em; }
  .tabs { gap: 18px; }
  .bag-btn span { display: none; }
  .panel {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; transform: none;
    padding: 22px 16px 70px; max-height: 44vh; overflow: auto;
    background: linear-gradient(to bottom, rgba(14,16,18,0), rgba(14,16,18,.92) 28px, #0e1012);
  }
  .panel::before { display: none; }
  .p-desc { margin: 12px 0 16px; }
  .crumb, .acc:not(:first-of-type) { display: none; }
  .controls { left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); justify-content: space-between; gap: 10px; z-index: 21; background: #0e1012; border-top: 1px solid var(--line); }
  .logo { font-size: 14px; letter-spacing: .24em; }
  .offer .offer__ship { display: none; }
  .hint, .credit { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
