:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --stage: #efece6;
  --stage-2: #e4dfd6;
  --ink: #1c1a17;
  --ink-2: #4a4540;
  --muted: #8a837a;
  --line: #e5e0d8;
  --accent: #8a2c22;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', 'Times New Roman', serif;
  --sans: 'Jost', 'Futura', 'Helvetica Neue', Arial, sans-serif;
  --gutter: clamp(16px, 3vw, 40px);
  --maxw: 1520px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 15px/1.55 var(--sans);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1ede6; padding: 0.1em 0.35em; border-radius: 2px; }
svg { width: 1em; height: 1em; flex: none; }

:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }

/* ---------- header ---------- */
.promo {
  background: var(--ink);
  color: #efe9df;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 9px var(--gutter);
}
.masthead { text-align: center; padding: 30px var(--gutter) 14px; }
.wordmark {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.06em;
  line-height: 1;
}
.wordmark em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0.01em; }
.wordmark.small { font-size: 18px; }
.mainnav {
  display: flex;
  justify-content: center;
  gap: 36px;
  border-bottom: 1px solid var(--line);
  padding: 10px var(--gutter) 12px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mainnav a { padding-bottom: 4px; border-bottom: 1px solid var(--ink); }

.app { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) 80px; min-height: 60vh; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs span[aria-hidden] { color: var(--muted); }

/* ---------- collection ---------- */
.collection { padding-top: 28px; }
.collection-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 10px 0 22px; }
.collection-head h1 { font: 400 clamp(32px, 4vw, 46px)/1.05 var(--serif); margin: 0; letter-spacing: 0; }
.count { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid #d6d0c6;
  background: var(--surface);
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-n { font-size: 11px; opacity: 0.6; }
.sort { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); }
.sort select {
  appearance: none;
  height: 36px;
  min-width: 200px;
  padding: 0 36px 0 14px;
  border: 1px solid #d6d0c6;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%231c1a17' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  font: 400 13px var(--sans);
  color: var(--ink);
  border-radius: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px 22px;
}
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 16px; } }

.card { min-width: 0; }
.card-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--stage);
}
.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s var(--ease), transform 1.2s var(--ease);
}
.card-media .img-b { opacity: 0; }
.card:hover .card-media img { transform: scale(1.025); }
.card.has-alt:hover .img-b { opacity: 1; }
.tag {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.94);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tag svg { font-size: 14px; }
.card-cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 13px;
  text-align: center;
  background: rgba(251, 250, 247, 0.92);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: translateY(100%);
  transition: transform 0.35s var(--ease);
}
.card:hover .card-cta,
.card:focus-within .card-cta { transform: none; }
@media (hover: none) { .card-cta { display: none; } }

