:root {
  --legal-paper: #f4f8f7;
  --legal-ink: #10262c;
  --legal-muted: #4b6266;
  --legal-line: rgba(28, 78, 82, .16);
  --legal-aqua: #69e7dc;
  --legal-deep: #03131d;
  --legal-panel: rgba(255, 255, 255, .78);
}

html {
  scroll-padding-top: 7rem;
}

body.legal-page {
  min-height: 100vh;
  color: var(--legal-ink);
  background:
    radial-gradient(circle at 76% 5%, rgba(103, 229, 219, .32), transparent 25rem),
    linear-gradient(180deg, #d9f2ef 0, var(--legal-paper) 24rem, #f6f9f8 100%);
}

body.legal-page::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: .25;
  background-image:
    linear-gradient(rgba(22, 78, 82, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 78, 82, .04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 66%);
}

.legal-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 3px;
  background: rgba(1, 19, 28, .08);
}

.legal-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #159b9c, #55ddd4);
  box-shadow: 0 0 16px rgba(49, 206, 197, .52);
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: #f2ffff;
  background: rgba(3, 19, 29, .9);
  border-bottom: 1px solid rgba(196, 246, 244, .13);
  backdrop-filter: blur(18px);
}

.legal-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(calc(100% - 2rem), var(--max));
  min-height: 82px;
  margin: 0 auto;
}

.legal-header__brand {
  display: inline-flex;
  width: clamp(154px, 18vw, 205px);
}

.legal-header__brand img {
  display: block;
  width: 100%;
  height: auto;
}

.legal-header__nav {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.legal-header__nav a {
  padding: .65rem .85rem;
  border-radius: 999px;
  color: rgba(239, 254, 253, .78);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .68rem;
  letter-spacing: .02em;
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

.legal-header__nav a:hover,
.legal-header__nav a:focus-visible {
  color: #fff;
  background: rgba(117, 236, 227, .12);
}

.legal-header__nav a:last-child {
  color: #04161e;
  background: var(--legal-aqua);
}

.legal-header__nav a:focus-visible {
  outline: 2px solid var(--legal-aqua);
  outline-offset: 3px;
}

.legal-main {
  position: relative;
  z-index: 1;
}

.legal-hero {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
  padding: clamp(5rem, 10vw, 9rem) 0 clamp(3rem, 6vw, 5.5rem);
}

.legal-hero__kicker {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 1.25rem;
  color: #176d70;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.legal-hero__kicker::before {
  width: 34px;
  height: 1px;
  content: "";
  background: currentColor;
}

.legal-hero h1 {
  max-width: 900px;
  margin: 0;
  color: #06212b;
  font-size: clamp(3.1rem, 8vw, 7.8rem);
  font-weight: 500;
  letter-spacing: -.065em;
  line-height: .92;
}

.legal-hero__intro {
  max-width: 760px;
  margin: 1.8rem 0 0;
  color: #35565c;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.legal-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 2rem;
}

.legal-hero__meta span,
.legal-hero__meta a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: .55rem .85rem;
  border: 1px solid rgba(16, 85, 90, .16);
  border-radius: 999px;
  color: #234b50;
  background: rgba(255, 255, 255, .45);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .68rem;
  text-decoration: none;
}

.legal-hero__meta a:hover,
.legal-hero__meta a:focus-visible {
  border-color: rgba(9, 119, 120, .45);
  color: #075e62;
}

.legal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto clamp(3.5rem, 7vw, 6.5rem);
  overflow: hidden;
  border: 1px solid var(--legal-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, .52);
  box-shadow: 0 28px 80px rgba(16, 66, 69, .09);
  backdrop-filter: blur(12px);
}

.legal-summary__item {
  min-height: 150px;
  padding: 1.5rem;
  border-right: 1px solid var(--legal-line);
}

.legal-summary__item:last-child {
  border-right: 0;
}

