:root {
  --primary: #0e7c66;
  --primary-soft: #ddf7ef;
  --primary-deep: #064e3b;
  --secondary: #2563eb;
  --secondary-soft: #eaf1ff;
  --accent: #f59e0b;
  --accent-soft: #fff4d8;
  --neutral: #f4f2e8;
  --paper: #fffdf6;
  --surface: #fffdf7;
  --surface-soft: #f7f8f2;
  --text: #111827;
  --text-muted: #475569;
  --text-soft: #64748b;
  --border: #d8dee6;
  --border-soft: #e5e7eb;
  --success: #22c55e;
  --warning: #f97316;
  --on-primary: #ffffff;
  --paper-rule: rgba(17, 24, 39, 0.055);
  --paper-grain: rgba(17, 24, 39, 0.032);
  --shadow-sm: 0 12px 28px rgba(63, 58, 43, 0.07);
  --shadow-lg: 0 26px 58px rgba(63, 58, 43, 0.1);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background-color: var(--neutral);
  background-image:
    linear-gradient(rgba(255, 253, 246, 0.74), rgba(255, 253, 246, 0.74)),
    repeating-linear-gradient(0deg, transparent 0 30px, var(--paper-rule) 30px 31px),
    repeating-linear-gradient(90deg, transparent 0 30px, rgba(14, 124, 102, 0.026) 30px 31px),
    radial-gradient(var(--paper-grain) 0.7px, transparent 0.7px);
  background-size: auto, 31px 31px, 31px 31px, 6px 6px;
  background-attachment: fixed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

code,
pre,
.section-kicker,
.eyebrow,
.brand small,
.hero-badges,
.source-row,
.diagram-node,
.button,
.nav-github {
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  transform: translateY(-140%);
  border-radius: 8px;
  background: var(--text);
  color: var(--on-primary);
  padding: 10px 14px;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(255, 253, 247, 0.88);
  border-bottom: 1px solid rgba(216, 222, 230, 0.66);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand strong {
  display: block;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 8px);
  grid-auto-rows: 8px;
  gap: 3px;
  width: 31px;
  height: 31px;
  align-content: center;
}

.brand-mark span {
  display: block;
  background: var(--primary);
  border-radius: 4px;
}

.brand-mark span:nth-child(2),
.brand-mark span:nth-child(4) {
  background: #22a394;
}

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

.site-nav a {
  border-radius: 9999px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.site-nav .nav-github {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary-deep);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 2px;
}

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

.hero {
  position: relative;
  min-height: 720px;
  display: grid;
  align-items: center;
  padding: 126px clamp(22px, 6vw, 72px) 72px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
  background: transparent;
}

.paper-hero {
  min-height: 680px;
  align-items: end;
  padding-bottom: clamp(62px, 8vw, 96px);
}

.paper-hero .hero-content {
  max-width: 900px;
}

.paper-rule {
  position: absolute;
  left: clamp(22px, 6vw, 72px);
  right: clamp(22px, 6vw, 72px);
  top: 112px;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), var(--border), transparent);
}

.hero-visual {
  position: absolute;
  inset: 0;
  opacity: 0.88;
  pointer-events: none;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(250, 251, 248, 0.98) 0%,
      rgba(250, 251, 248, 0.92) 34%,
      rgba(250, 251, 248, 0.62) 66%,
      rgba(250, 251, 248, 0.32) 100%
    );
}

.hero-visual img {
  width: min(68vw, 1280px);
  height: 100%;
  margin-left: auto;
  object-fit: cover;
  object-position: right center;
}

.hero-content {
  position: relative;
  max-width: 600px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(58px, 10vw, 124px);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-subtitle {
  margin-bottom: 28px;
  color: var(--text);
  font-size: clamp(20px, 3vw, 36px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-lede {
  margin-bottom: 18px;
  color: var(--primary);
  font-size: clamp(26px, 4.5vw, 46px);
  line-height: 1.12;
  font-weight: 750;
  letter-spacing: 0;
  max-width: 560px;
}

.hero-copy,
.section-lede {
  color: var(--text-muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.button-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}

.button-secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-badges span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: rgba(255, 253, 247, 0.82);
  padding: 8px 11px;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.paper-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: rgba(255, 253, 247, 0.78);
  padding: 7px 10px;
}

.section {
  scroll-margin-top: 86px;
  padding: clamp(72px, 10vw, 118px) clamp(22px, 5vw, 56px);
  border-bottom: 1px solid var(--border-soft);
  background: transparent;
}

.section-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.section h2 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: 0;
}

.paper-columns {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(30px, 6vw, 76px);
  align-items: start;
}

.abstract-copy {
  max-width: 760px;
  color: var(--text-muted);
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1.78;
}

.scope-note {
  border-left: 3px solid var(--accent);
  background: rgba(255, 244, 216, 0.52);
  padding: 16px 18px;
  color: var(--text);
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 42px;
}

.principles article,
.invariant-list article {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.principle-number {
  color: var(--primary);
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  font-weight: 700;
}

.principles h3,
.invariant-list h3 {
  margin: 14px 0 8px;
  font-size: 21px;
  line-height: 1.2;
}

.principles p,
.invariant-list p,
.split-heading p,
figcaption {
  color: var(--text-muted);
}

.architecture {
  background: rgba(247, 248, 242, 0.58);
}

.architecture-grid,
.safety-layout,
.run-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: clamp(34px, 6vw, 72px);
  align-items: center;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
}

.check-list li {
  position: relative;
  padding-left: 26px;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.pipeline {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(22px, 4vw, 34px);
  box-shadow: var(--shadow-lg);
}

.pipeline-row {
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  align-items: center;
  gap: 10px;
}

.diagram-node {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-muted);
  padding: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.diagram-node.strong {
  border-color: rgba(14, 124, 102, 0.36);
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.flow-line {
  height: 1px;
  background: var(--primary);
}

.packet {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
}

.packet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-weight: 700;
}

.packet-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--secondary);
}

.packet p {
  margin: 12px 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.source-row span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 8px;
}

.split-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr);
  gap: 32px;
  align-items: end;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  margin: 40px 0 34px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
  box-shadow: var(--shadow-sm);
}

