/* ============================================================
   CODEX OF PHYSICS — Global Design System
   Dark academic × Apple minimalism × Atomic aesthetics
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ──────────────────────────────────────────
   CSS CUSTOM PROPERTIES (Design Tokens)
   ────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-void:        #060811;
  --bg-deep:        #090d1a;
  --bg-surface:     #0d1224;
  --bg-card:        #111828;
  --bg-card-hover:  #151e32;
  --bg-glass:       rgba(13, 18, 36, 0.7);

  /* Accents */
  --accent-cyan:    #00d4ff;
  --accent-indigo:  #7c6bff;
  --accent-magenta: #e040fb;
  --accent-amber:   #ffb830;
  --accent-green:   #00ff9d;

  /* Glow variants */
  --glow-cyan:      0 0 20px rgba(0, 212, 255, 0.35), 0 0 60px rgba(0, 212, 255, 0.12);
  --glow-indigo:    0 0 20px rgba(124, 107, 255, 0.35), 0 0 60px rgba(124, 107, 255, 0.12);
  --glow-magenta:   0 0 20px rgba(224, 64, 251, 0.35), 0 0 60px rgba(224, 64, 251, 0.12);

  /* Typography */
  --font-sans:      'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono:      'Space Mono', 'Fira Code', monospace;

  /* Text */
  --text-primary:   #f0f4ff;
  --text-secondary: #8892aa;
  --text-muted:     #4a5268;
  --text-accent:    var(--accent-cyan);

  /* Borders */
  --border-subtle:  rgba(255,255,255,0.05);
  --border-soft:    rgba(255,255,255,0.08);
  --border-accent:  rgba(0, 212, 255, 0.3);

  /* Spacing */
  --nav-height:     68px;
  --section-pad-y:  120px;
  --section-pad-x:  clamp(24px, 6vw, 120px);

  /* Transitions */
  --ease-smooth:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:       180ms;
  --dur-base:       320ms;
  --dur-slow:       600ms;

  /* Border radius */
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
}

/* ──────────────────────────────────────────
   RESET & BASE
   ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: rgba(0,212,255,0.22); color: var(--text-primary); }

a { color: inherit; text-decoration: none; }
img, video, canvas { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ──────────────────────────────────────────
   SCROLLBAR
   ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,0.4); }

/* ──────────────────────────────────────────
   UTILITY CLASSES
   ────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--section-pad-x);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ──────────────────────────────────────────
   NAVIGATION
   ────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding-inline: var(--section-pad-x);
  transition: background var(--dur-base) var(--ease-smooth),
              backdrop-filter var(--dur-base) var(--ease-smooth),
              border-color var(--dur-base) var(--ease-smooth);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: opacity var(--dur-fast) ease;
}

.nav-logo:hover { opacity: 0.8; }

.nav-logo-icon {
  width: 32px; height: 32px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

.nav-logo svg { width: 32px; height: 32px; }

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

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  transition: color var(--dur-fast) ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent-cyan);
  transition: width var(--dur-base) var(--ease-smooth);
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  padding: 8px 20px;
  border-radius: 100px;
  border: 1px solid var(--border-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-cyan) !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--dur-fast) ease, box-shadow var(--dur-fast) ease !important;
}

.nav-cta:hover {
  background: rgba(0,212,255,0.1) !important;
  box-shadow: var(--glow-cyan) !important;
}

.nav-cta::after { display: none !important; }

/* ──────────────────────────────────────────
   HERO SECTION
   ────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding-bottom: 80px;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, transparent 30%, var(--bg-void) 85%);
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 760px;
  padding-inline: 24px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up var(--dur-slow) var(--ease-smooth) 0.3s forwards;
}

.hero-eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(28px);
  animation: fade-up var(--dur-slow) var(--ease-smooth) 0.55s forwards;
}

.hero-title .brand { color: white; }
.hero-title .accent { color: var(--accent-cyan); }

.hero-tagline {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.6;
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up var(--dur-slow) var(--ease-smooth) 0.75s forwards;
}

.hero-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fade-up var(--dur-slow) var(--ease-smooth) 0.95s forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  background: var(--accent-cyan);
  color: var(--bg-void);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all var(--dur-base) var(--ease-smooth);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(0,212,255,0.4);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--dur-base) var(--ease-smooth);
}

.btn-ghost:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: rgba(0,212,255,0.05);
  transform: translateY(-2px);
}

/* scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  animation: fade-up 0.6s ease 1.4s forwards;
}

.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--accent-cyan), transparent);
  animation: scroll-line-anim 1.8s ease-in-out infinite;
}

@keyframes scroll-line-anim {
  0% { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ──────────────────────────────────────────
   SECTION COMMON
   ────────────────────────────────────────── */
section { padding-block: var(--section-pad-y); }

.section-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--accent-cyan);
}

.section-title {
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.7;
}

/* fade-up animation helper */
@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.reveal.visible { opacity: 1; transform: none; }

/* ──────────────────────────────────────────
   SIMULATIONS LIBRARY
   ────────────────────────────────────────── */
#simulations { background: var(--bg-deep); }

.sims-header { margin-bottom: 64px; }

.sims-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.sim-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--dur-base) var(--ease-smooth);
  text-decoration: none;
  display: block;
  group: '';
}

.sim-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, var(--accent-cyan) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur-base) ease;
}

.sim-card:hover { background: var(--bg-card-hover); transform: translateY(-4px); }
.sim-card:hover::before { opacity: 1; }

.sim-card--featured { border-color: rgba(0,212,255,0.15); }
.sim-card--featured::before { opacity: 0.5; }
.sim-card--featured:hover::before { opacity: 1; }

.sim-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.badge-live {
  background: rgba(0, 255, 157, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 157, 0.25);
}

.badge-soon {
  background: rgba(255, 184, 48, 0.1);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 184, 48, 0.2);
}

.badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-live .badge-dot { animation: pulse-dot 1.5s ease infinite; }

.sim-card__canvas-preview {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  margin-bottom: 28px;
  overflow: hidden;
  position: relative;
}

.sim-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.sim-card__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 28px;
}

.sim-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.tag {
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--bg-surface);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  border: 1px solid var(--border-subtle);
}

.sim-card__link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--accent-cyan);
  transition: gap var(--dur-fast) ease;
}

.sim-card:hover .sim-card__link { gap: 10px; }

.sim-card--disabled {
  cursor: default;
  pointer-events: auto;
}

.sim-card--disabled:hover {
  transform: none;
  background: var(--bg-card);
}

/* ──────────────────────────────────────────
   ABOUT SECTION
   ────────────────────────────────────────── */
#about {
  background: var(--bg-void);
  position: relative;
  overflow: hidden;
}

#about::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(124,107,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-text .section-subtitle { max-width: 460px; margin-bottom: 24px; }

.about-text p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 20px;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}

.stat-item {
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent-cyan);
  display: block;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.about-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-glyph {
  width: 320px; height: 320px;
  position: relative;
}

.about-glyph canvas {
  width: 100%; height: 100%;
  border-radius: 50%;
}

/* ──────────────────────────────────────────
   FOOTER
   ────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: 48px;
  background: var(--bg-void);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.footer-credit {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.footer-credit span { color: var(--accent-cyan); }

/* ──────────────────────────────────────────
   NOISE TEXTURE OVERLAY
   ────────────────────────────────────────── */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ──────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --section-pad-y: 80px; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-visual { display: none; }
  .sims-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --section-pad-x: 20px; }
  .nav-links { display: none; }
  .hero-actions { flex-direction: column; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}
