/* ==========================================================
   Interstitium Games — site styles
   Edit the colors in :root to re-theme the whole site.
   ========================================================== */

:root {
  /* Palette — night sky, moonlight, water */
  --bg: #07080d;
  --bg-2: #0d1020;
  --ink: #e9ecf5;
  --ink-dim: #9aa3b8;
  --moon: #f3eedc;
  --accent: #8fb4ff;
  --accent-2: #b59cff;
  --glass: rgba(18, 20, 30, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.14);

  --radius: 20px;
  --max: 1080px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(143, 180, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(181, 156, 255, 0.12), transparent 60%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap {
  width: min(var(--max), 100% - 32px);
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  /* solid-ish instead of backdrop blur: blur over a constantly animating
     canvas + 3D-tilting cards made the bar flicker in Chrome */
  background: rgba(7, 8, 13, 0.88);
  border-bottom: 1px solid var(--glass-edge);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.nav { display: flex; gap: 20px; flex-wrap: wrap; }
.nav a { color: var(--ink-dim); font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(80px, 14vw, 160px) 0 clamp(60px, 10vw, 120px);
  text-align: center;
  overflow: hidden;
}
.moon {
  width: clamp(120px, 22vw, 200px);
  aspect-ratio: 1;
  margin: 0 auto 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffaf0, var(--moon) 45%, #cfc7ad 100%);
  box-shadow: 0 0 80px rgba(243, 238, 220, 0.35), 0 0 200px rgba(143, 180, 255, 0.2);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.hero p {
  color: var(--ink-dim);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  max-width: 640px;
  margin: 0 auto 32px;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0b12;
  font-weight: 600;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost {
  background: var(--glass);
  color: var(--ink);
  border: 1px solid var(--glass-edge);
}

/* ---------- Sections ---------- */
section { padding: clamp(56px, 9vw, 96px) 0; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0 0 10px;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 18px;
}
.lead { color: var(--ink-dim); max-width: 680px; }

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 36px);
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 32px;
}
.grid h3 { margin: 0 0 8px; font-family: var(--font-display); }
.grid p { margin: 0; color: var(--ink-dim); }

.game {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
}
.game .shot {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--glass-edge);
  background:
    linear-gradient(135deg, rgba(143, 180, 255, 0.25), rgba(181, 156, 255, 0.15)),
    var(--bg-2);
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  font-size: 0.9rem;
  overflow: hidden;
}
.game .shot img { width: 100%; height: 100%; object-fit: cover; }

.team {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 28px;
}
.team .name { font-weight: 600; margin: 0; }
.team .role { color: var(--ink-dim); margin: 0; font-size: 0.95rem; }

/* ---------- Prose pages (privacy, etc.) ---------- */
.prose { max-width: 760px; padding-block: 64px 96px; }
.prose h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 4px; }
.prose h2 { font-size: 1.35rem; margin-top: 40px; }
.prose p, .prose li { color: var(--ink-dim); }
.prose .updated { color: var(--ink-dim); font-size: 0.9rem; margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--glass-edge);
  padding: 32px 0 48px;
  color: var(--ink-dim);
  font-size: 0.9rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
}
.site-footer a { color: var(--ink-dim); }
.site-footer a:hover { color: var(--ink); }

/* ==========================================================
   v2 — starfield, dimension-slip scroll reveals, new sections
   ========================================================== */

/* The animated sky sits behind everything */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
main, .site-footer { position: relative; z-index: 1; }

/* Moon rises away and fades as you scroll, always behind the title */
.moon {
  position: relative;
  z-index: 0;
  will-change: transform, opacity; /* moved by motion.js */
}
.hero h1, .hero p, .hero .btn { position: relative; z-index: 1; }

/* No rubber-band overscroll: the sky shouldn't come unglued from the page */
html, body { overscroll-behavior-y: none; }

/* Custom cursor (assets/cursor.js) */
#cursor-layer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  will-change: transform;
}
.custom-cursor, .custom-cursor * { cursor: none !important; }

/* Secret achievement popup (assets/achievements.js) */
.achievements {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9000;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100% - 32px));
  pointer-events: none;
}
.achievement {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin: 0;
  background: rgba(13, 16, 32, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: rgba(181, 156, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(143, 180, 255, 0.15), 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 36px rgba(143, 180, 255, 0.18);
  pointer-events: auto;
  opacity: 0;
  transform: perspective(900px) translate3d(0, 40px, -60px) rotateX(14deg);
  filter: blur(5px);
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}
.achievement.in { opacity: 1; transform: none; filter: none; }
.achievement.out { opacity: 0; transform: translate3d(0, 20px, 0); filter: blur(4px); transition-duration: 0.5s; }
.achievement-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 20px rgba(181, 156, 255, 0.5);
}
.achievement-body p { margin: 0; }
.achievement-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.achievement-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--ink); }
.achievement-text { font-size: 0.9rem; color: var(--ink-dim); }
@media (prefers-reduced-motion: reduce) {
  .achievement, .achievement.in, .achievement.out { transform: none; filter: none; transition: opacity 0.3s ease; }
}

/* ---------- Dimension-slip reveal ----------
   Elements with [data-reveal] start "out of phase" (tilted back,
   blurred, color-split) and snap into our dimension on scroll.
   Only applies when JS is on, so the page never hides content. */
