/* ORBIT — Halcyon configurator. Space Grotesk, warm gallery palette. */
:root {
  --paper: #e9e5dd;
  --paper-2: #ded9cf;
  --ink: #1a1613;
  --ink-soft: #4d453d;
  --line: rgba(26,22,19,.14);
  --line-2: rgba(26,22,19,.30);
  --walnut: #6a3d20;
  --amber: #c88a4a;
  --amber-deep: #a8672d;
  --panel-bg: #f4f1ea;
  --shadow: 0 1px 2px rgba(26,22,19,.06), 0 12px 40px rgba(26,22,19,.10);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-io: cubic-bezier(.62,.03,.28,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--amber); color: #fff; }
a { color: inherit; text-decoration: none; }

/* soft film grain over everything */
.grain {
  position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ============ TOP BAR ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: 62px; padding: 0 clamp(16px, 3vw, 34px);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(var(--paper), rgba(233,229,221,0));
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.6px solid var(--ink); position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; top: -3px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--amber-deep);
}
.brand-word { font-weight: 700; letter-spacing: .32em; font-size: 15px; padding-left: 2px; }
.topnav { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-soft); letter-spacing: .04em; }
.nav-sep { opacity: .5; }
.nav-edition { font-variant-numeric: tabular-nums; }
.topcart {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: .04em; color: var(--ink-soft);
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 100px;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.topcart:hover { border-color: var(--line-2); background: rgba(255,255,255,.4); }
.cart-count {
  display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--ink); color: var(--paper); border-radius: 100px;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) { .topnav { display: none; } }

/* ============ STAGE ============ */
.stage {
  display: grid;
  grid-template-columns: 1fr minmax(380px, 468px);
  min-height: 100svh;
}

/* ---- viewport ---- */
.viewport {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 18%, #f2eee6 0%, #e6e1d8 46%, #d3cdc1 100%);
  border-right: 1px solid var(--line);
}
.viewport::after { /* vignette floor grounding */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 55% at 50% 108%, rgba(26,22,19,.22), transparent 60%);
}
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1s var(--ease); }
#scene.ready { opacity: 1; }

.vp-poster { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .8s var(--ease); }
.vp-poster img { width: min(62%, 520px); filter: saturate(.96) contrast(1.02); mix-blend-mode: multiply; }
.vp-poster.hide { opacity: 0; pointer-events: none; }

/* loader */
.vp-loader {
  position: absolute; left: 50%; bottom: clamp(28px, 8vh, 74px); transform: translateX(-50%);
  z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 14px;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.vp-loader.done { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.loader-ring {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.6px solid var(--line-2); position: relative; animation: spin 3.2s linear infinite;
}
.loader-dot { position: absolute; top: -3px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--amber-deep); }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { text-align: center; }
.loader-pct { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.loader-cap { display: block; font-size: 11px; color: var(--ink-soft); letter-spacing: .05em; margin-top: 2px; }
.loader-bar { width: 190px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0%; background: var(--amber-deep); transition: width .3s var(--ease); }

/* marginalia */
.vp-marginalia { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.marg {
  position: absolute; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); opacity: .62; font-variant-numeric: tabular-nums;
}
.marg-tl { top: 78px; left: clamp(16px,3vw,34px); }
.marg-bl { top: 98px; left: clamp(16px,3vw,34px); color: var(--amber-deep); opacity: .82; }
.marg-br { top: 116px; left: clamp(16px,3vw,34px); }

/* hint */
.vp-hint {
  position: absolute; top: 76px; right: 22px; z-index: 5;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; letter-spacing: .04em; color: var(--ink-soft);
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 100px;
  background: rgba(244,241,234,.6); backdrop-filter: blur(4px);
  transition: opacity .6s var(--ease);
}
.vp-hint.fade { opacity: 0; }

/* badges */
.vp-badges { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 8px; }
.chip {
  font-size: 11px; letter-spacing: .04em; color: var(--ink-soft);
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 100px;
  background: rgba(244,241,234,.72); backdrop-filter: blur(6px);
  white-space: nowrap;
}
.chip-btn { cursor: pointer; transition: all .28s var(--ease); font-family: inherit; }
.chip-btn:hover { border-color: var(--line-2); color: var(--ink); }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-btn:focus-visible, .buy:focus-visible, .sw:focus-visible, .topcart:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 3px; }

/* ---- configurator panel ---- */
.panel {
  background: var(--panel-bg);
  position: relative; z-index: 2;
  box-shadow: -20px 0 60px rgba(26,22,19,.05);
}
.panel-scroll {
  height: 100svh; overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(76px, 8vh, 96px) clamp(26px, 3vw, 44px) 40px;
  display: flex; flex-direction: column; gap: 26px;
}
.panel-scroll::-webkit-scrollbar { width: 8px; }
.panel-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }

