/* =========================================================
   Simulara — styles.css
   Sections: tokens · base · nav · hero · sections · mission
   · research · tracker · principles · contact · footer · responsive
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --void: #06070a;
  --void-2: #0b0d14;
  --panel: #11141d;
  --line: #1d2230;
  --text: #e8eaf0;
  --text-dim: #9095a6;
  --text-faint: #5a6072;
  --accent: #6ee7d8;
  --accent-deep: #2dd4bf;
  --violet: #8b7cf6;
  --danger: #f87171;
  --display: 'Space Grotesk', sans-serif;
  --body: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--void);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--void); }

/* ---------- Nav ---------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: rgba(6,7,10,0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.scrolled { border-bottom-color: var(--line); }
.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.logo-mark { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 34px; align-items: center; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  border: 1px solid var(--line);
  padding: 8px 18px;
  border-radius: 100px;
  color: var(--text) !important;
  transition: all 0.2s;
}
.nav-cta:hover { background: var(--text); color: var(--void) !important; border-color: var(--text); }
.menu-btn { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 24px 80px;
}
#field { position: absolute; inset: 0; z-index: 0; }
.hero-glow {
  position: absolute;
  top: 30%; left: 50%;
  transform: translate(-50%,-50%);
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(45,212,191,0.10) 0%, transparent 60%);
  z-index: 0;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 820px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(110,231,216,0.04);
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 26px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent) 0%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 40px;
}
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 30px;
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary { background: var(--text); color: var(--void); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(110,231,216,0.2); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.scroll-hint {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  z-index: 2;
  animation: bob 2.5s ease-in-out infinite;
}
@keyframes bob { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(6px)} }

/* ---------- Section primitives ---------- */
section { position: relative; z-index: 2; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 40px; }
.sec-pad { padding: 120px 0; }
.sec-head { max-width: 680px; margin-bottom: 64px; }
.sec-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 18px;
}
.sec-head h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 18px;
}
.sec-head p { color: var(--text-dim); font-size: 1.05rem; }

/* ---------- Mission ---------- */
.mission {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--void-2), var(--void));
}
.mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.mission-text h2 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}
.mission-text p { color: var(--text-dim); margin-bottom: 16px; }
.equation-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  font-family: var(--mono);
  position: relative;
  overflow: hidden;
}
.equation-box::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139,124,246,0.12), transparent 70%);
}
.eq-line { font-size: 15px; color: var(--text-dim); margin-bottom: 14px; position: relative; }
.eq-line .var { color: var(--accent); }
.eq-line .op { color: var(--violet); }
.eq-big { font-size: 22px; color: var(--text); margin: 20px 0; letter-spacing: 0.02em; }

/* ---------- Research cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.card:hover { border-color: var(--accent-deep); transform: translateY(-4px); }
.card-num { font-family: var(--mono); font-size: 12px; color: var(--text-faint); margin-bottom: 24px; }
.card-icon { width: 44px; height: 44px; margin-bottom: 20px; color: var(--accent); }
.card h3 { font-family: var(--display); font-size: 1.25rem; font-weight: 600; margin-bottom: 12px; letter-spacing: -0.01em; }
.card p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- Tracker ---------- */
.tracker { background: linear-gradient(180deg, var(--void), var(--void-2)); border-top: 1px solid var(--line); }
.tracker-inner {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 48px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
  align-items: center;
}
.tracker-text h2 { font-family: var(--display); font-size: 2rem; font-weight: 600; margin-bottom: 18px; letter-spacing: -0.02em; }
.tracker-text p { color: var(--text-dim); margin-bottom: 16px; }
.tracker-text .btn { margin-top: 12px; }
.quote-card {
  background: linear-gradient(135deg, rgba(139,124,246,0.08), rgba(110,231,216,0.04));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  position: relative;
}
.quote-mark {
  font-family: var(--display);
  font-size: 5rem;
  line-height: 0.5;
  color: var(--accent);
  opacity: 0.4;
  height: 40px;
}
.quote-text { font-family: var(--display); font-size: 1.3rem; font-weight: 500; line-height: 1.4; margin-bottom: 18px; }
.quote-sub { font-family: var(--mono); font-size: 12px; color: var(--text-faint); letter-spacing: 0.04em; }