.js [data-reveal] {
  opacity: 0;
  transform: perspective(1100px) translate3d(0, 56px, -90px) rotateX(11deg);
  filter: blur(6px) saturate(0.7);
  transition:
    opacity 0.9s ease,
    transform 1.15s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.1s ease;
  transition-delay: calc(var(--i, 0) * 110ms);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Headings arrive split into two "dimensions" and converge */
.js [data-reveal] h2,
.js [data-reveal] h3 {
  text-shadow: -5px 0 rgba(143, 200, 255, 0.5), 5px 0 rgba(190, 160, 255, 0.4);
  transition: text-shadow 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 110ms + 150ms);
}
.js [data-reveal].is-in h2,
.js [data-reveal].is-in h3 { text-shadow: 0 0 transparent, 0 0 transparent; }

/* ---------- Rift: the seam between sections ---------- */
.rift {
  position: relative;
  height: 1px;
  width: min(var(--max), 100% - 32px);
  margin-inline: auto;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  box-shadow: 0 0 18px rgba(143, 180, 255, 0.6);
  overflow: visible;
}
.js .rift[data-reveal] {
  filter: none;
  transform: scaleX(0);
  opacity: 0.2;
  transition: transform 1.4s cubic-bezier(0.7, 0, 0.2, 1), opacity 1.4s ease;
}
.js .rift[data-reveal].is-in { transform: scaleX(1); opacity: 1; }
.rift::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 90px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff, rgba(143, 200, 255, 0.5), transparent);
  animation: rift-spark 5s linear infinite;
  opacity: 0;
}
.rift.is-in::after { opacity: 1; }
@keyframes rift-spark {
  from { transform: translateX(-90px); }
  to   { transform: translateX(min(1080px, 100vw)); }
}

/* ---------- Tags & feature card ---------- */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.tag-live {
  color: #0a0b12;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.feature {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
  margin-top: 32px;
}
.feature h3 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.2;
  margin: 0 0 12px;
}
.feature p { color: var(--ink-dim); margin: 0 0 14px; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.facts li { color: var(--ink-dim); font-size: 0.95rem; padding-left: 18px; position: relative; }
.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.feature .shot {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  border: 1px solid var(--glass-edge);
  background:
    linear-gradient(135deg, rgba(143, 180, 255, 0.25), rgba(181, 156, 255, 0.15)),
    var(--bg-2);
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  font-size: 0.9rem;
  overflow: hidden;
}
.feature .shot img { width: 100%; height: 100%; object-fit: cover; }
.planned { margin-top: 20px; }
.planned .tag { margin-bottom: 10px; }

/* ---------- Goals ---------- */
.goals {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.goals h3 { margin: 6px 0 8px; font-family: var(--font-display); }
.goals p { margin: 0; color: var(--ink-dim); }
.num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Founders ---------- */
.founders {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 32px;
}
.founder h3 { margin: 14px 0 2px; font-family: var(--font-display); font-size: 1.35rem; }
.founder .role { color: var(--accent); margin: 0 0 12px; font-size: 0.95rem; }
.founder p:last-child { color: var(--ink-dim); margin: 0; }
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: #0a0b12;
  background: radial-gradient(circle at 35% 35%, #fffaf0, var(--moon) 50%, #cfc7ad);
  box-shadow: 0 0 24px rgba(243, 238, 220, 0.35);
}

.contact .small { margin-top: 18px; font-size: 0.95rem; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .game, .feature { grid-template-columns: 1fr; }
  .nav { gap: 14px; }
  .nav a { font-size: 0.9rem; }
  .brand { font-size: 0.9rem; }
}
@media (max-width: 600px) {
  /* icon-only brand so the nav fits on one line */
  .brand { font-size: 0; gap: 0; }
  .nav { gap: 14px; flex-wrap: nowrap; }
}

/* ---------- Extras ---------- */
::selection { background: rgba(143, 180, 255, 0.35); color: #fff; }

/* scroll progress: a thin rift along the bottom of the header */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px rgba(143, 180, 255, 0.7);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
  will-change: transform;
}

/* hero title: every few seconds it slips out of phase for a blink */
.hero h1 { animation: phase-slip 16s steps(1, end) infinite 6s; }
@keyframes phase-slip {
  0%, 97.5%, 100% { text-shadow: none; transform: none; }
  98% { text-shadow: -3px 0 rgba(143, 200, 255, 0.6), 3px 0 rgba(190, 160, 255, 0.5); transform: translateX(1px); }
  98.8% { text-shadow: 2px 0 rgba(143, 200, 255, 0.5), -2px 0 rgba(190, 160, 255, 0.4); transform: none; }
}

/* card glare that follows the cursor (set by motion.js) */
.glass.tilt { position: relative; }
.glass.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(143, 180, 255, 0.14), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.glass.tilt:hover::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1 { animation: none; }
  .moon { transform: none; }
  .js [data-reveal], .js .rift[data-reveal] {
    opacity: 1; transform: none; filter: none; transition: none;
  }
  .js [data-reveal] h2, .js [data-reveal] h3 { text-shadow: none; }
  .rift::after { animation: none; }
}
