:root {
  color-scheme: light;
  --paper: #f7f9f7;
  --surface: #ffffff;
  --surface-strong: #f0f4f1;
  --ink: #171a18;
  --muted: #5d6962;
  --line: #d9e2dc;
  --line-strong: #aebbb3;
  --teal: #0f766e;
  --teal-dark: #0d5651;
  --red: #b42318;
  --amber: #a15c06;
  --blue: #2559a7;
  --code-bg: #121614;
  --code-text: #edf6ef;
  --shadow: 0 20px 60px rgb(23 26 24 / 14%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--blue);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(-140%);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--surface);
  background: var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgb(217 226 220 / 86%);
  background: rgb(247 249 247 / 88%);
  backdrop-filter: blur(16px);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  gap: 20px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.site-brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: var(--surface);
  background: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 800;
}

.site-brand__text {
  font-size: 0.98rem;
  font-weight: 800;
}

.site-nav__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.site-nav__links a {
  min-height: 36px;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
}

.site-nav__links a:hover {
  color: var(--surface);
  background: var(--teal-dark);
}

.home-hero {
  position: relative;
  min-height: min(720px, 68vh);
  overflow: hidden;
  color: var(--surface);
  background: var(--ink);
}

.home-hero__image,
.home-hero__shade {
  position: absolute;
  inset: 0;
}

.home-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero__shade {
  background:
    linear-gradient(90deg, rgb(8 10 9 / 92%) 0%, rgb(8 10 9 / 68%) 48%, rgb(8 10 9 / 16%) 100%),
    linear-gradient(0deg, rgb(8 10 9 / 54%) 0%, rgb(8 10 9 / 0%) 38%);
}

.home-hero__content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) 0 42px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-hero .eyebrow {
  color: #8ee5d9;
}

.home-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3.15rem, 9vw, 6.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.home-hero__lede {
  max-width: 760px;
  margin: 24px 0 0;
  color: #e7f2ed;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
  text-decoration: none;
}

.button--primary {
  color: var(--ink);
  background: #9cf0dd;
}

.button--primary:hover {
  color: var(--ink);
  background: #c4f7ea;
}

.button--secondary {
  border-color: rgb(255 255 255 / 42%);
  color: var(--surface);
  background: rgb(255 255 255 / 9%);
}

.button--secondary:hover {
  color: var(--surface);
  border-color: #9cf0dd;
  background: rgb(156 240 221 / 18%);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  max-width: 660px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.hero-stats li {
  min-height: 78px;
  border-left: 2px solid #9cf0dd;
  padding: 6px 0 6px 14px;
}

.hero-stats strong,
.metric strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.hero-stats span,
.metric span {
  display: block;
  margin-top: 6px;
  color: inherit;
  font-size: 0.88rem;
}

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

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(260px, 0.42fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.section-heading h2,
.page-hero h1,
.markdown h2 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading p,
.page-hero p,
.markdown p {
  color: var(--muted);
}

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

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.feature-card,
.link-card,
.snippet-card,
.metric,
.rule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feature-card,
.link-card,
.snippet-card {
  min-height: 188px;
  padding: 20px;
}

.feature-card h3,
.link-card h3,
.snippet-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.feature-card p,
.link-card p,
.snippet-card p {
  margin: 0;
  color: var(--muted);
}

.snippet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 24px;
}

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

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(300px, 0.5fr);
  gap: 28px;
  align-items: center;
}

.install-grid h2 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.04;
}

.command {
  overflow-x: auto;
  margin: 0;
  border: 1px solid #2b352f;
  border-radius: 8px;
  padding: 18px;
  color: var(--code-text);
  background: var(--code-bg);
  box-shadow: var(--shadow);
}

.command code {
  color: inherit;
  background: transparent;
}

.page-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 900px);
  gap: 48px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.page-rail {
  position: sticky;
  top: 100px;
  align-self: start;
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}

.page-rail__label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.page-rail a {
  display: block;
  border-radius: 6px;
  padding: 8px 0;
  color: var(--ink);
  text-decoration: none;
}

.page-rail a:hover {
  color: var(--teal-dark);
}

.page-content {
  min-width: 0;
}

