/* ============================================================
   HabitRacer — legal pages (privacy, terms, delete-account)

   Same design language as site.css, tuned for long-form reading:
   quieter background, wider measure control, stronger hierarchy.

   Deliberately shares no file with site.css so a landing-page
   change can never restyle a policy document by accident. Tokens
   are duplicated rather than imported — @import would cost an
   extra blocking request on pages Play needs to resolve fast.

   Requires no markup changes: it styles the existing classes.
   ============================================================ */

:root {
  --bg: #05070f;
  --ink: #f2f5ff;
  --body: #9aa5c2;
  --muted: #6b7699;
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --mint: #2bd98b;
  --glass: rgba(255, 255, 255, .045);
  --edge: rgba(255, 255, 255, .1);
  --edge-2: rgba(255, 255, 255, .18);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 16px/1.75 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient wash, drawn on body so the markup stays untouched. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 12% -10%, rgba(124, 92, 255, .3), transparent 60%),
    radial-gradient(46vw 46vw at 92% 4%, rgba(34, 211, 238, .16), transparent 62%);
}
body > * { position: relative; z-index: 1; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(880px, 100% - 44px); margin-inline: auto; }

/* ── Nav ───────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 50;
  padding: 13px 0;
  border-bottom: 1px solid var(--edge);
  background: rgba(5, 7, 15, .72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; }

.logo {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: -.03em;
}
.logo:hover { text-decoration: none; }

/* The markup ships a literal "H"; swap it for the real app icon
   so the brand mark matches the landing page exactly. */
.logo-mark {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  background: url("assets/icon-512.png") center / cover no-repeat;
  box-shadow: 0 6px 18px rgba(124, 92, 255, .4);
  font-size: 0; color: transparent;
}

.nav-links { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.nav-links a { color: var(--body); }
.nav-links a:hover { color: var(--ink); text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 999px;
  background: linear-gradient(135deg, var(--violet), #5b8cff 55%, var(--cyan));
  color: #060915 !important; font-weight: 700; font-size: 13.5px;
  box-shadow: 0 10px 28px -8px rgba(124, 92, 255, .75);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 16px 38px -8px rgba(124, 92, 255, .95); text-decoration: none; }
.btn.sm { padding: 9px 17px; font-size: 13px; }

/* ── Document ──────────────────────────────────────────────── */

.legal {
  width: min(760px, 100% - 44px);
  margin: clamp(38px, 7vw, 76px) auto clamp(56px, 9vw, 104px);
}

.legal h1 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(31px, 5vw, 46px); font-weight: 700; line-height: 1.08; letter-spacing: -.035em;
}
.legal h1::after {
  content: ""; display: block; width: 64px; height: 3px; margin-top: 18px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--mint));
}

.updated {
  margin: 0 0 34px;
  color: var(--muted); font-size: 13px; letter-spacing: .02em;
}

.legal h2 {
  margin: 46px 0 14px;
  color: var(--ink);
  font-size: clamp(20px, 2.4vw, 25px); font-weight: 600; letter-spacing: -.025em; line-height: 1.25;
  scroll-margin-top: 84px;
}
.legal h3 {
  margin: 30px 0 10px;
  color: var(--ink);
  font-size: 16.5px; font-weight: 600; letter-spacing: -.015em;
}

.legal p { margin: 0 0 17px; }
.legal strong { color: var(--ink); font-weight: 600; }

.legal ul, .legal ol { margin: 0 0 20px; padding-left: 22px; }
.legal li { margin-bottom: 10px; }
.legal li::marker { color: var(--violet); }

.legal hr { margin: 40px 0; border: 0; border-top: 1px solid var(--edge); }

/* Callout box used for the deletion steps and the support address. */
.card-note {
  margin: 0 0 22px;
  padding: 22px 24px;
  border: 1px solid var(--edge); border-left: 3px solid var(--violet);
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.card-note > :last-child { margin-bottom: 0; }
.card-note ol, .card-note ul { margin-bottom: 0; }

.legal table { width: 100%; margin: 0 0 22px; border-collapse: collapse; font-size: 14.5px; }
.legal th, .legal td { padding: 12px 14px; border-bottom: 1px solid var(--edge); text-align: left; }
.legal th { color: var(--ink); font-weight: 600; }

/* ── Footer ────────────────────────────────────────────────── */

footer {
  padding: 44px 0 36px;
  border-top: 1px solid var(--edge);
  background: rgba(5, 7, 15, .6);
  font-size: 13.5px;
}
.foot-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px;
  padding-bottom: 26px;
}
.foot-brand p { margin: 11px 0 0; max-width: 34ch; color: var(--muted); font-size: 13px; line-height: 1.6; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: flex-start; }
.foot-links a { color: var(--body); }
.foot-links a:hover { color: var(--cyan); }
.foot-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  padding-top: 22px; border-top: 1px solid var(--edge);
  color: var(--muted); font-size: 12.5px;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 640px) {
  .wrap, .legal { width: min(100% - 32px, 880px); }
  .nav-links { gap: 15px; font-size: 13.5px; }
  .legal h2 { margin-top: 36px; }
  .card-note { padding: 18px 18px; }
  .foot-inner { flex-direction: column; gap: 22px; }
}

/* Very narrow: the nav's text links would wrap into the button. */
@media (max-width: 420px) {
  .nav-links a:not(.btn) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  body::before, .nav, footer { display: none !important; }
  body { background: #fff; color: #000; }
  .legal { width: auto; margin: 0; }
  .legal h1, .legal h2, .legal h3, .legal strong { color: #000; }
  a { color: #000; text-decoration: underline; }
  .card-note { border: 1px solid #999; background: none; }
}
