:root {
  color-scheme: dark;
  --bg: #0d0c0a;
  --bg-2: #17130f;
  --panel: #1d1914;
  --panel-2: #261f18;
  --line: #3a3128;
  --line-2: #574637;
  --text: #f4efe7;
  --muted: #b9afa2;
  --accent: #d97757;
  --accent-2: #e7b16f;
  --accent-3: #7fd7c4;
  --accent-4: #8fa8ff;
  --accent-soft: #321d16;
  --sand: #f0dfc7;
  --clay: #a7563f;
  --shell: min(1120px, calc(100vw - 40px));
  --wide-shell: min(1240px, calc(100vw - 40px));
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(217, 119, 87, 0.1), transparent 34%),
    linear-gradient(180deg, #15110d 0%, var(--bg) 38%, #080706 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(58, 49, 40, 0.76);
  background: rgba(13, 12, 10, 0.86);
  backdrop-filter: blur(18px);
}

.nav-shell,
.section-shell,
.hero-shell {
  width: var(--wide-shell);
  margin: 0 auto;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header .nav-shell {
  padding: 14px 0;
}

.brand,
.hero-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
}

.brand img {
  width: 38px;
  height: 38px;
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 1.8vw, 24px);
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  min-width: 0;
}

nav a:hover,
.site-footer a:hover {
  color: var(--accent-2);
}

nav a[aria-current="page"] {
  color: var(--text);
}

.icon-link {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.icon-link:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.055);
}

.icon-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.hero {
  position: relative;
  min-height: min(680px, calc(100vh - 64px));
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(115deg, rgba(23, 19, 15, 0.98) 0%, rgba(33, 27, 21, 0.9) 54%, rgba(16, 14, 12, 0.94) 100%),
    var(--bg-2);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 90px max(-70px, calc((100vw - 1280px) / 2)) auto auto;
  width: min(620px, 48vw);
  aspect-ratio: 5 / 4;
  background: url("diagrams/01-architecture.svg") center / contain no-repeat;
  opacity: 0.1;
  filter: sepia(0.45) saturate(0.75);
  pointer-events: none;
}

.hero-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(340px, 0.72fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  min-height: inherit;
  padding: clamp(82px, 9vw, 120px) 0 clamp(64px, 8vw, 104px);
}

.hero-copy {
  max-width: 680px;
}

.hero-title {
  gap: clamp(18px, 3vw, 30px);
  margin-bottom: 18px;
}

.hero-title img {
  width: clamp(112px, 11vw, 156px);
  height: clamp(112px, 11vw, 156px);
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(72px, 9vw, 116px);
  line-height: 0.88;
}

h2 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1;
}

h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.lede {
  max-width: 620px;
  margin: 28px 0 0;
  color: #d8cec0;
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.24;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button:hover {
  box-shadow: var(--soft-shadow);
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  color: #160b07;
  border-color: transparent;
}

.button.secondary {
  background: rgba(244, 239, 231, 0.055);
}

.command-card,
.setup-step,
.feature-grid article,
.why-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(29, 25, 20, 0.9);
}

.command-card {
  padding: 22px;
  box-shadow: var(--shadow);
}

.terminal-bar {
  display: flex;
  gap: 7px;
  margin-bottom: 16px;
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--line-2);
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 18px;
  border: 1px solid #41362c;
  border-radius: 8px;
  background: #0f0d0a;
  color: var(--text);
  white-space: pre-wrap;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.command-card p,
.section-heading p,
.feature-grid p,
.why-grid p,
.diagram-copy p {
  color: var(--muted);
}

.quickstart,
.why-section,
.feature-band,
.docs-band,
.diagram-section {
  padding: clamp(64px, 8vw, 100px) 0;
}

