:root {
  --paper: #f5f5f7;
  --surface: #ffffff;
  --ink: #161616;
  --muted: #6e6e73;
  --line: #dcdce0;
  --red: #c8102e;
  --red-dark: #9c0c22;
  --black-part: #161616;
  --white-part: #f2f2ef;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-plate: "Oswald", "Arial Narrow", sans-serif;
  --shadow-soft: 0 20px 60px -25px rgba(22,22,22,0.25);
  --shadow-tight: 0 2px 10px -4px rgba(22,22,22,0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 5vw;
  background: rgba(245,245,247,0.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 14px;
  color: var(--ink);
}
.brand-mark { width: 26px; height: 26px; }
.header-meta { font-size: 13px; color: var(--muted); }

/* ---------- Hero / Layout ---------- */
.hero { padding: 48px 5vw 40px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}

.viewer-col { position: sticky; top: 96px; }

.viewer-tabs {
  display: inline-flex;
  padding: 4px;
  background: #e8e8ea;
  border-radius: 999px;
  margin-bottom: 16px;
}
.viewer-tab {
  border: none;
  background: transparent;
  padding: 9px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.viewer-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-tight);
}

.viewer-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #eeeeef 100%);
  box-shadow: var(--shadow-soft);
}
.viewer-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.viewer-panel.is-active { opacity: 1; pointer-events: auto; }

.carousel { position: relative; width: 100%; height: 100%; overflow: hidden; }
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform .5s cubic-bezier(.65,0,.35,1);
}
.carousel-track img { width: 100%; height: 100%; object-fit: cover; flex-shrink: 0; }
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-tight);
}
.carousel-nav.prev { left: 16px; }
.carousel-nav.next { right: 16px; }
.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.carousel-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(22,22,22,0.25);
  transition: background .2s ease;
}
.carousel-dots span.is-active { background: var(--ink); }

#three-canvas-wrap { position: relative; width: 100%; height: 100%; cursor: grab; }
#three-canvas-wrap:active { cursor: grabbing; }
#three-canvas { width: 100%; height: 100%; display: block; }
#three-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted);
  background: linear-gradient(180deg, #ffffff 0%, #eeeeef 100%);
  transition: opacity .3s ease;
}
#three-loading.is-hidden { opacity: 0; pointer-events: none; }

.viewer-caption {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
}

/* ---------- Info column ---------- */
.info-col { padding-top: 6px; }
.eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 10px;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  line-height: 1.08;
}
.lede { font-size: 16px; line-height: 1.6; color: #3a3a3d; max-width: 52ch; margin: 0 0 22px; }

.meta-row { margin-bottom: 18px; }
.price { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.price small { display: block; font-family: var(--font-body); font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 2px; }

.spec-chips { display: flex; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }
.chip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.chip-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------- Form ---------- */
.order-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-tight);
}
.order-form h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 20px;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field label .req { font-weight: 400; color: var(--muted); }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-plate);
  font-size: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #fbfbfc;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input#email { font-family: var(--font-body); text-transform: none; letter-spacing: normal; font-size: 14.5px; }
