@font-face {
  font-family: "Vela Legal Mono";
  src: url("../assets/inconsolata-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Vela Legal Mono";
  src: url("../assets/inconsolata-medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Vela Legal Code";
  src: url("../assets/cascadia-code-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Vela Legal Sans";
  src: url("../assets/inter-light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

.legal-page {
  --legal-heading-font: "Vela Legal Mono", "SFMono-Regular", Consolas, monospace;
  --legal-body-font: "Vela Legal Sans", var(--font-sans);
  --legal-text: rgba(225, 225, 225, 1);
  --legal-muted: rgba(225, 225, 225, 0.6);
  background-color: var(--color-bg);
  color: var(--legal-text);
}

.legal-banner {
  height: 282px;
  background: #000 url("../assets/legal-background-desktop.webp") center / max(1440px, 100vw) auto no-repeat;
}

.legal-banner-inner {
  position: relative;
  display: flex;
  align-items: center;
  width: min(1040px, calc(100% - 80px));
  height: 100%;
  margin-inline: auto;
}

.legal-banner-copy { position: relative; z-index: 1; }
.legal-eyebrow { margin: 0 0 22px; color: var(--legal-muted); font: 400 14px/16px var(--legal-heading-font); }
.legal-banner h1 { margin: 0; font: 500 48px/50px var(--legal-heading-font); }
.legal-description { margin: 22px 0 0; color: var(--legal-muted); font: 400 16px/22px var(--legal-heading-font); }

.legal-constellation {
  position: absolute;
  top: 24px;
  right: 22px;
  width: 253px;
  height: 243px;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

.legal-page[data-page="privacy"] .legal-constellation { background-image: url("../assets/privacy-constellation.svg"); }
.legal-page[data-page="terms"] .legal-constellation { height: 234px; background-image: url("../assets/terms-constellation.svg"); }

.legal-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 60px;
  width: min(1040px, calc(100% - 80px));
  margin: 80px auto 120px;
}

.legal-directory {
  position: sticky;
  top: 88px;
  align-self: start;
  min-width: 0;
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #666 #171717;
}

.legal-directory > summary { display: none; }
.legal-nav { display: flex; flex-direction: column; gap: 24px; padding: 10px 6px 6px; font: 400 14px/16px var(--legal-heading-font); }
.legal-nav a, .legal-nav-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); color: rgba(225, 225, 225, 0.38); text-decoration: none; }
.legal-nav a { transition: color 160ms ease; }
.legal-nav-title { overflow-wrap: anywhere; }
.legal-nav-title small { display: block; margin-top: 5px; color: #666; font: 400 11px/15px var(--legal-heading-font); }
.legal-nav a:hover, .legal-nav a:focus-visible, .legal-nav a.is-active, .legal-nav a[aria-current="location"] { color: var(--legal-text); }
.legal-nav a:focus-visible, .legal-directory > summary:focus-visible, .legal-table-scroll:focus-visible { outline: 1px solid var(--legal-text); outline-offset: 5px; }

.legal-article { min-width: 0; color: var(--legal-muted); overflow-wrap: anywhere; font: 300 14px/22px var(--legal-body-font); }
.legal-release-date { margin: 0 0 24px; font: 400 12px/18px var(--legal-heading-font); }
.legal-section { padding-bottom: 40px; border-bottom: 1px solid var(--color-line); scroll-margin-top: 16px; }
.legal-section + .legal-section { margin-top: 40px; }
.legal-section h2 { margin: 0 0 24px; color: var(--legal-text); font: 500 28px/29px var(--legal-heading-font); }
.legal-section--information h2 { font: 400 22px/33px "Vela Legal Code", var(--legal-heading-font); }
.legal-section p { margin: 0 0 12px; }
.legal-section p:last-child, .legal-section ul:last-child { margin-bottom: 0; }
.legal-label { color: var(--legal-text); font-weight: inherit; }
.legal-clause { display: block; }
.legal-clause + .legal-clause { margin-top: 20px; }
.legal-clause + p { margin-top: 20px; }
.legal-clause p { display: inline; margin: 0; }
.legal-clause-number { flex: 0 0 22px; color: var(--legal-muted); font-weight: 300; }
.legal-subheading { margin: 20px 0; color: var(--legal-text); font: inherit; }
.legal-section ul { margin: 20px 0; padding-left: 22px; list-style: none; }
.legal-section li { position: relative; }
.legal-section li + li { margin-top: 20px; }
.legal-section li::before { content: ""; position: absolute; top: 0; left: -22px; width: 22px; height: 22px; background: url("../assets/legal-bullet.svg") center / contain no-repeat; }

.legal-table-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #666 #171717; }
.legal-table { width: 100%; table-layout: fixed; border-collapse: collapse; font: 300 12px/18px var(--legal-body-font); }
.legal-table[data-columns="4"], .legal-table[data-columns="5"] { min-width: 700px; }
.legal-table th, .legal-table td { padding: 12px 8px; text-align: left; vertical-align: top; font-weight: 300; overflow-wrap: anywhere; }
.legal-table thead { color: var(--legal-text); background: #151515; border-block: 1px solid #2a2a2a; }
.legal-table thead th { padding-block: 12px; }
.legal-table tbody tr { border-bottom: 1px solid var(--color-line); }
.legal-table-hint { display: none; }
.legal-table-scroll + .legal-table-hint + p { margin-top: 20px; }
.legal-page .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.legal-draft-note { margin: 30px 0 0; color: #777; font: 400 12px/18px var(--legal-heading-font); }

@media (max-width: 1100px) and (min-width: 701px) {
  .legal-layout { width: calc(100% - 64px); grid-template-columns: 170px minmax(0, 1fr); gap: 40px; }
  .legal-constellation { right: 0; transform: scale(.75); transform-origin: right center; opacity: .5; }
  .legal-description { max-width: 580px; }
  .legal-section:not(.legal-section--information) h2 { font-size: 26px; }
  .legal-table-hint { display: block; margin-top: 10px !important; font-size: 12px; }
}

@media (max-width: 700px) {
  .legal-page .site-header { height: 50px; padding-inline: 20px; }
  .legal-page .site-header.is-scrolled { background: #101010; }
  .legal-page .mobile-page-title { font: 500 16px/17px var(--legal-heading-font); }
  .legal-banner { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; background-image: none; }
  .legal-layout { display: block; width: auto; margin: 99px 20px 76px; }
  .legal-directory { display: none; }
  .legal-article { font-size: 12px; line-height: 18px; }
  .legal-release-date { margin-bottom: 20px; }
  .legal-section { padding-bottom: 20px; border-bottom-width: 0.5px; scroll-margin-top: 0; }
  .legal-section + .legal-section { margin-top: 20px; }
  .legal-section h2 { margin-bottom: 20px; color: rgba(232, 232, 230, 1); font: 500 14px/14.5px var(--legal-heading-font); }
  .legal-clause + .legal-clause { margin-top: 10px; }
  .legal-clause + p { margin-top: 10px; }
  .legal-clause-number { flex-basis: auto; }
  .legal-subheading { gap: 3px; margin-block: 20px; }
  .legal-section ul { margin-top: 20px; padding-left: 18px; }
  .legal-section li + li { margin-top: 10px; }
  .legal-section li::before { top: -2px; left: -20px; }
  .legal-table-scroll { max-width: none; margin-right: -20px; }
  .legal-table { font-size: 11px; line-height: 16px; }
  .legal-table[data-columns="2"] { width: calc(100% - 20px); }
  .legal-table[data-columns="4"] { min-width: 520px; }
  .legal-table[data-columns="5"] { min-width: 650px; }
  .legal-table th, .legal-table td { padding: 6px 4px 6px 6px; }
  .legal-table thead { border-width: 0.5px; }
  .legal-table thead th { padding-block: 6px; }
  .legal-table tbody tr { border-bottom-width: 0.5px; }
  .legal-draft-note { margin-top: 24px; font-size: 12px; line-height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .legal-nav a { transition: none; }
}
