/* Shared styles for the legal pages (terms.html, disclaimer.html).
   Tokens, header and footer mirror index.html. */
:root {
  --bg: #05070c;
  --bg-1: #080b13;
  --bg-2: #0c111c;
  --bg-3: #111827;
  --line: rgba(160, 180, 210, 0.10);
  --line-2: rgba(160, 180, 210, 0.18);
  --line-3: rgba(160, 180, 210, 0.28);
  --text: #e9eef6;
  --text-2: #a1adc0;
  --text-3: #647089;
  --blue: #2a7bff;
  --cyan: #22c3ee;
  --mint: #2df0c5;
  --amber: #ffb84d;
  --red: #ff5d5d;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --display: 'Archivo', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

::selection {
  background: rgba(45, 240, 197, 0.25);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font: 500 14px/1 var(--sans);
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(180deg, #3a86ff 0%, #1f6af0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 0 1px rgba(42, 123, 255, .7), 0 10px 30px -10px rgba(42, 123, 255, .7);
  transition: background .2s, box-shadow .2s;
}

.btn:hover {
  background: linear-gradient(180deg, #4a90ff 0%, #2a74f5 100%);
}

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 7, 12, .78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  height: 68px;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand img {
  width: 30px;
  height: auto;
}

.brand span {
  font: 700 19px/1 var(--display);
  font-stretch: 118%;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-2);
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

/* ---------- PAGE HEAD ---------- */
.page-head {
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(600px 240px at 12% 0%, rgba(42, 123, 255, .14), transparent 70%),
    radial-gradient(500px 220px at 88% 10%, rgba(45, 240, 197, .07), transparent 70%);
}

.eyebrow {
  font: 500 12px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 18px;
}

.page-head h1 {
  font: 700 clamp(34px, 5vw, 52px)/1.05 var(--display);
  font-stretch: 112%;
  letter-spacing: -0.03em;
  max-width: 820px;
}

.page-head .lede {
  margin-top: 18px;
  max-width: 680px;
  font-size: 17px;
  color: var(--text-2);
}

.page-head .lede a,
.meta a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
}

.page-head .lede a:hover,
.meta a:hover {
  color: var(--mint);
}

.meta {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font: 400 12.5px/1.5 var(--mono);
  color: var(--text-3);
}

/* ---------- LAYOUT ---------- */
.legal {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 64px;
  padding: 48px 0 96px;
}

.toc {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc h2 {
  font: 500 12px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
  border-left: 1px solid var(--line);
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-2);
  transition: color .2s, border-color .2s;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero) "  ";
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
}

.toc a:hover {
  color: var(--text);
  border-left-color: var(--line-3);
}

.toc a.active {
  color: var(--text);
  border-left-color: var(--mint);
}

/* ---------- PROSE ---------- */
.prose {
  max-width: 760px;
}

.prose section {
  padding-top: 8px;
  margin-bottom: 44px;
}

.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font: 600 23px/1.25 var(--display);
  font-stretch: 108%;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}

.prose h2 .n {
  font: 500 13px/1 var(--mono);
  color: var(--text-3);
  flex-shrink: 0;
}

.prose h3 {
  font: 600 16.5px/1.35 var(--sans);
  margin: 26px 0 8px;
}

.prose p,
.prose li {
  color: var(--text-2);
  font-size: 15.5px;
}

.prose p + p {
  margin-top: 12px;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose ul {
  margin: 12px 0 0;
  padding-left: 0;
  list-style: none;
}

.prose ul li {
  position: relative;
  padding-left: 22px;
  margin-top: 9px;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .68em;
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--line-3);
}

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s, color .2s;
}

.prose a:hover {
  color: var(--mint);
  text-decoration-color: var(--mint);
}

.prose code {
  font: 400 .88em/1 var(--mono);
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
}

.caps {
  font-size: 14px !important;
  letter-spacing: .01em;
  text-transform: uppercase;
  line-height: 1.7;
}

/* ---------- CALLOUTS ---------- */
.callout {
  position: relative;
  padding: 22px 24px 22px 60px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  margin: 0 0 40px;
}

.callout svg {
  position: absolute;
  left: 22px;
  top: 23px;
  width: 22px;
  height: 22px;
}

.callout h2,
.callout h3 {
  font: 600 17px/1.35 var(--sans);
  margin: 0 0 8px;
  color: var(--text);
}

.callout p,
.callout li {
  font-size: 15px;
}

.callout-danger {
  border-color: rgba(255, 93, 93, .45);
  background: linear-gradient(180deg, rgba(255, 93, 93, .10), rgba(255, 93, 93, .04));
}

.callout-danger svg,
.callout-danger h2,
.callout-danger h3 {
  color: var(--red);
}

.callout-warn {
  border-color: rgba(255, 184, 77, .38);
  background: linear-gradient(180deg, rgba(255, 184, 77, .08), rgba(255, 184, 77, .03));
}

.callout-warn svg {
  color: var(--amber);
}

/* Risk cards on the disclaimer page */
.risk-level {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font: 500 11px/1.2 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.risk-level.critical {
  color: var(--red);
  background: rgba(255, 93, 93, .12);
  box-shadow: inset 0 0 0 1px rgba(255, 93, 93, .35);
}

.risk-level.high {
  color: var(--amber);
  background: rgba(255, 184, 77, .10);
  box-shadow: inset 0 0 0 1px rgba(255, 184, 77, .32);
}

.risk-level.medium {
  color: var(--cyan);
  background: rgba(34, 195, 238, .08);
  box-shadow: inset 0 0 0 1px rgba(34, 195, 238, .28);
}

.ack {
  margin-top: 8px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--bg-1);
}

.ack p {
  color: var(--text);
}

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 32px;
  background: var(--bg-1);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font: 400 12.5px/1.5 var(--mono);
  color: var(--text-3);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.footer-links a {
  color: var(--text-2);
  transition: color .2s;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--text);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .legal {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 32px;
  }

  .toc {
    position: static;
    max-height: none;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-1);
  }
}

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

  .nav-links {
    display: none;
  }

  .nav-row {
    justify-content: space-between;
  }

  .page-head {
    padding: 48px 0 32px;
  }

  .callout {
    padding: 18px 18px 18px 50px;
  }

  .callout svg {
    left: 16px;
    top: 19px;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

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