:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f7f7f5;
  --bg-hover: #f1f0ee;
  --text: #37352f;
  --text-secondary: #787774;
  --text-tertiary: #a09f9c;
  --border: #e3e2e0;
  --accent: #2383e2;
  --accent-hover: #1a6bbf;
  --accent-light: #eaf1fb;
  --code-bg: #f7f6f3;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --btn-bg: #37352f;
  --btn-fg: #ffffff;
  --btn-hover: #1a1a16;
  --shadow: 0 2px 16px rgba(55, 53, 47, 0.06);
  --gate-fg: #1a6b3c;
  --gate-bg: #e7f6ee;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "IBM Plex Serif", ui-serif, Georgia, Cambria, serif;
  --font-body: var(--font-sans);
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --radius: 6px;
  --radius-lg: 10px;
  --max-w: 720px;
  --max-w-wide: 960px;
  --transition: 0.2s ease;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f0c;
  --bg-subtle: #101610;
  --bg-hover: #182018;
  --text: #d7f5dc;
  --text-secondary: #8fb89a;
  --text-tertiary: #5e7d68;
  --border: #243328;
  --accent: #3ddc84;
  --accent-hover: #2fbf70;
  --accent-light: #132418;
  --code-bg: #070a08;
  --nav-bg: rgba(11, 15, 12, 0.92);
  --btn-bg: #3ddc84;
  --btn-fg: #041208;
  --btn-hover: #2fbf70;
  --shadow: 0 0 0 1px rgba(61, 220, 132, 0.08), 0 12px 40px rgba(0, 0, 0, 0.35);
  --gate-fg: #d6ff6b;
  --gate-bg: #1c2610;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.nav-logo,
.footer-logo,
.pricing-card-price {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text);
}

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

.container.wide {
  max-width: var(--max-w-wide);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner,
.footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-inner {
  padding: 0 24px;
  height: 52px;
}

.nav-logo,
.footer-logo {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav-links,
.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

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

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

.nav-cta {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 13px !important;
  font-weight: 500;
  color: var(--text) !important;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 12px;
}

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

.theme-toggle {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-color: var(--btn-bg);
}

.btn-primary:hover {
  background: var(--btn-hover);
  border-color: var(--btn-hover);
  color: var(--btn-fg);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}

.section {
  padding: 80px 0;
}

.section-title {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.section-sub {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--border);
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.45;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 20%, transparent 75%);
  pointer-events: none;
}

.hero-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.hero-headline {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-rotating-wrap {
  display: inline-block;
  min-width: 8.5ch;
  vertical-align: bottom;
}

.hero-rotating {
  display: inline-block;
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1em;
  letter-spacing: -0.02em;
}

.hero-sub {
  max-width: 560px;
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-panel {
  margin-top: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-panel-label {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.panel-call {
  padding: 14px 16px 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
}

.panel-fn {
  color: var(--accent);
  font-weight: 500;
}

.panel-args {
  color: var(--text-secondary);
}

.panel-rows {
  list-style: none;
  padding: 8px 12px 14px;
}

.panel-rows li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 6px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.pill {
  flex: 0 0 auto;
  min-width: 72px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 999px;
  padding: 2px 8px;
  text-align: center;
}

.pill-gate {
  color: var(--gate-fg);
  background: var(--gate-bg);
}

.hero-memory-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.mem-node {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  font-size: 12px;
  color: var(--text-secondary);
}

.mem-node--active {
  color: var(--text);
  background: var(--accent-light);
  border-color: var(--accent);
}

.mem-node--fading { opacity: 0.7; }
.mem-node--dim { opacity: 0.4; }

.problem,
.stack,
.setup,
.rank,
.pricing,
.requirements {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.features,
.shared,
.how,
.surface,
.tokens,
.comparison {
  border-bottom: 1px solid var(--border);
}

.problem-grid,
.features-grid,
.surface-grid,
.pricing-grid {
  display: grid;
  gap: 16px;
}

.problem-grid { grid-template-columns: repeat(3, 1fr); }
.features-grid,
.pricing-grid { grid-template-columns: 1fr 1fr; }
.surface-grid { grid-template-columns: 1fr 1fr; }

.problem-card,
.feature-card,
.surface-card,
.pricing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.problem-card { padding: 24px; }
.feature-card,
.surface-card { padding: 28px; }
.pricing-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-card:hover,
.surface-card:hover {
  background: var(--bg-subtle);
}

.problem-icon,
.feature-icon {
  display: flex;
  align-items: center;
  width: 22px;
  height: 22px;
  margin-bottom: 14px;
  color: var(--accent);
}

.problem-icon svg,
.feature-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.problem-card p,
.feature-card p,
.surface-card p,
.pricing-card-desc,
.step-body p,
.rank-list p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.feature-card h3,
.surface-card h3,
.step-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stack-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px 26px;
  border-top: 3px solid var(--accent);
}

.stack-card:hover { background: var(--bg-hover); }

.stack-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.stack-card h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.stack-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.tech-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.step {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; }

.step-body {
  flex: 1;
  min-width: 0;
}

.step-body p code,
.step-note code {
  overflow-wrap: anywhere;
}

.step-num {
  min-width: 28px;
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.code-block {
  margin-top: 12px;
  max-width: 100%;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.code-block code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
}

.step-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-tertiary);
  border-radius: var(--radius);
  font-size: 13px !important;
  color: var(--text-tertiary) !important;
}

.rank-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
}

.rank-list li {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.rank-list li:last-child { border-bottom: none; }

.rank-index {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  min-width: 16px;
  padding-top: 2px;
}

.rank-list strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.token-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.token-fade {
  --token-head: 2.55rem;
  --token-row: 2.4rem;
  max-height: calc(var(--token-head) + 8 * var(--token-row));
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 calc(var(--token-head) + 5.2 * var(--token-row)),
    rgba(0, 0, 0, 0.55) calc(var(--token-head) + 6.6 * var(--token-row)),
    rgba(0, 0, 0, 0.18) calc(var(--token-head) + 7.4 * var(--token-row)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 calc(var(--token-head) + 5.2 * var(--token-row)),
    rgba(0, 0, 0, 0.55) calc(var(--token-head) + 6.6 * var(--token-row)),
    rgba(0, 0, 0, 0.18) calc(var(--token-head) + 7.4 * var(--token-row)),
    transparent 100%
  );
}

.token-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13px;
}

.token-table caption.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.token-table th,
.token-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.token-table thead th {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-subtle);
}

.token-table tbody th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.token-table td.tok {
  color: var(--accent);
  font-weight: 600;
}

.token-table tr.total th,
.token-table tr.total td {
  font-weight: 600;
  background: var(--bg-subtle);
  border-bottom: none;
}

.token-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.compare-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--bg);
}