/* ---------- Principles ---------- */
.principles { border-top: 1px solid var(--line); }
.principle-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 30px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.principle-row:first-of-type { border-top: 1px solid var(--line); }
.p-num { font-family: var(--mono); font-size: 14px; color: var(--accent-deep); }
.principle-row h3 { font-family: var(--display); font-size: 1.4rem; font-weight: 600; margin-bottom: 8px; }
.principle-row p { color: var(--text-dim); max-width: 620px; }
.safety-note {
  margin-top: 50px;
  background: linear-gradient(135deg, rgba(139,124,246,0.07), rgba(110,231,216,0.04));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 36px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.safety-note svg { color: var(--violet); flex-shrink: 0; margin-top: 2px; }
.safety-note h4 { font-family: var(--display); font-size: 1.1rem; margin-bottom: 6px; }
.safety-note p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--line); background: radial-gradient(ellipse at center, var(--void-2), var(--void)); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.contact-intro h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 18px;
}
.contact-intro p { color: var(--text-dim); margin-bottom: 28px; }
.contact-points { list-style: none; }
.contact-points li { display: flex; align-items: center; gap: 12px; color: var(--text-dim); margin-bottom: 14px; font-size: 0.95rem; }
.contact-points .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}
.contact-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px;
}
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--void-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px rgba(45,212,191,0.12);
}
.field textarea { resize: vertical; min-height: 110px; }
.field select { cursor: pointer; }
.field.invalid input,
.field.invalid textarea { border-color: var(--danger); }
.err { display: block; color: var(--danger); font-size: 12px; margin-top: 6px; min-height: 14px; font-family: var(--mono); }
.form-status { margin-top: 16px; font-size: 14px; text-align: center; min-height: 20px; }
.form-status.success { color: var(--accent); }
.form-status.error { color: var(--danger); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 60px 40px 40px; }
.foot-grid {
  max-width: 1180px;
  margin: 0 auto 50px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.foot-brand .logo { margin-bottom: 14px; }
.foot-brand p { color: var(--text-faint); font-size: 0.9rem; max-width: 280px; }
.foot-col h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.foot-col a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 12px;
  transition: color 0.2s;
}
.foot-col a:hover { color: var(--text); }
.foot-bottom {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-faint);
  font-family: var(--mono);
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: all 0.7s cubic-bezier(0.16,1,0.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  nav { padding: 16px 22px; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(6,7,10,0.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 22px; width: 100%; }
  .nav-links .nav-cta { margin: 8px 22px; width: auto; text-align: center; }
  .menu-btn { display: block; }
  .container { padding: 0 22px; }
  .sec-pad { padding: 80px 0; }
  .mission-grid,
  .tracker-inner,
  .contact-grid,
  .foot-grid { grid-template-columns: 1fr; gap: 36px; }
  .cards { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-bottom { flex-direction: column; gap: 14px; text-align: center; }
  .principle-row { grid-template-columns: 1fr; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, .reveal { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
  position: relative;
}
.auth-glow {
  position: fixed;
  top: 30%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(45,212,191,0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 48px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}
.auth-logo { margin-bottom: 28px; }
.auth-card h2 {
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.auth-sub { color: var(--text-dim); margin-bottom: 32px; font-size: 15px; }
.auth-form .field { margin-bottom: 20px; }
.auth-form .field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.auth-form .field input {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
}
.auth-form .field input:focus { border-color: var(--accent); }
.field-err { display: block; color: var(--danger); font-size: 13px; margin-top: 6px; }
.auth-error {
  background: rgba(248,113,113,0.07);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--danger);
  font-size: 14px;
  margin-bottom: 20px;
}
.auth-submit { width: 100%; justify-content: center; margin-top: 8px; background: var(--accent); color: var(--void); }
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(45,212,191,0.25); }
.auth-alt { margin-top: 24px; text-align: center; font-size: 14px; color: var(--text-dim); }
.auth-alt a { color: var(--accent); text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-faint);
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* nav auth links */
.nav-user { font-size: 13px; color: var(--text-dim); font-family: var(--mono); }
.nav-signout {
  background: none; border: none; color: var(--text-dim);
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: var(--body); padding: 0;
  transition: color 0.2s;
}
.nav-signout:hover { color: var(--text); }

/* =========================================================
   Light / Dark theme
   ========================================================= */

[data-theme="light"] {
  --void: #f4f6fb;
  --void-2: #eaedf6;
  --panel: #ffffff;
  --line: #dde1ef;
  --text: #0d0f1a;
  --text-dim: #4b5568;
  --text-faint: #8896aa;
  --accent: #0d9488;
  --accent-deep: #0f766e;
  --violet: #6d28d9;
}

[data-theme="light"] nav {
  background: rgba(244,246,251,0.88);
}

[data-theme="light"] .hero-glow {
  background: radial-gradient(circle, rgba(13,148,136,0.1) 0%, transparent 60%);
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Dark mode → show sun icon (click to go light) */
.icon-moon { display: none; }
.icon-sun  { display: block; }
/* Light mode → show moon icon (click to go dark) */
[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: none; }

@media (max-width: 860px) {
  [data-theme="light"] .nav-links {
    background: rgba(244,246,251,0.98);
  }
}
