/* =========================================================
   COSMIC AGENTS — Design System
   ========================================================= */
:root {
  --bg: #020309;
  --bg-1: #04060f;

  --ink: #eaeefc;
  --muted: rgba(234, 238, 252, 0.56);
  --dim: rgba(234, 238, 252, 0.32);

  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.14);

  /* Cosmic accent palette — refined dark celestial theme */
  --violet: #9d8df1;
  --violet-mid: #6366f1;
  --violet-glow: rgba(157, 141, 241, 0.16);
  --cyan: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.14);
  --rose: #e879f9;
  --rose-glow: rgba(232, 121, 249, 0.14);
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.14);
  --emerald: #10b981;

  --mono: "IBM Plex Mono", monospace;
  --display: "Sora", "Space Grotesk", sans-serif;
  --body: "Space Grotesk", sans-serif;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 64px rgba(0, 0, 0, 0.65);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* The hidden attribute loses to any author `display` (.btn is inline-flex,
   so a "hidden" Launch button stayed on screen). Make it final. */
[hidden] {
  display: none !important;
}

/* =========================================================
   COSMIC BACKGROUND
   ========================================================= */
.space {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.stars {
  position: absolute;
  inset: -60%;
  background-image:
    radial-gradient(1.5px 1.5px at 7% 8%, rgba(234, 238, 252, 0.9) 0%, transparent 60%),
    radial-gradient(1px 1px at 21% 31%, rgba(234, 238, 252, 0.7) 0%, transparent 60%),
    radial-gradient(1px 1px at 38% 64%, rgba(234, 238, 252, 0.65) 0%, transparent 60%),
    radial-gradient(2px 2px at 54% 11%, rgba(234, 238, 252, 0.8) 0%, transparent 60%),
    radial-gradient(1px 1px at 69% 45%, rgba(234, 238, 252, 0.6) 0%, transparent 60%),
    radial-gradient(1px 1px at 84% 74%, rgba(234, 238, 252, 0.7) 0%, transparent 60%),
    radial-gradient(1.5px 1.5px at 13% 82%, rgba(234, 238, 252, 0.55) 0%, transparent 60%),
    radial-gradient(1px 1px at 61% 89%, rgba(234, 238, 252, 0.5) 0%, transparent 60%),
    radial-gradient(1px 1px at 32% 50%, rgba(234, 238, 252, 0.45) 0%, transparent 60%),
    radial-gradient(2px 2px at 77% 24%, rgba(234, 238, 252, 0.4) 0%, transparent 60%),
    radial-gradient(1px 1px at 44% 70%, rgba(167, 139, 250, 0.65) 0%, transparent 60%),
    radial-gradient(1px 1px at 89% 41%, rgba(34, 211, 238, 0.55) 0%, transparent 60%),
    radial-gradient(1px 1px at 27% 17%, rgba(244, 114, 182, 0.5) 0%, transparent 60%),
    radial-gradient(1px 1px at 95% 58%, rgba(167, 139, 250, 0.45) 0%, transparent 60%),
    radial-gradient(1.5px 1.5px at 50% 38%, rgba(234, 238, 252, 0.35) 0%, transparent 60%);
  opacity: 0.7;
  animation: drift 36s ease-in-out infinite;
}

.nebula {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(ellipse 65% 55% at 12% 22%, rgba(124, 58, 237, 0.2), transparent 55%),
    radial-gradient(ellipse 55% 65% at 82% 18%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(ellipse 75% 45% at 50% 92%, rgba(167, 139, 250, 0.15), transparent 58%),
    radial-gradient(ellipse 45% 55% at 72% 68%, rgba(244, 114, 182, 0.09), transparent 55%),
    radial-gradient(ellipse 40% 35% at 30% 50%, rgba(124, 58, 237, 0.1), transparent 50%);
  filter: blur(24px);
  opacity: 0.9;
  animation: float 24s ease-in-out infinite;
}

.gridglow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 100% 55% at 50% 0%, rgba(0, 0, 0, 0.8), transparent 70%);
  opacity: 0.55;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  35% { transform: translate3d(14px, -16px, 0) scale(1.025); }
  70% { transform: translate3d(-10px, 12px, 0) scale(0.978); }
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -34px, 0); }
}

