/* Design tokens */
:root {
  --accent: #6c63ff;
  --accent-soft: rgba(108, 99, 255, 0.14);
  --accent-glow: rgba(108, 99, 255, 0.45);
  --bg: #f6f5ff;
  --bg-elevated: #ffffff;
  --text: #17162b;
  --text-muted: #5d5b78;
  --border: rgba(23, 22, 43, 0.1);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow: 0 20px 50px -20px rgba(60, 50, 160, 0.25);
  --radius: 20px;
  --max: 1120px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --accent-soft: rgba(108, 99, 255, 0.14);
  --accent-glow: rgba(108, 99, 255, 0.28);
  --bg: #0e0e14;
  --bg-elevated: #16161e;
  --text: #e8e8f0;
  --text-muted: #9a99ad;
  --border: rgba(255, 255, 255, 0.07);
  --glass: rgba(24, 24, 32, 0.6);
  --glass-border: rgba(255, 255, 255, 0.06);
  --shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* Keep the background blobs subdued in the dark theme */
:root[data-theme="dark"] .blob { opacity: 0.16; }
:root[data-theme="dark"] .blob-3 { opacity: 0.1; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

/* Animated background blobs that make the glass visible */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 22s ease-in-out infinite alternate;
}
.blob-1 { width: 520px; height: 520px; background: var(--accent); top: -160px; left: -120px; }
.blob-2 { width: 420px; height: 420px; background: #c86bfa; top: 30%; right: -140px; animation-delay: -7s; }
.blob-3 { width: 380px; height: 380px; background: #4fc3f7; bottom: -160px; left: 30%; opacity: 0.35; animation-delay: -14s; }

@keyframes drift {
  to { transform: translate(60px, 80px) scale(1.15); }
}

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

/* Glass surface */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow);
}

/* Header */
.header {
  position: sticky;
  top: 12px;
  z-index: 10;
  margin: 12px auto 0;
  width: calc(100% - 32px);
  max-width: var(--max);
  border-radius: 999px;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 50%; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
  text-decoration: none;
}
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Hero */
.hero {
  padding: 110px 0 80px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
}
.gradient {
  background: linear-gradient(120deg, var(--accent), #c86bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 36px;
}
.hero-logo {
  width: 112px;
  height: 112px;
  margin: 0 auto 28px;
  border-radius: 50%;
  box-shadow: 0 16px 48px -12px var(--accent-glow);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 30px -8px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 14px 36px -8px var(--accent-glow); }
.btn-ghost { color: var(--text); }

/* Sections */
section { padding: 70px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.section-head p { color: var(--text-muted); margin: 0; }

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.card {
  padding: 28px;
  border-radius: var(--radius);
  transition: transform 0.25s;
}
.card:hover { transform: translateY(-4px); }
.card h3 { margin: 14px 0 8px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--text-muted); }
.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-icon svg { width: 22px; height: 22px; }

/* Project showcase */
.project {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border-radius: var(--radius);
}
.project img { width: 84px; height: 84px; border-radius: 50%; }
.project h3 { margin: 0 0 4px; font-size: 1.4rem; }
.project p { margin: 0; color: var(--text-muted); }
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
  color: var(--accent);
  background: var(--accent-soft);
}

/* Lineage chain */
.lineage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.lineage span {
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
}
.lineage .arrow { padding: 0; color: var(--text-muted); }
.lineage .current { background: var(--accent); color: #fff; border-color: transparent; }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 14px; }
.step {
  position: relative;
  padding: 22px 22px 22px 74px;
  border-radius: var(--radius);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 22px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
}
.step h3 { margin: 4px 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--text-muted); }
pre {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

.note {
  padding: 20px 24px;
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}
.note p { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chips a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
}
.chips a:hover { color: var(--accent); text-decoration: none; }

/* CTA */
.cta {
  text-align: center;
  padding: 56px 24px;
  border-radius: 28px;
}
.cta h2 { margin: 0 0 12px; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.cta p { color: var(--text-muted); margin: 0 0 28px; }

/* Footer */
.footer {
  padding: 40px 0 50px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s, transform 0.7s; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .nav a.hide-mobile { display: none; }
  .project { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .hero { padding: 80px 0 50px; }
  section { padding: 50px 0; }
}

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