/* ============================================================
   Animat Agent — landing page styles
   Dark, neural / biological tech aesthetic
   ============================================================ */

:root {
  --bg: #07070d;
  --bg-alt: #0c0c16;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(140, 130, 200, 0.16);
  --border-strong: rgba(160, 140, 255, 0.35);
  --text: #e8e6f2;
  --text-dim: #a0a0b8;
  --text-faint: #6c6c84;
  --violet: #8b5cf6;
  --violet-bright: #a78bfa;
  --cyan: #38e8d0;
  --glow: rgba(139, 92, 246, 0.45);
  --radius: 16px;
  --radius-lg: 22px;
  --maxw: 1140px;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Structural colors (overridable per theme) */
  --nav-bg: rgba(7, 7, 13, 0.72);
  --nav-bg-solid: rgba(7, 7, 13, 0.9);
  --topbar-bg: linear-gradient(90deg, rgba(139,92,246,0.10), rgba(56,232,208,0.08));
  --code-bg: #05050b;
  --code-text: #cdd6ff;
  --footer-bg: #050509;
  --card-shadow: rgba(0, 0, 0, 0.45);
  --title-grad-from: #ffffff;
  --title-grad-mid: #c9bff5;
  --title-grad-to: var(--violet);
  --stat-grad-from: #ffffff;
  --stat-grad-to: var(--violet-bright);
  --check-tick: #07110f;
  --hero-glow: radial-gradient(ellipse at center, rgba(139,92,246,0.30), rgba(56,232,208,0.10) 40%, transparent 70%);
  --cta-glow: radial-gradient(ellipse at center, rgba(139,92,246,0.20), transparent 65%);
  --divider: rgba(140, 130, 200, 0.16);
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg: #f5f6fb;
  --bg-alt: #eceef6;
  --surface: rgba(20, 20, 50, 0.03);
  --surface-2: rgba(20, 20, 50, 0.05);
  --border: rgba(60, 50, 120, 0.14);
  --border-strong: rgba(120, 90, 220, 0.32);
  --text: #1a1a2b;
  --text-dim: #4b4b63;
  --text-faint: #8a8aa2;
  --violet: #7c3aed;
  --violet-bright: #6d28d9;
  --cyan: #0d9e8c;
  --glow: rgba(124, 58, 237, 0.28);
  --nav-bg: rgba(245, 246, 251, 0.78);
  --nav-bg-solid: rgba(245, 246, 251, 0.96);
  --topbar-bg: linear-gradient(90deg, rgba(124,58,237,0.10), rgba(13,158,140,0.08));
  --code-bg: #ffffff;
  --code-text: #3b2a6b;
  --footer-bg: #e9ebf3;
  --card-shadow: rgba(60, 50, 120, 0.18);
  --title-grad-from: #2a1a4a;
  --title-grad-mid: #7c3aed;
  --title-grad-to: #5b21b6;
  --stat-grad-from: #2a1a4a;
  --stat-grad-to: var(--violet-bright);
  --check-tick: #ffffff;
  --hero-glow: radial-gradient(ellipse at center, rgba(124,58,237,0.22), rgba(13,158,140,0.10) 40%, transparent 70%);
  --cta-glow: radial-gradient(ellipse at center, rgba(124,58,237,0.16), transparent 65%);
  --divider: rgba(60, 50, 120, 0.14);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Topbar ---------- */
.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.topbar__inner { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 8px 24px; }
.topbar .dot { color: var(--text-faint); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.is-scrolled { border-bottom-color: var(--border); background: var(--nav-bg-solid); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--violet-bright); font-weight: 700; letter-spacing: .01em; }
.brand__mark { filter: drop-shadow(0 0 6px var(--glow)); }
.brand__name { font-size: 18px; color: var(--text); }
.brand__sub { color: var(--violet-bright); margin-left: 2px; }

.nav__links { display: flex; align-items: center; gap: 28px; font-size: 14.5px; color: var(--text-dim); }
.nav__links a { transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__links a.nav__active { color: var(--violet-bright); }
.nav__links a.nav__active:not(.nav__github) { position: relative; }
.nav__links a.nav__active:not(.nav__github)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 2px;
  background: var(--violet-bright); border-radius: 2px; box-shadow: 0 0 10px var(--glow);
}
.nav__github {
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--violet-bright) !important;
  transition: background .2s, box-shadow .2s;
}
.nav__github:hover { background: rgba(139,92,246,0.14); box-shadow: 0 0 18px rgba(139,92,246,0.3); }
.nav__lang {
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .02em;
  transition: color .2s, border-color .2s, background .2s;
}
.nav__lang:hover { color: var(--cyan); border-color: var(--cyan); background: rgba(56,232,208,0.08); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
}
.theme-toggle__btn {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color .2s, background .2s, box-shadow .2s;
}
.theme-toggle__btn svg { width: 17px; height: 17px; display: block; }
.theme-toggle__btn:hover { color: var(--text); }
.theme-toggle__btn[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--violet) 0%, #6d4ad8 100%);
  box-shadow: 0 4px 14px rgba(139,92,246,0.35);
}
[data-theme="light"] .theme-toggle__btn[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--violet) 0%, #6d28d9 100%);
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 92px 0 72px; overflow: hidden; }
.hero__glow {
  position: absolute;
  top: -180px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 600px;
  background: var(--hero-glow);
  filter: blur(40px);
  pointer-events: none;
}
.hero__inner { position: relative; text-align: center; }

