:root {
  --ink: #151515;
  --muted: #6d6a64;
  --line: #dfddd7;
  --paper: #f8f7f3;
  --surface: #ffffff;
  --soft: #efede7;
  --accent: #8f2638;
  --accent-dark: #251f1d;
  --focus: #1f5f99;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px 1fr auto 44px;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 0 clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 247, 243, 0.93);
  backdrop-filter: blur(16px);
}

.brand {
  justify-self: start;
  color: var(--ink);
  text-decoration: none;
  font-size: 22px;
  font-weight: 650;
}

.header-nav {
  display: flex;
  gap: 28px;
}

.header-nav a,
.source-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.header-nav a:hover,
.source-link:hover {
  color: var(--ink);
}

.icon-button,
.gallery-arrow {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  cursor: pointer;
}

.icon-button svg,
.gallery-arrow svg,
.actions svg,
.source-link svg,
.viewer-ar-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.product-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: clamp(28px, 5vw, 72px);
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 38px) clamp(16px, 4vw, 42px) 44px;
}

.gallery-panel {
  min-width: 0;
}

.gallery-main {
  position: relative;
  display: grid;
  min-height: clamp(480px, 68vh, 780px);
  place-items: center;
  overflow: hidden;
  background: var(--soft);
}

.gallery-main::before {
  position: absolute;
  inset: 6%;
  content: "";
  border: 1px solid rgba(21, 21, 21, 0.05);
  pointer-events: none;
}

.gallery-main img {
  position: relative;
  display: block;
  width: min(72%, 620px);
  max-height: min(78vh, 720px);
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(37, 31, 29, 0.14));
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
}

.gallery-arrow.previous {
  left: 22px;
}

.gallery-arrow.next {
  right: 22px;
}

.thumb-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.thumb {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #ece9e1;
  cursor: pointer;
}

.thumb[aria-current="true"] {
  border-color: var(--ink);
}

.thumb img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.product-info {
  position: sticky;
  top: 100px;
  align-self: start;
  padding-top: clamp(6px, 4vh, 34px);
}

.product-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 520;
  letter-spacing: 0;
}

h1 {
  margin-top: 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.03;
  overflow-wrap: break-word;
}

.price-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  font-size: 22px;
}

.stock {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(21, 21, 21, 0.16);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin: 26px 0;
}

.spec-grid div {
  min-width: 0;
}

.spec-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.spec-grid dd {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.35;
}

.actions {
  display: grid;
  gap: 12px;
}

.primary-button,
.secondary-button,
.viewer-ar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border-radius: 4px;
  cursor: pointer;
}

.primary-button,
.viewer-ar-button {
  border: 1px solid var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.viewer-ar-button:focus-visible,
.thumb:focus-visible,
.gallery-arrow:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 55%);
  outline-offset: 3px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.ar-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: stretch;
  border-top: 1px solid var(--line);
  background: #e7e4dc;
  padding: clamp(28px, 5vw, 58px) clamp(16px, 4vw, 42px);
}

.viewer-copy {
  align-self: center;
  max-width: 340px;
}

.viewer-copy h2 {
  margin-top: 12px;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.05;
}

model-viewer {
  width: 100%;
  min-height: clamp(420px, 58vh, 680px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    #d4d0c5;
  background-size: 70px 70px;
}

.viewer-ar-button {
  position: absolute;
  right: 18px;
  bottom: 18px;
  min-width: 148px;
  padding: 0 18px;
  box-shadow: 0 14px 30px rgba(21, 21, 21, 0.2);
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 44px 1fr 44px;
  }

  .header-nav {
    display: none;
  }

  .site-header .icon-button:last-child {
    grid-column: 3;
  }

  .product-shell,
  .ar-band {
    grid-template-columns: 1fr;
  }

  .product-info {
    position: static;
    padding-top: 0;
  }

  .gallery-main {
    min-height: 62vh;
  }

  .gallery-main img {
    width: min(82%, 540px);
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 62px;
    padding: 0 12px;
  }

  .brand {
    justify-self: center;
  }

  .product-shell {
    padding-inline: 0;
    padding-top: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .gallery-main {
    min-height: 58vh;
  }

  .gallery-main img {
    width: 70vw;
    max-width: 70vw;
    max-height: none;
  }

  .gallery-arrow {
    width: 38px;
    height: 38px;
  }

  .gallery-arrow.previous {
    left: 12px;
  }

  .gallery-arrow.next {
    right: 12px;
  }

  .thumb-strip,
  .product-info {
    padding-inline: 14px;
    width: 100%;
    min-width: 0;
  }

  h1 {
    font-size: 28px;
    line-height: 1.08;
    max-width: 11.8em;
  }

  .thumb-strip {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
  }

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

  .price-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .ar-band {
    padding-inline: 14px;
  }

  model-viewer {
    min-height: 430px;
  }
}
