/* ============================================================
   QUOTH — 3D app tour. Stage, HUD, intro, finale.
   ============================================================ */

:root {
  --bg: #0b0d10;
  --slate: #1a1d21;
  --card: #24292e;
  --line: #2f363d;
  --text: #c9d1d9;
  --dim: #8b949e;
  --gold: #f0e68c;
  --gold-deep: #e1b12c;
  --red: #d73a49;
  --emerald: #2ea06c;
  --cream: #f5eede;
  --grotesk: 'Space Grotesk', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --iserif: 'Instrument Serif', serif;
}

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

html { scroll-behavior: auto; }

body {
  background: radial-gradient(ellipse 120% 90% at 50% 20%, #14171c 0%, var(--bg) 55%, #07080a 100%);
  color: var(--text);
  font-family: var(--grotesk);
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--slate); }

#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

.floor-glow {
  position: fixed;
  left: 50%; bottom: -12vh;
  width: 110vw; height: 38vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 100% at 50% 100%, rgba(240, 230, 140, 0.07), transparent 70%);
  z-index: 1;
  pointer-events: none;
}

/* ---------- stage ---------- */
.stage {
  position: fixed; inset: 0;
  perspective: 1500px;
  perspective-origin: 50% 46%;
  z-index: 2;
  overflow: hidden;
}
.wscale {
  position: absolute;
  left: 50%; top: 50%;
  transform-style: preserve-3d;
}
.world {
  position: absolute;
  transform-style: preserve-3d;
}

/* the app element is centered on world origin in main.js via margins */

