/* AURA One — Atelier. Dark studio-gallery: near-black grounds, warm ivory
   text, one metallic accent per finish, serif display + mono annotations. */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('fonts/plexmono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('fonts/plexmono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #0b0a09;
  --ivory: #ece3d1;
  --ivory-dim: #a99f8b;
  --accent: #9aa6b2;
  --hairline: rgba(236, 227, 209, 0.14);
  --serif: 'Fraunces', 'Georgia', serif;
  --mono: 'Plex Mono', 'SFMono-Regular', monospace;
  --ease-slow: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: auto; }

body {
  background-color: var(--bg);
  color: var(--ivory);
  font-family: var(--serif);
  font-weight: 340;
  overflow-x: hidden;
  transition: background-color 1.4s var(--ease-slow);
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- stage layers ---------- */
#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
  cursor: grab;
  touch-action: pan-y;            /* vertical swipe scrolls, horizontal turns the piece */
}
#stage:active { cursor: grabbing; }

#grain {
  position: fixed; inset: -50%; z-index: 3; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grain 1.1s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1.4%); }
  66% { transform: translate(1.6%, -1%); }
  100% { transform: translate(0, 0); }
}

#vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 90% 75% at 50% 46%, transparent 58%, rgba(0,0,0,0.42) 100%);
}

/* ---------- veil ---------- */
#veil {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity 1.2s var(--ease-slow), visibility 1.2s;
}
#veil.gone { opacity: 0; visibility: hidden; }
.veil-inner { text-align: center; }
.veil-mark {
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 300;
  letter-spacing: 0.32em;
  margin-left: 0.32em;
  animation: veilbreathe 2.6s ease-in-out infinite;
}
@keyframes veilbreathe { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
.veil-sub { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ivory-dim); margin-top: 1.2rem; }
.veil-bar { width: 120px; height: 1px; background: var(--hairline); margin: 1.6rem auto 0; overflow: hidden; }
.veil-bar span { display: block; height: 100%; width: 40%; background: var(--ivory); animation: veilbar 1.4s ease-in-out infinite; }
@keyframes veilbar { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }

/* ---------- masthead ---------- */
#masthead {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.4rem 2rem;
  pointer-events: none;
}
.wordmark {
  font-size: 1.15rem; letter-spacing: 0.26em; color: var(--ivory);
  text-decoration: none; pointer-events: auto; font-weight: 400;
}
.wordmark span { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em; color: var(--ivory-dim); margin-left: 0.7em; vertical-align: 0.35em; }
.masthead-meta { color: var(--ivory-dim); font-size: 0.6rem; }

/* ---------- chapter rail ---------- */
#rail {
  position: fixed; right: 1.6rem; top: 50%; transform: translateY(-50%);
  z-index: 20; display: flex; flex-direction: column; gap: 1.05rem;
}
.rail-item {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--ivory-dim);
  flex-direction: row-reverse;
}
.rail-num { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.12em; opacity: 0.65; transition: opacity 0.4s; }
.rail-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: 0.4;
  transition: transform 0.6s var(--ease-slow), opacity 0.4s, background 0.4s;
}
.rail-label {
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0; transform: translateX(6px);
  transition: opacity 0.5s, transform 0.5s var(--ease-slow);
}
.rail-item:hover .rail-label, .rail-item.active .rail-label { opacity: 0.9; transform: translateX(0); }
.rail-item.active { color: var(--ivory); }
.rail-item.active .rail-dot { opacity: 1; transform: scale(1.7); background: var(--accent); }
.rail-item.active .rail-num { opacity: 1; }

/* ---------- chapters ---------- */
#scroll-root { position: relative; z-index: 10; pointer-events: none; }
#scroll-root :is(a, button, input, .panel) { pointer-events: auto; }

.chapter { position: relative; padding: 0 2rem; }
.panel, .hero-copy { user-select: none; -webkit-user-select: none; }
.hero { min-height: 170vh; }
.materials { min-height: 190vh; }
.anatomy { min-height: 260vh; }
.light { min-height: 170vh; }
.space { min-height: 190vh; }
.specs { min-height: 130vh; display: flex; align-items: center; }
.reserve { min-height: 150vh; display: flex; align-items: center; }