/* =========================================================
   NAVIGATION
   ========================================================= */
.top-nav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(18px, 4.5vw, 64px);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  background: linear-gradient(180deg, rgba(2, 3, 9, 0.92), rgba(2, 3, 9, 0.55));
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  background: linear-gradient(100deg, var(--violet) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo.small {
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.875rem;
}

.nav-links a {
  transition: color 0.2s ease;
}

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

.nav-cta {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  background: var(--surface);
  transition: all 0.2s ease;
}

.nav-cta:hover {
  border-color: rgba(167, 139, 250, 0.5);
  background: var(--violet-glow);
  color: var(--violet);
  -webkit-text-fill-color: var(--violet);
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */
main {
  padding: 64px clamp(18px, 4.5vw, 64px) 100px;
  display: flex;
  flex-direction: column;
  gap: 88px;
  max-width: 1480px;
  margin: 0 auto;
}

/* =========================================================
   HERO — default two-column layout (used by pages that still
   pair copy with a figure, e.g. the How-it-works page).
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 52px;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero {
    grid-template-columns: minmax(360px, 0.68fr) minmax(580px, 1.32fr);
  }
}

.hero-copy {
  max-width: 580px;
  min-width: 0; /* let long words wrap inside the grid cell */
}

.hero-copy h1,
.hero-copy p {
  /* Ensure long words break instead of overflowing the column and
     painting underneath the adjacent figure panel. */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-visual {
  min-width: 0;
}




.eyebrow-center {
  justify-content: center;
  margin-bottom: 22px;
}

.lead-center {
  margin: 0 0 34px;
  max-width: 640px;
}



.footer-minimal {
  padding: 0 clamp(18px, 6vw, 72px) 36px;
}

.eyebrow {
  font-family: var(--mono);
  color: var(--violet);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.76rem;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: '';
  display: block;
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  opacity: 0.8;
  flex-shrink: 0;
}

h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 4vw, 4.4rem);
  font-weight: 700;
  margin: 0 0 26px;
  line-height: 1.16;
  letter-spacing: -0.018em;
  color: var(--ink);
}

.lead {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.74;
}



/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-bright);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  -webkit-text-fill-color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.primary {
  border-color: rgba(167, 139, 250, 0.5);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.28) 0%, rgba(34, 211, 238, 0.14) 100%);
}

.btn.primary:hover {
  border-color: rgba(167, 139, 250, 0.75);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.28);
}

.btn.secondary:hover {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}

.btn.small {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
}

/* =========================================================
   ORBIT / FLOW CARD
   ========================================================= */
.orbit-card {
  border-radius: var(--radius-xl);
  padding: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.orbit-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-family: var(--mono);
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.1);
  color: var(--violet);
  width: max-content;
}

.mono {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.875rem;
}

.orbit-caption {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* =========================================================
   LANDING SOLAR — sizing for the ambient hero component.
   All visual rules for the solar system itself live in
   solar.css; here we just give the landing instance its
   height and a slightly dimmer baseline so the hero copy
   stays dominant.
   ========================================================= */
.solar-system.landing-solar {
  /* Needs to comfortably fit 4 planets + labels around a Leader core,
     with the outer orbit staying clear of the panel edge. */
  height: 460px;
}

@media (max-width: 820px) {
  .solar-system.landing-solar {
    height: 360px;
  }
}

@media (max-width: 520px) {
  .solar-system.landing-solar {
    height: 300px;
  }
}

/* =========================================================
   SECTIONS
   ========================================================= */
.section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section-heading h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 2.8vw, 2.8rem);
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, var(--ink) 0%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-heading p {
  margin: 0;
  max-width: 600px;
  color: var(--muted);
  line-height: 1.72;
}