/* ---------- satellites ---------- */
.sat {
  position: absolute;
  font-family: var(--grotesk);
  opacity: 0;
  pointer-events: none;
}
.sat-invite {
  width: 300px;
  left: 490px; top: -150px;
  transform: translateZ(150px) rotateY(-14deg);
  background: rgba(36, 41, 46, 0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.3rem 1.4rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}
.si-title { font-size: 0.8rem; color: var(--dim); letter-spacing: 0.06em; }
.si-code {
  font-family: var(--mono);
  font-size: 1.7rem; letter-spacing: 0.28em;
  color: var(--gold);
  background: rgba(240, 230, 140, 0.06);
  border: 1px solid rgba(240, 230, 140, 0.25);
  border-radius: 8px;
  text-align: center;
  padding: 0.7rem 0.4rem;
  margin: 0.8rem 0 0.7rem;
}
.si-sub { font-size: 0.72rem; color: var(--dim); }

.sat-toast {
  left: 480px; top: 320px;
  transform: translateZ(190px) rotateY(-10deg);
  display: flex; align-items: center; gap: 0.8rem;
  background: rgba(36, 41, 46, 0.95);
  border: 1px solid rgba(46, 160, 108, 0.5);
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(46, 160, 108, 0.12);
}
.sat-toast b { display: block; font-size: 0.85rem; color: var(--text); }
.sat-toast span { font-size: 0.7rem; color: var(--dim); }

/* ---------- HUD ---------- */
.hud-top {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem 2rem;
  z-index: 40;
  pointer-events: none;
}
.hud-mark {
  font-family: var(--grotesk);
  font-weight: 700; font-size: 1rem; letter-spacing: 0.34em;
  color: var(--text);
}
.hud-cta {
  pointer-events: auto;
  font-family: var(--mono);
  font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--slate);
  background: var(--gold);
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border-radius: 4px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.hud-cta:hover { box-shadow: 0 0 28px rgba(240, 230, 140, 0.45); transform: translateY(-1px); }

.hud-caption {
  position: fixed; left: 2.4rem; bottom: 2.4rem;
  display: flex; flex-direction: column; gap: 0.55rem;
  z-index: 40;
  pointer-events: none;
  padding-left: 1.2rem;
  border-left: 3px solid var(--gold);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.hc-num {
  font-family: var(--mono);
  font-size: 0.95rem; letter-spacing: 0.34em;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(240, 230, 140, 0.55);
}
.hc-text {
  font-family: var(--grotesk);
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  font-weight: 700;
  line-height: 1.12;
  color: #ffffff;
  max-width: 22ch;
  text-shadow: 0 2px 18px rgba(7, 8, 10, 0.98), 0 0 44px rgba(7, 8, 10, 0.9);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.hud-caption.switching .hc-text { opacity: 0; transform: translateY(10px); }

.hud-dots {
  position: fixed; right: 1.8rem; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.8rem;
  z-index: 40;
  opacity: 0;
}
.hud-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(201, 209, 217, 0.25);
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.hud-dots i.on {
  background: var(--gold);
  transform: scale(1.5);
  box-shadow: 0 0 10px rgba(240, 230, 140, 0.7);
}

.hud-hint {
  position: fixed; left: 50%; bottom: 1.6rem;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.56rem; letter-spacing: 0.5em;
  color: var(--dim);
  z-index: 40;
  animation: hintpulse 2.4s ease-in-out infinite;
  transition: opacity 0.5s ease;
}
@keyframes hintpulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 0.2; } }

/* ---------- hero act ---------- */
.heroact {
  position: fixed; inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
}
.ha-film {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.ha-shade {
  will-change: opacity;
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(7, 8, 10, 0.82) 0%, rgba(7, 8, 10, 0.35) 45%, rgba(7, 8, 10, 0.15) 70%),
    linear-gradient(to top, rgba(7, 8, 10, 0.9) 0%, transparent 34%),
    linear-gradient(to bottom, rgba(7, 8, 10, 0.55) 0%, transparent 22%);
}
.ha-copy {
  position: absolute;
  left: clamp(2rem, 6vw, 7rem);
  top: 50%;
  transform: translateY(-58%);
  will-change: transform, opacity;
}
.ha-kicker {
  font-family: var(--mono);
  font-size: clamp(0.6rem, 0.9vw, 0.74rem);
  letter-spacing: 0.4em;
  color: var(--gold);
  margin-bottom: 1.6rem;
}
.ha-title {
  font-family: var(--iserif);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(3.2rem, 7.2vw, 6.6rem);
  line-height: 1.02;
  color: var(--cream);
  text-shadow: 0 4px 40px rgba(7, 8, 10, 0.8);
}
.ha-title em { font-style: italic; color: var(--gold); }
.ha-era {
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: clamp(0.58rem, 0.85vw, 0.72rem);
  letter-spacing: 0.42em;
  color: rgba(245, 238, 222, 0.55);
}
.ha-line {
  position: absolute;
  left: 0; top: 0;
  display: grid;
  font-size: 28px;
  line-height: 2.16;      /* matches the page's 34.56/16 ratio at any size */
  white-space: nowrap;
  opacity: 0;
  text-align: left;
  will-change: left, top, font-size;
}
.ha-line > span { grid-area: 1 / 1; white-space: nowrap; }
.hal-dig {
  font-family: 'Courier New', Courier, monospace;
  color: #3a3a3a;
  opacity: 0;
}
.hal-dig b { font-weight: 700; }
.ha-line .cursor {
  display: inline-block;
  width: 0.46em; height: 0.9em;
  background: currentColor;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: dotpulse 0.9s steps(1) infinite;
}

/* ---------- finale ---------- */
.finale {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  padding-bottom: 5.5vh;
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(7, 8, 10, 0.95) 30%, rgba(7, 8, 10, 0.6) 62%, rgba(7, 8, 10, 0.38) 100%);
}
.finale.live { pointer-events: auto; }
.finale h2 {
  font-family: var(--iserif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 4.6vw, 4rem);
  color: var(--cream);
  margin-bottom: 1.6rem;
}
.fin-cta {
  font-family: var(--grotesk);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--slate);
  background: var(--gold);
  text-decoration: none;
  padding: 1.05rem 2.4rem;
  border-radius: 6px;
  box-shadow: 0 0 0 rgba(240, 230, 140, 0);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}
