/* Cursed Store — public catalog */

body {
  background:
    radial-gradient(900px 520px at 50% -200px, rgba(217, 71, 44, .14), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}

/* Announcement */
.announce {
  padding: 9px var(--gutter);
  background: var(--accent);
  color: #fff;
  text-align: center;
  font: 600 12.5px/1.35 var(--font-display);
  letter-spacing: .02em;
}

/* Hero */
.hero {
  padding: 40px var(--gutter) 24px;
  text-align: center;
}
.hero__brand { margin: 0; }
.hero__logo {
  width: min(86vw, 460px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .6));
}
.hero__tagline {
  max-width: 34ch;
  margin: 14px auto 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: balance;
}
.hero__meta {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 16px 0 0;
  color: var(--muted);
  font: 600 11px/1 var(--font-display);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.hero__meta .live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(63, 191, 134, .6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(63, 191, 134, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 191, 134, 0); } }

/* Sticky category bar */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 11, 12, .82);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.bar.is-stuck { border-bottom-color: var(--line); }
.bar__inner, .search {
  display: flex; align-items: center; gap: 10px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 10px var(--gutter);
}
.bar__mark {
  flex: none; width: 0; opacity: 0; overflow: hidden; margin-right: -10px;
  transition: width .25s var(--ease), opacity .2s, margin .25s var(--ease);
}
.bar__mark img { width: 28px; height: auto; }
.bar.is-stuck .bar__mark { width: 28px; opacity: 1; margin-right: 0; }

.chips {
  flex: 1; min-width: 0;
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  padding-right: 24px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font: 600 13px/1 var(--font-display);
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip small { font-size: 11px; color: var(--faint); font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] small { color: #6d6a64; }

.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; margin-left: 4px; }
.search input {
  flex: 1; min-width: 0; height: 40px;
  padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  outline: none; font-size: 16px;
}
.search input:focus { border-color: var(--ink-2); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.search__cancel { background: none; border: 0; padding: 8px 4px; color: var(--ink-2); font: 600 14px var(--font-display); }

/* Content */
.content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px var(--gutter) 56px;
  outline: none;
}
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0 4px;
  color: var(--muted); font-size: 13px;
}

.section { margin-top: 30px; scroll-margin-top: 72px; }
.section:first-of-type { margin-top: 18px; }
.section__head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 14px;
}
.section__title {
  margin: 0;
  font: 600 27px/1 var(--font-gothic);
  letter-spacing: .01em;
}
.section__count { color: var(--gold); opacity: .7; font: 600 12px var(--font-display); letter-spacing: .08em; }
.section__head::after { content: ''; flex: 1; height: 1px; background: var(--line); transform: translateY(-5px); }

/* Featured rail */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(68vw, 290px);
  gap: 12px;
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x mandatory;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter) 4px;
  scroll-padding: 0 var(--gutter);
}
.rail::-webkit-scrollbar { display: none; }
.rail .card { scroll-snap-align: start; }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 12px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .rail { grid-auto-columns: 280px; } }

/* Card */
.card {
  display: block; width: 100%;
  padding: 0; border: 0; background: none;
  text-align: left; color: inherit;
  animation: rise .45s var(--ease) both;
}
.card__media {
  position: relative; display: block;
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  isolation: isolate;
}
.card__media::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  pointer-events: none;
}
/* Photos keep their own shape (square, portrait, 9:16…): shown whole, with a blurred
   copy of the same image filling any leftover space. */
