/* Hippocampus demo landing page
   Design tokens drive both themes; [data-theme] on <html> flips the palette. */

:root {
  --accent: #7c6cf0;
  --accent-strong: #6355e0;
  --accent-contrast: #ffffff;

  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-mono:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --wrap: 1080px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* Dark (default) */
[data-theme="dark"] {
  --bg: #0c0d12;
  --bg-alt: #12141c;
  --surface: #161824;
  --surface-2: #1c1f2e;
  --border: #262a3a;
  --text: #e8eaf2;
  --text-muted: #a2a7ba;
  --text-faint: #757b90;
  --code-bg: #0a0b10;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Light */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --border: #e7e9f2;
  --text: #14161f;
  --text-muted: #565c72;
  --text-faint: #838aa1;
  --code-bg: #f3f4f9;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  color: var(--accent);
}

.brand-name {
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

.theme-toggle svg {
  grid-area: 1 / 1;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 12vw, 132px) 0 clamp(56px, 9vw, 96px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto 0;
  height: 640px;
  background:
    radial-gradient(
      60% 60% at 20% 10%,
      color-mix(in srgb, var(--accent) 22%, transparent),
      transparent 70%
    ),
    radial-gradient(
      50% 50% at 85% 0%,
      color-mix(in srgb, #35c9c1 16%, transparent),
      transparent 70%
    );
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 5px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
}

.hero-title {
  margin: 0 0 22px;
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 720;
}

.accent {
  color: var(--accent);
}

.hero-sub {
  margin: 0 0 32px;
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  color: var(--text-muted);
  max-width: 660px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Sections */
.section {
  padding: clamp(64px, 9vw, 104px) 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 680;
}

.section-lede {
  margin: 0 0 44px;
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
}

/* Grids & cards */
.grid {
  display: grid;
  gap: 20px;
}

.features {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.demos {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.16rem;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.demo-card {
  display: flex;
  flex-direction: column;
  padding: 30px;
}

.demo-card p {
  flex: 1;
  margin-bottom: 24px;
}

.demo-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 7px;
  padding: 4px 10px;
  margin-bottom: 16px;
}

.demo-card .btn {
  align-self: flex-start;
}

.demos-note {
  margin: 28px 0 0;
  font-size: 0.95rem;
  color: var(--text-faint);
}

/* CTA */
.cta-inner {
  max-width: 720px;
}

.codeblock {
  margin: 0 0 28px;
  padding: 20px 22px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

.codeblock code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
}

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

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.footer-nav a {
  color: var(--text-muted);
  font-size: 0.93rem;
}

.footer-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .site-nav {
    gap: 16px;
  }

  .site-nav a[href="#how"] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn:hover {
    transform: none;
  }
}
