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

:root {
  --bg: #111113;
  --bg-alt: #17171a;
  --rule: #2a2a2f;
  --text: #e8e8ec;
  --text-secondary: #888894;
  --orange: #f7761a;
  --orange-dim: #c05e12;
  --white: #f5f5f7;
  --font-sans: "Overpass", system-ui, sans-serif;
  --font-mono: "Overpass Mono", "Courier New", monospace;
  --max: 1100px;
  color-scheme: dark;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 200;
  background: var(--orange);
  color: var(--bg);
  padding: 0.4rem 0.7rem;
  border-radius: 3px;
}
.skip-link:focus { top: 0.75rem; }

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 0 2rem;
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo img {
  height: 36px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--bg) !important;
  background: var(--orange);
  padding: 6px 14px;
  border-radius: 3px;
  transition: background 0.15s !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-cta:hover { background: var(--orange-dim) !important; text-decoration: none !important; }

.nav-menu { display: none; }
.nav-menu summary {
  list-style: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 20px;
  border-radius: 3px;
}
.nav-menu summary:hover { color: var(--white); }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary .fa-xmark { display: none; }
.nav-menu[open] summary .fa-bars { display: none; }
.nav-menu[open] summary .fa-xmark { display: block; }

/* ── HERO ── */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px 2rem 80px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}

.hero-parallax {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 40%, rgba(247, 118, 26, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(247, 118, 26, 0.04) 0%, transparent 60%);
  pointer-events: none;
  will-change: transform;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr minmax(180px, 280px);
  gap: 3rem;
  align-items: center;
}

.hero-mark {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  justify-self: end;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--orange);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 300;
  line-height: 1.18;
  max-width: 820px;
  color: var(--white);
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--text-secondary);
}

.hero-body {
  max-width: 580px;
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  background: var(--orange);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--orange-dim); text-decoration: none; }

.btn-secondary {
  display: inline-block;
  color: var(--text-secondary);
  font-size: 14px;
  border: 1px solid var(--rule);
  padding: 9px 20px;
  border-radius: 3px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: #555; color: var(--text); text-decoration: none; }

/* ── IMPLEMENTATIONS ── */
.implementations {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 2rem;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.implementations-title {
  font-size: 22px;
  font-weight: 400;
  color: var(--white);
  margin: 8px 0 10px;
  letter-spacing: -0.01em;
}

.implementations-copy p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 460px;
}

.implementation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 20px 22px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg-alt);
}

.implementation-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.implementation-version {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.implementation-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 4px;
}

.implementation-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ── SECTION ── */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 2rem;
  border-bottom: 1px solid var(--rule);
}

.section-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  max-width: 680px;
  margin-bottom: 48px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--orange);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 300;
  color: var(--white);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.section-body {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

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

/* ── FEATURE GRID ── */
.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.feature {
  padding: 32px 32px 32px 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.feature:nth-child(odd) { padding-left: 0; }
.feature:nth-child(even) { padding-left: 32px; border-right: none; }
.feature:last-child,
.feature:nth-last-child(2):nth-child(odd) { border-bottom: none; }

.feature h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.feature p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 360px;
}

.feature-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--orange);
}

.feature-link i { font-size: 11px; }

.nav-cta i { font-size: 11px; margin-left: 4px; }

/* ── PIPELINE ── */
.pipeline {
  display: flex;
  flex-direction: column;
  position: relative;
  margin-top: 48px;
}

.pipeline::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: var(--rule);
}

.pipeline-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 2rem;
  padding: 0 0 48px 0;
  position: relative;
  align-items: start;
}

.pipeline-step:last-child { padding-bottom: 0; }

.pipeline-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--bg);
  background: var(--orange);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  margin-top: 2px;
}

.pipeline-step:not(:first-child) .pipeline-num {
  background: var(--bg-alt);
  color: var(--text-secondary);
  border: 1px solid var(--rule);
}

.pipeline-content { padding-top: 4px; }

.pipeline-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.pipeline-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
}

.pipeline-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  border: 1px solid var(--rule);
  padding: 2px 8px;
  border-radius: 2px;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.code-block {
  background: #0c0c0e;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 20px 24px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a0a0b0;
  line-height: 1.7;
  overflow-x: auto;
}

