/* Blueprint legal pages - standalone, theme-aware styling.
   Depends only on ../../docs/brand/tokens.css (the brand palette).
   Does NOT depend on the site's styles.css.

   Theme resolution mirrors the main site:
   - data-theme="dark" (or default :root) uses the navy field palette.
   - data-theme="light" uses the paper palette.
   - data-theme="system" follows prefers-color-scheme.
   No em dashes anywhere in this file. */

/* ---- Semantic tokens, sourced straight from the adaptive brand tokens ----
   tokens.css already redefines the --bp-* surfaces per theme (LIGHT warm
   off-white by default, DARK navy field, and the system @media), so we just
   alias them here. No hardcoded palette values. */
:root {
  --bg-1:           var(--bp-bg);
  --bg-2:           var(--bp-bg-2);
  --surface:        var(--bp-surface);
  --surface-stroke: var(--bp-surface-stroke);
  --text-primary:   var(--bp-text);
  --text-secondary: var(--bp-text-dim);
  --link:           var(--bp-accent);
  --accent:         var(--bp-accent);
  --card-shadow:    var(--bp-card-shadow);
  --notice-bg:      color-mix(in srgb, var(--bp-accent) 9%, transparent);
  --notice-stroke:  color-mix(in srgb, var(--bp-accent) 42%, transparent);
  /* Match the homepage frame (styles.css --maxw / --pad) so every page lines up. */
  --maxw: 1080px;
  --pad:  clamp(20px, 5vw, 64px);
  --measure: 72ch; /* readable prose width inside the wide frame */
}

/* ---- Base ---- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--bp-font);
  color: var(--text-primary);
  background: var(--bg-1);
  background-image:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--bp-navy-top) 22%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.legal-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px var(--pad) 96px;
}

/* Keep the reading column comfortable inside the wide, homepage-aligned frame. */
.legal-header,
.legal-body,
.legal-footer { max-width: var(--measure); }

/* ---- Top bar with wordmark + back link ---- */
.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 26px;
  flex-wrap: wrap;
}

.wordmark {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
.wordmark .dot { color: var(--bp-accent); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.back-link:hover { color: var(--text-primary); text-decoration: none; }
.back-link .arrow { font-size: 1.05em; line-height: 1; }

/* ---- Heading block ---- */
.legal-header { margin: 8px 0 14px; }

.legal-header h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.1;
}

.updated {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
}


/* ---- Body content ---- */
.legal-body { margin-top: 10px; }

.legal-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  padding-top: 8px;
}

.legal-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 26px 0 8px;
}

.legal-body p { margin: 0 0 16px; }

.legal-body ul {
  margin: 0 0 16px;
  padding-left: 22px;
}
.legal-body li { margin: 0 0 8px; }

.legal-body strong { color: var(--text-primary); font-weight: 700; }

.lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Callout for the key honesty disclaimers */
.callout {
  border: 1px solid var(--surface-stroke);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  border-left: 3px solid var(--bp-accent);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 18px;
}
.callout p:last-child { margin-bottom: 0; }

hr.rule {
  border: none;
  border-top: 1px solid var(--surface-stroke);
  margin: 40px 0;
}

/* ---- Footer (identical to the homepage footer in styles.css) ---- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
  position: relative;
  z-index: 1;
}
footer {
  border-top: 1px solid var(--surface-stroke);
  padding-block: 48px;
  position: relative;
  z-index: 1;
}
.foot-inner { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: center; }
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: block;
  box-shadow: 0 1px 4px var(--card-shadow);
}
footer .wordmark { font-size: 1.1rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 22px; }
.foot-links a { color: var(--text-secondary); text-decoration: none; font-weight: 600; }
.foot-links a:hover { color: var(--accent); text-decoration: none; }
.foot-fine { margin-top: 22px; font-size: 0.82rem; color: var(--text-secondary); max-width: 70ch; }
.foot-fine a { color: var(--text-secondary); }

/* ---- Focus visibility for keyboard users ---- */
a:focus-visible {
  outline: 2px solid var(--bp-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 480px) {
  .legal-wrap { padding: 22px 16px 80px; }
  body { font-size: 16px; }
}