.badge {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13px;
  color: var(--violet-bright);
  background: rgba(139,92,246,0.08);
  margin-bottom: 28px;
  letter-spacing: .03em;
}

.hero__title {
  font-size: clamp(56px, 12vw, 132px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--title-grad-from) 0%, var(--title-grad-mid) 60%, var(--title-grad-to) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(139,92,246,0.25);
}
.hero__tagline {
  font-size: clamp(20px, 3.4vw, 30px);
  font-weight: 600;
  margin-top: 22px;
  color: var(--text);
}
.hero__desc {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--text-dim);
  font-size: 16.5px;
}
.hero__cta { display: flex; gap: 16px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
  cursor: pointer;
}
.btn--primary {
  background: linear-gradient(135deg, var(--violet) 0%, #6d4ad8 100%);
  color: #fff;
  box-shadow: 0 8px 30px rgba(139,92,246,0.35);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(139,92,246,0.5); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--violet-bright); }
.btn--lg { padding: 16px 38px; font-size: 16px; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 30px 20px;
  backdrop-filter: blur(6px);
}
.stat { text-align: center; }
.stat__num {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  background: linear-gradient(180deg, var(--stat-grad-from), var(--stat-grad-to));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label { color: var(--text-dim); font-size: 13.5px; margin-top: 6px; }

/* ---------- Sections ---------- */
.section { padding: 92px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section__head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section__head--left { text-align: left; margin-left: 0; }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
  font-weight: 600;
}
.section__title { font-size: clamp(28px, 4.4vw, 44px); font-weight: 800; letter-spacing: -.01em; }
.section__lead { color: var(--text-dim); font-size: 17px; margin-top: 16px; }

/* Grid */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: transform .2s, border-color .2s, box-shadow .2s, background .2s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx,50%) var(--my,0%), rgba(139,92,246,0.12), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 16px 40px var(--card-shadow); background: var(--surface-2); }
.card:hover::before { opacity: 1; }
.card__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(139,92,246,0.12);
  color: var(--violet-bright);
  margin-bottom: 18px;
  border: 1px solid var(--border-strong);
}
.card h3 { font-size: 19px; margin-bottom: 10px; font-weight: 700; }
.card p { color: var(--text-dim); font-size: 14.8px; }

/* Panels (capabilities) */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
}
.panel__title { font-size: 18px; margin-bottom: 18px; color: var(--violet-bright); font-weight: 700; }
.check { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.check li { position: relative; padding-left: 30px; color: var(--text-dim); font-size: 15px; }
.check li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  color: var(--check-tick);
  background: var(--cyan);
  border-radius: 50%;
}

/* About */
.about { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; align-items: start; }
.about__body p { color: var(--text-dim); margin-bottom: 16px; font-size: 16px; }
.about__body strong { color: var(--text); }
.about__list { list-style: none; counter-reset: a; display: flex; flex-direction: column; gap: 14px; margin: 8px 0 18px; }
.about__list li { position: relative; padding-left: 36px; color: var(--text-dim); font-size: 15.5px; }
.about__list li::before {
  counter-increment: a; content: counter(a);
  position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  color: var(--violet-bright);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
}
.about__list span { color: var(--text); font-weight: 600; }

