:root {
  --paper: #f5f6ef;
  --surface: #ffffff;
  --ink: #171f1b;
  --muted: #64706a;
  --line: #d8ded2;
  --line-strong: #aeb9ad;
  --pine: #195c4b;
  --pine-dark: #103d32;
  --coral: #f36f3f;
  --sky: #79b5d4;
  --lime: #c8d85e;
  --charcoal: #252924;
  --shadow: 0 24px 70px rgba(23, 31, 27, 0.16);
  --soft: 0 12px 28px rgba(23, 31, 27, 0.1);
  --radius: 8px;
  --radius-sm: 4px;
  --motion-smooth: cubic-bezier(0.45, 0, 0.16, 1);
  --motion-soft: cubic-bezier(0.32, 0.72, 0, 1);
  --font-ui: Aptos, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 31, 27, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 31, 27, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 40px 40px;
  font-family: var(--font-ui);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.animation-card {
  width: min(1240px, 100%);
  min-width: 0;
  border: 1px solid rgba(23, 31, 27, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(121, 181, 212, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.intro {
  display: grid;
  gap: 8px;
  padding: 26px 28px 22px;
}

.eyebrow,
.tiny {
  margin: 0;
  color: var(--pine);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.04;
}

h1 {
  font-size: clamp(34px, 5vw, 64px);
}

.intro p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.stage {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 660px;
  overflow: hidden;
  padding: 22px;
  background:
    radial-gradient(circle at 16% 16%, rgba(200, 216, 94, 0.22), transparent 24%),
    linear-gradient(180deg, #edf1e7, #f8f8f2);
}

.scene-label {
  display: none;
}

.desktop-scene,
.mobile-scene {
  position: absolute;
  min-width: 0;
  transition:
    transform 720ms var(--motion-smooth),
    opacity 620ms ease,
    filter 620ms ease;
}

.desktop-scene {
  left: 22px;
  right: 290px;
  top: 22px;
  bottom: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--soft);
}

.mobile-scene {
  right: 32px;
  bottom: 32px;
  width: 230px;
  opacity: 0.72;
  transform: translateY(18px) scale(0.9);
}

.stage[data-phase="mobile"] .desktop-scene {
  opacity: 0.34;
  filter: saturate(0.42);
  transform: translateX(-26px) scale(0.96);
}

.stage[data-phase="mobile"] .mobile-scene {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  background: #faf8f0;
  padding: 0 14px;
}

.browser-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.browser-bar strong {
  color: var(--muted);
  font-size: 13px;
}

.desktop-body {
  display: grid;
  grid-template-columns: 285px 1fr;
  min-width: 0;
  height: calc(100% - 40px);
}

.filter-rail {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 10px;
  border-right: 1px solid var(--line);
  background: #fbfcf8;
  padding: 12px;
}

.search-block,
.slider-block,
.filter-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.search-block span,
.block-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-block input {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: var(--ink);
  font-weight: 900;
}

.suggestion-popover {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 104px;
  z-index: 4;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity 360ms ease,
    transform 520ms var(--motion-smooth);
}

.stage[data-step="suggest"] .suggestion-popover,
.stage[data-step="type-product"] .suggestion-popover,
.stage[data-step="hover-suggest"] .suggestion-popover,
.stage[data-step="pick-suggest"] .suggestion-popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.suggestion-popover button {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--pine);
  border-radius: var(--radius);
  background: #e4f0e7;
  color: var(--pine-dark);
  padding: 10px;
  box-shadow: var(--soft);
  transition:
    transform 360ms var(--motion-smooth),
    background 300ms ease,
    border-color 300ms ease;
}

.suggestion-popover span {
  color: var(--muted);
  font-size: 12px;
}

.stage[data-step="hover-suggest"] .suggestion-popover button,
.stage[data-step="pick-suggest"] .suggestion-popover button {
  background: #d7eadb;
  border-color: var(--pine-dark);
  transform: translateY(-1px);
}

.stage[data-step="move-search"] .search-block input,
.stage[data-step="focus-search"] .search-block input,
.stage[data-step="type-h"] .search-block input,
.stage[data-step="type-hood"] .search-block input,
.stage[data-step="type-hoodie"] .search-block input {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(25, 92, 75, 0.12);
}

.block-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.option-row button {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #f7f8f2;
  color: var(--ink);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
  transition:
    transform 260ms ease,
    background 260ms ease,
    border-color 260ms ease,
    color 260ms ease;
}

.option-row.tight button {
  min-width: 34px;
  padding-left: 6px;
  padding-right: 6px;
}

.option-row button.is-active {
  border-color: var(--pine);
  background: var(--pine);
  color: var(--surface);
  transform: translateY(-1px);
}

.stage[data-step="move-type"] [data-type-option="hoodie"] {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(25, 92, 75, 0.14);
  transform: translateY(-1px);
}

.desktop-colors {
  gap: 7px;
}

.stock-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
}

.stock-toggle span {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  border-radius: 3px;
  background: #f7f8f2;
}

.stock-toggle.is-active span {
  border-color: var(--pine);
  background:
    linear-gradient(135deg, transparent 48%, var(--surface) 49% 59%, transparent 60%),
    var(--pine);
}

.slider-track {
  position: relative;
  height: 34px;
  border: 0;
  background: transparent;
}

.slider-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 6px;
  border-radius: 999px;
  background: #dfe6da;
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 14px;
  height: 6px;
  width: 100%;
  border-radius: 999px;
  background: var(--pine);
  transition: width 760ms var(--motion-soft);
}

.slider-thumb {
  position: absolute;
  left: calc(100% - 12px);
  top: 6px;
  width: 22px;
  height: 22px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 1px var(--coral), var(--soft);
  transition: left 760ms var(--motion-soft);
}

.price-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.price-inputs label {
  display: grid;
  gap: 4px;
}

.price-inputs span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.price-inputs input {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #f7f8f2;
  color: var(--ink);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.stage[data-step="price"] .slider-fill,
.stage[data-step="drag-price"] .slider-fill,
.stage[data-step="release-price"] .slider-fill,
.stage[data-step="mobile-intro"] .slider-fill,
.stage[data-step="mobile-hover-color"] .slider-fill,
.stage[data-step="mobile-color"] .slider-fill,
.stage[data-step="mobile-result"] .slider-fill {
  width: 76%;
}

.stage[data-step="price"] .slider-thumb,
.stage[data-step="drag-price"] .slider-thumb,
.stage[data-step="release-price"] .slider-thumb,
.stage[data-step="mobile-intro"] .slider-thumb,
.stage[data-step="mobile-hover-color"] .slider-thumb,
.stage[data-step="mobile-color"] .slider-thumb,
.stage[data-step="mobile-result"] .slider-thumb {
  left: calc(76% - 12px);
}

.stage[data-step="move-slider"] .slider-thumb,
.stage[data-step="drag-price"] .slider-thumb {
  box-shadow:
    0 0 0 1px var(--coral),
    0 0 0 5px rgba(243, 111, 63, 0.16),
    var(--soft);
}

.filter-chip-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip-stack span,
.mobile-head span {
  border-radius: var(--radius-sm);
  background: #e4f0e7;
  color: var(--pine-dark);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 900;
}

.products-panel {
  position: relative;
  min-width: 0;
  padding: 18px;
}

.products-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.products-head h2 {
  font-size: 28px;
}

.ajax-badge {
  display: none;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--surface);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
}

.stage[data-step="search"],
.stage[data-step="type-product"],
.stage[data-step="hover-suggest"],
.stage[data-step="pick-suggest"],
.stage[data-step="read-products"],
.stage[data-step="move-slider"],
.stage[data-step="drag-price"],
.stage[data-step="release-price"],
.stage[data-step="mobile-result"] {
  --pulse-products: 1;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  gap: 10px;
}

.product {
  display: grid;
  min-width: 0;
  gap: 8px;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
  box-shadow: var(--soft);
  transition:
    opacity 520ms ease,
    transform 720ms var(--motion-smooth),
    filter 520ms ease,
    box-shadow 520ms ease;
}

.product img {
  display: block;
  width: 100%;
  height: 82px;
  object-fit: contain;
  object-position: center;
  padding: 4px;
  border: 1px solid rgba(23, 31, 27, 0.12);
  border-radius: var(--radius-sm);
  background: #f4f7ef;
}

.product small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.product strong {
  font-size: 13px;
  line-height: 1.15;
}

.product.is-muted {
  opacity: 0.28;
  filter: saturate(0.24);
}

.product.is-selected {
  transform: translateY(-4px);
  box-shadow: 0 15px 28px rgba(23, 31, 27, 0.16);
}

.stage[data-step="search"] .product,
.stage[data-step="type-product"] .product,
.stage[data-step="type-hood"] .product,
.stage[data-step="type-hoodie"] .product,
.stage[data-step="hover-suggest"] .product,
.stage[data-step="pick-suggest"] .product,
.stage[data-step="pick-type"] .product,
.stage[data-step="pick-color"] .product,
.stage[data-step="read-products"] .product,
.stage[data-step="price"] .product,
.stage[data-step="drag-price"] .product,
.stage[data-step="release-price"] .product,
.stage[data-step="mobile-result"] .m-product {
  transform: translateY(-2px);
}

.phone {
  position: relative;
  min-width: 0;
  height: 512px;
  overflow: hidden;
  border: 10px solid var(--charcoal);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.phone-top {
  height: 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.mobile-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  font-size: 13px;
}

.mobile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  min-width: 0;
  gap: 8px;
  padding: 0 12px;
}

.m-product {
  display: grid;
  min-width: 0;
  place-items: center;
  min-height: 82px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 3px;
  transition:
    opacity 520ms ease,
    transform 720ms var(--motion-smooth),
    filter 520ms ease,
    box-shadow 520ms ease;
}

.m-product img {
  display: block;
  width: 100%;
  height: 76px;
  object-fit: contain;
  object-position: center;
  border-radius: 3px;
}

.mobile-drawer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--soft);
  transform: translateY(72%);
  transition: transform 780ms var(--motion-soft);
}

