/* Splash (index) - topology flow-field canvas + aurora orb; strict-CSP friendly (self-hosted topo.js). */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font-sans);
  color: var(--color-on-ink);
  background: linear-gradient(160deg, #060A2C 0%, var(--color-ink-deep) 45%, var(--color-ink) 100%);
  -webkit-font-smoothing: antialiased;
}

/* Topology canvas (vanilla flow-field port; runs from self-hosted topo.js) */
#topo { position: fixed; inset: 0; display: block; width: 100%; height: 100%; z-index: 0; }

/* Aurora orb glow (breathes via orbBreathe, gated on prefers-reduced-motion). */
.orb {
  position: fixed;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  /* Full viewport so the glow has no square edges. The glow size is the gradient
     radius - previously a 110vmin square whose radial gradient kept faint alpha at
     its left/right edges, showing as vertical bands on wide screens. */
  background:
    radial-gradient(circle 62vmin at 50% 40%,
      rgba(255, 225, 184, 0.42) 0%,
      rgba(255, 209, 160, 0.30) 15%,
      rgba(241, 154, 126, 0.22) 38%,
      rgba(232, 93, 74, 0.14) 60%,
      rgba(122, 46, 42, 0.06) 82%,
      rgba(6, 10, 44, 0) 100%);
}

.content {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: var(--space-xl);
  padding: var(--space-xl);
}
.mark { width: auto; height: 62.4px; display: block; }
.eyebrow {
  margin: 0;
  font-size: var(--text-eyebrow);
  letter-spacing: 0.28em; text-transform: uppercase;
  font-weight: var(--weight-semibold);
  color: var(--color-coral-soft);
}
h1 {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 6.4rem);
  line-height: 1.02; letter-spacing: -0.03em;
  font-weight: var(--weight-bold);
}
/* Typewriter caret: a thin bar that sits after the typed text and blinks. */
#headline { min-height: 1.02em; }
.caret {
  display: inline-block;
  width: 0.06em;
  height: 0.95em;
  margin-left: 0.06em;
  vertical-align: -0.06em;
  background: currentColor;
  /* 1s period = 60 blinks/min (60 bpm, a resting heart rate). */
  animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { display: none; } }

/* Swap-out: the first line fades/lifts away before the second is typed. */
#headline.swap-out { opacity: 0; transform: translateY(-6px); transition: opacity 300ms var(--ease-pathway), transform 300ms var(--ease-pathway); }

.sub {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(236, 233, 222, 0.78);
  max-width: 560px;
}
.enter {
  margin-top: var(--space-sm);
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent;
  border: 1px solid rgba(236, 233, 222, 0.5);
  color: var(--color-on-ink);
  font-family: inherit; font-size: 13px; font-weight: var(--weight-semibold);
  letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--motion-base) var(--ease-pathway),
              border-color var(--motion-base) var(--ease-pathway),
              transform var(--motion-base) var(--ease-pathway);
}
.enter:hover {
  background: rgba(236, 233, 222, 0.1);
  border-color: var(--color-on-ink);
  transform: translateY(-1px);
}
.enter:focus-visible { outline: 2px solid var(--color-coral-soft); outline-offset: 4px; }
.enter .chev { display: inline-block; }

/* Reveal: transform-only stagger, opacity stays 1 (paint-safe, no NO_FCP). */
.content > * { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .orb { animation: orbBreathe 9s var(--ease-pathway) infinite alternate; }
  .content > * { animation: rise var(--motion-deliberate) var(--ease-pathway) backwards; }
  .content > :nth-child(1) { animation-delay: 200ms; }
  .content > :nth-child(2) { animation-delay: 420ms; }
  .content > :nth-child(3) { animation-delay: 560ms; }
  .content > :nth-child(4) { animation-delay: 720ms; }
  .content > :nth-child(5) { animation-delay: 950ms; }
}
@keyframes orbBreathe {
  from { opacity: 0.82; transform: scale(1); }
  to   { opacity: 1;    transform: scale(1.045); }
}
@keyframes rise { from { transform: translateY(10px); } to { transform: translateY(0); } }

/* Exit fade (set by index.js on Enter / auto-advance) */
body.leaving-page .orb, body.leaving-page .content {
  opacity: 0; transition: opacity 600ms var(--ease-pathway);
}

/* Visually hidden, but available to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