.field input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22,22,22,0.08);
  outline: none;
}
.field-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.field-error { font-size: 12px; color: var(--red); margin: 6px 0 0; }
.field input.is-invalid { border-color: var(--red); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.dot-black { background: var(--black-part); }
.dot-red { background: var(--red); }

.color-swatches { display: flex; gap: 10px; margin-top: 6px; }
.swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--swatch);
  cursor: pointer;
  padding: 0;
  transition: transform .15s ease, border-color .15s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch.is-active { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

.field-toggle { margin-bottom: 16px; }
.toggle {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.toggle input[type="checkbox"] {
  appearance: none;
  width: 38px; height: 22px;
  border-radius: 999px;
  background: #d7d7db;
  position: relative;
  cursor: pointer;
  transition: background .2s ease;
  flex-shrink: 0;
}
.toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform .2s ease;
}
.toggle input[type="checkbox"]:checked { background: var(--red); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(16px); }
.field-conditional {
  margin-top: 10px;
  padding-left: 2px;
  animation: reveal .25s ease;
}
@keyframes reveal { from { opacity: 0; transform: translateY(-4px);} to { opacity: 1; transform: translateY(0);} }

.btn-primary {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
  margin-top: 4px;
}
.btn-primary:hover { background: #000; }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { background: #b7b7bb; cursor: not-allowed; }
.form-status {
  margin: 12px 0 0;
  font-size: 13px;
  min-height: 18px;
}
.form-status.is-error { color: var(--red-dark); }
.form-status.is-ok { color: #1c7a3c; }

/* ---------- How it works ---------- */
.how-it-works {
  max-width: 1000px;
  margin: 40px auto 0;
  padding: 60px 5vw 90px;
  border-top: 1px solid var(--line);
}
.how-it-works h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  text-align: center;
}
.section-lede { text-align: center; color: var(--muted); margin: 0 0 40px; }
.steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 20px;
}
.step-num {
  display: block;
  font-family: var(--font-plate);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 10px;
}
.steps p { margin: 0; font-size: 14px; line-height: 1.55; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 5vw 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.footer-links { display: flex; gap: 20px; font-size: 13.5px; font-weight: 500; }
.footer-links a:hover { color: var(--red); }
.footer-fine { flex-basis: 100%; font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .viewer-col { position: static; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .site-header { padding: 14px 5vw; }
  .hero { padding: 28px 5vw 30px; }
  .order-form { padding: 20px; }
  .steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   Checkout + success pages (same tokens as the rest of the site)
   ============================================================ */

.checkout-main { padding: 40px 5vw 80px; }
.checkout-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 48px;
  max-width: 1080px;
  margin: 0 auto;
  align-items: start;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 18px;
}
.back-link:hover { color: var(--ink); }

.checkout-form-col h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.checkout-lede { color: var(--muted); font-size: 15px; margin: 0 0 26px; }

.checkout-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-tight);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* checkout inputs: normal casing (not the plate-style uppercase) */
.checkout-form .field input {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: normal;
  font-size: 14.5px;
}

.pay-note {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 0;
  text-align: center;
}

/* ---- order summary ---- */
.summary-col { position: sticky; top: 96px; }
.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-soft);
}
.summary-card h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 18px;
}
.summary-empty { font-size: 14px; color: var(--muted); line-height: 1.6; }
.summary-empty a { color: var(--red); font-weight: 600; }

.summary-line-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-weight: 600;
  font-size: 15px;
}
.summary-item-price { font-family: var(--font-display); }

.summary-specs {
  margin: 16px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.summary-specs div { display: flex; justify-content: space-between; gap: 12px; }
.summary-specs dt { font-size: 12.5px; color: var(--muted); margin: 0; }
.summary-specs dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-plate);
  letter-spacing: 0.02em;
  text-align: right;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.summary-price { font-family: var(--font-display); font-size: 22px; }
.summary-fine { font-size: 11.5px; color: var(--muted); margin: 14px 0 0; }

/* ---- success page ---- */
.success-main {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 5vw 90px;
}
.success-card {
  max-width: 540px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-soft);
}
.success-check { margin: 0 auto 20px; width: 52px; height: 52px; }
.success-card h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.success-lede { font-size: 15px; line-height: 1.65; color: #3a3a3d; margin: 0 0 20px; }
.success-ref {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-plate);
  letter-spacing: 0.03em;
  margin: 0 0 20px;
}
.success-ref span { color: var(--ink); }
.success-followup { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0 0 28px; }
.success-followup a { color: var(--red); font-weight: 600; }
.success-btn { display: inline-block; width: auto; padding: 14px 28px; text-decoration: none; }

/* ---- checkout/success responsive ---- */
@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; gap: 28px; }
  .summary-col { position: static; order: -1; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .checkout-form, .summary-card { padding: 20px; }
  .success-card { padding: 32px 22px; }
}
