:root {
  --paper: #e9e9e6;
  --panel: #f7f7f4;
  --ink: #171717;
  --deep: #090909;
  --muted: rgba(23, 23, 23, 0.62);
  --line: rgba(23, 23, 23, 0.11);
  --strong-line: rgba(23, 23, 23, 0.78);
  --accent: #ff6a1a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 650;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
}

a {
  color: inherit;
}

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

h1,
h2,
h3,
strong,
.eyebrow,
.toc,
.top-actions,
.meta-table,
table,
.callout,
.north-star {
  font-family: var(--mono);
  letter-spacing: 0;
}

p,
li,
td {
  color: var(--muted);
  line-height: 1.58;
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--strong-line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    rgba(247, 247, 244, 0.94);
  background-size: 30px 30px;
  backdrop-filter: blur(16px);
}

.accent-line {
  height: 4px;
  background: var(--accent);
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand strong {
  font-size: clamp(1.05rem, 1.4vw, 1.46rem);
  font-weight: 950;
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.top-actions a {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 8px 10px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.prd-shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 880px);
  justify-content: center;
  gap: 28px;
  align-items: start;
  padding: 26px 0 70px;
}

.toc {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 7px;
  border: 1px solid var(--strong-line);
  background: rgba(247, 247, 244, 0.92);
  padding: 12px;
}

.toc span {
  color: var(--accent);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.toc a {
  border: 1px solid var(--line);
  background: rgba(247, 247, 244, 0.78);
  color: var(--muted);
  padding: 8px 9px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 850;
}

.toc a:hover,
.toc a.is-active {
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: inset 4px 0 0 var(--accent);
}

.prd-content {
  min-width: 0;
  border: 1px solid var(--strong-line);
  background: rgba(247, 247, 244, 0.96);
  padding: clamp(24px, 4vw, 46px);
}

.doc-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.doc-section:first-child {
  padding-top: 0;
}

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

.eyebrow,
.callout span,
.north-star span {
  display: block;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

h1 {
  max-width: 11ch;
  margin: 10px 0 16px;
  color: var(--deep);
  font-size: clamp(3.2rem, 6vw, 6rem);
  line-height: 0.9;
}

h2 {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: clamp(1.52rem, 2.3vw, 2.15rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}

.lead {
  max-width: 74ch;
  color: rgba(23, 23, 23, 0.72);
  font-size: clamp(1rem, 1.15vw, 1.13rem);
  font-weight: 720;
}

.meta-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
  border: 1px solid var(--strong-line);
  background: rgba(233, 233, 230, 0.34);
}

.meta-table div {
  min-height: 72px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.meta-table b {
  display: block;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.meta-table span {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.28;
}

.callout,
.north-star {
  margin: 18px 0;
  border-left: 5px solid var(--accent);
  background: rgba(255, 106, 26, 0.055);
  padding: 15px 18px;
}

.callout strong,
.north-star strong {
  display: block;
  margin-top: 7px;
  font-size: clamp(1.05rem, 1.55vw, 1.42rem);
  line-height: 1.18;
}

.scope-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.scope-columns > div {
  border: 1px solid var(--line);
  background: rgba(233, 233, 230, 0.24);
  padding: 15px;
}

ul {
  margin: 0;
  padding-left: 20px;
}

li + li {
  margin-top: 7px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: rgba(247, 247, 244, 0.86);
  font-size: 0.84rem;
}

th {
  background: var(--ink);
  color: var(--panel);
  text-align: left;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px 11px;
  vertical-align: top;
}

td:first-child {
  color: var(--ink);
  font-weight: 850;
}

.system-flow {
  display: grid;
  grid-template-columns: 1fr 20px 1fr 20px 1fr 20px 1fr 20px 1fr;
  align-items: center;
  margin: 18px 0;
}

.system-flow div {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(233, 233, 230, 0.24);
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
}

.system-flow i {
  height: 2px;
  background: var(--accent);
}

.north-star p {
  max-width: 72ch;
  margin-top: 8px;
}

@media (max-width: 1080px) {
  .prd-shell {
    grid-template-columns: 1fr;
  }

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

  .toc span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions a {
    flex: 1;
    text-align: center;
  }

  .toc,
  .meta-table,
  .scope-columns {
    grid-template-columns: 1fr;
  }

  .prd-content {
    padding: 18px;
  }

  .doc-section {
    padding: 24px 0;
  }

  h1 {
    font-size: clamp(2.8rem, 15vw, 4.4rem);
  }

  h2 {
    font-size: clamp(1.34rem, 7vw, 1.9rem);
  }

  table {
    display: block;
    overflow-x: auto;
  }

  th,
  td {
    min-width: 170px;
  }

  .system-flow {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .system-flow i {
    width: 2px;
    height: 20px;
    justify-self: center;
  }
}