.stage[data-phase="mobile"] .mobile-drawer {
  transform: translateY(0);
}

.color-row {
  display: flex;
  gap: 8px;
}

.color-swatch {
  width: 34px;
  height: 34px;
  border: 2px solid var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px var(--line-strong);
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.color-swatch.black {
  background: #20211f;
}

.color-swatch.gray {
  background: #b9bab3;
}

.color-swatch.blue {
  background: var(--sky);
}

.color-swatch.green {
  background: var(--lime);
}

.color-swatch.is-active {
  box-shadow: 0 0 0 3px rgba(25, 92, 75, 0.32);
  transform: translateY(-2px);
}

.stage[data-step="move-color"] .desktop-colors .color-swatch.gray,
.stage[data-step="pick-color"] .desktop-colors .color-swatch.gray,
.stage[data-step="mobile-hover-color"] .color-swatch.blue,
.stage[data-step="mobile-color"] .color-swatch.blue {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(25, 92, 75, 0.24);
}

.apply-mobile {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--pine);
  color: var(--surface);
  font-weight: 900;
}

.m-product.is-muted {
  opacity: 0.26;
  filter: saturate(0.2);
}

.m-product.is-selected {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 12px 24px rgba(23, 31, 27, 0.16);
}

.cursor {
  position: absolute;
  z-index: 20;
  left: 0;
  top: 0;
  width: 24px;
  height: 28px;
  transform: translate3d(var(--cursor-x, 70px), var(--cursor-y, 90px), 0);
  transition: transform var(--cursor-speed, 760ms) var(--motion-smooth);
  pointer-events: none;
}

