/* Vaenyx — simple interactive galaxy landing (v0.1.0)
   Palette & type per docs/design.md. Dark, moonlight-purple accent. */

:root {
  --bg: #0b0c14;
  --bg-elev: #0d0e1a;
  --card: #12131f;
  --card-hover: #171826;
  --border: #1e1f33;
  --border-2: #23243a;
  --border-3: #35364f;
  --text: #f0f0f6;
  --text-2: #9a9bb4;
  --text-3: #7a7b9c;
  --text-faint: #6f7090;
  --accent: #8f8bc0;
  --accent-2: #c0bde4;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow: hidden;              /* single-screen landing, no scroll */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

/* finger drags drive the gravity well (not scroll/zoom) — scoped to the hero
   layers so dialog bodies can still scroll on touch */
#galaxy, .stage {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* --- Background layers --- */
#galaxy {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* Radial darkening behind the text so copy keeps ≥4.5:1 contrast */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    120% 85% at 50% 74%,
    rgba(11, 12, 20, 0.88) 0%,
    rgba(11, 12, 20, 0.45) 38%,
    rgba(11, 12, 20, 0) 68%
  );
}

/* --- Content stage (centred, sitting a little low) --- */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  gap: 20px;
  /* content sits low: it begins in the bottom half so the galaxy owns the
     top; extra bottom room clears the fixed legal footer */
  padding:
    calc(56px + env(safe-area-inset-top))
    clamp(20px, 5vw, 48px)
    calc(clamp(52px, 8vh, 88px) + env(safe-area-inset-bottom));
}

.wordmark {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 7px;
  padding-left: 7px;             /* balance trailing letter-spacing */
  color: var(--accent);
}

.headline {
  font-weight: 500;
  font-size: clamp(28px, 4.6vw, 40px);
  letter-spacing: -0.5px;
  line-height: 1.16;
  color: var(--text);
  max-width: 15ch;
}

.sub {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 470px;
}

/* --- Download buttons (disabled / coming soon) --- */
.downloads {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--card);
  border: 0.5px solid var(--border-2);
  border-radius: 12px;
  padding: 12px 20px;
  cursor: not-allowed;
}

.btn .icon {
  width: 17px;
  height: 17px;
  fill: currentColor;
  opacity: 0.85;
  flex: none;
}

.note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
}

.note .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(143, 139, 192, 0.45);
  animation: pulse 2.6s var(--ease) infinite;
}

/* --- Entrance stagger --- */
.stage > * {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.8s var(--ease) forwards;
}
.wordmark  { animation-delay: 0.10s; }
.headline  { animation-delay: 0.24s; }
.sub       { animation-delay: 0.38s; }
.downloads { animation-delay: 0.54s; }
.note      { animation-delay: 0.68s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(143, 139, 192, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(143, 139, 192, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 139, 192, 0); }
}

/* --- Narrow phones: stack buttons --- */
@media (max-width: 430px) {
  .downloads { flex-direction: column; width: 100%; max-width: 300px; }
  .btn { justify-content: center; }
}

/* --- Interactive lettering (spans injected by js/letters.js) --- */
.word { display: inline-block; white-space: pre; }
.ltr {
  display: inline-block;
  transition: color 0.25s, text-shadow 0.25s;
  will-change: transform;
}
.ltr.lit {
  color: var(--accent-2);
  text-shadow: 0 0 14px rgba(192, 189, 228, 0.45);
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Legal footer --- */
.foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  font-size: 11px;
  color: var(--text-3);
  background: linear-gradient(rgba(11, 12, 20, 0), rgba(11, 12, 20, 0.9));
  pointer-events: none;              /* only the links catch the pointer */
}
.foot-links { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.flink {
  background: none;
  border: none;
  font: inherit;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px 2px;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}
.flink:hover, .flink:focus-visible { color: var(--accent-2); }
.foot-sep { opacity: 0.5; }
.foot-copy { color: var(--text-faint); }

/* --- Legal dialogs --- */
dialog.legal {
  background: var(--card);
  color: var(--text-2);
  border: 0.5px solid var(--border-3);
  border-radius: 14px;
  padding: 0;
  width: min(560px, 92vw);
  margin: auto;
}
dialog.legal::backdrop { background: rgba(5, 6, 12, 0.72); }
.legal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 14px 20px;
  border-bottom: 0.5px solid var(--border-2);
}
.legal-head h2 { font-size: 15px; font-weight: 500; color: var(--text); }
.legal-x {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  width: 44px; height: 44px;
  border-radius: 10px;
  transition: color 0.2s;
}
.legal-x:hover, .legal-x:focus-visible { color: var(--text); }
.legal-body {
  padding: 16px 20px 20px;
  font-size: 13px;
  line-height: 1.7;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  touch-action: pan-y;
}
.legal-body p + p { margin-top: 10px; }
.legal-body strong { color: var(--text); font-weight: 500; }

/* --- Reduced motion: no stagger, no pulse, no letter motion --- */
@media (prefers-reduced-motion: reduce) {
  .stage > * { opacity: 1; transform: none; animation: none; }
  .note .dot { animation: none; }
  .ltr { transition: none; }
}
