:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --paper-alt: #f3f6f4;
  --ink: #172224;
  --ink-muted: #4f5f62;
  --ink-soft: #6f7b7d;
  --line: #cbd6d3;
  --line-strong: #9fb3af;
  --teal: #1f5f63;
  --teal-dark: #143f42;
  --teal-soft: #e3eeee;
  --amber: #b1782c;
  --amber-soft: #f6ead6;
  --white: #ffffff;
  --max: 1180px;
  --read: 760px;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(23, 34, 36, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

body.is-menu-locked {
  overflow: hidden;
}

main,
.site-header,
.hero,
.page-band,
.site-footer {
  max-width: 100%;
  overflow-x: clip;
}

.header-inner,
.hero-inner,
.section-inner,
.footer-inner,
.wide,
.prose,
.content-grid,
.hero-copy {
  min-width: 0;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus-visible {
  top: 18px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(203, 214, 211, 0.72);
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}

.wordmark__name {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.wordmark__meta {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 650;
}

.site-nav a,
.language-links a {
  text-decoration: none;
}

.site-nav a {
  padding: 10px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a.is-active,
.site-nav a:focus-visible,
.site-nav a:hover {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
}

.language-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
}

.language-links a {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.language-links a[aria-current="page"] {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 19px;
  height: 2px;
  background: currentColor;
  content: "";
}

.nav-toggle span {
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  position: absolute;
  left: 0;
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 6px;
}

.hero {
  position: relative;
  min-height: min(760px, 82vh);
  display: grid;
  align-items: end;
  isolation: isolate;
  background-image:
    linear-gradient(90deg, rgba(251, 250, 247, 0.96) 0%, rgba(251, 250, 247, 0.82) 39%, rgba(251, 250, 247, 0.22) 76%),
    linear-gradient(180deg, rgba(251, 250, 247, 0) 62%, var(--paper) 100%),
    url("./images/hmp-hero.png");
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(72px, 11vw, 132px) 0 clamp(58px, 8vw, 96px);
}

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

.eyebrow,
.spec-label {
  font-family: "IBM Plex Mono", Consolas, monospace;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 16px 0 0;
  max-width: 720px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.96;
  font-weight: 720;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 680px;
  margin: 28px 0 0;
  color: var(--ink-muted);
  font-size: clamp(19px, 2.1vw, 24px);
  line-height: 1.55;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 760px;
  margin-top: 42px;
  border: 1px solid var(--line);
  background: var(--line);
}

.hero-meta div {
  min-width: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.hero-meta dt {
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-meta dd {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
}

.page-band {
  border-bottom: 1px solid var(--line);
}

.page-band:nth-of-type(even) {
  background: var(--paper-alt);
}

.section-inner {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(64px, 8vw, 104px) 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(36px, 7vw, 82px);
  align-items: start;
}

.toc {
  position: sticky;
  top: 98px;
  display: grid;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 14px;
}

.toc strong {
  color: var(--ink);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc a {
  display: block;
  padding: 8px 0;
  text-decoration: none;
  border-bottom: 1px solid rgba(203, 214, 211, 0.68);
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--teal-dark);
}

.prose {
  max-width: var(--read);
}

.wide {
  max-width: none;
}

.section-block {
  scroll-margin-top: 102px;
}

.section-block + .section-block {
  margin-top: clamp(64px, 8vw, 104px);
}

h2,
h3,
h4 {
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  overflow-wrap: break-word;
  letter-spacing: 0;
}

h2 {
  margin: 10px 0 22px;
  font-size: clamp(34px, 4.5vw, 58px);
  line-height: 1.04;
  font-weight: 720;
}

h3 {
  margin: 0 0 14px;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.16;
}

h4 {
  margin: 0;
  font-size: 22px;
}

p {
  margin: 0;
}

p + p {
  margin-top: 18px;
}

.lead {
  color: var(--ink-muted);
  font-size: 21px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.definition {
  margin-top: 32px;
  padding: 24px;
  border-left: 4px solid var(--teal);
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
}

.definition p {
  font-size: 19px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 34px;
}

.evidence-card,
.standard-card,
.term-card,
.workflow-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.evidence-card,
.standard-card,
.term-card {
  padding: 24px;
}

.evidence-card h3,
.standard-card h3,
.term-card h3,
.workflow-step h3 {
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 750;
}

.evidence-card ul,
.standard-card ul,
.scope-list,
.open-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--ink-muted);
}

.evidence-card li + li,
.standard-card li + li,
.scope-list li + li,
.open-list li + li {
  margin-top: 8px;
}

.standard-grid,
.term-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.standard-card p,
.term-card p,
.workflow-step p {
  color: var(--ink-muted);
  overflow-wrap: break-word;
}

.mono {
  font-family: "IBM Plex Mono", Consolas, monospace;
}

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

.tag-list span {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.diagram {
  margin: 36px 0;
}

.diagram img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.diagram figcaption {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 28px;
  background: var(--white);
  border: 1px solid var(--line);
}

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

.data-table th {
  color: var(--ink);
  background: #eef4f3;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td:first-child {
  width: 110px;
  color: var(--teal-dark);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-weight: 700;
}

.workflow {
  display: grid;
  gap: 14px;
  margin-top: 34px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}

.workflow-step .step-id {
  color: var(--teal-dark);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.split-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 34px;
  border: 1px solid var(--line);
  background: var(--line);
}

.split-panel article {
  padding: 26px;
  background: var(--white);
}

.split-panel h3 {
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 21px;
}

.split-panel ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--ink-muted);
}

.draft-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 28px;
  margin-top: 34px;
}

.references {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 15px;
}

.references ol {
  margin: 14px 0 0;
  padding-left: 22px;
}

.references li + li {
  margin-top: 10px;
}

.references a {
  color: var(--teal-dark);
}

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.78);
}

.footer-inner {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 14px;
}

.footer-inner strong {
  color: var(--white);
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: auto 1fr auto auto;
  }

  .nav-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .js .site-nav {
    position: fixed;
    inset: 72px 0 auto 0;
    display: none;
    max-height: calc(100vh - 72px);
    overflow: auto;
    padding: 20px 24px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 250, 247, 0.98);
    box-shadow: var(--shadow);
  }

  .js .site-nav.is-open {
    display: grid;
    gap: 6px;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .site-nav a {
    padding: 12px 0;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

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

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

  .hero-meta,
  .two-column,
  .standard-grid,
  .term-grid,
  .split-panel,
  .draft-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 660px) {
  body {
    font-size: 16px;
  }

  .header-inner {
    width: min(var(--max), calc(100% - 24px));
    gap: 12px;
  }

  .wordmark__meta {
    display: none;
  }

  .language-links {
    font-size: 12px;
  }

  .hero {
    min-height: auto;
    background-image:
      linear-gradient(180deg, rgba(251, 250, 247, 0.94), rgba(251, 250, 247, 0.88)),
      url("./images/hmp-hero.png");
  }

  .hero-inner,
  .section-inner,
  .footer-inner {
    width: min(var(--max), calc(100% - 24px));
  }

  .hero-meta {
    display: grid;
  }

  .toc {
    grid-template-columns: 1fr;
  }

  .workflow-step {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .data-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    white-space: normal;
  }

  .data-table th,
  .data-table td {
    min-width: 180px;
  }

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

  .hero h1,
  h2,
  h3,
  .eyebrow,
  .spec-label,
  .hero-lead,
  .lead,
  .definition p,
  .evidence-card,
  .standard-card,
  .term-card,
  .workflow-step,
  .split-panel,
  .draft-grid,
  .references,
  .footer-inner {
    min-width: 0;
    overflow-wrap: anywhere;
    hyphens: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
