/* ============================================
   RigelLabz — Design Tokens
   Palette: deep-space navy, Rigel ice-white, indigo→violet→pink gradient (matches logo)
   Type: Space Grotesk (display) / Inter (body) / JetBrains Mono (data & labels)
   ============================================ */

:root {
  --bg: #0a0d18;
  --bg-elevated: #10142a;
  --bg-elevated-2: #161b38;
  --border: rgba(168, 197, 255, 0.12);
  --border-strong: rgba(168, 197, 255, 0.28);

  --text: #f3f5fa;
  --text-muted: #97a0bd;
  --text-dim: #5b6280;

  --ice: #a8c5ff;
  --indigo: #6366f1;
  --violet: #8b5cf6;
  --pink: #ec4899;

  --gradient: linear-gradient(115deg, var(--indigo) 0%, var(--violet) 55%, var(--pink) 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --max-width: 1160px;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

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

.mono {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10, 13, 24, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.nav-logo { display: flex; align-items: center; gap: 12px; }
.nav-logo svg { height: 30px; width: auto; display: block; }
.nav-logo-stack { display: flex; flex-direction: column; gap: 1px; }
.nav-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 19px;
  line-height: 1;
}
.nav-logo-text .accent { color: var(--violet); }
.nav-logo-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}

/* Hero signature kicker — rotated tagline on the edge */
.hero-kicker {
  position: absolute;
  top: 130px;
  right: 32px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-kicker::after {
  content: '';
  width: 1px;
  height: 60px;
  background: linear-gradient(var(--border-strong), transparent);
}
@media (max-width: 900px) {
  .hero-kicker { display: none; }
}

.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a {
  font-size: 14.5px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
}

.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}

.nav.nav-open .nav-links {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  background: rgba(10, 13, 24, 0.97);
  border-bottom: 1px solid var(--border);
  padding: 20px 32px 28px;
  gap: 20px;
  z-index: 99;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--ice); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 130px 0 110px;
  overflow: hidden;
}
#starfield {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.9;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-content { max-width: 720px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ice);
  margin-bottom: 26px;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 10px 2px rgba(168,197,255,0.7);
}
.hero h1 {
  font-size: clamp(38px, 5.4vw, 60px);
  margin-bottom: 26px;
}
.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 40px;
}
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Section shared ---------- */
section { padding: 100px 0; position: relative; }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head .eyebrow { margin-bottom: 16px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); margin-bottom: 16px; }
.section-head p { color: var(--text-muted); font-size: 16.5px; }

/* ---------- About ---------- */
.about { border-top: 1px solid var(--border); }
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: start;
}
.about-grid p { color: var(--text-muted); margin-bottom: 20px; font-size: 16.5px; }
.about-grid p strong { color: var(--text); font-weight: 600; }
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
}
.stat-card + .stat-card { margin-top: 16px; }
.stat-card .num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  margin-bottom: 6px;
}
.stat-card .label { color: var(--text-dim); font-size: 13.5px; }

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

/* ---------- Constellation / Products ---------- */
.constellation { border-top: 1px solid var(--border); }
.const-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.star-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.star-card.live {
  border-color: var(--border-strong);
  background: linear-gradient(160deg, var(--bg-elevated-2), var(--bg-elevated));
}
.star-card.live:hover { transform: translateY(-4px); border-color: var(--ice); }
.star-card.dim { opacity: 0.55; }
.star-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-bottom: 22px;
}
.star-card.live .star-dot {
  background: var(--ice);
  box-shadow: 0 0 16px 3px rgba(168,197,255,0.65);
}
.star-card.dim .star-dot {
  background: var(--text-dim);
}
.star-card h3 { font-size: 20px; margin-bottom: 10px; }
.star-card p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 20px; }
.star-status {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.star-card.live .star-status { color: var(--ice); }
.star-card.dim .star-status { color: var(--text-dim); }
.star-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ice);
}

@media (max-width: 1050px) {
  .const-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .const-grid { grid-template-columns: 1fr; }
}

/* ---------- Lab Notes (placeholder) ---------- */
.lab-notes { border-top: 1px solid var(--border); padding: 80px 0; }
.lab-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px;
}
.lab-left { max-width: 560px; }
.lab-left h2 { font-size: clamp(24px, 3vw, 30px); margin-bottom: 14px; }
.lab-left p { color: var(--text-muted); font-size: 15.5px; }
.lab-status {
  font-size: 12px;
  color: var(--ice);
  border: 1px solid var(--border-strong);
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .lab-box { flex-direction: column; align-items: flex-start; padding: 32px; }
}

/* ---------- Principles ---------- */
.principles { border-top: 1px solid var(--border); }
.prin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.prin-item .prin-index {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
  display: block;
}
.prin-item h3 { font-size: 19px; margin-bottom: 10px; }
.prin-item p { color: var(--text-muted); font-size: 15px; }

@media (max-width: 900px) {
  .prin-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- CTA banner ---------- */
.cta-banner {
  border-top: 1px solid var(--border);
}
.cta-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-box::before {
  content: '';
  position: absolute;
  top: -50%; left: 50%;
  width: 600px; height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(139,92,246,0.18), transparent 65%);
  pointer-events: none;
}
.cta-box h2 { font-size: clamp(26px, 3.2vw, 34px); margin-bottom: 16px; position: relative; }
.cta-box p { color: var(--text-muted); margin-bottom: 32px; position: relative; }
.cta-box .hero-ctas { justify-content: center; position: relative; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 40px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 48px;
}
.footer-brand .nav-logo { margin-bottom: 16px; }
.footer-brand p { color: var(--text-dim); font-size: 14px; max-width: 280px; }
.footer-col h4 {
  font-size: 12.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  font-weight: 600;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom p { color: var(--text-dim); font-size: 13px; line-height: 1.7; max-width: 720px; }

@media (max-width: 820px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
  .cta-box { padding: 40px 24px; }
}

/* ---------- Legal pages ---------- */
.legal-page { padding: 70px 0 100px; }
.legal-page .wrap { max-width: 820px; }
.legal-header { margin-bottom: 48px; border-bottom: 1px solid var(--border); padding-bottom: 32px; }
.legal-header h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 12px; }
.legal-header .updated { color: var(--text-dim); font-size: 13.5px; font-family: 'JetBrains Mono', monospace; }
.legal-body h2 {
  font-size: 21px;
  margin-top: 44px;
  margin-bottom: 14px;
  color: var(--ice);
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li { color: var(--text-muted); font-size: 15.5px; margin-bottom: 14px; }
.legal-body ul { padding-left: 22px; margin-bottom: 14px; }
.legal-body strong { color: var(--text); }
.legal-body a { color: var(--ice); text-decoration: underline; text-underline-offset: 3px; }
.placeholder-note {
  display: inline-block;
  background: rgba(236, 73, 153, 0.12);
  border: 1px solid rgba(236, 73, 153, 0.35);
  color: #f4a5c8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  padding: 2px 8px;
  border-radius: 5px;
}