.code-block .kw { color: var(--orange); }
.code-block .cm { color: #555; }
.code-block .str { color: #c4b8a8; }

.viz-frame {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-alt);
}

.viz-frame iframe {
  display: block;
  width: 100%;
  height: 540px;
  border: none;
}

.chart-embed {
  margin: 40px 0 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: #0a0a0b;
}

.chart-embed iframe {
  display: block;
  width: 100%;
  border: none;
}

.chart-embed--gov-spectrum iframe {
  min-height: 140px;
  height: 200px;
  max-height: 340px;
}

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; }

.faq-category { margin-top: 2rem; }
.faq-category:first-child { margin-top: 0; }
.faq-category h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.faq-item { border-bottom: 1px solid var(--rule); }

.faq-a-inner p + p { margin-top: 0.85em; }

.faq-q {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr 24px;
  align-items: center;
  gap: 1rem;
  padding: 22px 0;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  color: var(--white);
  line-height: 1.4;
}

.faq-icon {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 18px;
  text-align: center;
  line-height: 1;
  transition: transform 0.2s;
  user-select: none;
}

.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.faq-a-inner {
  padding-bottom: 22px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 620px;
}

/* ── QUOTE ── */
.philosophy {
  background: var(--bg-alt);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.philosophy-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.philosophy-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--orange);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

blockquote {
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 300;
  font-style: italic;
  color: var(--white);
  line-height: 1.55;
  max-width: 740px;
  letter-spacing: -0.005em;
}

blockquote footer {
  margin-top: 20px;
  font-style: normal;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── SUBSCRIBE ── */
.subscribe-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
}

.subscribe-content h2,
.subscribe-card h2 {
  font-size: 26px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 8px;
}

.subscribe-content p,
.subscribe-card p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.subscribe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  width: 100%;
  align-items: start;
}

.subscribe-card {
  min-width: 0;
}

.book-card-title {
  color: var(--white);
  margin-bottom: 12px;
}

.btn-coming-soon {
  pointer-events: none;
  opacity: 0.72;
  cursor: default;
}

/* Substack embed: invert the inner frame only. The outer border stays on
   the unfiltered shell so it does not flip to a white ring. */
.subscribe-embed {
  max-width: 480px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: #0a0a0a;
  line-height: 0;
}

.subscribe-embed-invert {
  background: #fff;
  isolation: isolate;
  filter: invert(1) hue-rotate(180deg) contrast(0.92) brightness(1.05);
}

.subscribe-embed iframe {
  display: block;
  width: calc(100% + 2px);
  min-height: 150px;
  margin: -1px;
  border: 0;
  background: #fff;
  transform: translateZ(0);
}

.subscribe-pub {
  margin: 14px 0 0;
}

.subscribe-pub a {
  font-size: 13px;
  font-family: var(--font-mono);
}

.fund-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ── FOOTER ── */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 2rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
}

.footer-brand .wordmark {
  height: 28px;
  width: auto;
  display: block;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 200px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }

.footer-col a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 2rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-social a {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
}

.footer-social a:hover { color: var(--text); }

.footer-social svg {
  display: block;
  width: 1em;
  height: 1em;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .hero {
    padding: 48px 1.25rem 40px;
  }
  .hero-inner {
    grid-template-columns: 1fr 56px;
    gap: 1rem;
    align-items: start;
  }
  .hero-mark {
    width: 56px;
    max-width: 56px;
    justify-self: end;
  }
  .hero h1 { font-size: clamp(28px, 8vw, 36px); }
  .hero-body { margin-bottom: 28px; }

  .nav-links { display: none; }
  .nav-menu { display: block; }
  .nav-menu[open] .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 1rem 2rem 1.25rem;
  }

  .implementations { grid-template-columns: 1fr; gap: 1.5rem; }
  .implementation-row { flex-wrap: wrap; }

  .site-footer { grid-template-columns: 1fr; gap: 1.5rem; }

  .features { grid-template-columns: 1fr; }
  .feature,
  .feature:nth-child(even),
  .feature:nth-child(odd) {
    padding: 28px 0;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .feature:last-child { border-bottom: none; }

  .footer-links { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start; }

  .pipeline::before { left: 13px; }
  .pipeline-num { width: 20px; height: 20px; font-size: 9px; }
  .pipeline-step { grid-template-columns: 28px 1fr; gap: 1rem; }

  .subscribe-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

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