.metric-strip div {
  background: var(--surface);
  padding: 24px;
}

.metric-strip strong {
  display: block;
  color: var(--primary-deep);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: 0;
}

.metric-strip span {
  display: block;
  margin-top: 10px;
  color: var(--text-muted);
}

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

figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow-sm);
}

.paper-figures figure {
  background:
    linear-gradient(rgba(255, 253, 247, 0.94), rgba(255, 253, 247, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(17, 24, 39, 0.045) 23px 24px);
}

.headline-figure {
  margin: 0 0 28px;
  border-color: rgba(14, 124, 102, 0.28);
  background:
    linear-gradient(rgba(255, 253, 247, 0.96), rgba(255, 253, 247, 0.96)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(14, 124, 102, 0.055) 23px 24px);
  box-shadow: 0 22px 60px rgba(6, 78, 59, 0.12);
}

.headline-figure img {
  min-height: 360px;
}

.headline-figure figcaption {
  color: var(--primary-deep);
  font-weight: 700;
}

figure img {
  width: 100%;
  min-height: 260px;
  object-fit: contain;
}

figcaption {
  margin-top: 14px;
  font-size: 14px;
}

.result-table {
  display: grid;
  overflow-x: auto;
  margin: 0 0 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.result-table [role="row"] {
  display: grid;
  grid-template-columns: 1fr repeat(4, minmax(120px, 0.7fr));
  min-width: 760px;
  border-bottom: 1px solid var(--border-soft);
}

.result-table [role="row"]:last-child {
  border-bottom: 0;
}

.result-table span {
  padding: 14px 16px;
}

.result-table [role="columnheader"] {
  color: var(--primary-deep);
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(221, 247, 239, 0.44);
}

.geo-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: clamp(20px, 4vw, 44px);
  margin: 0 0 28px;
  border: 1px solid rgba(14, 124, 102, 0.28);
  border-radius: 8px;
  background: rgba(221, 247, 239, 0.34);
  padding: clamp(18px, 3vw, 26px);
}

.geo-summary h3 {
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.12;
}

.geo-summary p {
  margin-bottom: 0;
  color: var(--text-muted);
}

.safety {
  background: var(--primary-deep);
  color: var(--on-primary);
}

.safety .section-kicker,
.safety .section-lede {
  color: var(--primary-soft);
}

.qa {
  background: rgba(255, 253, 246, 0.68);
}

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

.qa-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(18px, 3vw, 24px);
  box-shadow: var(--shadow-sm);
}

.qa-card h3 {
  margin: 0 0 10px;
  color: var(--primary-deep);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.18;
}

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

.invariant-list {
  display: grid;
  gap: 14px;
}

.invariant-list article {
  border-color: rgba(221, 247, 239, 0.2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.invariant-list p {
  color: rgba(255, 255, 255, 0.78);
}

.run {
  background: rgba(247, 248, 242, 0.58);
}

.terminal {
  margin: 0;
  overflow-x: auto;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: #111827;
  color: #d1fae5;
  padding: clamp(20px, 4vw, 30px);
  box-shadow: var(--shadow-lg);
  line-height: 1.7;
  font-size: 14px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(22px, 5vw, 56px);
  color: var(--text-muted);
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  color: var(--text);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}

.site-footer a {
  color: var(--primary-deep);
  font-weight: 700;
}

@media (max-width: 900px) {
  .site-header {
    padding: 14px 18px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: 72px 16px auto 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    padding: 10px;
    box-shadow: var(--shadow-lg);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 13px 14px;
  }

  .hero {
    min-height: auto;
    padding-top: 104px;
  }

  .hero-visual {
    opacity: 0.36;
  }

  .hero-visual img {
    width: 100%;
    object-position: right center;
  }

  .architecture-grid,
  .safety-layout,
  .run-grid,
  .split-heading,
  .paper-columns,
  .geo-summary,
  .qa-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .principles,
  .metric-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }

  .hero-copy,
  .section-lede {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .pipeline-row {
    grid-template-columns: 1fr;
  }

  .flow-line {
    width: 1px;
    height: 22px;
    justify-self: center;
  }

  .site-footer {
    display: block;
  }

  .site-footer nav {
    justify-content: flex-start;
    margin-top: 18px;
  }
}
