:root {
  --paper: #f4f0e8;
  --paper-deep: #e9e3d7;
  --ink: #1d1a16;
  --muted: #7a7166;
  --line: rgba(29, 26, 22, 0.1);
  --clay: #b5652b;
  --clay-soft: #e8b98d;
  --light: #fff5e2;
  --sans: 'Mona Sans Variable', system-ui, sans-serif;
  --serif: 'Fraunces Variable', Georgia, serif;
}

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

html, body { height: 100%; }

body {
  background:
    radial-gradient(120% 80% at 30% 0%, #fbf8f2 0%, var(--paper) 55%, var(--paper-deep) 100%);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 32px) clamp(10px, 3vw, 32px);
}

/* ---------------------------------------------------------------- the shop card */
.shop {
  --photo: min(46vw, 62vh, 430px);
  --thumb: clamp(44px, min(6.4vw, 9vh), 66px);
  position: relative;
  width: min(100%, 980px);
}

.shop__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: clamp(8px, 2vh, 18px);
}

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand__mark { width: 18px; height: 18px; fill: none; stroke: var(--clay); stroke-width: 1.5; stroke-linejoin: round; }
.brand__name { font-family: var(--serif); font-size: 18px; font-weight: 560; letter-spacing: -0.01em; }
.crumb { white-space: nowrap; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.shop__body {
  display: grid;
  grid-template-columns: var(--thumb) var(--photo) minmax(0, 1fr);
  gap: clamp(12px, 2.2vw, 28px);
  align-items: start;
}

/* ---------------------------------------------------------------- thumbnails */
.thumbs {
  position: relative;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thumb {
  position: relative;
  display: block;
  width: var(--thumb);
  aspect-ratio: 1;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #8d8d8d;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 1px 2px rgba(40, 28, 16, 0.12), 0 6px 14px -8px rgba(40, 28, 16, 0.35);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.82) brightness(0.92);
  transition: filter 0.4s ease;
}

.thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.thumb.is-on img { filter: none; }
.thumb:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

@media (hover: hover) {
  .thumb:hover { transform: translateY(-2px); }
  .thumb:hover img { filter: none; }
}

.thumbs__mark {
  position: absolute;
  left: -2px;
  top: 0;
  width: calc(var(--thumb) + 4px);
  height: calc(var(--thumb) + 4px);
  margin-top: -2px;
  border-radius: 14px;
  border: 1.5px solid var(--clay);
  box-shadow: 0 0 0 4px rgba(181, 101, 43, 0.12), 0 0 18px -2px rgba(255, 196, 140, 0.7);
  pointer-events: none;
}

/* ---------------------------------------------------------------- the big photo */
.photo { position: relative; width: var(--photo); }

.photo__frame {
  position: relative;
  width: var(--photo);
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background: #8a8a8a;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 2px 4px rgba(40, 28, 16, 0.08),
    0 18px 40px -18px rgba(40, 28, 16, 0.45),
    0 40px 80px -40px rgba(40, 28, 16, 0.35);
  cursor: crosshair;
  touch-action: none;
}

.photo__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 6;
}

.photo__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo__img--next { clip-path: inset(0 100% 0 0); }

.photo__grain {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the veil of light: a soft warm band, wider than the frame, that crosses on a slant */
.veil {
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 46%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transform: skewX(-10.2deg);
  background: linear-gradient(90deg,
    rgba(255, 245, 226, 0) 0%,
    rgba(255, 226, 186, 0.4) 30%,
    rgba(255, 246, 228, 0.95) 50%,
    rgba(255, 226, 186, 0.4) 70%,
    rgba(255, 245, 226, 0) 100%);
  mix-blend-mode: screen;
  filter: blur(4px);
}

.veil__core {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background: linear-gradient(180deg, transparent 8%, #fff 30%, #fff 70%, transparent 92%);
  box-shadow: 0 0 14px 4px rgba(255, 240, 214, 0.9), 0 0 40px 10px rgba(255, 214, 160, 0.45);
}

/* the viewfinder that follows the pointer over the photo */
.finder {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 40%;
  height: 40%;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  background: rgba(255, 248, 236, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55), 0 0 0 9999px rgba(20, 16, 12, 0.22), 0 8px 24px -8px rgba(0, 0, 0, 0.4);
}

.finder__corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 0 solid #fff;
}
.finder__corner--tl { left: -3px; top: -3px; border-left-width: 2px; border-top-width: 2px; border-top-left-radius: 8px; }
.finder__corner--tr { right: -3px; top: -3px; border-right-width: 2px; border-top-width: 2px; border-top-right-radius: 8px; }
.finder__corner--bl { left: -3px; bottom: -3px; border-left-width: 2px; border-bottom-width: 2px; border-bottom-left-radius: 8px; }
.finder__corner--br { right: -3px; bottom: -3px; border-right-width: 2px; border-bottom-width: 2px; border-bottom-right-radius: 8px; }

.photo__hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.photo__hint svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

/* ---------------------------------------------------------------- product info and the detail panel */
.info {
  position: relative;
  height: var(--photo);
  display: flex;
  flex-direction: column;
  padding-top: 4px;
}

.info > :not(.detail) { transition: opacity 0.45s ease, filter 0.45s ease; }
.info.is-zoom > :not(.detail) { opacity: 0.12; filter: blur(3px); }

.info__kicker { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--clay); margin-bottom: 10px; }
.info__name { font-family: var(--serif); font-weight: 480; font-size: clamp(24px, 3.1vw, 36px); line-height: 1.05; letter-spacing: -0.02em; }
.info__price { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.info__unit { font-size: 12px; font-weight: 400; color: var(--muted); }
.info__note { margin-top: 14px; font-size: 14px; line-height: 1.5; color: #4c453d; max-width: 30ch; }

.roll { display: inline-block; }
.info__name, .info__price, .info__note { overflow: hidden; padding-bottom: 0.08em; }

.info__specs { display: flex; gap: 24px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.info__specs dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.info__specs dd { margin-top: 3px; font-size: 14px; font-weight: 550; }

.add {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #2a241e, #17130f);
  color: #fbf4e8;
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 10px 22px -12px rgba(23, 19, 15, 0.8);
}
.add svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.detail {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: #8a8a8a;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 18px 40px -18px rgba(40, 28, 16, 0.5),
    0 40px 80px -40px rgba(40, 28, 16, 0.4);
  transform-origin: 0% 50%;
}

.detail::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), inset 0 0 40px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.detail__view {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  will-change: background-position;
}

.detail__sheen {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.2) 48%, transparent 58%);
  mix-blend-mode: screen;
}

.detail__tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(20, 16, 12, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

/* the drawn pointer of the autopilot */
.pointer {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  fill: #fff;
  stroke: #1d1a16;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- narrow screens: photo on top, thumbs in a row, the
   detail as an inset in the photo's corner */
@media (max-width: 680px) {
  .shop { --photo: min(84vw, 50vh); --thumb: clamp(36px, min(11vw, 7.4vh), 56px); width: var(--photo); }
  .shop__head { margin-bottom: 8px; }
  .brand__name { font-size: 16px; }
  .crumb { font-size: 10px; }
  .shop__body { grid-template-columns: 1fr; gap: 8px; }
  .photo { order: 1; }
  .thumbs { order: 2; flex-direction: row; gap: 8px; }
  .thumbs__mark { top: 0; left: 0; margin-top: -2px; margin-left: -2px; }
  .info { order: 3; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: baseline; position: static; }
  .info__kicker, .info__note, .info__specs, .add { display: none; }
  .info__name { font-size: clamp(17px, 5vw, 22px); }
  .info__price { margin-top: 0; font-size: 16px; }
  .photo__hint { display: none; }
  .info.is-zoom > :not(.detail) { opacity: 1; filter: none; }
  .detail {
    inset: auto;
    top: 0;
    left: 0;
    width: calc(var(--photo) * 0.46);
    height: calc(var(--photo) * 0.46);
    border-radius: 14px;
    transform-origin: 50% 50%;
    z-index: 7;
  }
  .detail__tag { left: 8px; bottom: 8px; padding: 4px 7px; font-size: 9px; }
}

@media (max-width: 420px) {
  .crumb { display: none; }
}