.compare-header,
.compare-row {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.compare-row:last-child { border-bottom: none; }
.compare-header { background: var(--bg-subtle); }

.compare-header > div,
.compare-row > div {
  padding: 12px 16px;
  font-size: 13px;
  border-right: 1px solid var(--border);
}

.compare-header > div:last-child,
.compare-row > div:last-child { border-right: none; }

.compare-col-label { font-weight: 600; }

.compare-header .compare-col {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.compare-row .compare-col { color: var(--text-secondary); }

.compare-col-highlight {
  background: var(--accent-light);
  color: var(--accent) !important;
  font-weight: 500;
}

.compare-note {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.compare-note strong { color: var(--text); }

.pricing-card-managed { border-color: var(--accent); }

.pricing-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.pricing-card-managed .pricing-card-label { color: var(--accent); }

.pricing-card-price {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.pricing-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.pricing-list li {
  font-size: 14px;
  color: var(--text-secondary);
}

.pricing-list li::before {
  content: "– ";
  color: var(--text-tertiary);
}

.req-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.req-row {
  display: flex;
  gap: 24px;
  padding: 14px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.req-row:last-child { border-bottom: none; }
.req-row:hover { background: var(--bg-hover); }

.req-label {
  min-width: 120px;
  font-size: 13px;
  font-weight: 600;
}

.req-value {
  font-size: 13px;
  color: var(--text-secondary);
}

.footer {
  padding: 32px 0;
}

.footer-inner { padding: 0; }

.footer-copy {
  font-size: 12px;
  color: var(--text-tertiary);
}

.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-rotating { transition: none; }
}

@media (max-width: 800px) {
  .section { padding: 56px 0; }
  .hero { padding: 64px 0 56px; }
  .problem-grid,
  .features-grid,
  .surface-grid,
  .pricing-grid,
  .stack-grid { grid-template-columns: 1fr; }
  .nav-links a:not(.nav-cta) { display: none; }
  .req-row { flex-direction: column; gap: 4px; }
  .req-label { min-width: 0; }
  .compare-header,
  .compare-row { grid-template-columns: 92px 1fr 1fr; }
  .compare-header > div,
  .compare-row > div { padding: 10px; font-size: 12px; }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-memory-strip { display: none; }
  .panel-rows li { flex-direction: column; gap: 4px; }
  .step {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .hero-ctas { flex-direction: column; }
  .btn { width: 100%; }
}