.quickstart {
  background:
    linear-gradient(135deg, rgba(50, 29, 22, 0.88), rgba(20, 16, 12, 0.94)),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.why-section {
  background:
    radial-gradient(circle at 78% 16%, rgba(231, 177, 111, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(13, 12, 10, 0.96), rgba(23, 19, 15, 0.96));
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 900px;
  margin-bottom: 30px;
}

.section-heading p:not(.eyebrow) {
  max-width: 720px;
  font-size: 18px;
}

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

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

.why-grid article {
  min-height: 260px;
  padding: 24px;
  box-shadow: var(--soft-shadow);
}

.why-grid article:nth-child(1) {
  border-top-color: var(--accent);
}

.why-grid article:nth-child(2) {
  border-top-color: var(--sand);
}

.why-grid article:nth-child(3) {
  border-top-color: var(--accent-2);
}

.why-index {
  display: inline-block;
  margin-bottom: 48px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.setup-step {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 22px;
  box-shadow: var(--soft-shadow);
}

.setup-step span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(217, 119, 87, 0.62);
  border-radius: 999px;
  background: rgba(217, 119, 87, 0.14);
  color: var(--accent-2);
  font-weight: 850;
}

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

.feature-grid article {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 176px;
  padding: 24px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  padding: 8px;
  border: 1px solid rgba(217, 119, 87, 0.45);
  border-radius: 8px;
  background: rgba(217, 119, 87, 0.08);
  color: var(--accent-2);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-grid article:nth-child(3n + 1) {
  border-top-color: var(--accent);
}

.feature-grid article:nth-child(3n + 2) {
  border-top-color: var(--sand);
}

.feature-grid article:nth-child(3n) {
  border-top-color: var(--accent-2);
}

.docs-band {
  background:
    linear-gradient(135deg, rgba(127, 215, 196, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(13, 12, 10, 0.98), rgba(18, 20, 18, 0.98));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.link-panel,
.stat-grid article,
.artifact-grid article,
.reference-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(29, 25, 20, 0.82);
}

.link-panel {
  display: grid;
  align-content: start;
  min-height: 240px;
  padding: 24px;
  box-shadow: var(--soft-shadow);
}

.link-panel:hover {
  border-color: rgba(127, 215, 196, 0.62);
  transform: translateY(-1px);
}

.link-panel p,
.stat-grid p,
.artifact-grid p,
.reference-card p,
.catalog-row p,
.doc-section p,
.step-list li,
td {
  color: var(--muted);
}

.page-hero {
  padding: clamp(72px, 9vw, 118px) 0 clamp(56px, 7vw, 84px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(115deg, rgba(23, 19, 15, 0.98) 0%, rgba(21, 28, 26, 0.94) 55%, rgba(12, 11, 10, 0.96) 100%),
    var(--bg-2);
}

.page-hero h1 {
  max-width: 960px;
  font-size: clamp(46px, 7vw, 86px);
  line-height: 0.96;
}

.case-hero {
  background:
    linear-gradient(120deg, rgba(143, 168, 255, 0.12), transparent 38%),
    linear-gradient(115deg, rgba(23, 19, 15, 0.98), rgba(18, 24, 31, 0.94) 55%, rgba(12, 11, 10, 0.96));
}

.doc-page {
  padding: clamp(48px, 7vw, 82px) 0;
}

.doc-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 54px);
  width: var(--wide-shell);
  margin: 0 auto;
}

.content-nav {
  position: sticky;
  top: 94px;
  display: grid;
  align-self: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 12, 10, 0.78);
}

.content-nav a {
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.content-nav a:hover {
  background: rgba(127, 215, 196, 0.1);
  color: var(--text);
}

.doc-content {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.doc-section {
  padding: clamp(24px, 4vw, 38px);
  border-bottom: 1px solid var(--line);
}

.doc-section:last-child {
  border-bottom: 0;
}

.doc-section h2 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 46px);
}

.doc-section > h3 {
  margin-top: 26px;
}

.doc-section > p {
  max-width: 780px;
  font-size: 17px;
}

.step-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding-left: 22px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.stat-grid {
  margin: 22px 0;
}

.stat-grid article {
  padding: 22px;
}

.stat-grid span {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-3);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  line-height: 1;
}

.compact-stats article:nth-child(2) span,
.stat-grid article:nth-child(2) span {
  color: var(--accent-2);
}

.compact-stats article:nth-child(3) span,
.stat-grid article:nth-child(3) span {
  color: var(--accent-4);
}

.artifact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.artifact-grid article {
  min-width: 0;
  padding: 22px;
}

.artifact-grid pre {
  margin-top: 16px;
}

.reference-stats {
  max-width: 780px;
}

.reference-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.reference-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 22px;
}

.reference-card h3 {
  margin-bottom: 0;
}

.meta-line {
  margin: 0;
  font-size: 14px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.tag-list span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d8cec0;
  font-size: 12px;
  font-weight: 750;
}

.catalog-group {
  margin-top: 28px;
}

.catalog-group h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(22px, 3vw, 30px);
}

.catalog-group h3 span {
  color: var(--accent-3);
  font-size: 15px;
}

.catalog-list {
  display: grid;
  gap: 10px;
}

.catalog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.36fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(58, 49, 40, 0.72);
}

.catalog-row h4 {
  margin: 0 0 6px;
  font-size: 18px;
}

.catalog-row p {
  margin: 0;
}

.catalog-row code {
  align-self: start;
  justify-self: end;
  color: #d4c8b9;
  text-align: right;
}

.callout {
  margin: 22px 0 0;
  padding: 18px;
  border: 1px solid rgba(127, 215, 196, 0.45);
  border-radius: 8px;
  background: rgba(127, 215, 196, 0.08);
  color: #d8ece7;
}

