/*
  Buffer v3 legal pages (/privacy-policy, /terms-of-use): one shell, two
  documents, rendered by v3-legal.js from legal-content.js. A port of the
  v1 buffer-legal.css with the v3 values from
  design/v3-handoff/Legal Page v3.dc.html. Nav, footer, tokens and the
  glows come from v3-site.css.
*/

/* Proportional figures in the documents, as on the v1 legal pages and in
   the legal reference: Inter's tabular feature also widens the hyphen
   (7.4 to 10.4px at 16px), which pulls words like "de-identified" apart.
   The section and contents numbers stay tabular. */
body { font-variant-numeric: normal; }

.v3-legal-hero {
  position: relative;
  margin: clamp(8px, 1vw, 12px) clamp(8px, 1vw, 12px) 0;
  border-radius: clamp(24px, 3vw, 28px);
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, var(--sage-200) 0%, var(--sage-100) 55%, var(--white) 100%);
  padding: clamp(120px, 14vw, 160px) clamp(16px, 4vw, 48px) clamp(48px, 6vw, 72px);
}

.v3-legal-hero .v3-legal-glow-a { --t: 1.2; top: -200px; left: -120px; width: 720px; height: 720px; }
.v3-legal-hero .v3-legal-glow-b { --t: 1.2; top: -40px; right: -160px; width: 760px; height: 760px; }
.v3-legal-hero .v3-legal-glow-c { --t: 1.2; top: -80px; right: 260px; width: 520px; height: 520px; }

.v3-legal-hero-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.v3-legal-title {
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--ink);
  text-wrap: balance;
}

.v3-legal-updated {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* The header's small text sits on the drifting teal glow, which takes teal
   and text-2 below 4.5:1 (3.1 and 2.6 at worst). Charcoal stays above 4.8
   throughout. The reference draws the kicker teal and the date text-2. */
.v3-legal-hero .v3-kicker { color: var(--ink-2); }

.v3-legal-main {
  max-width: 1200px;
  margin: clamp(32px, 5vw, 56px) auto 0;
  padding: 0 clamp(16px, 4vw, 48px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

/* Contents card: sticky beside the document, and scrollable if it is taller
   than the window, so the last entries are never out of reach. */
.v3-legal-toc {
  position: sticky;
  top: 100px;
  min-width: 0;
  max-height: calc(100vh - 124px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border-radius: 20px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v3-legal-toc-title {
  padding: 4px 12px 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--accent);
}

.v3-legal-toc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.v3-legal-toc-link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.v3-legal-toc-link[aria-current] {
  background: var(--zone);
  color: var(--ink);
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .v3-legal-toc-link:hover { background: var(--tray); }
}

[data-press="toc"].is-pressed {
  transform: scale(calc(1 - .02 * var(--m))) !important;
  transition: transform .09s ease-out !important;
}

.v3-legal-toc-n {
  flex: none;
  min-width: 22px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.v3-legal-doc {
  min-width: 0;
  border-radius: clamp(24px, 3vw, 28px);
  background: var(--surface);
  padding: clamp(8px, 2vw, 24px) clamp(20px, 5vw, 64px) clamp(24px, 4vw, 48px);
  box-shadow: var(--shadow-card);
}

.v3-legal-section {
  padding: clamp(28px, 4vw, 40px) 0;
  scroll-margin-top: 110px;
}

.v3-legal-section + .v3-legal-section { border-top: 1px solid var(--hairline); }

.v3-legal-h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
  font-size: clamp(22px, 2.4vw, 26px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
}

.v3-legal-section-n {
  flex: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.v3-legal-blocks {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.v3-legal-blocks p,
.v3-legal-blocks li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  text-wrap: pretty;
}

.v3-legal-blocks h3 {
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--ink);
}

.v3-legal-blocks ul {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v3-legal-blocks li { padding-left: 4px; }
.v3-legal-blocks li::marker { color: var(--accent); }
.v3-legal-blocks strong { font-weight: 600; color: var(--ink); }

.v3-legal-blocks a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgb(var(--teal-rgb) / .6);
  overflow-wrap: anywhere;
}

@media (hover: hover) and (pointer: fine) {
  .v3-legal-blocks a:hover { color: var(--accent); }
}

.v3-legal-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--tray);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

.v3-legal-noscript {
  padding: 32px 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* Below 1024px the grid collapses and the contents card is never sticky. */
@media (max-width: 1023px) {
  .v3-legal-main { grid-template-columns: minmax(0, 1fr); }

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