.card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity .4s, transform .6s var(--ease), filter .3s;
}
.card__media img.fill { inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(26px) saturate(1.1); }
.card__media img.is-loaded { opacity: 1; }
.card:hover .card__media img:not(.fill) { transform: scale(1.035); }
.card__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 1; }
.card__body {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 2px 0;
}
.card__text { display: block; min-width: 0; }
.card__name {
  display: block;
  font: 600 15px/1.25 var(--font-display);
  letter-spacing: -.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card__cat { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.card__price { color: var(--gold); font: 600 13px/1.25 var(--font-display); font-variant-numeric: tabular-nums; }

.card.is-soldout .card__media img { filter: grayscale(1) brightness(.5); }
.card.is-soldout .card__name, .card.is-soldout .card__price { color: var(--muted); }
.card__soldout {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center;
}
.card__soldout .badge { height: 28px; padding: 0 14px; font-size: 11px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Skeleton */
.skel { border-radius: var(--r); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.skel--media { aspect-ratio: 1; }
.skel--line { height: 12px; margin-top: 12px; width: 70%; border-radius: 6px; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* Empty / error */
.empty {
  display: grid; justify-items: center; gap: 10px;
  padding: 64px 16px; text-align: center; color: var(--muted);
}
.empty svg { width: 40px; height: 40px; color: var(--faint); }
.empty strong { color: var(--ink); font: 600 17px var(--font-display); }
.empty p { margin: 0; max-width: 32ch; }

/* Detail sheet */
.sheet {
  width: 100%; max-width: 100%;
  max-height: 94dvh;
  margin: auto 0 0; padding: 0;
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--ink);
  overflow: hidden auto;
  overscroll-behavior: contain;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .55);
}
.sheet[open] { animation: sheet-up .38s var(--ease); }
.sheet::backdrop { background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .3s; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.sheet__grab { position: sticky; top: 0; z-index: 3; height: 0; display: flex; justify-content: center; }
.sheet__grab::before { content: ''; width: 40px; height: 4px; margin-top: 8px; border-radius: 4px; background: rgba(255, 255, 255, .35); }
.sheet__close {
  position: absolute; top: 14px; right: 14px; z-index: 4;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(11, 11, 12, .6);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff;
}
.sheet__close svg { width: 18px; height: 18px; }
.sheet__layout { position: relative; }
.sheet__media { position: relative; aspect-ratio: 1; max-height: 64dvh; width: 100%; background: var(--surface-2); overflow: hidden; }
.sheet__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sheet__media img.fill { inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(34px) saturate(1.1); }
.sheet__media .card__badges { top: 16px; left: 16px; }
.sheet.is-soldout .sheet__media img { filter: grayscale(.85) brightness(.7); }
.sheet__body { padding: 22px 20px calc(26px + var(--safe-b)); }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sheet__title { margin: 6px 0 0; font: 600 34px/1 var(--font-gothic); letter-spacing: .005em; }
.sheet__price { margin: 0; padding-top: 22px; font: 600 19px/1 var(--font-display); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stock { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; font: 600 13px var(--font-display); }
.stock::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock--in { color: var(--ok); }
.stock--out { color: #ff6b63; }
.stock span { color: var(--muted); font-weight: 500; }
.sheet__desc { margin: 16px 0 0; color: var(--ink-2); line-height: 1.6; white-space: pre-line; }
.sheet__label { margin: 22px 0 10px; }
.garments { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.garments li {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--ink-2); font: 500 13px var(--font-display);
}
.note {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 24px; padding: 14px 16px;
  border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 13.5px; line-height: 1.5;
}
.note svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 1px; }
.note strong { color: var(--ink); font-weight: 600; }
.sheet__actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet__actions .btn { flex: 1; }

@media (min-width: 820px) {
  .sheet {
    width: min(940px, 92vw);
    max-height: min(86vh, 720px);
    margin: auto;
    border-radius: 24px; border-bottom: 1px solid var(--line);
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  }
  .sheet[open] { animation: pop .3s var(--ease); }
  .sheet__grab { display: none; }
  .sheet__layout { display: grid; grid-template-columns: 1fr 1fr; height: min(86vh, 720px); }
  .sheet__media { aspect-ratio: auto; max-height: none; height: 100%; }
  .sheet__body { overflow-y: auto; padding: 40px 36px; }
  .sheet__title { font-size: 42px; }
  .sheet__head { padding-right: 44px; }
  @keyframes pop { from { transform: scale(.97); opacity: 0; } }
}

/* Footer */
.foot {
  border-top: 1px solid var(--line);
  padding: 44px var(--gutter) calc(40px + var(--safe-b));
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.foot__mark { width: 44px; height: auto; margin: 0 auto 16px; opacity: .9; }
.foot__info { display: grid; gap: 6px; justify-items: center; margin: 0; }
.foot__info a { color: var(--ink-2); text-decoration: none; }
.foot__info a:hover { color: var(--ink); text-decoration: underline; }
.foot__social { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.foot__social a { text-decoration: none; }
.foot__legal { margin: 26px 0 0; color: var(--faint); font-size: 12px; }

/* Placeholders & small states */
.card__ph { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, var(--surface-3), var(--surface-2)); }
.card__ph img { position: static; width: 34%; height: auto; opacity: .35 !important; filter: grayscale(.4); }
.card__media img.is-broken { visibility: hidden; }
.sheet .eyebrow { color: var(--gold); }
.bar.is-searching { border-bottom-color: var(--line); }

.sheet__layout:focus { outline: none; }

/* ── Opening animation ─────────────────────────────────────────────────────
   Logo flickers in from blur, a red line tracks loading, then the logo flies
   to its place in the header while the page rises in underneath. */
.intro { display: none; }
html.intro-on { overflow: hidden; }
html.intro-on .intro {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background-color: var(--bg);
  transition: background-color .7s ease;
  cursor: pointer;
}
.intro__glow {
  position: absolute; inset: 0;
  background: radial-gradient(60vmax 42vmax at 50% 46%, rgba(217, 71, 44, .24), transparent 62%);
  opacity: 0;
  animation: intro-glow 1.8s ease-out .05s forwards;
  transition: opacity .45s;
}
.intro__inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 30px; }
.intro__logo {
  width: min(74vw, 380px); height: auto;
  opacity: 0; filter: blur(14px); transform: scale(1.07);
  animation: intro-logo 1.15s cubic-bezier(.2, .8, .2, 1) .15s forwards;
  will-change: transform, opacity, filter;
}
.intro__bar {
  width: 120px; height: 2px; border-radius: 2px; overflow: hidden;
  background: rgba(255, 255, 255, .1);
  opacity: 0; animation: intro-fade .4s ease .4s forwards;
  transition: opacity .35s;
}
.intro__bar span {
  display: block; height: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  animation: intro-load 1.2s cubic-bezier(.3, .7, .3, 1) .45s forwards;
}
.intro.is-done .intro__bar span { animation: none; transform: scaleX(1); transition: transform .22s ease-out; }

@keyframes intro-glow { 0% { opacity: 0; } 55% { opacity: 1; } 100% { opacity: .75; } }
@keyframes intro-fade { to { opacity: 1; } }
@keyframes intro-load { to { transform: scaleX(.82); } }
@keyframes intro-logo {
  0%   { opacity: 0;   filter: blur(14px); transform: scale(1.07); }
  38%  { opacity: 1; }
  46%  { opacity: .3; }
  52%  { opacity: 1; }
  58%  { opacity: .55; }
  64%  { opacity: 1;   filter: blur(0);    transform: scale(1); }
  100% { opacity: 1;   filter: blur(0);    transform: scale(1); }
}

/* Page underneath: waits hidden, then rises in as the intro leaves. */
html.intro-on .hero__logo { opacity: 0; }
html.intro-on .announce,
html.intro-on .hero__tagline,
html.intro-on .hero__meta,
html.intro-on .bar,
html.intro-on .content { opacity: 0; transform: translateY(16px); }
html.intro-leaving .intro { background-color: transparent; pointer-events: none; }
html.intro-leaving .intro__glow, html.intro-leaving .intro__bar { opacity: 0; }
html.intro-leaving .announce,
html.intro-leaving .hero__tagline,
html.intro-leaving .hero__meta,
html.intro-leaving .bar,
html.intro-leaving .content {
  opacity: 1; transform: none;
  transition: opacity .7s cubic-bezier(.2, .8, .2, 1), transform .7s cubic-bezier(.2, .8, .2, 1);
}
html.intro-leaving .announce { transition-delay: .2s; }
html.intro-leaving .hero__tagline { transition-delay: .35s; }
html.intro-leaving .hero__meta { transition-delay: .42s; }
html.intro-leaving .bar { transition-delay: .5s; }
html.intro-leaving .content { transition-delay: .58s; }