.callout a {
  color: var(--accent-3);
  font-weight: 800;
}

.inline-diagram {
  margin-top: 24px;
}

.inline-diagram img {
  border-radius: 8px;
}

.diagram-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(217, 119, 87, 0.14), transparent 22%),
    radial-gradient(circle at 82% 34%, rgba(231, 177, 111, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(244, 239, 231, 0.018), transparent 34%),
    var(--bg);
}

.diagram-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='900' height='620' viewBox='0 0 900 620' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23e7b16f' stroke-opacity='.18' stroke-width='1.2'%3E%3Cpath d='M84 150C180 86 270 112 360 178S540 268 650 204 792 118 850 156'/%3E%3Cpath d='M56 420C190 332 292 360 412 434S654 520 828 392'/%3E%3Cpath d='M180 90L300 246 182 394M474 126L410 286 566 468M718 112L648 302 792 442'/%3E%3C/g%3E%3Cg fill='%23d97757' fill-opacity='.38'%3E%3Ccircle cx='84' cy='150' r='5'/%3E%3Ccircle cx='300' cy='246' r='6'/%3E%3Ccircle cx='474' cy='126' r='5'/%3E%3Ccircle cx='650' cy='204' r='6'/%3E%3Ccircle cx='828' cy='392' r='5'/%3E%3Ccircle cx='412' cy='434' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 900px 620px;
  background-position: center 120px;
  background-repeat: repeat-y;
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 86%, transparent 100%);
  opacity: 0.34;
  pointer-events: none;
}

.diagram-section .section-shell {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 48px;
}

.diagram-feature {
  display: grid;
  grid-template-columns: minmax(260px, 0.58fr) minmax(420px, 1fr);
  align-items: start;
  gap: clamp(28px, 5vw, 58px);
}

.diagram-feature.reverse {
  grid-template-columns: minmax(420px, 1fr) minmax(260px, 0.58fr);
}

.diagram-feature.reverse .diagram-copy {
  order: 2;
}

.diagram-copy {
  max-width: 430px;
}

.diagram-copy h3 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.diagram-points {
  display: grid;
  gap: 9px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.diagram-points li {
  position: relative;
  padding-left: 22px;
  color: #d4c8b9;
  font-size: 15px;
}

.diagram-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 119, 87, 0.12);
}

figure {
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.diagram-open {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.diagram-open:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
}

figure img {
  width: 100%;
  background: transparent;
}

.diagram-grid {
  display: grid;
  gap: 34px;
}

.image-modal {
  width: min(1160px, calc(100vw - 36px));
  max-height: min(860px, calc(100vh - 36px));
  padding: 52px 18px 18px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #0b0907;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
}

.image-modal::backdrop {
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(8px);
}

.image-modal img {
  width: 100%;
  max-height: calc(100vh - 116px);
  object-fit: contain;
  background: #0d0c0a;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--accent-2);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer .nav-shell {
  padding: 28px 0;
}

@media (max-width: 980px) {
  .hero-shell,
  .setup-grid,
  .why-grid,
  .feature-grid,
  .link-grid,
  .stat-grid,
  .artifact-grid,
  .doc-layout,
  .diagram-feature,
  .diagram-feature.reverse,
  .diagram-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero::after {
    inset: auto -150px 12px auto;
    width: 620px;
    max-width: 98vw;
    opacity: 0.08;
  }

  .hero-shell {
    padding: 52px 0 70px;
  }

  .diagram-feature.reverse .diagram-copy {
    order: 0;
  }

  .content-nav {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .content-nav a {
    text-align: center;
  }

  .nav-shell {
    flex-wrap: wrap;
  }

  nav {
    justify-content: flex-start;
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
}

@media (max-width: 560px) {
  :root {
    --shell: min(100vw - 28px, 1120px);
    --wide-shell: min(100vw - 28px, 1240px);
  }

  h1 {
    font-size: clamp(62px, 19vw, 78px);
  }

  h2 {
    font-size: clamp(32px, 11vw, 44px);
  }

  .hero-title {
    margin-bottom: 22px;
  }

  .hero-title img {
    width: clamp(88px, 25vw, 118px);
    height: clamp(88px, 25vw, 118px);
  }

  .lede {
    font-size: 19px;
  }

  .quickstart,
  .why-section,
  .feature-band,
  .docs-band,
  .diagram-section {
    padding: 56px 0;
  }

  .content-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-grid,
  .catalog-row {
    grid-template-columns: 1fr;
  }

  .catalog-row code {
    justify-self: start;
    text-align: left;
  }

  .page-hero h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .site-footer .nav-shell {
    align-items: flex-start;
    flex-direction: column;
  }
}