.legal-summary__item span {
  display: block;
  margin-bottom: .9rem;
  color: #357276;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legal-summary__item strong,
.legal-summary__item a {
  color: #0d3037;
  font-size: .95rem;
  font-weight: 550;
  line-height: 1.45;
  text-decoration: none;
}

.legal-summary__item a {
  text-decoration: underline;
  text-decoration-color: rgba(9, 114, 117, .3);
  text-underline-offset: .25em;
}

.legal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 850px);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: start;
  justify-content: center;
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
  padding-bottom: clamp(5rem, 10vw, 10rem);
}

.legal-toc {
  position: sticky;
  top: 112px;
  max-height: calc(100vh - 136px);
  overflow-y: auto;
  padding: 1.25rem;
  border: 1px solid var(--legal-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .52);
  scrollbar-width: thin;
  backdrop-filter: blur(12px);
}

.legal-toc__title {
  margin: 0 0 .85rem;
  color: #287074;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legal-toc ol {
  display: grid;
  gap: .22rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: legal-sections;
}

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

.legal-toc a {
  display: grid;
  grid-template-columns: 1.65rem 1fr;
  gap: .35rem;
  padding: .42rem .45rem;
  border-radius: 8px;
  color: #4a6266;
  font-size: .73rem;
  line-height: 1.35;
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

.legal-toc a::before {
  color: #65a0a1;
  content: counter(legal-sections, decimal-leading-zero);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .6rem;
}

.legal-toc a:hover,
.legal-toc a:focus-visible,
.legal-toc a.is-current {
  color: #0b5559;
  background: rgba(79, 205, 198, .12);
}

.legal-toc a:focus-visible {
  outline: 2px solid #188c8d;
  outline-offset: 2px;
}

.legal-document {
  min-width: 0;
}

.legal-preamble,
.legal-section {
  padding: clamp(1.5rem, 3.2vw, 2.6rem);
  border: 1px solid var(--legal-line);
  border-radius: 24px;
  background: var(--legal-panel);
  box-shadow: 0 24px 70px rgba(16, 66, 69, .07);
}

.legal-preamble {
  margin-bottom: 1rem;
  border-color: rgba(26, 137, 136, .22);
  background:
    linear-gradient(135deg, rgba(94, 225, 216, .13), transparent 46%),
    rgba(255, 255, 255, .82);
}

.legal-preamble p {
  margin: 0;
  color: #31545a;
  font-size: 1.02rem;
}

.legal-section {
  margin-top: 1rem;
  scroll-margin-top: 112px;
}

.legal-section__number {
  display: block;
  margin-bottom: .75rem;
  color: #268084;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.legal-section h2 {
  margin: 0 0 1.15rem;
  color: #092b33;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 560;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.legal-section h3 {
  margin: 1.7rem 0 .65rem;
  color: #123a41;
  font-size: 1.02rem;
  font-weight: 650;
}

.legal-section p,
.legal-section li,
.legal-section dd {
  color: var(--legal-muted);
}

.legal-section p {
  margin: .8rem 0;
}

.legal-section ul,
.legal-section ol {
  display: grid;
  gap: .55rem;
  margin: .9rem 0;
  padding-left: 1.25rem;
}

.legal-section li::marker {
  color: #288a8b;
}

.legal-section a {
  color: #076d70;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}

.legal-section a:hover,
.legal-section a:focus-visible {
  color: #034b4e;
}

.legal-section code {
  padding: .1em .35em;
  border: 1px solid rgba(16, 85, 90, .13);
  border-radius: 5px;
  color: #0b5559;
  background: rgba(78, 194, 188, .08);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82em;
  overflow-wrap: anywhere;
}

.legal-table-wrap {
  margin: 1.2rem 0;
  overflow-x: auto;
  border: 1px solid var(--legal-line);
  border-radius: 16px;
}

.legal-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, .46);
}

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

