:root {
  --ink: #13231f;
  --ink-soft: #53635e;
  --paper: #f5f4ee;
  --surface: #fffdf7;
  --line: #d8ddd6;
  --forest: #174c3c;
  --forest-deep: #0b3026;
  --mint: #a8e6c7;
  --blue: #4c83ee;
  --green: #2e9c72;
  --orange: #db7948;
  --purple: #8a6bd1;
  --code: #0d201b;
  --code-ink: #dff6ec;
  --shadow: 0 20px 60px rgba(19, 35, 31, 0.09);
  --radius: 22px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
code, pre { font-family: var(--mono); }
code { font-size: 0.92em; }
p code, li code, td code, .callout code, .draft-banner code {
  padding: 0.12em 0.34em;
  border: 1px solid rgba(23, 76, 60, 0.1);
  border-radius: 6px;
  color: var(--forest);
  background: rgba(168, 230, 199, 0.14);
}

.shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(216, 221, 214, 0.85);
  background: rgba(245, 244, 238, 0.9);
  backdrop-filter: blur(14px);
}

.nav-inner {
  width: min(1180px, calc(100% - 48px));
  min-height: 68px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand, .footer-brand {
  color: var(--forest-deep);
  font-size: 1.15rem;
  font-weight: 850;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.nav-brand::before, .footer-brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 9px;
  border-radius: 3px;
  background: var(--green);
  box-shadow: 6px -6px 0 var(--mint);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 680;
}

.nav-links a { text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--forest); }

.hero {
  min-height: 640px;
  padding-block: 88px 72px;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  align-items: center;
  gap: 72px;
}

.eyebrow, .doc-label {
  margin: 0 0 16px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1, .docs-header h1 {
  margin: 0;
  color: var(--forest-deep);
  font-size: clamp(3.5rem, 7vw, 6.8rem);
  font-weight: 830;
  letter-spacing: -0.075em;
  line-height: 0.94;
}

.hero h1 em {
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.hero-lead {
  max-width: 670px;
  margin: 30px 0 0;
  color: var(--ink-soft);
  font-size: 1.12rem;
}

.hero-actions, .doc-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 48px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--forest);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 760;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover { transform: translateY(-2px); }
.button.primary { color: #fff; background: var(--forest); box-shadow: 0 10px 24px rgba(23, 76, 60, 0.18); }
.button.primary:hover { background: var(--forest-deep); }
.button.secondary { color: var(--forest); background: transparent; }
.button.secondary:hover { background: var(--surface); }

.pipeline-card {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid rgba(168, 230, 199, 0.45);
  border-radius: 32px;
  background: var(--forest-deep);
  box-shadow: var(--shadow);
}

.pipeline-grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(168, 230, 199, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 230, 199, 0.5) 1px, transparent 1px);
  background-size: 42px 42px;
  transform: perspective(500px) rotateX(58deg) scale(1.45) translateY(58px);
}

.pipeline-card::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -70px;
  top: -70px;
  border-radius: 50%;
  background: rgba(76, 131, 238, 0.25);
  filter: blur(12px);
}

.pipeline-content {
  position: relative;
  z-index: 1;
  padding: 42px;
  color: #f3fff9;
}