.panel {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 24rem;
}
.materials .panel, .space .panel { margin-left: clamp(0rem, 6vw, 7rem); }
.light .panel { margin-left: auto; margin-right: clamp(0rem, 6vw, 7rem); align-items: flex-start; }
.panel-top { justify-content: flex-start; padding-top: 16vh; }
.panel-wide { max-width: 40rem; margin: 0 auto; }

.hero-copy {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: 12vh;
  max-width: 30rem;
  margin-left: clamp(0rem, 6vw, 7rem);
}

.kicker { color: var(--accent); margin-bottom: 1.6rem; transition: color 1s; }
.display {
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  font-weight: 320;
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.display em { font-style: italic; font-weight: 300; color: var(--accent); transition: color 1s; }
.lede, .body {
  margin-top: 1.7rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ivory-dim);
  max-width: 21rem;
}
.hint { margin-top: 2.6rem; color: var(--ivory-dim); display: flex; gap: 1.8rem; font-size: 0.62rem; }
.hint .hint-drag { color: var(--ivory); }

/* ---------- swatches ---------- */
.swatches { display: flex; gap: 1.1rem; margin-top: 2.4rem; }
.swatch {
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 1px solid var(--hairline);
  cursor: pointer; position: relative;
  transition: transform 0.5s var(--ease-slow);
}
.swatch::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color 0.5s, transform 0.6s var(--ease-slow);
  transform: scale(0.8);
}
.swatch:hover { transform: translateY(-3px); }
.swatch.active::after { border-color: var(--accent); transform: scale(1); }
.sw-graphite { background: radial-gradient(circle at 32% 30%, #454c56, #17191d 68%); }
.sw-pearl { background: radial-gradient(circle at 32% 30%, #fbf6ea, #cfc4ae 68%); }
.sw-copper { background: radial-gradient(circle at 32% 30%, #e2a06a, #7e4425 68%); }
.finish-name { margin-top: 1.4rem; color: var(--ivory-dim); }
.finish-name b { color: var(--ivory); font-weight: 500; }

/* ---------- env switch ---------- */
.env-switch { display: flex; gap: 0; margin-top: 2.4rem; border: 1px solid var(--hairline); border-radius: 2rem; overflow: hidden; }
.env-btn {
  appearance: none; background: transparent; border: 0; color: var(--ivory-dim);
  padding: 0.72rem 1.5rem; cursor: pointer; font-size: 0.66rem;
  transition: color 0.4s, background 0.4s;
}
.env-btn + .env-btn { border-left: 1px solid var(--hairline); }
.env-btn:hover { color: var(--ivory); }
.env-btn.active { color: var(--bg); background: var(--ivory); }

/* ---------- room controls ---------- */
.room-controls { margin-top: 2.4rem; max-width: 19rem; }
.room-controls label { color: var(--ivory-dim); display: block; margin-bottom: 0.9rem; }
.room-controls label b { color: var(--ivory); font-weight: 500; }
#room-scale {
  width: 100%; appearance: none; height: 1px; background: var(--hairline);
  outline: none; cursor: ew-resize;
}
#room-scale::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ivory); border: 1px solid var(--bg);
  transition: transform 0.3s var(--ease-slow);
}
#room-scale::-webkit-slider-thumb:hover { transform: scale(1.25); }
#room-scale::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ivory); border: 1px solid var(--bg); }
.room-controls .hint { margin-top: 1.3rem; display: block; }

/* ---------- annotations ---------- */
#annotations { position: fixed; inset: 0; z-index: 15; pointer-events: none; }
.anno {
  position: absolute; top: 0; left: 0;
  display: flex; align-items: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
}
.anno-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 12px var(--accent); }
.anno-line { width: 3.2rem; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); flex: none; }
.anno-left { flex-direction: row-reverse; }
.anno-left .anno-line { background: linear-gradient(-90deg, var(--accent), transparent); }
.anno-left { transform-origin: right; }
.anno-text { display: flex; flex-direction: column; gap: 0.25rem; white-space: nowrap; }
.anno-left .anno-text { text-align: right; align-items: flex-end; }
.anno-text b { font-family: var(--mono); font-weight: 500; font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ivory); }
.anno-text i { font-family: var(--mono); font-style: normal; font-size: 0.58rem; letter-spacing: 0.1em; color: var(--ivory-dim); }

/* ---------- specs ---------- */
.spec-grid {
  margin-top: 2.8rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--hairline);
}
.spec-grid > div {
  padding: 1.15rem 0.4rem 1.15rem 0;
  border-bottom: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.spec-grid dt { color: var(--accent); font-size: 0.6rem; transition: color 1s; }
.spec-grid dd { font-size: 0.98rem; color: var(--ivory); font-weight: 340; }

/* ---------- reserve ---------- */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 2.8rem; }
.tier {
  border: 1px solid var(--hairline);
  padding: 1.7rem 1.5rem 1.6rem;
  border-radius: 2px;
  background: rgba(11, 10, 9, 0.55);
  backdrop-filter: blur(8px);
  transition: transform 0.6s var(--ease-slow), border-color 0.5s;
}
.tier:hover { transform: translateY(-5px); border-color: var(--accent); }
.tier-lead { border-color: rgba(236, 227, 209, 0.32); }
.tier h3 { font-size: 1.25rem; font-weight: 400; font-style: italic; }
.tier-note { color: var(--ivory-dim); font-size: 0.58rem; margin-top: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; }
.price { font-size: 2rem; font-weight: 300; margin-top: 1.3rem; }
.btn-reserve {
  margin-top: 1.4rem; width: 100%;
  appearance: none; background: transparent; border: 1px solid var(--hairline);
  color: var(--ivory); padding: 0.8rem 0.5rem; cursor: pointer;
  font-size: 0.6rem; letter-spacing: 0.14em;
  position: relative; overflow: hidden;
  transition: color 0.45s, border-color 0.45s;
}
.btn-reserve::before {
  content: ''; position: absolute; inset: 0; background: var(--ivory);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease-slow);
  z-index: -1;
}
.btn-reserve:hover { color: var(--bg); border-color: var(--ivory); }
.btn-reserve:hover::before { transform: scaleX(1); }
.btn-reserve.done { color: var(--bg); border-color: var(--accent); }
.btn-reserve.done::before { transform: scaleX(1); background: var(--accent); }
.btn-reserve span { position: relative; z-index: 1; }