.page-hero {
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}

.page-hero h1 {
  max-width: 900px;
}

.page-hero p:last-child {
  max-width: 760px;
  margin: 14px 0 0;
  font-size: 1.08rem;
}

.page-content > h1 {
  display: none;
}

.markdown h2 {
  margin-top: 42px;
  padding-top: 6px;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.markdown h3 {
  margin: 30px 0 10px;
  font-size: 1.18rem;
  line-height: 1.25;
}

.markdown p,
.markdown li {
  font-size: 1.02rem;
}

.markdown a {
  overflow-wrap: anywhere;
}

.markdown ul,
.markdown ol {
  padding-left: 1.25rem;
}

.markdown li + li {
  margin-top: 6px;
}

.markdown code {
  border-radius: 5px;
  padding: 2px 5px;
  color: #26302b;
  background: #e9f1ec;
  font-size: 0.94em;
  overflow-wrap: anywhere;
}

.markdown pre {
  overflow-x: auto;
  border: 1px solid #26302b;
  border-radius: 8px;
  padding: 18px;
  color: var(--code-text);
  background: var(--code-bg);
}

.markdown pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.markdown table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
}

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

.markdown th {
  color: var(--ink);
  background: var(--surface-strong);
  font-size: 0.88rem;
}

.catalog-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(300px, 0.52fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 36px;
}

.catalog-intro > *,
.metric-strip,
.metric,
.rule-card {
  min-width: 0;
}

.catalog-intro__copy {
  border-left: 3px solid var(--teal);
  padding-left: 18px;
}

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

.metric {
  min-height: 108px;
  padding: 16px;
}

.metric strong {
  color: var(--teal-dark);
}

.rule-domain {
  margin-top: 44px;
}

.rule-domain__heading {
  display: grid;
  grid-template-columns: minmax(0, 0.5fr) minmax(280px, 0.7fr);
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.rule-domain__heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.rule-domain__heading p {
  margin: 0;
}

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

.rule-card {
  display: flex;
  flex-direction: column;
  min-height: 212px;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.rule-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: 0 18px 44px rgb(15 118 110 / 12%);
}

.rule-card__top,
.rule-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.rule-card__top {
  justify-content: space-between;
}

.rule-card__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94rem;
  font-weight: 900;
}

.rule-card h3 {
  margin: 20px 0 16px;
  font-size: 1.1rem;
  line-height: 1.3;
}

.rule-card__meta {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.rule-card__sample {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 850;
}

.pill--warning {
  color: var(--red);
  border-color: rgb(180 35 24 / 28%);
  background: rgb(180 35 24 / 8%);
}

.pill--info {
  color: var(--blue);
  border-color: rgb(37 89 167 / 28%);
  background: rgb(37 89 167 / 8%);
}

.pill--fix {
  color: var(--teal-dark);
  border-color: rgb(15 118 110 / 28%);
  background: rgb(15 118 110 / 8%);
}

.pill--manual {
  color: var(--amber);
  border-color: rgb(161 92 6 / 28%);
  background: rgb(161 92 6 / 8%);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 24px 0 38px;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 920px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .site-nav__links {
    justify-content: flex-start;
  }

  .home-hero {
    min-height: 640px;
  }

  .home-hero__shade {
    background: rgb(8 10 9 / 76%);
  }

  .hero-stats,
  .section-heading,
  .feature-grid,
  .link-grid,
  .snippet-grid,
  .install-grid,
  .page-shell,
  .catalog-intro,
  .rule-domain__heading,
  .rule-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    gap: 24px;
    padding-top: 30px;
  }

  .page-rail {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
  }

  .page-rail__label {
    flex-basis: 100%;
  }

  .page-rail a {
    padding: 0;
  }
}

@media (max-width: 620px) {
  .site-nav,
  .home-hero__content,
  .home-section,
  .page-shell,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .site-nav__links a {
    padding-inline: 7px;
  }

  .home-hero {
    min-height: 620px;
  }

  .home-hero h1 {
    font-size: 3.4rem;
  }

  .hero-stats,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .link-card,
  .rule-card {
    min-height: auto;
  }

  .site-footer {
    flex-direction: column;
  }
}
