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

:root {
  --bg: #0a0a0a;
  --bg-2: #060606;
  --surface: #0d0d0d;
  --surface-2: #161616;
  --ink: #ffffff;
  --ink-2: #d0d0d0;
  --muted: #888888;
  --soft: #555555;
  --line: #1a1a1a;
  --line-2: #2a2a2a;
  --red: #46be3c;
  --red-dim: #3aa832;
  --green: #46be3c;
  --green-dim: #3aa832;
  --green-2: rgba(70, 190, 60, 0.08);
  --blue: #4488ff;
  --amber: #ffaa00;
  --purple: #aa66ff;
  --radius: 10px;
  --max: 1080px;
  --nav-h: 60px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Starfield Canvas ──────────────────────────────────────── */

#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Navigation ────────────────────────────────────────────── */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(10, 10, 10, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  color: var(--ink);
}

.nav-logo img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.nav-logo span {
  color: var(--red);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-cta {
  color: #000 !important;
  background: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700 !important;
  transition: background 0.2s;
}

.nav-cta:hover {
  background: #ccc;
}

.nav-download {
  color: #fff !important;
  background: #55C2A4 !important;
}

.nav-download:hover {
  background: #45a88a !important;
}

/* ── Hero ──────────────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 120px 24px 80px;
}

.hero-compact {
  min-height: 60vh;
  padding: 120px 24px 60px;
  position: relative;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.3);
}

.hero-compact .hero-inner {
  position: relative;
  z-index: 1;
}

.hero-inner {
  max-width: 800px;
  width: 100%;
}

.eyebrow {
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1.0;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero-copy {
  color: var(--ink-2);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--red);
}

.btn.primary {
  background: var(--ink);
  color: #000;
  border-color: var(--ink);
}

.btn.primary:hover {
  background: #ccc;
}

.hero .btn:not(.primary) {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ── Sections ──────────────────────────────────────────────── */

.section {
  padding: 80px 24px;
  position: relative;
  z-index: 1;
}

.section.alt {
  background: var(--bg-2);
}

.section.dark {
  background: var(--surface);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.section-head {
  margin-bottom: 40px;
}

.section-kicker {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.lead {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 560px;
}

.muted {
  color: var(--muted);
}

code {
  background: var(--surface-2);
  color: var(--green);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 0.85em;
}

/* ── Grid ──────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: 14px;
}

.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }

/* ── Cards ─────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--line-2);
}

.card.dark-card {
  background: var(--surface-2);
  border-color: var(--line);
}

/* ── Media Card ─────────────────────────────────────────────── */

.media-card {
  overflow: hidden;
  padding: 0;
}

.media-card img {
  width: 100%;
  display: block;
  border-radius: var(--radius) var(--radius) 0 0;
}

.media-caption {
  padding: 16px 20px;
}

.media-caption h3 {
  margin-bottom: 4px;
}

.media-caption p {
  margin: 0;
}

/* ── Fade Up Animation ──────────────────────────────────────── */

.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── Tags ──────────────────────────────────────────────────── */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.tag.green { background: rgba(70, 190, 60, 0.1); color: var(--green); }
.tag.blue { background: rgba(68,136,255,0.1); color: var(--blue); }
.tag.amber { background: rgba(255,170,0,0.1); color: var(--amber); }

/* ── Code Box ──────────────────────────────────────────────── */

.codebox {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  font-family: "DM Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.8;
  overflow-x: auto;
}

.codebox .dim { color: var(--soft); }

/* ── Stat Strip ────────────────────────────────────────────── */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.stat {
  padding: 16px;
  border-right: 1px solid var(--line);
}

.stat:last-child { border-right: 0; }

.stat strong {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
}

.stat span {
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── Feature List ──────────────────────────────────────────── */

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.feature-list li {
  color: var(--muted);
  padding-left: 16px;
  position: relative;
  font-size: 0.88rem;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

/* ── Link List ─────────────────────────────────────────────── */

.doc-nav {
  display: grid;
  gap: 8px;
}

.doc-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: border-color 0.2s;
}

.doc-nav a:hover {
  border-color: var(--red);
}

.doc-nav a::after {
  content: "\2192";
  color: var(--red);
}

/* ── Footer ────────────────────────────────────────────────── */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 28px 24px;
  background: rgba(10, 10, 10, 0.95);
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.footer a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--red);
}

.footer-links {
  display: flex;
  gap: 16px;
}

/* ── 3D Card (mouse tilt only) ─────────────────────────────── */

.card-3d {
  transform-style: preserve-3d;
}

.card-3d-inner {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
}

/* ── Actions Row ───────────────────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 900px) {
  .nav-links a:not(.nav-cta):not(.nav-keep) {
    display: none;
  }

  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1),
  .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 600px) {
  .hero {
    padding: 100px 16px 60px;
  }

  .section {
    padding: 60px 16px;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .stat-strip {
    grid-template-columns: 1fr;
  }

  .stat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stat:last-child {
    border-bottom: 0;
  }
}