/* Architecture diagram */
.arch {
  max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.arch__row { display: flex; gap: 18px; justify-content: center; width: 100%; }
.arch__row--split { gap: 18px; }
.arch__row--foot { margin-top: 6px; }
.arch__arrow { color: var(--violet); font-size: 22px; line-height: 1; margin: 6px 0; opacity: .7; }
.arch__box {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--surface);
  text-align: center;
  position: relative;
  transition: border-color .2s, box-shadow .2s;
}
.arch__box:hover { border-color: var(--border-strong); box-shadow: 0 0 24px rgba(139,92,246,0.18); }
.arch__box strong { display: block; font-size: 16px; margin: 6px 0 4px; }
.arch__box small { color: var(--text-faint); font-size: 12px; }
.arch__tag {
  display: inline-block;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cyan); font-weight: 600;
}
.arch__sense { border-color: rgba(56,232,208,0.3); }
.arch__reflex { border-color: rgba(255,120,120,0.3); }
.arch__cortex { border-color: var(--border-strong); background: rgba(139,92,246,0.07); }
.arch__gate { background: rgba(139,92,246,0.07); }
.arch__journal, .arch__motor, .arch__mem { font-size: 14px; font-weight: 600; }
.arch__note { text-align: center; color: var(--text-faint); font-size: 13.5px; margin-top: 28px; max-width: 620px; margin-left: auto; margin-right: auto; }

/* Steps */
.steps { list-style: none; display: flex; flex-direction: column; gap: 22px; max-width: 820px; margin: 0 auto; }
.step { display: flex; gap: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; transition: border-color .2s; }
.step:hover { border-color: var(--border-strong); }
.step__no {
  flex: 0 0 40px; width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), #6d4ad8);
  color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 6px 18px rgba(139,92,246,0.35);
}
.step__body { flex: 1; }
.step__body h3 { font-size: 17px; margin-bottom: 4px; }
.step__body p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 12px; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--code-text);
}
pre code { white-space: pre; }
code { font-family: var(--mono); font-size: 0.92em; color: var(--violet-bright); background: rgba(139,92,246,0.10); padding: 1px 6px; border-radius: 5px; }
pre code { color: var(--code-text); background: none; padding: 0; }

.callout {
  max-width: 820px; margin: 32px auto 0;
  border: 1px solid rgba(56,232,208,0.3);
  background: rgba(56,232,208,0.06);
  border-radius: 14px;
  padding: 18px 22px;
  color: var(--text-dim);
  font-size: 14.5px;
}
.callout strong { color: var(--cyan); }

/* CTA */
.cta { padding: 96px 0; text-align: center; position: relative; overflow: hidden; border-top: 1px solid var(--border); }
.cta::before {
  content: ""; position: absolute; inset: 0;
  background: var(--cta-glow);
}
.cta__inner { position: relative; }
.cta h2 { font-size: clamp(28px, 4.6vw, 46px); font-weight: 800; letter-spacing: -.01em; }
.cta p { color: var(--text-dim); font-size: 17px; margin: 14px 0 30px; }

/* Footer */
.footer { background: var(--footer-bg); border-top: 1px solid var(--border); padding: 56px 0 28px; }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer__motto { color: var(--text-faint); font-size: 13.5px; margin-top: 12px; font-style: italic; }
.footer__col h4 { font-size: 14px; color: var(--text); margin-bottom: 14px; letter-spacing: .02em; }
.footer__col a { display: block; color: var(--text-dim); font-size: 14px; margin-bottom: 10px; transition: color .2s; }
.footer__col a:hover { color: var(--violet-bright); }
.footer__bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 13px; flex-wrap: wrap; gap: 8px;
}

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--2 { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .nav__links { gap: 16px; font-size: 13.5px; }
}
@media (max-width: 640px) {
  .nav__links a:not(.nav__github) { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .grid--3 { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 56px; }
  .section { padding: 64px 0; }
  .step { flex-direction: column; gap: 14px; }
}