.legal-table th {
  color: #27676b;
  background: rgba(66, 182, 177, .08);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.legal-table td {
  color: #4b6266;
  font-size: .86rem;
}

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

.legal-callout {
  margin: 1.3rem 0 0;
  padding: 1rem 1.15rem;
  border-left: 3px solid #42bcb6;
  border-radius: 0 12px 12px 0;
  background: rgba(72, 193, 186, .09);
}

.legal-callout p {
  margin: 0;
  color: #31555a;
}

.legal-contact-card {
  display: grid;
  gap: .3rem;
  margin-top: 1.2rem;
  padding: 1.25rem;
  border: 1px solid var(--legal-line);
  border-radius: 16px;
  background: rgba(78, 194, 188, .08);
}

.legal-contact-card strong {
  color: #102f36;
}

.legal-contact-card p {
  margin: 0;
}

.legal-placeholder {
  width: min(calc(100% - 2rem), 920px);
  margin: 0 auto;
  padding: 0 0 clamp(6rem, 12vw, 11rem);
}

.legal-placeholder__card {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 4.5rem);
  border: 1px solid var(--legal-line);
  border-radius: 28px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 35px 100px rgba(16, 66, 69, .1);
}

.legal-placeholder__card::after {
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(27, 139, 140, .16);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 28px rgba(27, 139, 140, .035),
    0 0 0 62px rgba(27, 139, 140, .025);
}

.legal-placeholder__status {
  display: inline-flex;
  margin-bottom: 1.3rem;
  padding: .55rem .8rem;
  border: 1px solid rgba(17, 126, 127, .2);
  border-radius: 999px;
  color: #176d70;
  background: rgba(78, 202, 195, .1);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.legal-placeholder__card h2 {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 0 1rem;
  color: #092b33;
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 550;
  letter-spacing: -.045em;
  line-height: 1.05;
}

.legal-placeholder__card p {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: .75rem 0;
  color: var(--legal-muted);
  font-size: 1.02rem;
}

.legal-placeholder__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.7rem;
}

.legal-placeholder__actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .75rem 1rem;
  border: 1px solid rgba(15, 107, 109, .23);
  border-radius: 999px;
  color: #0b5d60;
  font-size: .85rem;
  text-decoration: none;
}

.legal-placeholder__actions a:first-child {
  color: #ecffff;
  background: #0b575c;
}

.legal-placeholder__actions a:hover,
.legal-placeholder__actions a:focus-visible {
  border-color: #16888a;
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 157, 156, .15);
}

.legal-page .site-footer-wide {
  color: rgba(225, 245, 247, .66);
}

@media (max-width: 980px) {
  .legal-summary {
    grid-template-columns: 1fr 1fr;
  }

  .legal-summary__item:nth-child(2) {
    border-right: 0;
  }

  .legal-summary__item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--legal-line);
  }

  .legal-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .legal-toc {
    position: static;
    max-height: none;
    overflow: visible;
  }

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

@media (max-width: 650px) {
  .legal-header__inner {
    min-height: 72px;
  }

  .legal-header__nav a:first-child {
    display: none;
  }

  .legal-header__nav a {
    padding: .6rem .72rem;
    font-size: .62rem;
  }

  .legal-hero {
    padding-top: 4rem;
  }

  .legal-hero h1 {
    font-size: clamp(3rem, 17vw, 5.2rem);
  }

  .legal-summary {
    grid-template-columns: 1fr;
  }

  .legal-summary__item {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--legal-line);
  }

  .legal-summary__item:nth-child(3) {
    border-bottom: 1px solid var(--legal-line);
  }

  .legal-summary__item:last-child {
    border-bottom: 0;
  }

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

  .legal-preamble,
  .legal-section {
    border-radius: 18px;
  }
}

@media print {
  body.legal-page {
    color: #000;
    background: #fff;
  }

  body.legal-page::before,
  .legal-progress,
  .legal-header,
  .legal-toc,
  .site-footer-wide__nav,
  .site-footer-wide__contact {
    display: none !important;
  }

  .legal-hero,
  .legal-summary,
  .legal-layout {
    width: 100%;
  }

  .legal-hero {
    padding: 1rem 0;
  }

  .legal-hero h1 {
    font-size: 42pt;
  }

  .legal-layout {
    display: block;
  }

  .legal-preamble,
  .legal-section {
    break-inside: avoid;
    box-shadow: none;
  }

  .site-footer-wide {
    color: #222;
    background: #fff;
    box-shadow: none;
  }
}