/* ---------- colophon ---------- */
#colophon {
  padding: 4rem 2rem 3rem;
  text-align: center;
  color: var(--ivory-dim);
  display: flex; flex-direction: column; gap: 0.6rem;
}
#colophon .dim { opacity: 0.5; }

/* ---------- reveals ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.1s var(--ease-slow), transform 1.1s var(--ease-slow); }
.reveal.revealed { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  #grain { animation: none; }
}

/* ---------- fallback ---------- */
#fallback { display: none; }
.no-webgl #fallback {
  display: flex; position: fixed; inset: 0; z-index: 5;
  flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
  text-align: center; color: var(--ivory-dim); pointer-events: none;
}
.no-webgl #stage { display: none; }
.fallback-disc {
  width: min(46vw, 320px); height: min(46vw, 320px); border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(236,227,209,0.28), transparent 42%),
    radial-gradient(circle at 50% 50%, #23262c 0%, #101114 58%, #0b0a09 100%);
  box-shadow: 0 40px 90px rgba(0,0,0,0.6), inset 0 0 60px rgba(0,0,0,0.5);
}
.noscript-note { position: fixed; bottom: 1rem; left: 0; right: 0; text-align: center; color: var(--ivory-dim); z-index: 60; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  #masthead { padding: 1.1rem 1.2rem; }
  .masthead-meta { display: none; }
  #rail { right: 0.8rem; gap: 0.85rem; }
  .rail-label { display: none; }
  .chapter { padding: 0 1.2rem; }
  .hero { min-height: 150vh; }
  .hero-copy { margin-left: 0; max-width: 100%; padding-bottom: 9vh; }
  .materials .panel, .light .panel, .space .panel { margin: 0; max-width: 100%; }
  .panel { justify-content: flex-end; padding-bottom: 10vh; }
  .panel-top { justify-content: flex-start; padding-top: 12vh; }
  .display { font-size: clamp(2.3rem, 9.5vw, 3rem); }
  .lede, .body { font-size: 0.95rem; max-width: 100%; }
  .spec-grid { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: 1fr; }
  .anno-line { width: 1.6rem; }
  .anno-text b { font-size: 0.56rem; }
  .anno-text i { display: none; }
  .hint { flex-direction: column; gap: 0.5rem; }
}
