:root {
  --bg: #06070a;
  --bg-elevated: #0d0f14;
  --bg-panel: #11141c;
  --ink: #e8e6e1;
  --ink-muted: #8a8790;
  --ink-dim: #5c5866;
  --line: rgba(232, 230, 225, 0.08);
  --line-strong: rgba(232, 230, 225, 0.16);
  --accent: #d4a574;
  --accent-soft: rgba(212, 165, 116, 0.14);
  --accent-hot: #e8b86d;
  --danger: #c45c5c;
  --ok: #6a9e7a;
  --radius: 2px;
  --font-display: "Syne", sans-serif;
  --font-body: "Sora", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 4.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(40, 48, 72, 0.45), transparent 55%),
    radial-gradient(ellipse 40% 30% at 90% 20%, rgba(212, 165, 116, 0.06), transparent 50%),
    radial-gradient(ellipse 35% 25% at 10% 60%, rgba(70, 90, 120, 0.08), transparent 45%),
    linear-gradient(180deg, #06070a 0%, #080a10 50%, #06070a 100%);
}

/* subtle star field */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 28% 42%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 67% 12%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 82% 58%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 45% 78%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 91% 88%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 8% 72%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 55% 28%, rgba(255, 255, 255, 0.45), transparent);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.site {
  position: relative;
  z-index: 1;
}

/* ——— Header ——— */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  background: rgba(6, 7, 10, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s;
}

.topbar.scrolled {
  border-bottom-color: var(--line);
  background: rgba(6, 7, 10, 0.92);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.brand-mark {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
}

.brand-locale {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.top-meta a {
  color: var(--ink-muted);
  transition: color 0.25s;
}

.top-meta a:hover {
  color: var(--accent);
}

.stock-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.stock-pulse::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(106, 158, 122, 0.5);
  animation: pulse 2.4s ease infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ——— Hero ——— */
.hero {
  min-height: 100svh;
  display: grid;
  align-content: end;
  padding:
    calc(var(--header-h) + 2rem)
    clamp(1.25rem, 4vw, 3rem)
    clamp(2.5rem, 6vw, 4.5rem);
  position: relative;
}

.hero-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  opacity: 0.48;
  filter: saturate(0.9) contrast(1.08);
  transform: scale(1.04);
  animation: heroDrift 28s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  to {
    transform: scale(1.1) translate3d(-1.5%, -1%, 0);
  }
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 7, 10, 0.88) 0%, rgba(6, 7, 10, 0.28) 50%, rgba(6, 7, 10, 0.7) 100%),
    linear-gradient(180deg, rgba(6, 7, 10, 0.4) 0%, rgba(6, 7, 10, 0.1) 35%, rgba(6, 7, 10, 0.96) 100%);
}

.hero-copy {
  position: relative;
  max-width: 42rem;
  animation: riseIn 1s var(--ease) both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

.hero-kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.8rem, 14vw, 8.5rem);
  line-height: 0.88;
  letter-spacing: -0.055em;
  margin-bottom: 1.25rem;
}

.hero h1 span {
  display: block;
  font-size: 0.28em;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.55rem;
}

.hero-lede {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--ink-muted);
  max-width: 28rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #120e0a;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.scroll-hint {
  position: absolute;
  right: clamp(1.25rem, 4vw, 3rem);
  bottom: clamp(2.5rem, 6vw, 4.5rem);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  writing-mode: vertical-rl;
  animation: fadeHint 2s ease infinite alternate;
}