.fin-cta:hover { box-shadow: 0 0 44px rgba(240, 230, 140, 0.5); transform: translateY(-2px); }
.fin-note {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.62rem; letter-spacing: 0.22em;
  color: var(--dim);
}
.fin-freq {
  display: inline-flex;
  margin-top: 1.6rem;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(36, 41, 46, 0.72);
  backdrop-filter: blur(4px);
}
.fin-freq button {
  font-family: var(--grotesk);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--dim);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0.42rem 1.1rem;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
}
.fin-freq button em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-left: 0.35rem;
  opacity: 0.85;
}
.fin-freq button.on {
  color: var(--slate);
  background: var(--gold);
}
.fin-freq button.on em { color: var(--slate); opacity: 0.75; }
.fin-freq button[data-freq="yearly"]:not(.on) {
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(240, 230, 140, 0.35), 0 0 10px rgba(240, 230, 140, 0.25);
  animation: yearlyGlow 1.6s ease-in-out infinite;
}
@keyframes yearlyGlow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(240, 230, 140, 0.35), 0 0 8px rgba(240, 230, 140, 0.2); }
  50% { box-shadow: inset 0 0 0 1px rgba(240, 230, 140, 0.7), 0 0 20px rgba(240, 230, 140, 0.55); }
}

.fin-tiers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.4rem;
  width: min(96vw, 1600px);
}
.fin-tier {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.15rem 1.2rem 1rem;
  background: rgba(36, 41, 46, 0.72);
  backdrop-filter: blur(4px);
  text-align: left;
}
.fin-tier.hot { border-color: rgba(240, 230, 140, 0.5); box-shadow: 0 0 26px rgba(240, 230, 140, 0.08); }
.ft-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 0.2rem;
}
.ft-head b {
  font-family: var(--grotesk);
  font-weight: 700; font-size: 1.15rem;
  color: var(--text);
}
.ft-price {
  font-family: var(--grotesk);
  font-weight: 700; font-size: 1.55rem;
  color: var(--gold);
  white-space: nowrap;
}
.ft-price i { font-style: normal; font-weight: 400; font-size: 0.72rem; color: var(--dim); }
.ft-desc {
  font-size: 0.82rem;
  color: var(--dim);
  margin-bottom: 0.7rem;
  min-height: 2.6em;
  line-height: 1.35;
}
.ft-inherit {
  font-family: var(--grotesk);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.ft-feats { list-style: none; margin: 0 0 0.75rem; padding: 0; flex: 1; }
.ft-feats li {
  font-size: 0.82rem;
  color: var(--text);
  opacity: 0.88;
  padding: 0.22rem 0 0.22rem 1.15rem;
  position: relative;
  line-height: 1.4;
}
.ft-feats li::before {
  content: "→";
  position: absolute; left: 0;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.74rem;
}
.ft-yearly {
  font-family: var(--mono);
  font-size: 0.7rem; letter-spacing: 0.04em;
  line-height: 1.3;
  color: var(--dim);
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
  height: 2.3em;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
}
@media (max-width: 1100px) {
  .fin-tiers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .fin-tiers { grid-template-columns: 1fr; }
}
.fin-foot {
  margin-top: 2.2rem;
  font-family: var(--mono);
  font-size: 0.56rem; letter-spacing: 0.18em;
  color: rgba(139, 148, 158, 0.6);
}

/* ---------- scroll driver ---------- */
.scroll-space { height: 1400vh; position: relative; z-index: 0; }

.app { opacity: 0; }
.hud-dots { transition: opacity 0.4s ease; }

/* ---------- reduced motion / small screens ---------- */
@media (prefers-reduced-motion: reduce) {
  .hud-hint, .dot.pulse { animation: none; }
}
@media (max-width: 900px) {
  .hud-caption .hc-text { font-size: 0.9rem; max-width: 24ch; }
  .hud-dots { display: none; }
}