.eyebrow { display: flex; align-items: center; gap: 9px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.eyebrow-tick { width: 22px; height: 1px; background: var(--amber-deep); }

.headline {
  font-size: clamp(36px, 4.4vw, 54px); font-weight: 500; line-height: .98;
  letter-spacing: -.025em; margin-top: -4px;
}
.headline em { font-style: italic; color: var(--amber-deep); font-weight: 500; }

.lede { font-size: 15px; line-height: 1.62; color: var(--ink-soft); max-width: 40ch; }

/* groups */
.group { border-top: 1px solid var(--line); padding-top: 18px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.group-label { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.group-value { font-size: 16px; font-weight: 500; }
.group-note { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); margin-top: 13px; max-width: 42ch; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw {
  cursor: pointer; background: none; border: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-family: inherit;
}
.sw-face {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(145deg, var(--sw2), var(--sw));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 3px 8px rgba(26,22,19,.14);
  position: relative; transition: transform .34s var(--ease), box-shadow .34s var(--ease);
}
.sw-fab .sw-face { border-radius: 50%; }
.sw-face::after {
  content: ""; position: absolute; inset: -5px; border-radius: inherit;
  border: 1.5px solid var(--ink); opacity: 0; transform: scale(.85);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.sw-fab .sw-face::after { border-radius: 50%; }
.sw:hover .sw-face { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 8px 16px rgba(26,22,19,.2); }
.sw.is-active .sw-face::after { opacity: 1; transform: scale(1); }
.sw-tag { font-size: 11px; letter-spacing: .02em; color: var(--ink-soft); transition: color .3s var(--ease); }
.sw.is-active .sw-tag { color: var(--ink); font-weight: 500; }

/* spec */
.spec { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 9px; }
.spec-row { display: flex; justify-content: space-between; font-size: 13.5px; }
.spec-row span { color: var(--ink-soft); }
.spec-row b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* checkout */
.checkout { border-top: 1px solid var(--line); padding-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.price { display: flex; align-items: baseline; gap: 2px; position: relative; }
.price-cur { font-size: 18px; font-weight: 500; align-self: flex-start; margin-top: 6px; color: var(--ink-soft); }
.price-num { font-size: clamp(32px, 4vw, 40px); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price-sub { position: absolute; left: 2px; bottom: -15px; font-size: 11px; letter-spacing: .03em; color: var(--ink-soft); white-space: nowrap; }

.buy {
  cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--paper); background: var(--ink);
  border: none; border-radius: 100px; padding: 15px 22px;
  display: inline-flex; align-items: center; gap: 10px;
  position: relative; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.buy::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent, rgba(200,138,74,.9), transparent);
  transform: translateX(-140%); transition: transform .6s var(--ease);
}
.buy:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(26,22,19,.28); }
.buy:hover::before { transform: translateX(140%); }
.buy-arrow { transition: transform .3s var(--ease); }
.buy:hover .buy-arrow { transform: translateX(4px); }
.buy.added { background: var(--amber-deep); }

.fine { font-size: 11.5px; line-height: 1.5; color: var(--ink-soft); opacity: .85; margin-top: -6px; }

/* footer */
.foot {
  position: fixed; bottom: 0; left: 0; z-index: 8;
  width: calc(100% - min(468px, 100%));
  padding: 14px clamp(16px, 3vw, 34px);
  display: none; /* baked into viewport margins instead; keep semantic in DOM */
  font-size: 11px; color: var(--ink-soft);
}
.foot { display: flex; justify-content: space-between; }
.foot a { border-bottom: 1px solid transparent; transition: border-color .3s var(--ease); }
.foot a:hover { border-color: var(--line-2); }
.foot-right { display: flex; gap: 20px; align-items: center; }
.foot-guide { color: var(--amber-deep); }
@media (max-width: 900px) { .foot-right { gap: 14px; } }
@media (max-width: 480px) { .foot { flex-direction: column; gap: 8px; align-items: flex-start; } }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: 56svh auto; }
  .viewport { border-right: none; border-bottom: 1px solid var(--line); }
  .panel-scroll { height: auto; padding-top: 34px; }
  .foot { position: static; width: 100%; border-top: 1px solid var(--line); }
  .vp-hint, .vp-marginalia { display: none; }
}
@media (max-width: 480px) {
  .brand-word { letter-spacing: .24em; }
  .headline { font-size: 34px; }
  .swatches { gap: 8px; }
  .sw-face { width: 42px; height: 42px; }
  .checkout { flex-direction: column; align-items: stretch; }
  .buy { justify-content: center; }
  .price-sub { position: static; margin-top: 4px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .12s !important; }
  .loader-ring { animation: none; }
}
