:root {
  --bg: #090909;
  --ink: #f3f0e8;
  --muted: #a6a29a;
  --line: #45433f;
  --line-soft: #272624;
  --red: #ff4d3d;
  --blue: #4da3ff;
  --max: 1240px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 70% 38%, rgba(255, 255, 255, .025), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--ink); color: var(--bg); }

.shell {
  width: min(calc(100% - 56px), var(--max));
  margin: 0 auto;
}

.topbar {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  letter-spacing: .08em;
}

.brand-mark {
  width: 76px;
  height: 86px;
  object-fit: contain;
  flex: none;
}

.brand > span {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 400;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(22px, 4vw, 50px);
}

nav a {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
}

.repo-link {
  padding: 10px 15px;
  border: 1px solid var(--blue);
  color: var(--ink);
}

.tab-link {
  position: relative;
  padding: 10px 0;
}

.tab-link[aria-current="page"] { color: var(--ink); }

.tab-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  background: var(--red);
}

nav a:hover,
nav a:focus-visible { color: var(--ink); }

.hero {
  min-height: 690px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 32px;
  align-items: center;
  padding: 68px 0 86px;
  border-bottom: 1px solid var(--line);
}

.hero-copy { max-width: 700px; position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
}

.prompt { color: var(--red); font-weight: 800; }

h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(56px, 6.9vw, 98px);
  font-weight: 400;
  letter-spacing: -.07em;
  line-height: .95;
}

.lede {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.35vw, 17px);
}

.tagline {
  display: flex;
  gap: 15px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
}

.tagline i { color: var(--red); font-style: normal; }
.tagline i:last-of-type { color: var(--blue); }

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

.hero-actions a {
  min-width: 160px;
  display: inline-flex;
  justify-content: space-between;
  gap: 24px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
}

.hero-actions .primary-action {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.hero-actions a:hover,
.hero-actions a:focus-visible { border-color: var(--blue); }

.hero-mark {
  min-width: 0;
  display: grid;
  place-items: center;
}

.hero-mark img {
  width: min(100%, 500px);
  height: auto;
  filter: drop-shadow(0 0 24px rgba(243, 240, 232, .025));
}

.rule {
  margin-top: 74px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.rule p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 32px 0 88px;
}

.cards article {
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-right: 0;
}

.cards article:last-child { border-right: 1px solid var(--line-soft); }

.card-index { color: var(--red); font-size: 11px; }
.cards article:nth-child(even) .card-index { color: var(--blue); }

.cards h2 {
  margin: 44px 0 9px;
  font-size: 16px;
  font-weight: 550;
  letter-spacing: -.02em;
}

.cards p {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.stack-diagram {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 42px 0 104px;
}

.stack-layer,
.stack-links {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  column-gap: 24px;
}

.stack-layer { align-items: stretch; }

.layer-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.layer-label span { color: var(--blue); }
.stack-layer:first-child .layer-label span,
.stack-layer:last-child .layer-label span { color: var(--red); }

.stack-nodes {
  min-width: 0;
  display: grid;
}

.stack-nodes-paired {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stack-node {
  position: relative;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .012);
  transition: background-color 140ms ease, border-color 140ms ease;
}

.stack-node::after {
  content: "↗";
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--muted);
  font-size: 11px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.stack-node:hover,
.stack-node:focus-visible {
  border-color: var(--ink);
  background: rgba(255, 255, 255, .035);
}

.stack-node:hover::after,
.stack-node:focus-visible::after { opacity: 1; }

.stack-node:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.stack-node strong {
  font-size: 18px;
  font-weight: 540;
  letter-spacing: -.025em;
}

.stack-node small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.stack-node-shared {
  border-color: var(--blue);
  text-align: center;
}

.stack-links svg {
  display: block;
  width: 100%;
  height: 28px;
  overflow: visible;
}

.stack-links-merge svg { height: 36px; }

.stack-links path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.stack-nodes-backend {
  position: relative;
}

.stack-nodes-backend .stack-node:first-child { border-color: var(--blue); }
.stack-nodes-backend .stack-node:last-child { border-color: var(--red); }

.backend-arrow {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  width: 30px;
  height: 24px;
  place-items: center;
  transform: translate(-50%, -50%);
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
}

.hardware-page { min-height: calc(100vh - 230px); }

.subpage-hero {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 0 80px;
  border-bottom: 1px solid var(--line);
}

.subpage-hero h1 { font-size: clamp(64px, 8vw, 112px); }
.subpage-hero .lede { max-width: 760px; }

.hardware-learning { padding: 42px 0 104px; }

.learning-intro {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 64px;
  align-items: end;
  padding-bottom: 36px;
}

.learning-intro .eyebrow { margin-bottom: 12px; }

.learning-intro h2 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(36px, 4.5vw, 58px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: 1;
}

.learning-intro > p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.resource-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resource-card {
  position: relative;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line-soft);
  transition: background-color 140ms ease, border-color 140ms ease;
}

.resource-card:nth-child(even) { border-left: 0; }
.resource-card:nth-child(n + 3) { border-top: 0; }
.resource-card-start { border-color: var(--red); }

.resource-card:hover,
.resource-card:focus-visible {
  z-index: 1;
  border-color: var(--ink);
  background: rgba(255, 255, 255, .025);
}

.resource-meta {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.resource-meta b { margin-right: 8px; color: var(--blue); font-weight: 500; }
.resource-card-start .resource-meta b { color: var(--red); }

.resource-card h3 {
  margin: 48px 0 10px;
  font-size: 18px;
  font-weight: 540;
  letter-spacing: -.025em;
}

.resource-card p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.resource-card > small {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 26px;
  color: var(--ink);
  font-size: 10px;
  text-transform: uppercase;
}

.resource-card > small span { color: var(--muted); }
.resource-card:hover > small span,
.resource-card:focus-visible > small span { color: var(--blue); }

.resource-shelves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
  border: 1px solid var(--line-soft);
}

.resource-shelf { min-width: 0; padding: 24px; }
.resource-shelf + .resource-shelf { border-left: 1px solid var(--line-soft); }

.resource-shelf-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.resource-shelf-heading span { color: var(--red); font-size: 10px; }
.resource-shelf:nth-child(even) .resource-shelf-heading span { color: var(--blue); }

.resource-shelf-heading h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.resource-list { display: grid; }

.resource-list a {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 14px 28px 14px 0;
  border-top: 1px solid var(--line-soft);
}

.resource-list a:last-child { border-bottom: 1px solid var(--line-soft); }
.resource-list span { font-size: 12px; }
.resource-list small { color: var(--muted); font-size: 9px; }

.resource-list b {
  position: absolute;
  top: 15px;
  right: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.resource-list a:hover b,
.resource-list a:focus-visible b { color: var(--blue); }

.build-guide { padding: 42px 0 104px; }

.build-guide-intro {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 64px;
  align-items: end;
  padding-bottom: 36px;
}

.build-guide-intro .eyebrow { margin-bottom: 12px; }

.build-guide-intro h2 {
  margin: 0;
  font-size: clamp(36px, 4.5vw, 58px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: 1;
}

.build-guide-intro > p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.build-guide-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
}

.build-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line-soft);
}

