/* ──────────────────────────────────────────────────────────────────
   progy legal pages (/terms, /privacy).
   Reuses the homepage design DNA from styles.css — Outfit display,
   monochrome palette, brand mark, canvas tableau, vignette — but swaps
   the fixed single-screen hero for a scrolling document column.

   styles.css loads FIRST (for brand/status/canvas/vignette tokens),
   then this file overrides what a long, scrollable page needs:
     - the chrome (brand/status/canvas/vignette) becomes position: fixed
       so it stays put while the document scrolls underneath it
     - a readability veil dims the canvas behind the prose
     - a prose column with legal-document typography
   ────────────────────────────────────────────────────────────────── */

/* The homepage pins body height to the viewport and hides overflow via
   `.page`. Legal pages have no `.page`; the document scrolls naturally. */
html, body {
  height: auto;
  min-height: 100%;
}
body {
  /* Vertical scroll on; horizontal still clipped (canvas can overdraw edges). */
  overflow-x: hidden;
  overflow-y: auto;
}

/* ─── Chrome → fixed, so it tracks the viewport during scroll ─── */
.canvas-wrap,
.vignette,
.brand,
.status {
  position: fixed;
}

/* Readability veil: a fixed white wash over the canvas, under the prose.
   The homepage relies on its vignette to keep the centered hero legible;
   a full-length document needs a stronger, even wash so body text never
   competes with the moving particles behind it. */
.legal-veil {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.62);
}

/* Top shade — mirrors the homepage `.page::before`, masking content as it
   scrolls up under the fixed brand/status chrome. */
.legal-topshade {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 96px;
  z-index: 8;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    rgba(255, 255, 255, 0.94) 32%,
    rgba(255, 255, 255, 0.55) 66%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* ─── Document column ─── */
.legal {
  position: relative;
  z-index: 6;
  max-width: 720px;
  margin: 0 auto;
  /* Top padding clears the fixed brand/status chrome; bottom gives the
     footer room to breathe. */
  padding: 132px 24px 96px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #86868b;
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.3s ease;
}
.legal-back:hover { color: #1d1d1f; }
.legal-back .arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.legal-back:hover .arrow { transform: translateX(-3px); }

.legal-kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #86868b;
  margin-bottom: 16px;
}

.legal-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #1d1d1f;
}
/* Same gradient accent the homepage uses on "Pay per token." */
.legal-title .accent {
  background: linear-gradient(135deg, #1d1d1f 0%, #3a3a3c 60%, #1d1d1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.04em;
}

.legal-updated {
  margin-top: 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #a8adb5;
}

/* Short framing note under the title (the "plain-language" summary). */
.legal-lede {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  color: #4a4a4f;
}
.legal-lede strong { font-weight: 600; color: #1d1d1f; }

/* ─── Prose ─── */
.legal-prose {
  margin-top: 44px;
}
.legal-prose section {
  margin-top: 40px;
}
.legal-prose section:first-child { margin-top: 0; }

.legal-prose h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1d1d1f;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
/* Monospace section number, echoing the terminal block on the homepage. */
.legal-prose h2 .num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: #a8adb5;
}

.legal-prose h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
  margin: 26px 0 10px;
}

.legal-prose p {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.72;
  color: #3a3a3f;
  margin-bottom: 14px;
}
.legal-prose p:last-child { margin-bottom: 0; }

.legal-prose a {
  color: #1d1d1f;
  text-decoration: none;
  border-bottom: 1px solid #c7cbd0;
  transition: border-color 0.3s ease;
}
.legal-prose a:hover { border-bottom-color: #1d1d1f; }

.legal-prose strong { font-weight: 600; color: #1d1d1f; }

.legal-prose ul {
  margin: 4px 0 16px;
  padding-left: 0;
  list-style: none;
}
.legal-prose li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: #3a3a3f;
  margin-bottom: 9px;
}
/* Hairline dash marker, matching the meta-strip dashes on the homepage. */
.legal-prose li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 12px;
  height: 1px;
  background: #c7cbd0;
}

/* ─── Footer ─── */
.legal-foot {
  position: relative;
  z-index: 6;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #a8adb5;
}
.legal-foot .sep { color: #d8dbe0; padding: 0 10px; }
.legal-foot a {
  color: #86868b;
  text-decoration: none;
  transition: color 0.3s ease;
}
.legal-foot a:hover { color: #1d1d1f; }

/* ─── Responsive ─── */
@media (max-width: 760px) {
  .legal { padding: 112px 22px 72px; }
  .legal-back { margin-bottom: 32px; }
  .legal-prose section { margin-top: 34px; }
  .legal-topshade { height: 76px; }
}

@media (max-width: 420px) {
  .legal { padding: 100px 18px 60px; }
  .legal-prose p,
  .legal-prose li { font-size: 14px; }
  .legal-foot { padding: 0 18px 44px; letter-spacing: 0.18em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .status-dot::after { display: none; }
}
