:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #9a9a9a;
  --line: #e8e8e8;
  --font: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --accent: #111111; /* set per color view by script */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 12px/1.5 var(--font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 56px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hdr::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--ease), background .4s;
}
body.view-color .hdr::after { transform: scaleX(1); }
.brand { justify-self: start; font-weight: 500; letter-spacing: .3em; font-size: 13px; }
.bag { justify-self: end; }

.hdr-colors { display: flex; align-items: center; gap: 14px; opacity: 0; pointer-events: none; transition: opacity .3s; }
body:not(.view-landing) .hdr-colors { opacity: 1; pointer-events: auto; }
.dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  outline: 1px solid transparent; outline-offset: 3px;
  transition: outline-color .2s, transform .2s;
}
.dot:hover { transform: scale(1.15); }
.dot.active { outline-color: var(--ink); }
.hdr-all { color: var(--muted); transition: color .2s; }
.hdr-all:hover, .hdr-all.active { color: var(--ink); }

main { flex: 1; }

/* ---------- Landing: color chips ---------- */
.landing {
  min-height: calc(100vh - 56px - 84px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px 64px;
  text-align: center;
}
.tag { color: var(--muted); text-transform: none; letter-spacing: .02em; margin: 0 0 8px; }
.tag i { font-style: italic; }
.pick { font-size: 12px; font-weight: 400; letter-spacing: .2em; margin: 0 0 48px; }

/* Deck: chips stacked like a fanned swatch book, cycled by script.js */
.deck {
  position: relative;
  width: 240px;
  height: 352px;
  margin-right: 48px; /* room for the fan */
  animation: rise .8s var(--ease) both;
}
.deck .chip {
  position: absolute; inset: 0 auto auto 0;
  width: 240px;
  animation: none;
  transform-origin: 50% 100%;
  transition: transform .9s var(--ease), opacity .9s var(--ease), box-shadow .45s var(--ease);
}
.deck .chip .chip-swatch { height: 260px; }
.deck .chip:hover { box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 26px 44px -18px rgba(0,0,0,.32); }

/* Palette bar: every color, always one click away */
.palette {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 4px;
  padding: 14px 16px 16px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.palette::-webkit-scrollbar { display: none; }
.sw { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 64px; padding: 4px; color: var(--muted); transition: color .2s; }
.sw-c {
  width: 36px; height: 36px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
  transition: transform .35s var(--ease), border-radius .35s var(--ease);
}
.sw-n { font-size: 10px; }
.sw:hover, .sw.active { color: var(--ink); }
.sw:hover .sw-c, .sw.active .sw-c { transform: translateY(-4px); }
.sw.active .sw-c { box-shadow: inset 0 0 0 1px rgba(0,0,0,.1), 0 0 0 2px #fff, 0 0 0 3px var(--ink); }
.chip {
  width: 168px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.12);
  text-align: left;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
  animation: rise .7s var(--ease) both;
  animation-delay: calc(var(--i) * 70ms);
}
.chip:hover { transform: translateY(-8px); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 22px 40px -18px rgba(0,0,0,.28); }
.chip-swatch { display: block; height: 176px; background: var(--c); border-bottom: 1px solid rgba(0,0,0,.06); }
.chip-all .chip-swatch { background: var(--stripes); }
.chip-label { display: flex; flex-direction: column; padding: 12px 14px 14px; gap: 1px; }
.chip-label b { font-weight: 500; letter-spacing: .08em; text-transform: none; font-size: 13px; }
.chip-label b sup { font-size: 7px; }
.chip-label span { color: #555; }
.chip-label .count { color: var(--muted); margin-top: 8px; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Shop grid ---------- */
.shop { padding: 28px 24px 64px; }
.shop-head { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 24px; }
.shop-head .name { color: var(--ink); display: inline-flex; align-items: center; gap: 10px; }
.shop-head .name::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.shop-head .name.all::before { display: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 40px 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.card { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.card-img { width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.card-img svg, .card-img img { width: 80%; height: 80%; object-fit: contain; transition: transform .5s var(--ease); }
/* Optical sizing so a beanie doesn't look as big as a jacket */
.card[data-type="beanie"] .card-img img { width: 52%; height: 52%; }
.card[data-type="shorts"] .card-img img { width: 70%; height: 70%; }
.card:hover .card-img svg, .card:hover .card-img img { transform: scale(1.06); }
/* Coming soon: blurred product + label in the swatch color */
.card-img, .pdp-img { position: relative; }
.is-soon img, .is-soon svg { filter: blur(12px) saturate(1.15); opacity: .85; }
.card:hover .is-soon img { transform: none; }
.soon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  padding: 7px 10px 7px 13px; /* extra left balances letter-spacing */
  background: rgba(255, 255, 255, .92);
  color: var(--cs);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .22em;
  white-space: nowrap;
  pointer-events: none;
}
.pdp-img .soon { font-size: 14px; padding: 10px 14px 10px 17px; }
.add.soon-btn[disabled] { background: transparent; color: var(--cs); border: 1px solid currentColor; opacity: 1; }

.card-code { display: inline-flex; align-items: center; gap: 6px; }
.card-code i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

.empty { text-align: center; color: var(--muted); padding: 120px 0; }

/* ---------- Product detail ---------- */
.pdp { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; align-items: center; min-height: calc(100vh - 56px - 72px); }
.pdp-img { aspect-ratio: 1; display: grid; place-items: center; animation: rise .6s var(--ease) both; }
.pdp-img svg, .pdp-img img { width: 82%; height: 82%; object-fit: contain; }
.pdp-img[data-type="beanie"] img { width: 60%; height: 60%; }
.thumbs { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }
.thumb { width: 64px; height: 64px; border: 1px solid var(--line); padding: 6px; transition: border-color .2s; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.active { border-color: var(--ink); }
.pdp-info { display: flex; flex-direction: column; gap: 22px; max-width: 360px; animation: rise .6s var(--ease) .08s both; }
.pdp-back { color: var(--muted); }
.pdp-back:hover { color: var(--ink); }
.pdp-title { font-size: 12px; font-weight: 500; margin: 0; }
.pdp-title span { display: block; color: var(--muted); font-weight: 400; }
.pdp-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pdp-label { color: var(--muted); width: 100%; }
.variant { display: inline-flex; align-items: center; gap: 8px; }
.variant .dot { width: 18px; height: 18px; }
.size { min-width: 44px; height: 36px; padding: 0 10px; border: 1px solid var(--line); transition: border-color .2s; }
.size:hover { border-color: var(--muted); }
.size.active { border-color: var(--ink); }
.add { height: 48px; background: var(--ink); color: #fff; transition: opacity .2s; }
.add:hover { opacity: .85; }
.add[disabled] { opacity: .3; cursor: default; }
.note { color: var(--muted); min-height: 1.5em; margin: -8px 0 0; }

/* ---------- Footer ---------- */
.ftr { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 28px; padding: 28px 24px; color: var(--muted); font-size: 11px; }
.ftr a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px) {
  .hdr { padding: 0 16px; grid-template-columns: 1fr auto; grid-template-areas: "brand bag" "colors colors"; height: auto; min-height: 56px; }
  .brand { grid-area: brand; line-height: 56px; }
  .bag { grid-area: bag; }
  .hdr-colors { grid-area: colors; justify-content: center; gap: 12px; flex-wrap: wrap; }
  body:not(.view-landing) .hdr-colors { padding-bottom: 14px; }
  body.view-landing .hdr-colors { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; }
  .shop { padding: 20px 16px 48px; }
  .deck { width: 200px; height: 300px; margin-right: 40px; }
  .deck .chip { width: 200px; }
  .deck .chip .chip-swatch { height: 212px; }
  .palette { flex-wrap: wrap; gap: 6px 0; padding: 10px 8px 12px; }
  .sw { width: 20%; min-width: 0; gap: 4px; }
  .sw-c { width: 30px; height: 30px; }
  .pdp { grid-template-columns: 1fr; gap: 16px; padding: 16px 16px 56px; min-height: 0; }
  .pdp-info { max-width: none; }
}

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