/* ── Tokens (shared with landing) ──────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --green: #00a651;
  --green-deep: #007a3d;
  --green-bright: #2dcc6a;
  --yellow: #f4c400;
  --yellow-hot: #ffe033;
  --black: #0a0a0a;
  --ink: #111111;
  --header-h: 29dvh;
  --logo-max-h: calc(var(--header-h) - 1.35rem);
  --split: var(--header-h);
}

html {
  scroll-behavior: smooth;
}

body.legal-body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--black);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ── Split world (matches index) ───────────────────────────── */
.world {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.sky {
  position: absolute;
  inset: 0 0 calc(100% - var(--split)) 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, var(--green-bright) 0%, var(--green) 55%, var(--green-deep) 100%);
}

.street {
  position: absolute;
  inset: var(--split) 0 0 0;
  background:
    linear-gradient(180deg, #e8b800 0%, var(--yellow) 12%, var(--yellow-hot) 100%);
}

.wall-texture {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ── Shell: fixed green header + scrolling yellow body ─────── */
.legal-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* Green zone — stays put, never scrolls */
.legal-header {
  flex: 0 0 var(--header-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  padding: 0.15rem 1rem 0.2rem;
  overflow: hidden;
}

.legal-logo {
  flex: 0 0 auto;
  display: block;
  line-height: 0;
  text-decoration: none;
}

.legal-logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(96vw, 820px);
  max-height: var(--logo-max-h);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.2));
}

.legal-back {
  flex-shrink: 0;
  margin-top: 0.125rem;
  line-height: 1.2;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(10, 10, 10, 0.5);
  border-bottom: 1px solid rgba(10, 10, 10, 0.2);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.legal-back:hover {
  color: var(--black);
  border-color: rgba(10, 10, 10, 0.45);
}

/* Yellow zone — only this area scrolls */
.legal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--black) rgba(10, 10, 10, 0.08);
}

.legal-scroll::-webkit-scrollbar {
  width: 8px;
}

.legal-scroll::-webkit-scrollbar-track {
  background: rgba(10, 10, 10, 0.06);
  border-left: 1px solid rgba(10, 10, 10, 0.08);
}

.legal-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--black) 0%, #2a2a2a 100%);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 51, 0.35);
}

.legal-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--black) 0%, var(--green-deep) 100%);
  box-shadow: inset 0 0 0 1px var(--yellow-hot);
}

.legal-scroll::-webkit-scrollbar-thumb:active {
  background: var(--green-deep);
  box-shadow: inset 0 0 0 1px var(--yellow);
}

.legal-scroll__inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
}

/* ── Document content ──────────────────────────────────────── */
.legal-doc__intro {
  padding-bottom: 1.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid rgba(10, 10, 10, 0.14);
}

.legal-doc__title {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(1.1rem, 3.2vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--black);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
  margin-bottom: 0.55rem;
}

.legal-doc__updated {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(10, 10, 10, 0.48);
}

.legal-doc__welcome {
  margin-top: 1.1rem;
  font-size: 1rem;
  color: var(--ink);
}

.legal-doc__welcome strong {
  font-weight: 700;
}

/* ── Sections (numbered + bullets) ─────────────────────────── */
.legal-section {
  padding: 1.35rem 0;
  border-bottom: 1px solid rgba(10, 10, 10, 0.1);
}

.legal-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.legal-section__heading {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(0.88rem, 2.4vw, 1.05rem);
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 0.8rem;
}

.legal-section__num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  font-size: 0.72rem;
  letter-spacing: 0;
  color: var(--yellow-hot);
  background: var(--black);
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
}

.legal-section p {
  margin-bottom: 0.8rem;
  color: var(--ink);
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.legal-list li {
  position: relative;
  padding-left: 1.1rem;
}

.legal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--black);
}

.legal-list strong {
  font-weight: 700;
  color: var(--black);
}

/* ── Footer ────────────────────────────────────────────────── */
.legal-footer {
  padding-top: 2rem;
  text-align: center;
}

.legal-footer__copy {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(10, 10, 10, 0.34);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 520px) {
  .legal-header {
    padding: 0.125rem 1rem 0.175rem;
  }

  .legal-logo img {
    max-width: min(96vw, 680px);
  }

  .legal-scroll__inner {
    padding: 1rem 1rem 2rem;
  }

  .legal-section__heading {
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (max-height: 640px) {
  :root {
    --header-h: 26dvh;
    --logo-max-h: calc(var(--header-h) - 1.25rem);
  }
}

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