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

:root {
  --ink: #0A0F1C;
  --navy: #002768;
  --red: #C8262A;
  --dark-red: #A90100;
  --white: #FFFFFF;
  --surface: #FCFCFD;
  --surface-alt: #F4F5F7;
  --hairline: #E5E7EB;
  --body-copy: #26303F;
  --accent: var(--red);
  --container: 1240px;
}

html {
  scroll-behavior: smooth;
  background: var(--surface);
}

body {
  margin: 0;
  background-color: var(--surface);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(100%, var(--container));
  margin: 0 auto;
  padding-inline: 32px;
}

main { min-height: 50vh; }

.legal-hero {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: clamp(68px, 8vw, 104px) 0 clamp(76px, 9vw, 118px);
  background:
    linear-gradient(rgba(10, 15, 28, .9), rgba(10, 15, 28, .94)),
    url("../../assets/blueprint-background.webp") center / cover fixed;
  color: var(--white);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 66% calc(100% - 14px), 62% 100%, 0 100%);
}

.legal-hero .eyebrow {
  display: block;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.legal-hero h1 {
  max-width: 900px;
  margin: 0 0 20px;
  color: var(--white);
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(46px, 7vw, 88px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: .95;
  text-transform: uppercase;
  text-wrap: balance;
}

.legal-hero h1 span { color: var(--accent); }

.legal-hero .lede {
  max-width: 670px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.7;
}

.legal-content {
  margin-top: -14px;
  padding: clamp(58px, 7vw, 88px) 0 clamp(82px, 10vw, 128px);
  background:
    linear-gradient(rgba(252, 252, 253, .94), rgba(252, 252, 253, .97)),
    url("../../assets/white-engineering-background.webp") center top / cover fixed;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 780px);
  gap: clamp(36px, 5vw, 68px);
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 120px;
  padding: 26px 24px 24px;
  border-top: 4px solid var(--accent);
  background: var(--surface-alt);
}

.legal-toc h2 {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 15px;
  line-height: 1.2;
  text-transform: uppercase;
}

.legal-toc ol {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: privacy-toc;
}

.legal-toc li { counter-increment: privacy-toc; }

.legal-toc a {
  display: grid;
  grid-template-columns: 28px 1fr;
  padding: 6px 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.legal-toc a::before {
  content: counter(privacy-toc, decimal-leading-zero);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}

.legal-toc a:hover { color: var(--accent); }

.legal-toc a:focus-visible,
.legal-section a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.legal-updated {
  margin-bottom: 38px;
  color: #5B6471;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.legal-section {
  padding: 0 0 42px;
  scroll-margin-top: 120px;
}

.legal-section + .legal-section { padding-top: 6px; }

.legal-section h2 {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(10, 15, 28, .1);
  color: var(--ink);
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(22px, 2.5vw, 28px);
  letter-spacing: -.01em;
  line-height: 1.08;
  text-transform: uppercase;
  text-wrap: balance;
}

.legal-section p,
.legal-section li {
  color: var(--body-copy);
  font-size: 16px;
  line-height: 1.7;
}

.legal-section p { margin: 0 0 16px; }

.legal-section ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.legal-section li {
  position: relative;
  padding-left: 22px;
}

.legal-section li::before {
  position: absolute;
  top: .72em;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  content: "";
}

.legal-section a {
  color: var(--dark-red);
  font-weight: 700;
  text-underline-offset: 3px;
}

.legal-section a:hover { color: var(--navy); }

.contact-block {
  padding: 24px 26px;
  background: var(--surface-alt);
}

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

@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .legal-toc {
    position: static;
    top: auto;
  }

  .legal-toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }
}

@media (max-width: 640px) {
  .container { padding-inline: 20px; }

  .legal-hero {
    padding-top: 54px;
    padding-bottom: 76px;
    background-attachment: scroll;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), 62% calc(100% - 10px), 56% 100%, 0 100%);
  }

  .legal-content {
    margin-top: -10px;
    background-attachment: scroll;
  }

  .legal-toc ol { grid-template-columns: 1fr; }
  .legal-section { scroll-margin-top: 92px; }
  .contact-block { padding: 22px 20px; }
}

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