/* Shared layout for the legal pages (/terms, /privacy). Same bright look as
   /accessibility: a summary column on the left and the full text in a card on
   the right that scrolls on its own, so the page fits one screen on desktop. */
:root {
  color-scheme: light;
  --ink: oklch(0.2 0.03 296);
  --text-2: oklch(0.38 0.02 296);
  --muted: oklch(0.45 0.02 296);
  --purple: oklch(0.55 0.25 293);
  --purple-ink: oklch(0.45 0.24 293);
  --magenta: oklch(0.62 0.27 320);
  --border: oklch(0.9 0.02 293);
  --tint: oklch(0.97 0.01 293);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, oklch(0.55 0.25 293 / 0.09), transparent 42%),
    radial-gradient(circle at 88% 92%, oklch(0.62 0.27 320 / 0.07), transparent 45%),
    #fff;
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}
a { color: var(--purple-ink); }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
}
.top img { height: 34px; width: auto; display: block; }
.back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  color: var(--ink); font-weight: 600; font-size: 0.88rem; text-decoration: none;
}
.back:hover { border-color: var(--purple); color: var(--purple-ink); }
/* Keep "Back to Project3000" on one line, also on small phones. */
.back { white-space: nowrap; flex: none; }
@media (max-width: 420px) {
  .top { gap: 10px; }
  .top img { height: 28px; }
  .back { padding: 8px 12px; font-size: 0.82rem; gap: 5px; }
}


main {
  flex: 1 1 auto;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 4px clamp(16px, 4vw, 40px) 8px;
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 22px;
  align-items: start;
}

.intro h1 {
  margin: 6px 0 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.intro h1 .grad {
  background: linear-gradient(100deg, var(--purple-ink), oklch(0.5 0.25 320));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eyebrow {
  display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--purple-ink);
}
.intro > p { margin: 0 0 14px; color: var(--text-2); font-size: 0.93rem; line-height: 1.55; }
.dates { font-size: 0.82rem !important; color: var(--muted) !important; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 50px -24px oklch(0.4 0.1 293 / 0.28);
}
.summary { padding: 18px 20px; }
.summary h2 { margin: 0 0 10px; font-family: 'Space Grotesk', sans-serif; font-size: 1.08rem; }
.summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.summary li { display: flex; gap: 10px; font-size: 0.86rem; line-height: 1.5; color: var(--text-2); }
.summary li svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--purple-ink); }
.summary li strong { color: var(--ink); }
.summary .related { margin: 14px 0 0; font-size: 0.84rem; color: var(--text-2); }

.doc { position: relative; /* keeps screen-reader-only captions inside the scrolling card */ padding: 6px 26px 22px; counter-reset: sec; }
.doc h2 {
  margin: 24px 0 8px; font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem;
  display: flex; align-items: baseline; gap: 10px; scroll-margin-top: 16px;
}
.doc h2::before {
  counter-increment: sec; content: counter(sec);
  flex: none; display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--magenta));
  color: #fff; font-size: 0.78rem; font-family: Inter, sans-serif; font-weight: 700;
  transform: translateY(-1px);
}
.doc h2.sr-only::before { content: none; counter-increment: none; }
.doc h3 { margin: 16px 0 6px; font-size: 0.95rem; color: var(--ink); }
.doc p, .doc li { font-size: 0.9rem; line-height: 1.65; color: var(--text-2); }
.doc p { margin: 0 0 10px; }
.doc ul { margin: 0 0 10px; padding-left: 20px; }
.doc li + li { margin-top: 4px; }
.doc strong { color: var(--ink); }
.doc .lead { margin-top: 18px; }
.callout {
  margin: 10px 0 14px; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(135deg, oklch(0.55 0.25 293 / 0.08), oklch(0.62 0.27 320 / 0.07));
  border: 1px solid oklch(0.55 0.25 293 / 0.35);
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.limits { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 0.88rem; }
/* Grid columns may shrink below their content, so a wide table never widens the page. */
main > * { min-width: 0; }
@media (max-width: 600px) {
  /* Narrow screens: tables scroll inside their own box instead of pushing the page wider. */
  .doc .limits { display: block; overflow-x: auto; }
  .doc .limits th, .doc .limits td { padding: 6px 8px; }
  .doc code { word-break: break-word; overflow-wrap: anywhere; }
}
.limits th, .limits td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.limits th { color: var(--ink); font-weight: 600; background: var(--tint); }
.doc code { font-size: 0.8rem; color: var(--ink); word-break: break-all; }
.toc { margin: 10px 0 4px; padding: 12px 16px; border-radius: 12px; background: var(--tint); border: 1px solid var(--border); }
.toc p { margin: 0 0 6px !important; font-size: 0.8rem !important; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted) !important; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 24px; }
.toc li { font-size: 0.85rem; line-height: 1.7; break-inside: avoid; }

/* Desktop: one screen, the document scrolls inside its own card. */
@media (min-width: 900px) and (min-height: 620px) {
  body { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  main { min-height: 0; height: 100%; align-items: stretch; }
  .intro { min-height: 0; overflow-y: auto; padding-right: 2px; }
  .doc { min-height: 0; overflow-y: auto; }
}
@media (max-width: 899px) {
  main { grid-template-columns: 1fr; }
  .doc { padding: 4px 18px 18px; }
  .toc ol { columns: 1; }
}