.card-swatches { display: flex; align-items: center; gap: 7px; min-height: 22px; margin: 14px 0 10px; }
.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  outline: 1px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.2s;
}
.dot:hover { outline-color: var(--ink); }
.more { font-size: 12px; color: var(--muted); margin-left: 2px; }
.card-title { font: 400 22px/1.2 var(--serif); margin: 0; }
.card-text:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card-no { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.card-note { margin: 10px 0 0; font-size: 11.5px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.card-note.is-ready { color: var(--accent); }

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.placeholder svg { font-size: 56px; color: #c9c2b7; }

.empty, .notice { color: var(--ink-2); padding: 60px 0; text-align: center; grid-column: 1 / -1; }
.notice h1 { font: 400 36px var(--serif); }

/* ---------- product detail ---------- */
.pdp { padding-top: 22px; }
.pdp-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.pager { display: flex; gap: 24px; font-size: 12.5px; color: var(--ink-2); }
.pager a { display: inline-flex; align-items: center; gap: 6px; }
.pager a:hover { color: var(--ink); }
.pager svg { font-size: 16px; }
.pager span { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pdp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.gallery { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; position: sticky; top: 16px; }
.thumbs { display: flex; flex-direction: column; gap: 10px; }
.thumb {
  position: relative;
  width: 76px;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  background: var(--stage);
  overflow: hidden;
  transition: border-color 0.2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { border-color: #b7afa3; }
.thumb[aria-selected='true'] { border-color: var(--ink); }
.thumb-3d { display: grid; place-content: center; justify-items: center; gap: 2px; color: var(--ink); font-size: 11px; letter-spacing: 0.14em; }
.thumb-3d svg { font-size: 30px; }

.stage {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: calc(100vh - 60px);
  width: 100%;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 30%, #f6f4f0 0%, var(--stage) 55%, var(--stage-2) 100%);
  transition: background 0.4s;
}
.stage { container-type: inline-size; }
.stage:fullscreen { aspect-ratio: auto; max-height: none; width: 100vw; height: 100vh; }
.stage:-webkit-full-screen { aspect-ratio: auto; max-height: none; width: 100vw; height: 100vh; }
.stage:fullscreen .viewer-tools { bottom: 28px; }
.stage.is-expanded { position: fixed; inset: 0; z-index: 1000; aspect-ratio: auto; max-height: none; width: auto; height: 100dvh; }
.stage.is-expanded .viewer-tools { bottom: max(20px, env(safe-area-inset-bottom)); }
html.stage-expanded { overflow: hidden; }
html.stage-expanded .gallery { z-index: 1000; }
.stage[data-theme='dark'] { background: radial-gradient(120% 90% at 50% 30%, #3a3733 0%, #252321 60%, #191817 100%); }
.stage-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--stage); }
.stage[data-mode='3d'] .stage-img { display: none; }
.stage[data-mode='img'] .stage-3d { visibility: hidden; }
.stage-3d { position: absolute; inset: 0; }
.viewer-host { position: absolute; inset: 0; }
.viewer-host canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.viewer-hint, .viewer-finish, .viewer-measure {
  position: absolute;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  pointer-events: none;
}
.viewer-hint { top: 16px; left: 18px; }
.viewer-finish { top: 16px; right: 18px; font-family: var(--serif); font-style: italic; font-size: 18px; letter-spacing: 0.01em; text-transform: none; color: var(--ink); }
.viewer-measure { top: 44px; left: 18px; color: var(--accent); font-weight: 400; }
.stage[data-theme='dark'] .viewer-hint { color: #bdb5aa; }
.stage[data-theme='dark'] .viewer-finish { color: #f1ebe2; }
.stage[data-theme='dark'] .viewer-measure { color: #f0a493; }

.measure-label {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  padding: 4px 9px;
  font-size: 12px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.viewer-tools {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 24px rgba(40, 30, 20, 0.08);
  max-width: calc(100% - 24px);
}
.viewer-tools button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 58px;
  padding: 7px 6px 6px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}
.viewer-tools button svg { font-size: 19px; }
.viewer-tools button:hover { background: #f1ede6; color: var(--ink); }
.viewer-tools button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.tool-sep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--line); }
@container (max-width: 760px) {
  .viewer-tools button { min-width: 0; padding: 8px 8px; }
  .viewer-tools button span { display: none; }
  .viewer-tools button svg { font-size: 20px; }
}
@container (max-width: 400px) {
  .viewer-tools button { padding: 7px 5px; }
  .viewer-tools button svg { font-size: 18px; }
  .tool-sep { margin: 6px 1px; }
  .viewer-hint { display: none; }
}

.viewer-progress {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.viewer-progress[hidden], .viewer-error[hidden], .viewer-measure[hidden] { display: none; }
.viewer-progress .bar { width: 180px; height: 1px; background: rgba(0, 0, 0, 0.12); overflow: hidden; }
.viewer-progress .bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.2s; }
.viewer-error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(80%, 420px);
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
}

.info { padding-top: 4px; }
.eyebrow { margin: 0 0 8px; font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); }
.pdp-title { font: 400 clamp(36px, 4vw, 52px)/1.04 var(--serif); margin: 0 0 18px; }
.lede { font-size: 15.5px; color: var(--ink-2); margin: 0 0 24px; max-width: 46ch; }

.option { border-top: 1px solid var(--line); padding: 20px 0 6px; }
.option-label { margin: 0 0 14px; font-size: 13px; letter-spacing: 0.02em; color: var(--ink-2); }
.option-label strong { font-weight: 400; color: var(--ink); }
.finish-group { margin-bottom: 14px; }
.finish-group-name { margin: 0 0 8px; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  outline: 1px solid transparent;
  outline-offset: 3px;
  transition: outline-color 0.15s, transform 0.15s;
}
.swatch:hover { outline-color: #b7afa3; }
.swatch[aria-pressed='true'] { outline-color: var(--ink); }

.variants { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.variant { height: 40px; min-width: 64px; padding: 0 16px; border: 1px solid #d6d0c6; background: var(--surface); font-size: 13px; }
.variant:hover { border-color: var(--ink); }
.variant[aria-pressed='true'] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.btn svg { font-size: 18px; }
.btn-primary { background: var(--ink); color: #fff; transition: background 0.2s; }
.btn-primary:hover { background: #3a352f; }
.btn-meta { opacity: 0.6; letter-spacing: 0.06em; }

.pending-note { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; color: var(--ink-2); font-size: 14px; }
.pending-note .option-label { color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em; font-size: 11.5px; font-weight: 400; margin-bottom: 8px; }
.pending-note p:last-child { margin: 0; }

.specs { margin: 24px 0 0; border-top: 1px solid var(--line); }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.specs dt { color: var(--ink-2); }
.specs dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fineprint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .pdp-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery { position: static; grid-template-columns: minmax(0, 1fr); }
  .thumbs { flex-direction: row; order: 2; overflow-x: auto; }
  .thumb { width: 64px; flex: none; }
  .pager span { display: none; }
}
@media (max-width: 560px) {
  .promo { font-size: 10px; letter-spacing: 0.1em; }
  .collection-head { flex-direction: column; gap: 4px; }
  .sort { width: 100%; }
  .sort select { flex: 1; min-width: 0; }
  .card-title { font-size: 19px; }
  .card-swatches .dot:nth-child(n + 5) { display: none; }
}

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