/* Brand tokens: deep-space black, off-white text, crimson (energy) and violet (nebula) accents. */
:root {
  --bg: #07070a;
  --surface: #121218;
  --line: #26262f;
  --text: #f2f0eb;
  --muted: #a6a4ad;
  --accent: #ff3d3d;
  --accent-2: #8b5cf6;
  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

/* Base reset; overflow-x clip stops any horizontal scroll on phones */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* Film-grain overlay for a printed, textile feel (decorative only) */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Top bar: floats over the hero, blurred so the stars show through */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--pad);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.logo { font: 800 18px/1 var(--display); font-stretch: 112%; letter-spacing: 0.08em; text-decoration: none; }
.bar-links { display: flex; gap: 20px; }
.bar-link { font: 500 14px/1 var(--mono); text-decoration: none; color: var(--muted); transition: color .2s; }
.bar-link:hover { color: var(--text); }

/* Hero: full screen, starfield canvas behind, content centred.
   The radial gradient is the fallback "space" if the canvas can't run. */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 55%, #1a1030 0%, var(--bg) 60%);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none; /* no iOS long-press menu while powering up */
}
.stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }

/* Aura: crimson core inside a violet halo behind the wordmark; JS scales it on power-up */
.aura {
  position: absolute; left: 50%; top: 50%; z-index: -1;
  width: min(120vw, 1100px); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 61 61 / .35) 0%, rgb(139 92 246 / .22) 35%, transparent 65%);
  transform: translate(-50%, -50%);
  opacity: .55;
  will-change: transform, opacity;
  pointer-events: none;
}
.hero-inner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: clamp(16px, 3vw, 28px);
  padding: 96px var(--pad) 64px;
  max-width: 100%;
}

/* Wordmark: sized to the viewport so it fills the width without overflowing */
.wordmark {
  margin: 0;
  font: 900 clamp(48px, 16vw, 280px)/0.82 var(--display);
  font-stretch: 125%;
  letter-spacing: -0.02em;
  display: flex;
  max-width: 100%;
}
.wordmark span { display: inline-block; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
/* While fully powered up, the letters spread apart slightly (transform only) */
.hero.charged .wordmark span:nth-child(1) { transform: translateX(-6%); }
.hero.charged .wordmark span:nth-child(2) { transform: translateX(-3%); }
.hero.charged .wordmark span:nth-child(5) { transform: translateX(3%); }
.hero.charged .wordmark span:nth-child(6) { transform: translateX(6%); }

/* Hidden message: fades and rises in only while the hero is powered up */
.secret {
  margin: 0;
  font: 500 clamp(12px, 1.4vw, 15px)/1 var(--mono); letter-spacing: .3em; text-transform: uppercase;
  color: var(--text); text-shadow: 0 0 14px var(--accent), 0 0 2px var(--bg);
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1);
}
.hero.charged .secret { opacity: 1; transform: none; }
.hint { margin: 8px 0 0; font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); opacity: .8; text-shadow: 0 0 8px var(--bg); transition: opacity .4s; }
/* The prompt fades out once its job is done (while powered up) */
.hero.charged .hint { opacity: 0; }

/* Wordmark letters rise in one by one (only when JS runs and motion is allowed) */
html.js .wordmark span { animation: rise .9s cubic-bezier(.2,.8,.2,1) both; }
.wordmark span:nth-child(2) { animation-delay: .06s; }
.wordmark span:nth-child(3) { animation-delay: .12s; }
.wordmark span:nth-child(4) { animation-delay: .18s; }
.wordmark span:nth-child(5) { animation-delay: .24s; }
.wordmark span:nth-child(6) { animation-delay: .30s; }
@keyframes rise { from { transform: translateY(40%); opacity: 0; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 28px;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font: 600 15px/1 var(--body); text-decoration: none; cursor: pointer;
  transition: transform .2s, background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); color: var(--text); border-color: var(--text); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Shared section spacing and labels */
.teaser, .list { padding: clamp(72px, 11vw, 140px) var(--pad); }
.label { margin: 0 0 20px; font: 500 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Teaser tiles: locked placeholders with a nebula glow and a cursor spotlight on desktop */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 24px); }
.tile {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px;
  background:
    radial-gradient(240px circle at var(--x, 50%) var(--y, 45%), rgb(255 255 255 / .08), transparent 60%),
    radial-gradient(circle at 70% 85%, rgb(139 92 246 / .18), transparent 55%),
    radial-gradient(circle at 25% 20%, rgb(255 61 61 / .12), transparent 50%),
    var(--surface);
  display: flex; flex-direction: column; justify-content: space-between; padding: 20px;
}
.tile-no { font: 800 clamp(40px, 6vw, 72px)/1 var(--display); font-stretch: 125%; }
.tile-lock { font: 500 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } .tile { aspect-ratio: 16 / 10; } }

/* Join section */
.list h2 { margin: 0 0 28px; font: 900 clamp(40px, 8vw, 96px)/0.95 var(--display); font-stretch: 110%; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 480px) { .cta-row .btn { flex: 1 1 100%; } }

/* Footer */
.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 28px var(--pad);
  border-top: 1px solid var(--line);
  font: 500 13px/1 var(--mono); color: var(--muted);
}
.foot-links { display: flex; gap: 20px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--text); }

/* Scroll reveal: hidden only once JS has loaded, so content never gets stuck invisible */
html.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
html.js .reveal.in { opacity: 1; transform: none; }

/* Reduced motion: no looping or entrance animation, content shown immediately, no power-up hint */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
  .hint { display: none; }
  .secret { opacity: 1; transform: none; } /* no power-up, so show the message */
}
