/* ============================================================
   VOIDLINE — design system
   void black / dying-star ember / pale plasma cyan / bone white
   ============================================================ */

:root {
  --void:   #04060a;
  --abyss:  #0a1018;
  --ember:  #c1502e;
  --ember-hot: #e8825a;
  --plasma: #a7d8df;
  --bone:   #e9e4d8;
  --bone-dim: rgba(233, 228, 216, 0.62);
  --bone-faint: rgba(233, 228, 216, 0.34);
  --hairline: rgba(167, 216, 223, 0.18);

  --font-display: "Syncopate", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ember); color: var(--void); }

a { color: var(--plasma); }

:focus-visible {
  outline: 1px solid var(--plasma);
  outline-offset: 4px;
  border-radius: 1px;
}

/* ---------- shader canvas ---------- */

#void {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  animation: canvas-in 2.4s ease-out both;
}

@keyframes canvas-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

main, .hud { position: relative; z-index: 1; }

/* ---------- HUD ---------- */

.hud {
  position: fixed;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  pointer-events: none;
  z-index: 5;
}

.hud-top { top: 0; }
.hud-bottom { bottom: 0; color: var(--bone-faint); }

.hud a { pointer-events: auto; }

.hud-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--bone);
  text-decoration: none;
}

.hud-link {
  color: var(--bone-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.hud-link:hover { color: var(--plasma); border-color: var(--plasma); }

.hud-au { font-variant-numeric: tabular-nums; }

.hud-signal { transition: color 0.6s ease; }
.hud-signal.lost { color: var(--ember-hot); }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 96px 24px 64px;
  position: relative;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-faint);
  margin-bottom: 40px;
}

.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 9vw, 7.6rem);
  line-height: 1;
  color: var(--bone);
  letter-spacing: 0;
  text-indent: 0.3em; /* balance the per-letter tracking */
  white-space: nowrap;
}

.title span {
  display: inline-block;
  margin-right: 0.3em;
  opacity: 0;
  animation: letter-in 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.title span:nth-child(1) { animation-delay: 0.55s; }
.title span:nth-child(2) { animation-delay: 0.70s; }
.title span:nth-child(3) { animation-delay: 0.85s; }
.title span:nth-child(4) { animation-delay: 1.00s; }
.title span:nth-child(5) { animation-delay: 1.15s; }
.title span:nth-child(6) { animation-delay: 1.30s; }
.title span:nth-child(7) { animation-delay: 1.45s; }
.title span:nth-child(8) { animation-delay: 1.60s; }

@keyframes letter-in {
  from { opacity: 0; transform: translateY(0.18em); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.tagline {
  margin-top: 44px;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.9;
  color: var(--bone-dim);
  max-width: 34em;
}

.meta-row {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.scroll-cue {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.cue-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bone-faint);
  transition: color 0.3s ease;
}
.scroll-cue:hover .cue-label { color: var(--plasma); }

.cue-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(180deg, var(--plasma), transparent);
  animation: cue-pulse 2.6s ease-in-out infinite;
}

@keyframes cue-pulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.7); transform-origin: top; }
  50%      { opacity: 1; transform: scaleY(1); }
}

/* ---------- descent / acts ---------- */

.descent { position: relative; }

/* the voidline itself */
.descent::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(167, 216, 223, 0.28) 18%,
    rgba(167, 216, 223, 0.22) 46%,
    rgba(193, 80, 46, 0.4) 78%,
    transparent 100%);
  pointer-events: none;
}

.act {
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 18vh 7vw;
  overflow: clip;
}

.act-body { max-width: 480px; position: relative; }

.act-left .act-body { margin-right: auto; margin-left: 4vw; }
.act-right .act-body { margin-left: auto; margin-right: 4vw; }

.act-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--plasma);
  margin-bottom: 26px;
}

#act-3 .act-eyebrow { color: var(--ember-hot); }

