:root {
  --bg: #08111f;
  --bg-2: #0b1627;
  --surface: rgba(255,255,255,.065);
  --surface-strong: rgba(255,255,255,.095);
  --surface-solid: #101d30;
  --text: #f5f8fc;
  --muted: #a8b5c7;
  --border: rgba(255,255,255,.12);
  --accent: #70e1f5;
  --accent-2: #b49cff;
  --accent-soft: rgba(112,225,245,.12);
  --good: #8ce7ae;
  --shadow: 0 24px 70px rgba(0,0,0,.26);
  --radius: 22px;
  --max: 1160px;
}

html[data-theme="light"] {
  --bg: #f5f8fc;
  --bg-2: #edf3fa;
  --surface: rgba(255,255,255,.72);
  --surface-strong: rgba(255,255,255,.94);
  --surface-solid: #ffffff;
  --text: #122033;
  --muted: #5c6b7d;
  --border: rgba(18,32,51,.12);
  --accent: #087f98;
  --accent-2: #6c4dd9;
  --accent-soft: rgba(8,127,152,.08);
  --good: #17834b;
  --shadow: 0 20px 55px rgba(36,54,78,.12);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

html[data-theme="light"] { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  background:
    radial-gradient(circle at 8% 5%, rgba(112,225,245,.13), transparent 28rem),
    radial-gradient(circle at 92% 9%, rgba(180,156,255,.12), transparent 26rem),
    linear-gradient(180deg, var(--bg), var(--bg-2) 45%, var(--bg));
}

a { color: inherit; }
button, input { font: inherit; }

.container {
  width: min(var(--max), 91%);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
}

.navbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  margin-right: auto;
  color: var(--text);
  font-weight: 900;
  letter-spacing: .08em;
  text-decoration: none;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a,
.icon-btn {
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  padding: 9px 12px;
  cursor: pointer;
  transition: .2s ease;
}

.nav-links a:hover,
.nav-links a.active,
.icon-btn:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.menu-btn { display: none; }

.page-hero {
  padding: 104px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  align-items: center;
  gap: 54px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  color: var(--accent);
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .78rem;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 99px;
  background: var(--accent);
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 22px;
  max-width: 840px;
  font-size: clamp(3.2rem, 8vw, 6.9rem);
  line-height: .96;
  letter-spacing: -.06em;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -.04em;
}

h3 { line-height: 1.3; }

.gradient-text {
  color: transparent;
  background: linear-gradient(95deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
}

.lead {
  max-width: 710px;
  color: var(--muted);
  font-size: 1.1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  min-height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--surface-strong);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}

.btn.primary {
  color: #061c23;
  border-color: var(--accent);
  background: var(--accent);
}

html[data-theme="light"] .btn.primary { color: white; }

.hero-panel,
.card,
.research-set,
.tool-panel,
.matrix,
.note-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 30px;
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  bottom: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(112,225,245,.25), transparent 68%);
  pointer-events: none;
}

.hero-panel .label {
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero-panel h3 {
  margin: 8px 0 16px;
  font-size: 1.7rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 11px;
  font-size: .85rem;
}

.section {
  padding: 74px 0;
}

.section-head {
  max-width: 760px;
  margin-bottom: 30px;
}

.section-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  padding: 25px;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease;
}

a.card:hover {
  transform: translateY(-5px);
  background: var(--surface-strong);
}

.card-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.card h3 {
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.card p {
  margin-bottom: 0;
  color: var(--muted);
}

.arrow {
  display: inline-block;
  margin-top: 18px;
  color: var(--accent);
  font-weight: 800;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  color: var(--text);
}

.stat span {
  color: var(--muted);
  font-size: .83rem;
}

.research-intro {
  padding-bottom: 36px;
}

.tool-panel {
  position: sticky;
  top: 88px;
  z-index: 20;
  margin-bottom: 28px;
  padding: 16px;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(15px);
}

.tools-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 260px;
  flex: 1 1 360px;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 13px;
  outline: none;
  padding: 0 15px 0 42px;
  color: var(--text);
  background: var(--surface-solid);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  cursor: pointer;
  transition: .2s ease;
}

.chip:hover,
.chip.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
}

.research-stack {
  display: grid;
  gap: 24px;
}

.research-set {
  overflow: hidden;
}

.research-set-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(112,225,245,.09), rgba(180,156,255,.065));
}

.research-set-head h2 {
  margin-bottom: 6px;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.research-set-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.set-meta {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: var(--surface);
  font-size: .82rem;
}

.questions {
  padding: 12px 20px 20px;
}

.qa {
  border-bottom: 1px solid var(--border);
}

.qa:last-child { border-bottom: 0; }

.qa summary {
  list-style: none;
  position: relative;
  cursor: pointer;
  padding: 20px 44px 20px 0;
  font-weight: 800;
  line-height: 1.45;
}

.qa summary::-webkit-details-marker { display: none; }

.qa summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 17px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--accent);
  background: var(--surface);
  font-size: 1.15rem;
  transition: transform .2s ease;
}

.qa[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}

.answer {
  max-width: 900px;
  padding: 0 40px 20px 0;
  color: var(--muted);
}

.answer p:last-child { margin-bottom: 0; }

.citations {
  margin: 0 20px 22px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
}

.citations h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.citation {
  margin: 0;
  padding: 11px 0 11px 1.6em;
  text-indent: -1.6em;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: .92rem;
}

.citation:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.citation a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.citation a:hover { text-decoration: underline; }

.empty-state {
  display: none;
  padding: 34px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.note-card {
  padding: 20px;
}

.note-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 11px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 900;
}

.note-card h3 {
  margin-bottom: 8px;
  font-size: 1.06rem;
}

.note-card p,
.note-card li {
  color: var(--muted);
  font-size: .94rem;
}

.note-card p:last-child { margin-bottom: 0; }

.matrix {
  overflow: hidden;
  margin-bottom: 28px;
}

.matrix-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

.matrix-head h3 { margin-bottom: 4px; }
.matrix-head p { margin-bottom: 0; color: var(--muted); }

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
}

.matrix-cell {
  min-height: 140px;
  padding: 22px;
  background: var(--surface-solid);
}

.matrix-cell strong {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
}

.matrix-cell span { color: var(--muted); }

.quote {
  margin-bottom: 28px;
  padding: 22px 24px;
  border-left: 4px solid var(--accent);
  border-radius: 0 18px 18px 0;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  color: var(--text);
}

.site-footer {
  margin-top: 60px;
  padding: 34px 0 42px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-row p { margin: 0; }

kbd {
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: .78rem;
}

.hidden { display: none !important; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-panel { position: static; }
}

@media (max-width: 720px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 4.5%;
    right: 4.5%;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-solid);
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 12px; }
  .page-hero { padding-top: 78px; }
  h1 { font-size: clamp(3rem, 17vw, 5.4rem); }
  .card-grid,
  .stats,
  .notes-grid,
  .matrix-grid { grid-template-columns: 1fr; }
  .research-set-head { flex-direction: column; }
  .search-box { min-width: 100%; }
  .answer { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
