/* Khanna Gems theme (from the Figma): ivory ground, ink serif capitals, crimson + gold accents */
:root {
  --fg: #1c1a17;
  --fg-soft: rgba(28, 26, 23, 0.7);
  --ivory: #f5f1ea;
  --cream: #f4ede1;
  --gold: #c5a059;
  --gold-soft: rgba(197, 160, 89, 0.55);
  --red: #b3141c;
  --red-hover: #95101a;
  --logo-main: #b3141c;
  --logo-accent: #c5a059;
  --shadow: none;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", system-ui, sans-serif;
}

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

html, body { background: #ffffff; }

body {
  font-family: var(--sans);
  color: var(--fg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.dark { --logo-main: #e3c07a; }

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: pan-y;
}
#scene.grab { cursor: grab; }
#scene.grabbing { cursor: grabbing; }

#scroll-space { height: 1100vh; }

/* ---------- overlays ---------- */
.scrim, .vignette, .grain { position: fixed; inset: 0; pointer-events: none; }
.scrim {
  opacity: 0;
  background: linear-gradient(90deg, rgba(8, 7, 6, 0.6) 0%, rgba(8, 7, 6, 0) 45%, rgba(8, 7, 6, 0) 55%, rgba(8, 7, 6, 0.6) 100%);
}
.vignette {
  opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.75) 100%);
}
.grain {
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 20; }
.progress span { display: block; height: 100%; width: 0; background: var(--red); }

.logo { display: block; width: 150px; height: 48px; overflow: visible; }

.loader {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #ffffff;
  transition: opacity 0.9s ease, visibility 0.9s;
}
.loader .logo { width: 220px; height: 70px; animation: pulse 1.6s ease-in-out infinite; }
.loader em { font: 500 10px var(--sans); letter-spacing: 0.3em; color: #9a8f80; font-style: normal; }
.loader.done { opacity: 0; visibility: hidden; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------- header: nav · logo · consultation ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 20px 4.5vw;
  color: var(--fg);
}
.topbar nav { display: flex; gap: 30px; }
.topbar nav a {
  color: inherit; text-decoration: none; font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  opacity: 0.85; transition: opacity 0.3s, color 0.3s; padding-bottom: 4px; border-bottom: 1px solid transparent;
}
.topbar nav a:hover { opacity: 1; color: var(--gold); border-bottom-color: var(--gold); }
.brand { justify-self: center; display: block; }
.topbar .btn { justify-self: end; }

.btn {
  display: inline-block; padding: 11px 22px; border: 1px solid var(--gold);
  border-radius: 2px; color: inherit; text-decoration: none;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; white-space: nowrap;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.btn:hover { background: var(--gold); color: #16110a; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.red:hover { background: var(--red-hover); border-color: var(--red-hover); }

/* ---------- captions ---------- */
.caption {
  position: fixed; z-index: 5; pointer-events: none;
  max-width: 520px; opacity: 0; visibility: hidden;
  text-shadow: var(--shadow);
  will-change: opacity, transform;
}
.caption.left { left: 6vw; bottom: 14vh; }
.caption.right { right: 6vw; bottom: 14vh; text-align: right; }
.caption.hero { left: 6vw; bottom: 9vh; max-width: 980px; }

.eyebrow {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--red); margin-bottom: 16px; font-weight: 500;
}
body.dark .caption .eyebrow { color: #e0b46a; }
.caption h1, .caption h2 {
  font-family: var(--serif); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--fg);
}
.caption h1 { font-size: clamp(44px, 5.8vw, 90px); line-height: 1.02; }
.caption h2 { font-size: clamp(32px, 3.6vw, 54px); line-height: 1.06; }
.caption em { font-style: normal; color: var(--gold); }
.caption p:not(.eyebrow) {
  margin-top: 22px; font-size: 14px; line-height: 1.8; color: var(--fg-soft);
  font-weight: 400; max-width: 400px;
}
.caption.right p:not(.eyebrow) { margin-left: auto; }
.caption.hero .lead { font-size: 15px; max-width: 460px; }
.caption h2 + p::before, .caption h1 + p::before {
  content: ""; display: block; width: 64px; height: 1px; background: var(--gold); margin-bottom: 20px;
}
.caption.right h2 + p::before { margin-left: auto; }

.scroll-hint {
  position: fixed; left: 50%; bottom: 4vh; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--fg); pointer-events: none; z-index: 5;
}
.scroll-hint i {
  width: 1px; height: 46px; background: linear-gradient(var(--red), transparent);
  animation: drip 1.8s ease-in-out infinite; transform-origin: top;
}
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* trust badges, as in the Figma hero */
.badges {
  position: fixed; right: 4.5vw; top: 50%; transform: translateY(-50%); z-index: 5;
  display: flex; flex-direction: column; gap: 18px; padding-left: 18px;
  border-left: 1px solid var(--gold-soft); pointer-events: none; opacity: 0;
}
.badges p {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg);
  display: flex; align-items: center; gap: 12px;
}
.badges p::before {
  content: ""; width: 7px; height: 7px; border: 1px solid var(--gold); transform: rotate(45deg); flex: none;
}

/* ---------- specs ---------- */
.specs { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
.gem-head {
  position: absolute; top: 13vh; left: 50%; transform: translateX(-50%);
  text-align: center; opacity: 0; width: 90vw;
}
.gem-head .eyebrow { margin-bottom: 10px; color: #e0b46a; }
.gem-head h3 {
  font-family: var(--serif); font-weight: 400; text-transform: uppercase; letter-spacing: 0.03em;
  font-size: clamp(30px, 3.2vw, 48px); color: var(--cream); line-height: 1;
}
.gem-sub {
  margin-top: 12px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(244, 237, 225, 0.62);
}
.swap { transition: opacity 0.25s ease; }
.swapping { opacity: 0 !important; }

.col {
  position: absolute; top: 52%; transform: translateY(-50%);
  list-style: none; display: flex; flex-direction: column; gap: 32px;
  width: min(300px, 25vw);
}
.col.l { left: 7vw; text-align: right; }
.col.r { right: 7vw; }
.spec { opacity: 0; }
.spec .k {
  display: block; font-size: 10px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}
.spec .v {
  display: block; font-family: var(--serif); font-size: 25px; font-weight: 400;
  color: var(--cream); line-height: 1.1;
}
.spec .rule {
  display: block; height: 1px; margin-top: 12px;
  background: linear-gradient(90deg, transparent, var(--gold-soft));
}
.col.r .spec .rule { background: linear-gradient(90deg, var(--gold-soft), transparent); }

.drag-hint {
  position: absolute; left: 50%; bottom: 17vh; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(244, 237, 225, 0.55); opacity: 0;
}

.stone-bar {
  position: fixed; left: 50%; bottom: 5vh; transform: translateX(-50%);
  display: flex; align-items: center; gap: 22px; z-index: 8;
  opacity: 0; pointer-events: none;
}
.stone-bar.live { pointer-events: auto; }
.picker {
  display: flex; gap: 4px; padding: 5px; border-radius: 3px;
  background: rgba(14, 12, 10, 0.6); border: 1px solid rgba(197, 160, 89, 0.35);
  backdrop-filter: blur(10px);
}
.gem-btn {
  display: flex; align-items: center; gap: 9px; padding: 8px 13px 8px 10px;
  border-radius: 2px; border: 0; background: transparent; cursor: pointer;
  color: rgba(244, 237, 225, 0.7); font: 500 10.5px var(--sans); letter-spacing: 0.12em;
  text-transform: uppercase; transition: background 0.3s, color 0.3s;
}
.gem-btn i {
  width: 11px; height: 11px; transform: rotate(45deg); border-radius: 1px;
  background: var(--c); box-shadow: 0 0 10px var(--c);
}
.gem-btn:hover { color: var(--cream); }
.gem-btn.active { background: rgba(197, 160, 89, 0.2); color: var(--cream); }

/* ---------- chapters ---------- */
.chapters {
  position: fixed; left: 26px; top: 50%; transform: translateY(-50%); z-index: 9;
  display: flex; flex-direction: column; gap: 16px;
}
.chapters button {
  display: flex; align-items: center; gap: 12px;
  background: none; border: 0; cursor: pointer; color: var(--fg);
  font: 500 10px var(--sans); letter-spacing: 0.2em; text-transform: uppercase;
}
.chapters button span { opacity: 0; transform: translateX(-6px); transition: opacity 0.3s, transform 0.3s; }
.chapters button:hover span, .chapters button.active span { opacity: 0.85; transform: none; }
.chapters button i {
  order: -1; width: 7px; height: 7px; border: 1px solid currentColor; transform: rotate(45deg);
  transition: background 0.3s, border-color 0.3s;
}
.chapters button.active i { background: var(--red); border-color: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .topbar nav { gap: 18px; } .topbar nav a { font-size: 10px; } }
@media (max-width: 820px) {
  .topbar { padding: 14px 20px; grid-template-columns: auto 1fr; }
  .topbar nav { display: none; }
  .brand { justify-self: start; }
  .logo { width: 118px; height: 38px; }
  .btn { padding: 9px 14px; font-size: 9.5px; }
  .chapters, .badges { display: none; }

  .caption, .caption.hero { left: 20px; right: 20px; max-width: none; bottom: 12vh; }
  .caption.right { text-align: left; }
  .caption.right p:not(.eyebrow), .caption.right h2 + p::before { margin-left: 0; }

  .gem-head { top: 10vh; }
  .col { top: auto; bottom: 19vh; transform: none; gap: 14px; width: calc(50vw - 30px); }
  .col.l { left: 20px; text-align: left; }
  .col.r { right: 20px; }
  .spec .v { font-size: 19px; }
  .spec .k { font-size: 9px; margin-bottom: 3px; }
  .spec .rule { display: none; }
  .drag-hint { display: none; }

  .stone-bar { bottom: 3vh; flex-direction: column; gap: 10px; width: calc(100vw - 40px); }
  .gem-btn { padding: 8px 10px; }
  .gem-btn span { display: none; }
}
