:root {
  --paper: #fbfbf8;
  --ink: #111312;
  --muted: #5f6863;
  --line: #d9ded8;
  --strong-line: #222522;
  --panel: #ffffff;
  --blue: #12385f;
  --teal: #137264;
  --mint: #dff4eb;
  --amber: #f4c86a;
  --red: #b23c42;
  --shadow: 0 24px 70px rgba(20, 28, 24, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(17, 19, 18, 0.035) 1px, transparent 1px) 0 0 / 72px 72px,
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 248, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 780;
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
}

.brand-logo {
  width: 118px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: transparent;
}

.brand-logo img {
  display: block;
  width: 118px;
  height: auto;
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
}

.topnav a {
  text-decoration: none;
  padding: 5px 0;
  border-bottom: 1px solid transparent;
}

.topnav a[aria-current] {
  color: var(--ink);
  border-color: var(--ink);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--strong-line);
  border-radius: 2px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.button.secondary {
  background: var(--panel);
  color: var(--ink);
}

.hero {
  max-width: 1260px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 118px) clamp(20px, 4vw, 56px) 42px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 0.78fr);
  gap: clamp(32px, 5vw, 70px);
  align-items: start;
}

.standard-code {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.standard-code::before,
.standard-code::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.standard-code::before {
  width: 38px;
}

.standard-code::after {
  flex: 1;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 960px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 9vw, 132px);
  line-height: 0.93;
  font-weight: 500;
}

.lede {
  max-width: 760px;
  margin: 28px 0 0;
  color: #2e3431;
  font-size: clamp(19px, 2.1vw, 27px);
  line-height: 1.35;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 46px;
  border: 1px solid var(--strong-line);
  background: var(--strong-line);
}

.hero-meta div {
  min-height: 92px;
  padding: 16px;
  background: var(--panel);
}

.label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.value {
  display: block;
  margin-top: 10px;
  font-size: 16px;
  font-weight: 760;
}

.assurance-map {
  position: relative;
  padding: 22px;
  border: 1px solid var(--strong-line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.map-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.assurance-map svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 18px;
}

.stack-diagram {
  color: var(--ink);
  overflow: visible;
}

.diagram-band,
.diagram-group,
.diagram-card,
.diagram-cell {
  stroke: var(--strong-line);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.diagram-group {
  fill: rgba(255, 255, 255, 0.78);
}

.fill-soft {
  fill: #f3f5f1;
}

.fill-panel {
  fill: #ffffff;
}

.fill-mint {
  fill: var(--mint);
}

.diagram-flow {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.diagram-kicker,
.diagram-code,
.diagram-label,
.diagram-small,
.diagram-cell-title,
.diagram-cell-sub,
.diagram-rail-text {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.diagram-kicker {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.1em;
}

.diagram-code {
  fill: var(--blue);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 720;
}

.diagram-label {
  fill: var(--ink);
  font-size: 18px;
  font-weight: 760;
}

.diagram-small {
  fill: var(--muted);
  font-size: 13px;
}

.diagram-cell-title {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 760;
}

.diagram-cell-sub {
  fill: var(--muted);
  font-size: 12px;
}

.diagram-rail line,
.diagram-rail rect {
  stroke: var(--strong-line);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.diagram-rail rect {
  fill: #ffffff;
}

.diagram-rail-text {
  fill: var(--blue);
  font-size: 12px;
  font-weight: 720;
}

.map-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.contents-panel {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 32px;
  margin-top: 56px;
}

.contents-panel hr {
  margin: 0 0 14px;
  border: 0;
  border-top: 1px solid var(--strong-line);
}

.contents-panel h2 {
  font-size: 20px;
}

.contents-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--strong-line);
  background: var(--strong-line);
}

.contents-links a {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 54px;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--panel);
  text-decoration: none;
  font-weight: 720;
}

.contents-links span {
  color: var(--teal);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
}

.section {
  max-width: 1260px;
  margin: 0 auto;
  padding: 64px clamp(20px, 4vw, 56px);
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 28px;
  margin-bottom: 28px;
}

.section-number {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  line-height: 0.9;
}

.section-title h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.98;
  font-weight: 500;
}

.section-title p {
  max-width: 830px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.standard-text {
  max-width: 920px;
  margin-left: 148px;
  color: #303632;
  font-size: 18px;
}

.standard-text p {
  margin: 0 0 18px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(300px, 0.38fr);
  gap: 32px;
  align-items: start;
}

.rule-list {
  border-top: 1px solid var(--strong-line);
}

.rule {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 22px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.rule code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  color: var(--teal);
}

.rule h3 {
  font-size: 20px;
  margin-bottom: 6px;
}

.rule p {
  margin: 0;
  color: var(--muted);
}

.callout {
  border: 1px solid var(--strong-line);
  background: var(--panel);
  padding: 22px;
}

.callout h3 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.callout p,
.callout li {
  color: var(--muted);
}

.callout ul {
  padding-left: 19px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.filter-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.filter-button[aria-pressed] {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--strong-line);
  background: var(--strong-line);
}

.domain {
  background: var(--panel);
  min-height: 430px;
  padding: 22px;
}

.domain header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.domain code {
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--blue);
  font-size: 13px;
}

.domain h3 {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.15;
}

.status-tag {
  border: 1px solid var(--line);
  padding: 4px 7px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.domain-section {
  margin-top: 18px;
}

.domain-section h4 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.domain-section p,
.domain-section li {
  color: #333a36;
  font-size: 14px;
}

.domain-section ul {
  margin: 0;
  padding-left: 18px;
}

.clause-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.clause-list strong {
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.deficiency {
  padding: 12px;
  border-left: 3px solid var(--red);
  background: #fff6f5;
  color: #5f2024;
  font-size: 14px;
}

.matrix {
  overflow-x: auto;
  border: 1px solid var(--strong-line);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: #f3f5f1;
}

td {
  color: #303632;
  font-size: 14px;
}

.attestation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--strong-line);
  background: var(--strong-line);
}

.attestation article {
  background: var(--panel);
  padding: 24px;
}

.attestation strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-weight: 500;
  color: var(--blue);
}