.pipeline-label {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.pipeline-content ol { margin: 42px 0; padding: 0; list-style: none; }
.pipeline-content li {
  padding: 14px 0;
  display: grid;
  grid-template-columns: 46px 1fr;
  border-bottom: 1px solid rgba(223, 246, 236, 0.14);
  font-size: 1.05rem;
  font-weight: 650;
}
.pipeline-content li span { color: var(--mint); font-family: var(--mono); font-size: 0.72rem; }

.tile-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.tile-strip i { aspect-ratio: 1; border-radius: 7px; background: var(--mint); opacity: 0.32; }
.tile-strip i:nth-child(2), .tile-strip i:nth-child(5) { opacity: 0.75; }
.tile-strip i:nth-child(3) { background: var(--blue); opacity: 0.86; }

.band { border-block: 1px solid var(--line); background: rgba(255, 253, 247, 0.65); }
.platform-row {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow-x: auto;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.section { padding-block: 112px; }
.section-heading { max-width: 760px; margin-bottom: 46px; }
.section-heading.compact { max-width: 620px; }
.section h2, .cta h2, .contract-copy h2 {
  margin: 0;
  color: var(--forest-deep);
  font-size: clamp(2.2rem, 4vw, 4rem);
  letter-spacing: -0.055em;
  line-height: 1.02;
}
.section-heading > p:last-child { max-width: 660px; margin-top: 20px; color: var(--ink-soft); font-size: 1.06rem; }

.install-grid, .contract-section {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 22px;
  align-items: stretch;
}

.code-card {
  overflow: hidden;
  border-radius: var(--radius);
  color: var(--code-ink);
  background: var(--code);
  box-shadow: var(--shadow);
}

.code-head {
  min-height: 50px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(223, 246, 236, 0.12);
  color: #9ebbb0;
  font-family: var(--mono);
  font-size: 0.7rem;
}

.status-pill, .tag {
  padding: 4px 9px;
  border: 1px solid rgba(168, 230, 199, 0.35);
  border-radius: 999px;
  color: var(--mint);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

pre { margin: 0; padding: 26px; overflow-x: auto; font-size: 0.82rem; line-height: 1.72; }
.kw { color: #84b7ff; }
.str { color: #d7c57f; }
.comment { color: #75978a; }

.status-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.status-card h3 { margin: 5px 0 14px; font-size: 1.55rem; letter-spacing: -0.03em; line-height: 1.2; }
.status-card p { color: var(--ink-soft); }
.status-card a, .text-link { color: var(--forest); font-weight: 760; }
.note-kicker { margin: 0; color: var(--green) !important; font-family: var(--mono); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.feature-card {
  position: relative;
  min-height: 260px;
  padding: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.feature-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--card-accent); }
.accent-blue { --card-accent: var(--blue); }
.accent-green { --card-accent: var(--green); }
.accent-orange { --card-accent: var(--orange); }
.accent-purple { --card-accent: var(--purple); }
.feature-index { color: var(--card-accent); font-family: var(--mono); font-size: 0.72rem; font-weight: 800; }
.feature-card h3 { margin: 44px 0 12px; font-size: 1.35rem; letter-spacing: -0.035em; }
.feature-card p { margin: 0; color: var(--ink-soft); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.step-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.step-card > span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--forest-deep);
  background: var(--mint);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 800;
}
.step-card h3 { margin: 26px 0 10px; font-size: 1.22rem; letter-spacing: -0.03em; }
.step-card p { margin: 0; color: var(--ink-soft); }

.contract-section { padding-block: 128px; grid-template-columns: 0.82fr 1.18fr; align-items: center; gap: 70px; }
.contract-copy p:not(.eyebrow) { margin: 24px 0; color: var(--ink-soft); }
.contract-copy .example-note { font-size: 0.9rem; }
.code-card-large pre { min-height: 330px; display: flex; align-items: center; }

.boundaries { border-top: 1px solid var(--line); }
.ownership-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.ownership-grid > div { padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ownership-grid h3 { margin: 0 0 22px; font-size: 1.35rem; }
.check-list { margin: 0; padding: 0; list-style: none; }
.check-list li { position: relative; margin: 12px 0; padding-left: 25px; color: var(--ink-soft); }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }
.check-list.muted li::before { content: "→"; color: var(--blue); }

.fit-section { border-top: 1px solid var(--line); }
.fit-grid > div:last-child { background: rgba(76, 131, 238, 0.04); }

.related-projects { border-top: 1px solid var(--line); }
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.project-card {
  min-height: 290px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--mint);
  box-shadow: var(--shadow);
}
.project-type {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.project-card h3 { margin: 36px 0 12px; font-size: 1.8rem; letter-spacing: -0.045em; }
.project-card p { margin: 0; color: var(--ink-soft); }
.project-link { margin-top: auto; padding-top: 30px; color: var(--forest); font-weight: 760; }

.cta {
  margin-bottom: 112px;
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-radius: 28px;
  color: #fff;
  background: var(--forest-deep);
}
.cta h2 { color: #fff; font-size: clamp(2rem, 4vw, 3.4rem); }
.cta .button.primary { color: var(--forest-deep); background: var(--mint); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { min-height: 180px; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.footer-inner p { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.88rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; color: var(--ink-soft); font-size: 0.86rem; }

/* Reference page */
.docs-shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 230px minmax(0, 790px);
  justify-content: space-between;
  gap: 72px;
}
.docs-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--line);
}
.docs-sidebar a { padding: 5px 18px 5px 0; color: var(--ink-soft); font-size: 0.84rem; text-decoration: none; }
.docs-sidebar a:hover { color: var(--forest); }
.sidebar-title { margin: 0 0 12px; color: var(--ink); font-size: 0.9rem; font-weight: 800; }
.docs-content { min-width: 0; padding-bottom: 120px; }
.docs-header { padding: 88px 0 74px; }
.docs-header h1 { font-size: clamp(3.2rem, 7vw, 6rem); }
.docs-lead { max-width: 670px; margin: 25px 0; color: var(--ink-soft); font-size: 1.18rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { border-color: var(--line); color: var(--forest); background: var(--surface); }
.draft-banner, .callout {
  margin-top: 30px;
  padding: 18px 20px;
  border-left: 4px solid var(--blue);
  border-radius: 0 12px 12px 0;
  color: var(--ink-soft);
  background: rgba(76, 131, 238, 0.08);
}
.callout.warning { border-color: var(--orange); background: rgba(219, 121, 72, 0.08); }
.doc-section { padding: 72px 0; border-top: 1px solid var(--line); }
.doc-section h2 { margin: 0 0 20px; color: var(--forest-deep); font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.045em; line-height: 1.06; }
.doc-section h3 { margin: 34px 0 12px; color: var(--forest-deep); font-size: 1.26rem; letter-spacing: -0.025em; }
.doc-section p { color: var(--ink-soft); }
.doc-code { margin: 24px 0; box-shadow: none; }
.table-wrap { margin-top: 28px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 16px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--forest); background: rgba(168, 230, 199, 0.14); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.two-column-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.two-column-list > div { padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.two-column-list h3 { margin-top: 0; }
.two-column-list ul { padding-left: 20px; color: var(--ink-soft); }
.two-column-list li { margin: 9px 0; }
.docs-ownership { margin: 26px 0; }
.doc-steps { margin: 28px 0; }
.doc-steps .step-card { padding: 24px; }
.doc-steps .step-card h3 { margin-top: 22px; }
.exception-grid { margin: 26px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.exception-grid code { padding: 12px 14px; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 10px; color: var(--forest); background: var(--surface); }

.companion-note {
  margin-top: 50px;
  padding: 38px;
  border: 1px solid rgba(168, 230, 199, 0.45);
  border-radius: var(--radius);
  background: var(--forest-deep);
}
.companion-note h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.045em;
  line-height: 1.08;
}
.companion-note p:not(.eyebrow) { margin: 18px 0 0; color: #cde3da; }
.companion-note a { color: var(--mint); font-weight: 760; }

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; padding-top: 72px; gap: 50px; }
  .pipeline-card { min-height: 390px; }
  .install-grid, .contract-section { grid-template-columns: 1fr; }
  .contract-section { gap: 46px; }
  .docs-shell { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; margin-top: 28px; padding: 16px; flex-direction: row; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .docs-sidebar a { white-space: nowrap; padding: 4px 7px; }
  .sidebar-title { display: none; }
  .docs-header { padding-top: 55px; }
}

@media (max-width: 680px) {
  .shell, .nav-inner, .docs-shell { width: min(100% - 30px, 1180px); }
  .nav-inner { min-height: 62px; }
  .nav-links { gap: 15px; font-size: 0.78rem; }
  .nav-links a:first-child { display: none; }
  .hero { min-height: auto; padding-block: 60px; }
  .hero h1 { font-size: clamp(3.1rem, 16vw, 5rem); }
  .hero-lead { font-size: 1rem; }
  .pipeline-content { padding: 30px; }
  .platform-row { min-height: 70px; }
  .section { padding-block: 78px; }
  .feature-grid, .ownership-grid, .two-column-list, .exception-grid, .steps-grid, .project-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 220px; }
  .project-card { min-height: 250px; }
  .contract-section { padding-block: 88px; }
  .code-card pre { font-size: 0.74rem; padding: 20px; }
  .cta { margin-bottom: 72px; padding: 32px; align-items: flex-start; flex-direction: column; }
  .footer-inner { min-height: 210px; align-items: flex-start; justify-content: center; flex-direction: column; }
  .docs-header h1 { font-size: 3.2rem; }
  .doc-section { padding: 58px 0; }
  .companion-note { padding: 30px; }
}

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