.stage[data-snap="true"] .cursor {
  transition: none;
}

.cursor svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 28px;
  overflow: visible;
  fill: var(--surface);
  stroke: #030303;
  stroke-width: 4;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 4px rgba(23, 31, 27, 0.22));
}

.cursor span {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
  opacity: 0;
  transform: scale(0.2);
}

.stage[data-click="true"] .cursor span {
  animation: clickPulse 440ms ease-out;
}

@keyframes clickPulse {
  0% {
    opacity: 0.78;
    transform: scale(0.2);
  }

  100% {
    opacity: 0;
    transform: scale(3.2);
  }
}

@media (max-width: 900px) {
  .page-shell {
    padding: 12px;
  }

  .stage {
    min-height: 980px;
  }

  .desktop-scene,
  .mobile-scene {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .desktop-scene {
    height: 560px;
    margin-bottom: 20px;
  }

  .mobile-scene {
    width: min(230px, 100%);
    margin: 0 auto;
  }

  .desktop-body {
    grid-template-columns: 1fr;
  }

  .filter-rail {
    grid-template-columns: 1fr 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .suggestion-popover {
    left: 18px;
    right: calc(50% + 9px);
  }

  .product-grid {
    grid-template-columns: 1fr 1fr;
  }

}

@media (max-width: 560px) {
  h1 {
    font-size: clamp(30px, 9.5vw, 36px);
  }

  .intro p {
    font-size: 16px;
  }

  .intro {
    padding-left: 16px;
    padding-right: 16px;
  }

  .stage {
    padding: 14px;
    min-height: 1120px;
  }

  .desktop-scene {
    height: 690px;
    max-width: 100%;
    overflow: hidden;
  }

  .stage[data-phase="mobile"] {
    min-height: 850px;
  }

  .stage[data-phase="mobile"] .desktop-scene {
    height: 245px;
    overflow: hidden;
    margin-bottom: 14px;
  }

  .filter-rail,
  .compact-filter {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .products-head {
    flex-wrap: wrap;
  }

  .suggestion-popover {
    left: 18px;
    right: 18px;
    top: 128px;
  }

  .cursor {
    width: 22px;
    height: 26px;
  }

  .cursor svg {
    width: 22px;
    height: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