.attestation h3 {
  margin-top: 14px;
  font-size: 20px;
}

.attestation p {
  color: var(--muted);
}

.deficiency-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.deficiency-list li {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: #3e2426;
}

.questions {
  position: relative;
}

.copy-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.copy-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.question-list {
  counter-reset: questions;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--strong-line);
}

.question-list li {
  counter-increment: questions;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.question-list li::before {
  content: counter(questions, decimal-leading-zero);
  color: var(--teal);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.references {
  columns: 2;
  column-gap: 34px;
  margin: 0;
  padding-left: 20px;
}

.references li {
  break-inside: avoid;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.reference-block {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--strong-line);
}

.reference-block h3 {
  margin-bottom: 18px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer {
  max-width: 1260px;
  margin: 0 auto;
  padding: 34px clamp(20px, 4vw, 56px) 60px;
  border-top: 1px solid var(--strong-line);
  color: var(--muted);
  font-size: 13px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.45fr) minmax(0, 0.8fr);
  gap: 42px;
}

.footer h2,
.footer h3 {
  color: var(--ink);
}

.footer h2 {
  font-size: 22px;
}

.footer h3 {
  margin-top: 3px;
  font-size: 28px;
}

.author-credit {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.author-credit p {
  max-width: 720px;
}

.credit-label {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.credit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}

.credit-links a {
  font-weight: 720;
}

.feedback-dialog {
  width: min(680px, calc(100vw - 36px));
  padding: 0;
  border: 1px solid var(--strong-line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 32px 90px rgba(17, 19, 18, 0.22);
}

.feedback-dialog::backdrop {
  background: rgba(17, 19, 18, 0.46);
}

.feedback-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1;
  font-weight: 500;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--strong-line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
}

.request-type {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--strong-line);
  background: var(--strong-line);
}

.request-type legend {
  padding: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.request-type label {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 12px;
  background: var(--panel);
  font-size: 14px;
  font-weight: 700;
}

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

.feedback-form label:not(.request-type label) {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.feedback-form input,
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  letter-spacing: 0;
}

.feedback-form input {
  min-height: 42px;
  padding: 8px 10px;
}

.feedback-form textarea {
  resize: vertical;
  padding: 10px;
}

.turnstile-row {
  min-height: 66px;
  display: flex;
  align-items: center;
}

.feedback-form input:focus,
.feedback-form textarea:focus,
.icon-button:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.form-status {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-status[data-tone="success"] {
  color: var(--teal);
}

.form-status[data-tone="error"] {
  color: var(--red);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topnav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .hero-grid,
  .two-col,
  .section-head,
  .contents-panel {
    grid-template-columns: 1fr;
  }

  .hero-meta,
  .attestation,
  .domain-grid,
  .deficiency-list,
  .footer-grid,
  .request-type,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .references {
    columns: 1;
  }

  .standard-text {
    margin-left: 0;
  }

  .author-credit {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 24px;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--paper);
  }

  .hero,
  .section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .rule,
  .question-list li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .contents-links {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(48px, 16vw, 76px);
  }
}

@media print {
  .topbar,
  .filters,
  .contents-panel,
  .copy-row,
  .feedback-dialog {
    display: none;
  }

  body {
    background: white;
  }

  .section,
  .hero,
  .footer {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  .domain,
  .callout,
  .attestation article {
    break-inside: avoid;
  }
}
