:root {
  --bg: #05070f;
  --bg-soft: #0a0e1c;
  --ink: #eef1fb;
  --ink-dim: #9aa3c0;
  --ink-faint: #5b6585;
  --sun: #ffd166;
  --sun-deep: #ff9e3d;
  --cyan: #5ad1ff;
  --violet: #9b7bff;
  --line: rgba(255, 255, 255, 0.08);
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 680px at 50% -8%, rgba(255, 178, 92, 0.14), transparent 60%),
    radial-gradient(820px 560px at 12% 16%, rgba(255, 158, 61, 0.06), transparent 55%),
    radial-gradient(900px 600px at 88% 16%, rgba(155, 123, 255, 0.07), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ethereal drifting aurora — soft gold light behind everything */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(620px 420px at 28% 24%, rgba(255, 190, 110, 0.07), transparent 60%),
    radial-gradient(520px 380px at 76% 72%, rgba(255, 158, 61, 0.05), transparent 60%);
  filter: blur(34px);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
  100% { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

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

/* Background emblem — π (CCW) → golden ratio (CCW) → static cosmic compass */
.bg-emblem {
  position: fixed;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(94vw, 760px);
  aspect-ratio: 1;
  z-index: 0;
  opacity: 0.22;
  pointer-events: none;
}
.bg-emblem svg { width: 100%; height: 100%; overflow: visible; }
.em-pi { transform-origin: 100px 100px; animation: spin 150s linear infinite reverse; }
.em-gold { transform-origin: 100px 100px; animation: spin 120s linear infinite reverse; }
.em-core { animation: corePulse 6s ease-in-out infinite; }

main, .nav, .footer { position: relative; z-index: 1; }

h1, h2, h3, .brand-name, .hero-eyebrow, .section-eyebrow {
  font-family: "Space Grotesk", "Inter", sans-serif;
}

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

.grad {
  background: linear-gradient(100deg, var(--sun) 0%, var(--sun-deep) 38%, var(--violet) 78%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== NAV ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 0 8px rgba(255, 200, 80, 0.5));
}
.brand-name { font-weight: 600; letter-spacing: 0.28em; font-size: 0.92rem; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--ink-dim); font-size: 0.92rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  color: var(--ink) !important;
}
.nav-cta:hover { border-color: var(--sun); box-shadow: 0 0 18px rgba(255, 209, 102, 0.25); }

/* ===== HERO ===== */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 70px 28px 90px;
  text-align: center;
}
.hero-star {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: clamp(150px, 32vw, 230px);
  aspect-ratio: 1;
  margin-bottom: 26px;
}
.star-svg { width: 100%; height: 100%; overflow: visible; }
.star-orbit { transform-origin: 100px 100px; animation: spin 120s linear infinite reverse; }
.star-back { transform-origin: 100px 100px; transform: rotate(45deg); animation: spin 100s linear infinite; }
.star-main {
  filter: drop-shadow(0 0 22px rgba(255, 174, 76, 0.55));
  animation: corePulse 5.5s ease-in-out infinite;
}
.star-glow {
  position: absolute;
  width: 140%; height: 140%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 174, 76, 0.30), transparent 60%);
  filter: blur(12px);
  animation: breathe 5.5s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes corePulse { 0%, 100% { opacity: 0.95; } 50% { opacity: 1; filter: drop-shadow(0 0 42px rgba(255, 174, 76, 0.8)); } }
@keyframes breathe { 0%, 100% { transform: scale(0.94); opacity: 0.7; } 50% { transform: scale(1.06); opacity: 1; } }

.hero-eyebrow {
  color: var(--sun);
  letter-spacing: 0.4em;
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(2.4rem, 6.5vw, 4.6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.hero-tagline {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  font-weight: 400;
  color: var(--sun);
  letter-spacing: 0.01em;
  margin-bottom: 20px;
}
.hero-sub {
  max-width: 620px;
  margin: 0 auto 36px;
  color: var(--ink-dim);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: "Space Grotesk", sans-serif;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  background: linear-gradient(100deg, var(--sun), var(--sun-deep));
  color: #1a1206;
  box-shadow: 0 0 30px rgba(255, 158, 61, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 44px rgba(255, 158, 61, 0.55); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink-dim); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-faint); }

.spectrum-bar {
  height: 2px;
  max-width: 640px;
  margin: 70px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--sun) 18%, var(--violet) 52%, var(--cyan) 82%, transparent);
  opacity: 0.65;
}

