/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

/* ─── Tokens — Metal dark theme ─── */
:root {
  --bg: #070707;
  --surface: rgba(217,217,217,0.05);
  --surface-hover: rgba(217,217,217,0.09);
  --panel: #121212;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text: #fbfbfb;
  --text-muted: rgba(251,251,251,0.6);
  --text-dim: rgba(251,251,251,0.4);
  --pill-bg: #1d1d1d;
  --pill-border: rgba(44,47,54,0.52);

  /* Metal chromatic palette */
  --metal-1: #aae8ff;
  --metal-2: #c5fe9e;
  --metal-3: #f7888d;
  --metal-4: #007cff;
  --metal-5: #fffdc3;

  --font: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Roboto Mono', ui-monospace, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ─── Metal ring button ─── */
/*
 * Technique: a wrapper div has overflow:hidden + border-radius.
 * Its ::before pseudo is a large conic gradient that spins via
 * transform:rotate(), creating the animated iridescent ring border.
 * The inner button sits on top with a matching border-radius.
 */
.metal-ring {
  position: relative;
  display: inline-flex;
  border-radius: var(--ring-r, var(--r-md));
  padding: var(--ring-w, 1.5px);
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  flex-shrink: 0;
}

.metal-ring.slow { --ring-speed: 7s; }
.metal-ring.hot { --metal-2: #ffd36e; --metal-3: #ff7aa8; --metal-4: #8a7cff; }
.metal-ring.cool { --metal-1: #d3f5ff; --metal-2: #9efbd3; --metal-3: #9ab8ff; --metal-4: #56ccff; }
.metal-ring.planet { --metal-1: #332f68; --metal-2: #b84f19; --metal-3: #f07b22; --metal-4: #ffbd5f; --metal-5: #9fe8b4; }
.metal-ring.subtle::after { opacity: 0.22; filter: blur(7px); }
.metal-ring.pop::after { opacity: 0.72; filter: blur(18px); inset: -8px; }
.metal-ring.pop { --ring-w: 2px; }

.metal-ring::before {
  content: '';
  position: absolute;
  inset: -200%;
  background: conic-gradient(
    from 0deg,
    var(--metal-1) 0%,
    var(--metal-2) 16%,
    var(--metal-3) 33%,
    var(--metal-4) 50%,
    var(--metal-5) 66%,
    var(--metal-4) 83%,
    var(--metal-1) 100%
  );
  animation: metal-spin var(--ring-speed, 3.5s) linear infinite;
  z-index: -1;
}

/* Glow bloom behind the ring */
.metal-ring::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    var(--metal-1),
    var(--metal-2),
    var(--metal-3),
    var(--metal-4),
    var(--metal-5),
    var(--metal-1)
  );
  animation: metal-spin var(--ring-speed, 3.5s) linear infinite;
  filter: blur(10px);
  opacity: 0.45;
  z-index: -2;
}

@keyframes metal-spin {
  to { transform: rotate(360deg); }
}

.metal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: calc(var(--ring-r, var(--r-md)) - var(--ring-w, 1.5px));
  background: #1e1e1e;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  transition: background 160ms ease;
  user-select: none;
  -webkit-user-select: none;
}

.metal-btn:hover { background: #2a2a2a; }

.metal-ring.large { --ring-r: var(--r-lg); --ring-w: 1.5px; }
.metal-ring.large .metal-btn { padding: 14px 32px; font-size: 15px; }

.metal-ring.hero-cta {
  --ring-r: var(--r-pill);
  --ring-w: 2px;
}

.metal-ring.hero-cta .metal-btn {
  min-width: 270px;
  min-height: 58px;
  padding: 18px 42px;
  border-radius: calc(var(--r-pill) - 2px);
  font-size: 16px;
  font-weight: 600;
}

.metal-ring.hero-cta.pop::after {
  opacity: 0.42;
  filter: blur(12px);
  inset: -5px;
}

.metal-ring.pill { --ring-r: var(--r-pill); }
.metal-ring.pill .metal-btn { border-radius: calc(var(--r-pill) - 1.5px); }

.metal-ring.circle {
  --ring-r: var(--r-pill);
  width: 40px;
  height: 40px;
  padding: 1.5px;
  flex-shrink: 0;
}
.metal-ring.circle .metal-btn {
  width: 100%;
  height: 100%;
  border-radius: var(--r-pill);
  padding: 0;
  font-size: 16px;
}

/* ─── Ghost / secondary button ─── */
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  user-select: none;
}

.ghost-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.ghost-btn.large { padding: 14px 32px; font-size: 15px; border-radius: var(--r-lg); }
.ghost-btn.pill { border-radius: var(--r-pill); }

/* ─── Pill chip ─── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--mono);
  white-space: nowrap;
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--metal-2);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Nav ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 24px;
  background: rgba(7,7,7,0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  flex-shrink: 0;
  margin-right: 8px;
}

.nav-logo span {
  display: inline-block;
  background: conic-gradient(from 0deg, var(--metal-1), var(--metal-2), var(--metal-3), var(--metal-4), var(--metal-5), var(--metal-1));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex: 1;
}

.nav-links a {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--text-muted);
  transition: color 140ms ease, background 140ms ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Hero ─── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg) url('../images/hero/poster-sky.webp') center / cover no-repeat;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transition: opacity 800ms ease;
}

.hero-video.loaded { opacity: 1; }

/* Scrim: lighter in middle so the room is visible, darker at edges */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom,
      rgba(7,7,7,0.55) 0%,
      rgba(7,7,7,0.15) 35%,
      rgba(7,7,7,0.22) 65%,
      rgba(7,7,7,0.70) 100%
    );
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 80px 24px 60px;
  max-width: 820px;
  isolation: isolate;
}

