:root {
  --paper: #F5F5F2;
  --surface: #FFFFFF;
  --muted: #E9E9E6;
  --ink: #111111;
  --ink-soft: #555555;
  --line: #D1D1CC;
  --line-strong: #737373;
  --accent: #1F5F8B;
  --accent-light: #84C1EB;
  --dark: #111111;
  --radius: 4px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--surface); }
a { color: inherit; text-underline-offset: 3px; }
.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.measure { max-width: 76ch; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--accent);
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
}
.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}
.brand span,
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.back-link:hover,
.back-link:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.legal-hero {
  padding: 64px 0 72px;
  background: var(--dark);
  color: var(--surface);
}
.legal-hero .eyebrow { margin: 0 0 18px; color: var(--accent-light); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 {
  max-width: 900px;
  margin-bottom: 24px;
  font-size: clamp(44px, 7vw, 86px);
  line-height: .92;
  letter-spacing: -.045em;
}
.legal-intro {
  max-width: 760px;
  margin-bottom: 0;
  color: #C4C4C4;
  font-size: clamp(18px, 2vw, 22px);
}
.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 28px;
  color: #B8B8B8;
  font-size: 13px;
  font-weight: 800;
}

.legal-main { padding: 64px 0 88px; }
.review-status {
  margin: 0 0 40px;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  font-weight: 800;
}
.legal-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 760px);
  gap: 64px;
  align-items: start;
}
.legal-toc {
  position: sticky;
  top: 104px;
  display: grid;
  border-top: 4px solid var(--ink);
}
.legal-toc strong { padding: 14px 0; }
.legal-toc a {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.legal-toc a:hover,
.legal-toc a:focus-visible { color: var(--accent); outline: none; }
.legal-content section {
  padding: 0 0 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 104px;
}
.legal-content section:last-child { margin-bottom: 0; }
.legal-content h2 {
  margin-bottom: 18px;
  font-size: clamp(26px, 3.5vw, 38px);
  line-height: 1.08;
  letter-spacing: -.025em;
}
.legal-content h3 { margin-top: 28px; margin-bottom: 10px; font-size: 19px; }
.legal-content p,
.legal-content li { max-width: 76ch; }
.legal-content li + li { margin-top: 8px; }
.placeholder {
  display: inline;
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-weight: 800;
}
.source-link { color: var(--accent); font-weight: 700; }
.source-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.site-footer {
  padding: 36px 0;
  background: var(--dark);
  color: var(--surface);
}
.footer-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.footer-links a { color: #C4C4C4; font-size: 13px; font-weight: 800; }
.footer-links a:hover,
.footer-links a:focus-visible { color: var(--accent-light); outline: none; }

.error-main {
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
  padding: 64px 0;
  background: var(--dark);
  color: var(--surface);
}
.error-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .65fr);
  gap: 72px;
  align-items: center;
}
.error-code {
  margin: 0;
  color: var(--accent-light);
  font-size: clamp(120px, 24vw, 300px);
  font-weight: 900;
  line-height: .72;
  letter-spacing: -.08em;
}
.error-copy h1 {
  max-width: 680px;
  font-size: clamp(42px, 6vw, 72px);
}
.error-copy > p {
  max-width: 620px;
  color: #C4C4C4;
  font-size: 19px;
}
.error-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--surface);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
}
.button.secondary { background: transparent; color: var(--surface); border-color: #666666; }
.button:hover,
.button:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 3px; }
.route-list { border-top: 4px solid var(--accent-light); }
.route-list a {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #666666;
  color: var(--surface);
  font-weight: 800;
  text-decoration: none;
}
.route-list a::after { content: "→"; color: var(--accent-light); }
.route-list a:hover,
.route-list a:focus-visible { color: var(--accent-light); outline: none; }

@media (max-width: 820px) {
  .legal-grid,
  .error-grid { grid-template-columns: 1fr; }
  .legal-grid { gap: 40px; }
  .legal-toc { position: static; }
  .error-grid { gap: 56px; }
}

@media (max-width: 620px) {
  .nav { min-height: 64px; gap: 12px; }
  .brand { max-width: 190px; font-size: 14px; }
  .brand span { font-size: 10px; }
  .back-link { font-size: 13px; }
  .legal-hero { padding: 42px 0 52px; }
  .legal-main { padding: 44px 0 64px; }
  .legal-content section { scroll-margin-top: 88px; }
  .footer-grid { display: grid; }
  .error-main { min-height: calc(100vh - 64px); padding: 48px 0; }
  .error-code { font-size: 150px; }
  .error-actions,
  .error-actions .button { width: 100%; }
}
