:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #f1f4f7;
  --ink: #15171c;
  --muted: #596170;
  --line: #dce1e7;
  --line-strong: #c7ced8;
  --blue: #1f5fbf;
  --teal: #0f766e;
  --amber: #9a6700;
  --red: #b42318;
  --shadow: 0 16px 44px rgba(31, 41, 55, 0.08);
  --radius: 8px;
  --wrap: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #174a94;
}

.wrap {
  width: min(100% - 40px, var(--wrap));
  margin: 0 auto;
}

.narrow {
  max-width: 820px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 248, 250, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  color: #343946;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: #e8edf3;
  color: var(--ink);
}

.masthead {
  padding: 92px 0 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.page-head {
  padding: 76px 0 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

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

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6f8fa;
  color: #242936;
  padding: 0.08em 0.32em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

h1 {
  max-width: 920px;
  margin: 0;
  color: var(--ink);
  font-size: 56px;
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 720;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0;
}

.lead {
  max-width: 820px;
  margin: 22px 0 0;
  color: #363d4a;
  font-size: 21px;
  line-height: 1.52;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 15px;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  border-color: #9aa5b4;
  color: var(--ink);
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.button.primary:hover {
  border-color: #174a94;
  background: #174a94;
  color: #ffffff;
}

.system-map {
  display: grid;
  grid-template-columns: 1fr 32px 1fr 32px 1fr 32px 1fr;
  align-items: stretch;
  gap: 0;
  margin-top: 56px;
}

.map-item {
  min-height: 138px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 18px;
  box-shadow: 0 1px 0 rgba(21, 23, 28, 0.03);
}

.map-docs {
  border-top-color: var(--blue);
}

.map-rtl {
  border-top-color: var(--red);
}

.map-lab {
  border-top-color: var(--teal);
}

.map-tools {
  border-top-color: var(--amber);
}

.map-line {
  position: relative;
  min-height: 138px;
}

.map-line::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-strong);
}

.map-label,
.repo-name {
  display: block;
  color: var(--ink);
  font-weight: 720;
}

.map-copy,
.repo-copy {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.section {
  padding: 72px 0;
  background: var(--surface);
}

.section.muted {
  background: var(--surface-muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 56px;
  align-items: start;
}

.prose p {
  margin: 0 0 18px;
  color: #363d4a;
}

.prose p:last-child {
  margin-bottom: 0;
}

.section-head {
  max-width: 760px;
  margin-bottom: 28px;
}

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

.repo-card,
.rule-card,
.faq-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 1px 0 rgba(21, 23, 28, 0.03);
}

.repo-card {
  color: var(--ink);
  text-decoration: none;
}

.repo-card:hover {
  border-color: #aeb7c4;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.content-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.side-list {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 4px;
}

.side-list a {
  border-radius: var(--radius);
  color: #343946;
  padding: 8px 10px;
  font-size: 14px;
  text-decoration: none;
}

.side-list a:hover {
  background: #e8edf3;
  color: var(--ink);
}

.wide {
  max-width: 840px;
}

.anchor-section {
  padding: 0 0 46px;
}

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

.anchor-section h2 {
  margin-bottom: 16px;
}

.rule-list {
  display: grid;
  gap: 12px;
}

.rule-list > div {
  border-left: 3px solid var(--line-strong);
  padding-left: 16px;
}

.rule-list p,
.rule-card p,
.faq-card p {
  margin: 0;
  color: #3a414e;
}

.preview-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 28px;
  align-items: start;
}

.preview-column,
.answer-column {
  display: grid;
  gap: 14px;
}

.question-list {
  display: grid;
  gap: 8px;
}

.question-list a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  font-weight: 650;
  text-decoration: none;
}

.question-list a:hover {
  border-color: #aeb7c4;
}

.faq-card h2 {
  margin-bottom: 10px;
  font-size: 22px;
}

.rule-card h3 {
  margin-bottom: 8px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #eef2f6;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  font-size: 14px;
}

.footer-inner a {
  color: #343946;
}

@media (max-width: 900px) {
  .masthead {
    padding: 68px 0 44px;
  }

  .page-head {
    padding: 56px 0 38px;
  }

  h1 {
    font-size: 42px;
  }

  .lead {
    font-size: 18px;
  }

  .system-map,
  .two-column,
  .content-grid,
  .preview-shell {
    grid-template-columns: 1fr;
  }

  .system-map {
    gap: 12px;
  }

  .map-line {
    display: none;
  }

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

  .side-list {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(100% - 28px, var(--wrap));
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
  }

  .nav {
    justify-content: flex-start;
  }

  .nav a {
    padding: 6px 8px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 25px;
  }

  .section {
    padding: 50px 0;
  }

  .actions,
  .button {
    width: 100%;
  }

  .repo-grid,
  .rule-grid,
  .side-list {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 18px 0;
  }
}