/* ===== SECTIONS ===== */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 90px 28px;
}
.section-eyebrow {
  color: var(--cyan);
  letter-spacing: 0.34em;
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(1.8rem, 4.4vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 40px;
  max-width: 760px;
}

.mission { border-top: 1px solid var(--line); }
.mission-body { max-width: 760px; }
.mission-body p { color: var(--ink-dim); font-size: 1.1rem; margin-bottom: 22px; }
.mission-body strong { color: var(--ink); font-weight: 500; }
.mission-body em { color: var(--sun); font-style: normal; }

/* ===== CARDS ===== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 209, 102, 0.4);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 158, 61, 0.12);
}
.card-icon {
  font-size: 1.6rem;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 12px;
  margin-bottom: 20px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 209, 102, 0.22), rgba(255, 158, 61, 0.05));
  border: 1px solid var(--line);
}
.card h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 12px; }
.card p { color: var(--ink-dim); font-size: 0.98rem; }

/* ===== PRINCIPLES ===== */
.principles { border-top: 1px solid var(--line); }
.principle-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.principle-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  color: var(--sun);
  letter-spacing: 0.2em;
}
.principle h3 { font-size: 1.35rem; font-weight: 600; margin: 10px 0 12px; }
.principle p { color: var(--ink-dim); font-size: 1rem; }

/* ===== CLOSING ===== */
.closing {
  position: relative;
  text-align: center;
  padding: 130px 28px;
  overflow: hidden;
}
.closing-glow {
  position: absolute;
  left: 50%; top: 50%;
  width: 700px; height: 360px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(255, 158, 61, 0.18), transparent 70%);
  filter: blur(20px);
}
.closing h2 {
  position: relative;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 36px;
}
.closing .btn { position: relative; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 56px 28px 70px;
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-tag { color: var(--ink-dim); font-size: 0.95rem; margin-bottom: 18px; }
.footer-mail { color: var(--sun); font-size: 0.95rem; }
.footer-mail:hover { text-shadow: 0 0 16px rgba(255, 209, 102, 0.5); }
.footer-legal { color: var(--ink-faint); font-size: 0.82rem; margin-top: 26px; }

/* ===== CONSTANTS — MATHEMATICS OF LIGHT ===== */
.mono { font-family: var(--mono); }
.constants {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 28px 0;
}
.constants-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.const {
  background: rgba(255, 255, 255, 0.015);
  padding: 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.25s;
}
.const:hover { background: rgba(255, 209, 102, 0.05); }
.const-val {
  font-family: var(--mono);
  font-size: 0.98rem;
  color: var(--sun);
  letter-spacing: 0.01em;
}
.const-lbl {
  font-size: 0.74rem;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

/* ===== ETYMOLOGY ===== */
.etymology { border-top: 1px solid var(--line); }
.etymology .section-title { margin-bottom: 18px; }
.greek-key { width: 240px; max-width: 62%; height: 22px; display: block; margin: 0 0 26px; }
.etym-line {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--ink-dim);
  margin-bottom: 30px;
}
.etym-line em { color: var(--sun); font-style: italic; font-family: "Inter", sans-serif; }
.etym-body { max-width: 720px; }
.etym-body p { color: var(--ink-dim); font-size: 1.08rem; margin-bottom: 20px; }
.etym-body em { color: var(--ink); font-style: normal; }
.etym-coda {
  font-family: "Space Grotesk", sans-serif;
  color: var(--sun);
  font-size: 1.18rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 760px) {
  .nav-links { gap: 16px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .cards, .principle-row { grid-template-columns: 1fr; }
  .constants-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 64px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .star-orbit, .star-back, .star-main, .star-glow, body::before,
  .em-pi, .em-gold, .em-core { animation: none; }
  .star-back { transform: rotate(45deg); }
  html { scroll-behavior: auto; }
}