@keyframes fadeHint {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

/* ——— Toolbar ——— */
.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  padding: 0.9rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(6, 7, 10, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.filter-btn:hover {
  color: var(--ink);
}

.filter-btn.active {
  color: var(--accent);
  border-color: rgba(212, 165, 116, 0.35);
  background: var(--accent-soft);
}

.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.count-label {
  font-size: 0.75rem;
  color: var(--ink-dim);
}

.count-label strong {
  color: var(--ink);
  font-weight: 600;
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.sort-wrap select {
  appearance: none;
  background: var(--bg-elevated);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath stroke='%238a8790' stroke-width='1.5' d='m1 1 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}

.sort-wrap select:focus {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* ——— Gallery ——— */
.gallery-section {
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 4vw, 3rem) 5rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.65rem, 1.5vw, 1.1rem);
}

.tile {
  position: relative;
  grid-column: span 4;
  aspect-ratio: 1 / 1.05;
  overflow: hidden;
  background: var(--bg-elevated);
  cursor: pointer;
  isolation: isolate;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.tile.visible {
  opacity: 1;
  transform: translateY(0);
}

.tile.featured {
  grid-column: span 8;
  aspect-ratio: 16 / 10;
}

.tile.tall {
  grid-column: span 4;
  aspect-ratio: 3 / 4;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  background:
    radial-gradient(ellipse at center, #141820 0%, #0a0c11 70%);
  transition: transform 0.8s var(--ease), filter 0.5s;
  will-change: transform;
}

.tile:hover img {
  transform: scale(1.06);
  filter: brightness(1.08);
}

.tile-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(6, 7, 10, 0.55) 70%,
    rgba(6, 7, 10, 0.92) 100%
  );
  opacity: 0.85;
  transition: opacity 0.4s;
  pointer-events: none;
}

.tile:hover .tile-shade {
  opacity: 1;
}

.tile-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 1.2rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  pointer-events: none;
}

.tile-top {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  right: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  pointer-events: none;
}

.badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line-strong);
  background: rgba(6, 7, 10, 0.65);
  backdrop-filter: blur(8px);
}

.badge.in-stock {
  color: var(--ok);
  border-color: rgba(106, 158, 122, 0.4);
}

.badge.out-of-stock {
  color: var(--danger);
  border-color: rgba(196, 92, 92, 0.4);
}

.badge.tag {
  color: var(--accent);
  border-color: rgba(212, 165, 116, 0.35);
}

.tile-id {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

.tile-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tile-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.tile-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.tile-pieces {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--ink-muted);
}

/* ——— Detail overlay ——— */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 5, 8, 0.78);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
}

.detail {
  width: min(1080px, 100%);
  max-height: min(92vh, 900px);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.45s var(--ease);
}

.overlay.open .detail {
  transform: none;
}

.detail-visual {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 45%, #1a2030 0%, #0a0c12 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.detail-visual img {
  width: 100%;
  height: 100%;
  max-height: 92vh;
  object-fit: contain;
  padding: 2rem;
  animation: imagePop 0.6s var(--ease) both;
}

@keyframes imagePop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

.detail-body {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-left: 1px solid var(--line);
}

.detail-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(6, 7, 10, 0.55);
  backdrop-filter: blur(8px);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ink-muted);
  transition: color 0.25s, border-color 0.25s;
}

.detail-close:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.detail-id {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.detail h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.detail-price {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.detail-blurb {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.spec dt {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.15rem;
}

.spec dd {
  font-size: 0.9rem;
  font-weight: 500;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.footer {
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.72rem;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

.footer a:hover {
  color: var(--accent);
}

/* ——— Responsive ——— */
@media (max-width: 960px) {
  .tile,
  .tile.featured,
  .tile.tall {
    grid-column: span 6;
    aspect-ratio: 1 / 1.05;
  }

  .detail {
    grid-template-columns: 1fr;
    max-height: 94vh;
  }

  .detail-visual {
    max-height: 42vh;
  }

  .detail-visual img {
    max-height: 42vh;
    padding: 1.25rem;
  }

  .detail-body {
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .scroll-hint {
    display: none;
  }
}

@media (max-width: 640px) {
  .top-meta .hide-sm {
    display: none;
  }

  .tile,
  .tile.featured,
  .tile.tall {
    grid-column: span 12;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 18vw, 4.5rem);
  }

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

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

  .tile {
    opacity: 1;
    transform: none;
  }
}