.build-panel + .build-panel { border-left: 0; }

.build-panel-label {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.build-panel-label span { color: var(--blue); }

.parts-list { display: grid; }

.parts-list a {
  position: relative;
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 18px 38px 18px 0;
  border-top: 1px solid var(--line-soft);
}

.parts-list a:last-child { border-bottom: 1px solid var(--line-soft); }

.parts-list a > span {
  position: absolute;
  top: 18px;
  right: 4px;
  color: var(--muted);
}

.parts-list a:hover > span,
.parts-list a:focus-visible > span { color: var(--blue); }

.parts-list strong { font-size: 14px; font-weight: 540; }

.parts-list small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.setup-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-steps li {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.setup-steps li > div { min-width: 0; }

.setup-steps li > span { color: var(--red); font-size: 10px; }
.setup-steps strong { display: block; font-size: 13px; font-weight: 540; }
.setup-steps p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

.setup-steps code {
  color: var(--ink);
  font-family: var(--mono);
  font-size: inherit;
}

.setup-steps pre {
  width: 100%;
  max-width: 100%;
  margin: 12px 0 0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  background: #060606;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.7;
}

.build-docs-link {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--blue);
  font-size: 11px;
}

.build-docs-link:hover,
.build-docs-link:focus-visible { background: rgba(77, 163, 255, .06); }


footer {
  min-height: 112px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  color: #77736d;
  font-size: 11px;
}

.footer-brand { color: var(--ink); }
footer > :last-child { justify-self: end; }

@media (max-width: 960px) {
  .shell { width: min(calc(100% - 36px), var(--max)); }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 82px 0 70px;
  }

  .hero-mark img { width: min(82vw, 470px); }

  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards article:nth-child(2) { border-right: 1px solid var(--line-soft); }
  .cards article:nth-child(n + 3) { border-top: 0; }

  .stack-diagram { width: 100%; }

  .learning-intro { grid-template-columns: 1fr; gap: 24px; }

  .build-guide-intro { grid-template-columns: 1fr; gap: 24px; }
  .build-guide-grid { grid-template-columns: 1fr; }
  .build-panel + .build-panel { border-top: 0; border-left: 1px solid var(--line-soft); }

}

@media (max-width: 600px) {
  .shell { width: min(calc(100% - 24px), var(--max)); }
  .topbar { min-height: 96px; }
  .brand { gap: 7px; }
  .brand-mark { width: 58px; height: 68px; }
  .brand > span { font-size: 12px; letter-spacing: .04em; }
  nav { gap: 14px; }
  .repo-link { padding: 8px 10px; }

  .hero { padding-top: 70px; }
  h1 { font-size: clamp(52px, 17vw, 78px); }
  .tagline { gap: 9px; font-size: 11px; }
  .hero-actions { flex-direction: column; }
  .hero-actions a { width: 100%; }

  .rule { margin-top: 58px; }
  .cards { grid-template-columns: 1fr; }
  .cards article,
  .cards article:nth-child(2),
  .cards article:last-child {
    border: 1px solid var(--line-soft);
    border-bottom: 0;
  }
  .cards article:last-child { border-bottom: 1px solid var(--line-soft); }

  .stack-diagram { padding: 32px 0 82px; }
  .stack-layer,
  .stack-links { grid-template-columns: 1fr; }
  .layer-label {
    justify-content: flex-start;
    padding: 12px 0 8px;
    border-top: 0;
  }
  .stack-links::before { display: none; }
  .stack-links svg { grid-column: 1; }
  .stack-node { min-height: 76px; padding: 15px; }
  .stack-node strong { font-size: 15px; }

  .resource-cards,
  .resource-shelves { grid-template-columns: 1fr; }
  .resource-card:nth-child(even) { border-left: 1px solid var(--line-soft); }
  .resource-card:nth-child(n + 2) { border-top: 0; }
  .resource-shelf + .resource-shelf { border-top: 1px solid var(--line-soft); border-left: 0; }


  footer { grid-template-columns: 1fr; padding: 30px 0; }
  footer > :last-child { justify-self: start; }
}