.act-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  line-height: 1.5;
  margin-bottom: 30px;
}

.act-prose {
  color: var(--bone-dim);
  margin-bottom: 26px;
}

.act-prose em { font-style: italic; color: var(--bone); }

.act-note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--bone-faint);
  border-left: 1px solid var(--hairline);
  padding-left: 16px;
}

/* giant ghost numerals — the AU depth of each act */
.ghost {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(7rem, 24vw, 20rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(233, 228, 216, 0.07);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.act-left  .ghost { right: 2vw; }
.act-right .ghost { left: 2vw; }

/* tick marks on the voidline */
.au-tick {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--bone-faint);
  white-space: nowrap;
}

.au-tick i {
  display: block;
  width: 7px;
  height: 7px;
  border: 1px solid var(--plasma);
  border-radius: 50%;
  background: var(--void);
}

#act-3 .au-tick i { border-color: var(--ember-hot); }

/* ---------- transmission ---------- */

.transmission {
  max-width: 620px;
  margin: 6vh auto;
  padding: 40px 44px;
  border: 1px solid var(--hairline);
  background: rgba(4, 6, 10, 0.72);
  font-family: var(--font-mono);
  position: relative;
  z-index: 2;
}

.tx-head {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ember-hot);
  margin-bottom: 22px;
}

.tx-body {
  font-size: 14px;
  line-height: 2;
  color: var(--bone);
}

.tx-body.typing::after {
  content: "▍";
  color: var(--plasma);
  animation: caret-blink 0.9s steps(1) infinite;
}

@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.tx-foot {
  margin-top: 22px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--bone-faint);
}

/* ---------- credits ---------- */

.credits {
  padding: 22vh 24px 16vh;
  text-align: center;
  position: relative;
}

.credits-intro {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bone-faint);
  margin-bottom: 72px;
}

.credit-block { margin-bottom: 44px; }

.credit-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--bone-faint);
  margin-bottom: 12px;
}

.credit-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bone);
}

.credit-name.sm { font-size: 0.8rem; }

.credit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  justify-content: center;
  column-gap: 64px;
  margin: 72px 0;
}

.credit-grid .credit-block { margin-bottom: 40px; }

.credits-studio {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 120px;
}

.credits-end { max-width: 460px; margin: 0 auto; }

.end-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--bone);
  margin-bottom: 28px;
}

.end-note {
  font-size: 13px;
  line-height: 1.9;
  color: var(--bone-faint);
}

.end-note a { color: var(--plasma); text-decoration: none; border-bottom: 1px solid var(--hairline); }
.end-note a:hover { border-color: var(--plasma); }

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.on { opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #void { animation: none; }
  .title span { animation: none; opacity: 1; }
  .cue-line { animation: none; opacity: 0.6; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .descent::before { left: 28px; }
  .au-tick {
    left: 28px;
    top: 14vh;
    transform: translate(-4px, 0); /* circle centered on the rail, label reads right */
  }
  .act { padding: 16vh 24px 16vh 64px; }
  .act-left .act-body,
  .act-right .act-body { margin: 0; }
  .act-left .ghost, .act-right .ghost { left: auto; right: -4vw; opacity: 0.5; }
  .transmission { margin: 6vh 24px 6vh 64px; padding: 30px 26px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hud { padding: 18px 20px; }
  .hud-bottom { font-size: 10px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .title { font-size: 1.85rem; text-indent: 0.22em; }
  .title span { margin-right: 0.22em; }
  .eyebrow, .meta-row { font-size: 10px; letter-spacing: 0.18em; max-width: 30ch; }
  .tagline br { display: none; }
  .tagline { margin-top: 34px; }
  .ghost { display: none; } /* on a phone the numerals crowd the prose — the rail ticks carry the depth */
  .credit-grid { grid-template-columns: 1fr; column-gap: 0; }
  .scroll-cue { bottom: 44px; }
}
