/* legal.css — shared styling for BetterPipe's standalone legal pages
   (privacy.html, terms.html). Mirrors the design tokens and type system from
   index.html so these pages match the marketing site in both the default dark
   theme and the light theme. No build step; served as-is by Cloudflare Pages. */

:root {
  --ink: #0A0A0B;
  --ink-2: #131316;
  --ink-3: #1B1B20;
  --bone: #E8E2D2;
  --bone-mute: #9A958A;
  --signal: #22D3EE;
  --signal-deep: #0891B2;
  --alarm: #FF5A6B;

  --bg: var(--ink);
  --bg-2: var(--ink-2);
  --bg-3: var(--ink-3);
  --fg: var(--bone);
  --fg-mute: var(--bone-mute);
  --rule: rgba(232, 226, 210, 0.10);
  --rule-strong: rgba(232, 226, 210, 0.22);

  --font-display: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', monospace;
  --font-italic: 'Instrument Serif', Georgia, serif;

  --max-w: 1320px;
  --measure: 680px;
  --gutter: clamp(20px, 4vw, 56px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
  --ink: #F5F2EB;
  --ink-2: #EFEBE0;
  --ink-3: #E6E1D4;
  --bone: #15151A;
  --bone-mute: #57575F;
  --signal: #0E7490;
  --signal-deep: #155E75;
  --bg: var(--ink);
  --bg-2: var(--ink-2);
  --bg-3: var(--ink-3);
  --fg: var(--bone);
  --fg-mute: var(--bone-mute);
  --rule: rgba(10, 10, 11, 0.08);
  --rule-strong: rgba(10, 10, 11, 0.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { background: var(--bg); }
body {
  font-family: var(--font-body);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02", "kern";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--signal); color: var(--ink); }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--fg-mute);
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); }
.wordmark .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.wordmark .name i {
  color: var(--signal);
  font-style: italic;
  font-family: var(--font-italic);
  font-weight: 400;
  margin-left: 2px;
}
.back-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 200ms var(--ease-out);
}
.back-link:hover { color: var(--signal); }
.back-link .arrow { transition: transform 200ms var(--ease-out); }
.back-link:hover .arrow { transform: translateX(-3px); }

/* ---------- Hero ---------- */
main { flex: 1 0 auto; }
.legal-hero {
  position: relative;
  padding: clamp(56px, 10vw, 116px) 0 clamp(30px, 5vw, 52px);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.legal-hero::before {
  content: '';
  position: absolute;
  inset: -45% 0 auto 0;
  height: 420px;
  background: radial-gradient(58% 100% at 18% 0%,
    color-mix(in srgb, var(--signal) 13%, transparent), transparent 70%);
  pointer-events: none;
}
.legal-hero .container { position: relative; }
.legal-hero .eyebrow { color: var(--signal); display: block; margin-bottom: 22px; }
.legal-hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.0;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
}
.legal-hero h1 i {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  color: var(--signal);
  letter-spacing: -0.01em;
  margin-left: 4px;
}
.legal-hero .meta { margin-top: 22px; }
.legal-hero .lede {
  margin-top: 28px;
  max-width: var(--measure);
  color: var(--fg-mute);
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* ---------- Article ---------- */
.legal-body { padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 9vw, 120px); }
article.doc { max-width: var(--measure); counter-reset: sec; }
article.doc > section { padding-top: 44px; }
article.doc > section:first-of-type { padding-top: 0; }
article.doc > section + section { border-top: 1px solid var(--rule); }
article.doc h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
article.doc h2::before {
  counter-increment: sec;
  content: counter(sec, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  color: var(--signal);
  font-weight: 500;
  flex: none;
}
article.doc h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  margin: 26px 0 10px;
}
article.doc p { margin-bottom: 16px; color: var(--fg); }
article.doc p.muted, article.doc .muted { color: var(--fg-mute); }
article.doc ul { margin: 0 0 16px; padding: 0; list-style: none; }
article.doc li { position: relative; padding-left: 22px; margin-bottom: 10px; }
article.doc li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  opacity: 0.7;
}
article.doc a.link { color: var(--signal); position: relative; }
article.doc a.link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  transition: opacity 200ms;
}
article.doc a.link:hover::after { opacity: 1; }
article.doc strong { font-weight: 600; color: var(--fg); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0;
  background: var(--bg);
  flex-shrink: 0;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer .links { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer a.flink, .site-footer .copy {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
}
.site-footer a.flink { transition: color 200ms var(--ease-out); }
.site-footer a.flink:hover { color: var(--signal); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