.hero-content::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 48%;
  width: min(860px, 92vw);
  height: 430px;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at center, rgba(7,7,7,0.44) 0%, rgba(7,7,7,0.30) 38%, rgba(7,7,7,0.08) 70%, transparent 100%);
  filter: blur(12px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-h1 {
  font-size: clamp(48px, 7.2vw, 86px);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: 0;
  color: var(--text);
  text-shadow:
    0 2px 18px rgba(7,7,7,0.72),
    0 18px 56px rgba(7,7,7,0.44);
}

.hero-h1 .gradient-word {
  background: linear-gradient(90deg, #fff2dc 0%, #ffbd5f 34%, #f07b22 62%, #9fe8b4 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(251,251,251,0.86);
  max-width: 620px;
  text-shadow: 0 2px 18px rgba(7,7,7,0.78);
}

.hero-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  isolation: isolate;
}

.hero-planet-glow {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: min(390px, 72vw);
  height: 92px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.58;
  background:
    radial-gradient(ellipse at 52% 50%, rgba(255,189,95,0.54) 0%, rgba(240,123,34,0.36) 28%, transparent 62%),
    radial-gradient(ellipse at 44% 58%, rgba(184,79,25,0.32) 0%, transparent 58%),
    radial-gradient(ellipse at 60% 42%, rgba(159,232,180,0.28) 0%, transparent 42%),
    radial-gradient(ellipse at 50% 56%, rgba(51,47,104,0.34) 0%, transparent 70%);
  filter: blur(15px) saturate(1.12);
  transform: translate(-50%, -50%);
}

.hero-planet-glow::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(51,47,104,0.10), rgba(240,123,34,0.16), rgba(159,232,180,0.10));
  mix-blend-mode: screen;
  opacity: 0.38;
}

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  animation: float-scroll 2.8s ease-in-out infinite;
}

.hero-scroll-line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
}

@keyframes float-scroll {
  0%,100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(4px); opacity: 0.9; }
}

/* ─── Section shell ─── */
.section {
  padding: 96px 28px;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.section-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.section-h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  max-width: 580px;
}

.section-sub {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 480px;
}

/* ─── Feature grid ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 200ms ease, background 200ms ease;
}

.feature-card:hover {
  border-color: var(--border-strong);
  background: #161616;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.feature-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ─── Showcase card (big dark band) ─── */
.showcase {
  background: #0e0e0e;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 340px;
}

.showcase-copy {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.showcase-copy h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.showcase-copy p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
}

.showcase-copy .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.showcase-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(0,0,0,0.3);
  border-left: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Mock terminal / code block */
.code-block {
  width: 100%;
  max-width: 340px;
  background: #0a0a0a;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #111;
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dot.r { background: #ff5f57; }
.code-dot.y { background: #febc2e; }
.code-dot.g { background: #28c840; }

.code-body {
  padding: 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
}

.code-body .c-key  { color: #aae8ff; }
.code-body .c-str  { color: #c5fe9e; }
.code-body .c-fn   { color: #f7888d; }
.code-body .c-cmt  { color: rgba(251,251,251,0.3); }
.code-body .c-num  { color: #fffdc3; }

/* ─── Stats strip ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.stat-cell {
  background: var(--panel);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-num {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
}

/* Ghost button in hero needs extra legibility against the video */
.hero-actions .ghost-btn {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.22);
  color: rgba(251,251,251,0.85);
}

.hero-actions .ghost-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.38);
  color: var(--text);
}

/* ─── CTA band ─── */
.cta-band {
  margin: 0 28px 96px;
  border-radius: var(--r-xl);
  background: #0e0e0e;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

/* Atmospheric gradient background on the CTA band */
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 15% 50%, rgba(170,232,255,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 70% at 85% 50%, rgba(247,136,141,0.10) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 50% 0%, rgba(197,254,158,0.07) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.cta-inner {
  position: relative;
  z-index: 1;
  padding: 72px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.cta-inner h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
  max-width: 560px;
}

.cta-inner p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.65;
}

.cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

/* ─── Footer ─── */
.footer {
  padding: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-logo {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-dim);
  transition: color 140ms ease;
}

.footer-links a:hover { color: var(--text-muted); }

.footer-copy {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .hero-video { display: none; }
  .nav-links { display: none; }
  .hero-content { padding: 100px 20px 60px; }
  .hero-h1 { font-size: 42px; }
  .hero-sub { font-size: 16px; }
  .section { padding: 64px 20px; }
  .feature-grid { grid-template-columns: 1fr; }
  .showcase { grid-template-columns: 1fr; }
  .showcase-visual { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .cta-band { margin: 0 20px 64px; }
  .cta-inner { padding: 48px 28px; }
  .footer { flex-direction: column; align-items: flex-start; }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .metal-ring::before,
  .metal-ring::after,
  .chip .dot,
  .hero-tag .dot,
  .nav-logo span,
  .hero-scroll { animation: none; }
  * { transition-duration: 0ms !important; }
}