/* =========================================================
   STEPS
   ========================================================= */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.steps.steps-minimal {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.step {
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
  align-items: start;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.step:hover {
  border-color: rgba(167, 139, 250, 0.28);
  background: var(--surface-hover);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.1);
}

.step-index {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(34, 211, 238, 0.14));
  border: 1px solid rgba(167, 139, 250, 0.32);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--violet);
  flex-shrink: 0;
}

.step-body h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.step-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.94rem;
}

/* =========================================================
   CTA BANNER
   ========================================================= */
.cta-banner {
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  border: 1px solid rgba(167, 139, 250, 0.18);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(34, 211, 238, 0.06) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  box-shadow: 0 8px 40px rgba(124, 58, 237, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.cta-banner h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cta-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.96rem;
}

/* =========================================================
   CARDS (generic)
   ========================================================= */
.card {
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  padding: 0 clamp(18px, 6vw, 72px) 52px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.footer-note {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 380px;
  line-height: 1.65;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--muted);
}

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

.footer-bottom {
  margin: 20px 0 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: center;
}

/* =========================================================
   TASK CARDS (landing + demo; filled by examples.js)
   ========================================================= */
.task-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.task-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.task-card:hover {
  border-color: rgba(167, 139, 250, 0.45);
  background: var(--surface-hover);
}

.task-card:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

.task-card-title {
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
}

.task-card-blurb {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* =========================================================
   REVEAL ANIMATION
   ========================================================= */
/* Content used to be opacity:0 until JS revealed it, so a script failure
   (or a crawler / print view) got a blank page. Hide only once JS is known
   to be running: <html class="js"> is set by an inline script in <head>. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(8px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.7s ease;
}

.js [data-reveal].reveal {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* =========================================================
   LEGACY / COMPATIBILITY STUBS
   ========================================================= */
@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes beam {
  0%, 100% { transform: rotate(-28deg); opacity: 0.3; }
  50% { transform: rotate(18deg); opacity: 0.7; }
}

.orbit-stage { position: relative; height: 320px; display: grid; place-items: center; }
.orbit-ring {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}
.ring-a { width: 286px; height: 286px; animation: spin 16s linear infinite; }
.ring-b { width: 190px; height: 190px; opacity: 0.5; animation: spin 12s linear infinite reverse; }

.code-card { border-radius: var(--radius-lg); padding: 18px; border: 1px solid var(--border); background: var(--surface); }
.code { margin: 0; padding: 14px; border-radius: var(--radius-md); background: rgba(2, 3, 9, 0.6); border: 1px solid var(--border); font-family: var(--mono); font-size: 0.88rem; line-height: 1.6; overflow-x: auto; color: var(--muted); }
.pill-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-link { font-family: var(--mono); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); transition: all 0.2s ease; }
.pill-link:hover { border-color: rgba(251, 191, 36, 0.45); background: var(--gold-glow); color: var(--gold); }
.metric { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; background: var(--surface); }
.metric-value { font-size: 1.4rem; font-weight: 700; }
.metric-label { margin-top: 6px; color: var(--muted); font-family: var(--mono); font-size: 0.84rem; }
.hero-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 640px; }
.proof-row { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.proof { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; background: var(--surface); }
.proof-value { font-size: 1.2rem; font-weight: 700; }
.proof-label { margin-top: 6px; color: var(--muted); font-size: 0.84rem; }
.beam { position: absolute; width: 1px; height: 240px; background: linear-gradient(180deg, transparent, rgba(167, 139, 250, 0.6), transparent); opacity: 0.45; animation: beam 5s ease-in-out infinite; }
.code-title { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .cta-banner { flex-direction: column; align-items: flex-start; }
  .proof-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stars, .nebula { animation: none !important; }
  .solar-system::after { animation: none !important; }
  .orbit, .planet-anchor, .sun-core { animation: none !important; }
  .btn { transition: none; }
  .js [data-reveal] {
    opacity: 0;
    transform: none;
    filter: none;
    transition: opacity 0.4s ease;
  }
}
