:root {
  --ink: #e9f2f8;
  --dim: #8fa3b0;
  --accent: #8ad8ff;
  --line: rgba(160, 200, 225, 0.28);
  --glass: rgba(8, 14, 20, 0.52);
  --serif: "Palatino", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: -apple-system, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
}

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

html { scroll-behavior: auto; }
body {
  background: #000;
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}

#scroll-space { height: 1500vh; }

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

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

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 50;
  background: #010204;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.9s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; }
.loader-title {
  font-family: var(--serif); font-size: 22px; letter-spacing: 0.55em;
  padding-left: 0.55em; color: var(--ink); margin-bottom: 22px;
}
.loader-bar {
  width: 220px; height: 1px; background: rgba(255,255,255,0.14);
  margin: 0 auto 14px; overflow: hidden;
}
.loader-fill {
  width: 40%; height: 100%; background: var(--accent);
  animation: load-slide 1.1s ease-in-out infinite alternate;
}
@keyframes load-slide { from { transform: translateX(-60%);} to { transform: translateX(240%);} }
.loader-sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em;
  color: var(--dim); text-transform: uppercase;
}

/* ---------- scroll cue ---------- */
#scroll-cue {
  position: fixed; z-index: 20; right: 34px; bottom: 32px;
  display: flex; align-items: center; gap: 12px; pointer-events: none;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--dim);
  opacity: 0; animation: cue-in 1.2s ease 2s forwards;
  transition: opacity 0.5s ease;
}
#scroll-cue.gone { opacity: 0 !important; animation: none; }
#scroll-cue i {
  width: 1px; height: 34px; background: linear-gradient(180deg, transparent, var(--accent));
  animation: cue-drop 1.9s ease-in-out infinite;
}
@keyframes cue-in { to { opacity: 1; } }
@keyframes cue-drop {
  0%, 100% { transform: translateY(-5px); opacity: 0.35; }
  50%      { transform: translateY(5px);  opacity: 1; }
}

/* ---------- HUD ---------- */
#telemetry {
  position: fixed; left: 34px; bottom: 30px; z-index: 10; pointer-events: none;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  display: flex; flex-direction: column; gap: 6px;
}
.t-key { color: var(--dim); display: inline-block; width: 62px; }
.t-val { color: var(--ink); }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; z-index: 5; pointer-events: none;
  opacity: 0; visibility: hidden;
  will-change: opacity, transform;
}

.hero {
  inset: 0; display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  padding-left: 9vw;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(64px, 10.5vw, 150px);
  line-height: 0.94; letter-spacing: 0.06em;
  text-shadow: 0 2px 40px rgba(0,0,0,0.75);
}
.hero-sub {
  margin-top: 28px; font-size: 15px; line-height: 1.75;
  color: #c9dae5; letter-spacing: 0.04em; font-weight: 300;
  text-shadow: 0 1px 18px rgba(0,0,0,0.8);
}

.caption {
  left: 50%; bottom: 12vh; transform: translateX(-50%);
  font-size: 13px; letter-spacing: 0.08em; color: #cfe2ee;
  background: var(--glass); border: 1px solid var(--line);
  padding: 12px 26px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
.caption .mono { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.24em; }

/* ---------- projected labels ---------- */
.p-label {
  position: fixed; z-index: 6; pointer-events: none;
  opacity: 0; transform: translate(-4px, -50%);
  transition: opacity 0.35s ease;
  padding-left: 26px; max-width: 250px;
}
.p-label i {
  position: absolute; left: 0; top: 50%;
  width: 8px; height: 8px; margin-top: -4px;
  border: 1px solid var(--accent); border-radius: 50%;
  box-shadow: 0 0 10px rgba(138,216,255,0.8);
}
.p-label i::after {
  content: ""; position: absolute; left: 8px; top: 3px;
  width: 14px; height: 1px; background: var(--line);
}
.p-label b {
  display: block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.22em; color: var(--ink); margin-bottom: 4px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.9);
}
.p-label small {
  display: block; font-size: 11px; line-height: 1.5; color: var(--dim);
  text-shadow: 0 1px 10px rgba(0,0,0,0.9);
}

/* ---------- interior cards ---------- */
.card {
  top: 50%; transform: translateY(-50%);
  width: min(420px, 84vw);
  background: var(--glass);
  border: 1px solid var(--line);
  border-top: 1px solid rgba(138,216,255,0.55);
  padding: 30px 32px 26px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}
.card.left { left: 7vw; }
.card.right { right: 7vw; }
.card h2 {
  font-family: var(--mono); font-weight: 500; font-size: 12px;
  letter-spacing: 0.34em; color: var(--ink); margin-bottom: 16px;
}
.card h2 .idx { color: var(--accent); margin-right: 10px; }
.card p {
  font-size: 14px; line-height: 1.8; color: #d4e2ec; font-weight: 300;
}
.card p b { color: #fff; font-weight: 500; }
.card .mono { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.spec {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px dashed rgba(160,200,225,0.22);
}
.spec span {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--dim);
}
.spec span b {
  display: block; font-size: 12.5px; color: var(--ink);
  letter-spacing: 0.04em; margin-top: 4px; font-weight: 500;
}

/* ---------- closing quote ---------- */
.quote {
  inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 0 8vw;
}
.quote blockquote {
  font-family: var(--serif); font-size: clamp(22px, 3.2vw, 40px);
  line-height: 1.5; max-width: 900px; font-weight: 400;
  text-shadow: 0 2px 30px rgba(0,0,0,0.85);
}
.quote cite {
  margin-top: 30px; font-family: var(--mono); font-style: normal;
  font-size: 11px; letter-spacing: 0.26em; color: var(--dim);
}
.quote cite i { font-style: italic; }

/* ---------- creator credit ---------- */
.credit {
  left: 50%; bottom: 8vh; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--dim);
}
.credit a {
  color: var(--ink); text-decoration: none; pointer-events: auto;
  border-bottom: 1px solid rgba(138, 216, 255, 0.45); padding-bottom: 3px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.credit a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.credit .dot { color: rgba(160, 200, 225, 0.45); }

@media (max-width: 720px) {
  .credit {
    font-size: 9px; letter-spacing: 0.12em; gap: 8px; bottom: 6vh;
    flex-wrap: wrap; justify-content: center; white-space: normal;
    width: 86vw; text-align: center;
  }
  .hero { padding-left: 7vw; padding-right: 7vw; }
  /* centre with a negative margin, not translateX — the scroll code owns the
     inline transform and would otherwise drop the horizontal half-shift */
  .card.left, .card.right {
    left: 50%; right: auto;
    margin-left: calc(min(420px, 84vw) / -2);
  }
  #telemetry { display: none; }
  .p-label small { display: none; }
  #scroll-cue { right: 16px; bottom: 20px; }
  #scroll-cue span { display: none; }
}
