/* ============================================================
   PaiChat — legal pages (Privacy / Terms)
   Shared theme + nav + footer + article layout
   ============================================================ */

:root {
  --bg:         oklch(0.13 0.012 290);
  --bg-2:       oklch(0.15 0.014 290);
  --surface:    oklch(0.17 0.014 290);
  --surface-2:  oklch(0.20 0.014 290);
  --hairline:   oklch(0.28 0.014 290 / 0.7);
  --hairline-2: oklch(0.32 0.014 290 / 0.5);

  --ink:        oklch(0.98 0.005 290);
  --ink-2:      oklch(0.82 0.01 290);
  --ink-3:      oklch(0.65 0.01 290);
  --ink-4:      oklch(0.50 0.01 290);

  --purple:      oklch(0.72 0.20 295);
  --purple-2:    oklch(0.60 0.22 290);
  --purple-soft: oklch(0.78 0.16 300);
  --grad-1: #c4a8ff;
  --grad-2: #7c5cff;
  --grad-3: #ff9bb1;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); color-scheme: dark; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button { background: none; border: none; color: inherit; font-family: inherit; cursor: pointer; padding: 0; }
img { display: block; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; letter-spacing: 0.02em; text-transform: lowercase; }
.dim { color: var(--ink-4); }
.grad {
  background: linear-gradient(110deg, var(--grad-1) 0%, var(--grad-2) 45%, var(--grad-3) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================================
   NAV (matches landing)
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 16px 28px;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  background: oklch(0.12 0.012 290 / 0.6);
  border-bottom: 1px solid var(--hairline);
}
.nav-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(196,168,255,0.16), rgba(124,92,255,0.10));
  border: 1px solid rgba(196,168,255,0.18);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4) inset, 0 6px 20px -4px rgba(124,92,255,0.3);
}
.brand-mark img { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3)); }
.brand-mark.sm { width: 24px; height: 24px; border-radius: 7px; }
.brand-word {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.nav-links { display: flex; gap: 26px; justify-self: center; font-size: 14px; }
.nav-links a { color: var(--ink-3); transition: color .15s ease; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, oklch(0.72 0.22 295), oklch(0.58 0.24 290));
  color: white;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 0 0 1px rgba(196,168,255,0.4),
    0 12px 30px -10px rgba(124,92,255,0.6);
}
.btn-primary:hover { transform: translateY(-1px); }
.kbd {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; line-height: 1;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.06);
}

/* ============================================================
   LEGAL ARTICLE
   ============================================================ */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 96px 28px 80px;
}
.legal-head {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 36px;
  margin-bottom: 48px;
}
.legal-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-3);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: oklch(0.17 0.014 290 / 0.6);
  font-size: 11px;
}
.legal-eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--purple-soft);
  box-shadow: 0 0 8px var(--purple);
}
.legal-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(36px, 5.6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-top: 20px;
  font-weight: 600;
}
.legal-date {
  color: var(--ink-3);
  margin-top: 18px;
  font-size: 12px;
}
.legal-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-4);
  font-size: 12.5px;
  margin-bottom: 28px;
  transition: color .15s ease;
}
.legal-back:hover { color: var(--ink-2); }

.legal-body {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.7;
}
.legal-body > p:first-of-type {
  font-size: 16.5px;
  color: var(--ink-2);
  margin-bottom: 26px;
}
.legal-body p { margin: 14px 0; }
.legal-body h2 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 56px 0 18px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}
.legal-body h2:first-of-type {
  margin-top: 16px;
  padding-top: 0;
  border-top: none;
}
.legal-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 28px 0 8px;
  letter-spacing: -0.005em;
}
.legal-body ul {
  margin: 12px 0 18px;
  padding-left: 22px;
}
.legal-body li {
  margin: 6px 0;
}
.legal-body li::marker { color: var(--ink-4); }
.legal-body a {
  color: var(--purple-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .15s ease;
}
.legal-body a:hover { color: var(--ink); }
.legal-body strong { color: var(--ink); font-weight: 600; }
.legal-body .placeholder {
  color: var(--ink-4);
  background: oklch(0.17 0.014 290 / 0.6);
  border: 1px dashed var(--hairline);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.legal-contact {
  margin-top: 24px;
  padding: 22px 24px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: oklch(0.17 0.014 290 / 0.4);
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.7;
}
.legal-contact .placeholder { display: inline-block; margin-bottom: 4px; }

/* ============================================================
   FOOTER (matches landing)
   ============================================================ */
.foot {
  border-top: 1px solid var(--hairline);
  margin-top: 60px;
  padding: 60px 28px 40px;
  max-width: 1240px;
  margin-left: auto; margin-right: auto;
}
.foot-top {
  display: grid;
  grid-template-columns: 1.4fr 3fr;
  gap: 50px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--hairline);
}
.foot-brand { display: flex; align-items: center; gap: 8px; }
.foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.foot-cols > div { display: flex; flex-direction: column; gap: 8px; }
.foot-h { margin-bottom: 6px; }
.foot-cols a { color: var(--ink-3); font-size: 13.5px; transition: color .15s ease; }
.foot-cols a:hover { color: var(--ink); }
.foot-bot { display: flex; justify-content: space-between; padding-top: 24px; flex-wrap: wrap; gap: 12px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .foot-top { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .legal { padding: 60px 20px 60px; }
  .legal-head { margin-bottom: 36px; padding-bottom: 28px; }
  .foot-cols { grid-template-columns: repeat(2, 1fr); }
  .nav { padding: 14px 18px; }
}
