/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

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

a {
  color: inherit;
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0a0b;
  --bg-raise: #131315;
  --fg: #f5f5f5;
  --fg-muted: rgba(245, 245, 245, 0.6);
  --fg-faint: rgba(245, 245, 245, 0.35);
  --border: rgba(245, 245, 245, 0.12);
  --border-strong: rgba(245, 245, 245, 0.22);
  --max-width: 1200px;
  --content-width: 620px;
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --section-gap: clamp(4rem, 12vh, 7rem);
  --radius: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Global page shell ---------- */
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* subtle off-black texture: soft vignette + faint grain, keeps the video frame the brightest thing on screen */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 15%, rgba(255, 255, 255, 0.05), transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 80%, rgba(255, 255, 255, 0.035), transparent 60%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main {
  position: relative;
  z-index: 1;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

.eyebrow {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
}

p {
  margin: 0 0 1em;
  color: var(--fg-muted);
  font-size: 1.05rem;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  color: var(--fg);
  font-weight: 600;
}

.lede {
  font-size: 1.15rem;
  color: var(--fg);
}

/* ---------- Layout shell ---------- */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem var(--gutter);
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
}

.brand img {
  height: 22px;
  width: auto;
  opacity: 0.95;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.4em 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--fg);
  border-color: var(--border-strong);
}

.nav-link:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
  border-radius: 2px;
}

.header-nav.desktop-only {
  display: none;
}

/* ---------- Two-column hero layout (index) ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;
}

.stage-inner {
  width: 100%;
  max-width: 340px;
}

.content-col {
  display: flex;
  flex-direction: column;
}

.hero {
  padding-top: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5em 1em;
  margin-top: 0.5rem;
}

.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 3px var(--border);
}

.section {
  padding: var(--section-gap) 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* ---------- Video frame ---------- */
.video-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-raise);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 0 90px -20px rgba(255, 255, 255, 0.08);
  animation: float 7s ease-in-out infinite;
}

.video-frame video {
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 1024;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- Three steps ---------- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.step {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.step:hover {
  border-color: var(--border-strong);
  background: rgba(245, 245, 245, 0.02);
}

.step-index {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fg-faint);
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.step h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35em;
}

.step p {
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem var(--gutter) 3rem;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--fg-faint);
  font-size: 0.85rem;
}

.site-footer nav {
  display: flex;
  gap: 1.5rem;
}

.site-footer a {
  color: var(--fg-muted);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--fg);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Doc pages (privacy, contact, press kit) ---------- */
.doc {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) 0 var(--section-gap);
}

.doc .eyebrow {
  margin-top: 1rem;
}

.updated {
  color: var(--fg-faint);
  font-size: 0.85rem;
  margin-top: 2.5rem;
}

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 1.75rem;
  padding: 0.85em 1.6em;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -12px rgba(255, 255, 255, 0.25);
}

.btn:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

/* ---------- Fact list ---------- */
.fact-list {
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0;
}

.fact-list > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.fact-list dt {
  flex: 0 0 180px;
  color: var(--fg-faint);
  font-weight: 600;
}

.fact-list dd {
  margin: 0;
  color: var(--fg);
  flex: 1 1 200px;
}

.fact-list a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em;
}

.fact-list a:hover,
.fact-list a:focus-visible {
  text-decoration-color: var(--fg);
}

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 22.5%;
  border: 1px solid var(--border-strong);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 8px 20px -10px rgba(0, 0, 0, 0.7);
}

/* ---------- Gameplay carousel ---------- */
.carousel {
  margin-top: 1.5rem;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s var(--ease);
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.media-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-raise);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 20px 40px -20px rgba(0, 0, 0, 0.7);
}

.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.media-caption {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--fg-faint);
  text-align: center;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1rem;
}

.carousel-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.carousel-btn:hover,
.carousel-btn:focus-visible {
  border-color: var(--border-strong);
}

.carousel-btn:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border-strong);
  cursor: pointer;
}

.carousel-dot.is-active {
  background: var(--fg);
}

.carousel-dot:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

/* ---------- Screenshot grid ---------- */
.screenshot-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.screenshot-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-raise);
  padding: 0;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.screenshot-thumb:hover,
.screenshot-thumb:focus-visible {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.screenshot-thumb:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.screenshot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Lightbox ---------- */
body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 5vw, 3rem);
  background: rgba(10, 10, 11, 0.92);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-image {
  max-width: min(90vw, 720px);
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}

.lightbox-caption {
  position: absolute;
  bottom: clamp(1rem, 4vh, 2rem);
  left: 0;
  right: 0;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin: 0;
}

.lightbox-close {
  position: absolute;
  top: clamp(1rem, 3vh, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s var(--ease);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  border-color: var(--border-strong);
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(10, 10, 11, 0.6);
  color: var(--fg);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s var(--ease);
}

.lightbox-btn:hover,
.lightbox-btn:focus-visible {
  border-color: var(--border-strong);
}

.lightbox-prev {
  left: clamp(0.5rem, 3vw, 2rem);
}

.lightbox-next {
  right: clamp(0.5rem, 3vw, 2rem);
}

/* ---------- Logos ---------- */
.logo-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.logo-tile img {
  max-width: 70%;
  height: auto;
}

.logo-tile-dark {
  background: var(--bg-raise);
}

.logo-tile-light {
  background: #f5f5f5;
}

@media (max-width: 420px) {
  .logo-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Asset list ---------- */
.asset-list {
  margin: 0 0 1em;
  padding-left: 1.25em;
  color: var(--fg-muted);
}

.asset-list li {
  margin-bottom: 0.4em;
}

/* ---------- Desktop layout ---------- */
@media (min-width: 1000px) {
  .header-nav.desktop-only {
    display: inline-flex;
    gap: 20px;
  }

  .layout {
    grid-template-columns: minmax(280px, 380px) 1fr;
    align-items: start;
    gap: clamp(3rem, 6vw, 6rem);
  }

  .stage {
    position: sticky;
    top: 3rem;
    align-items: flex-start;
    padding-top: 1rem;
  }

  .stage-inner {
    max-width: 100%;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 999px) {
  .stage-inner {
    max-width: 300px;
    margin: 0 auto;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .video-frame {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
