/* ─────────────────────────────────────────────────────────────────────────────
   Legal pages — privacy.html, terms.html

   These two are hand-written static HTML outside the Angular app (they must
   stay readable and indexable with no build step), so they cannot import
   src/styles.scss. This file is the bridge: the same tokens, the same sky, the
   same glass, kept in one place rather than pasted into each page's <style>.

   When a token changes in src/styles.scss, change it here too — the values
   below are deliberately copied verbatim so a diff between the two is obvious.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  --font-display: 'Poppins', system-ui, sans-serif;
  --font-text: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* The sky, top to bottom: the zenith is already night and only the lowest
     band still holds blue. Every stop keeps a little cyan so it reads as air. */
  --sky-1: #010204;
  --sky-2: #020408;
  --sky-3: #030810;
  --sky-4: #050d19;
  --sky-5: #071322;

  --c-bg: #010204;
  --c-surface: rgba(255, 255, 255, 0.05);
  --c-border: rgba(255, 255, 255, 0.1);
  --c-ink: #eef2f8;
  --c-muted: #9ba6b8;
  --c-faint: #66718a;

  --glass-hi: rgba(214, 232, 255, 0.55);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.1);

  --r-lg: 14px;
  --measure: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-text);
  color: var(--c-ink);
  background: var(--c-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* One fixed sky for the whole document, exactly as on the landing page: it does
   not scroll with the text, so a long policy never runs off the bottom of the
   gradient into flat black. Fixed + `z-index: -1` keeps it out of the flow, so
   it costs one paint and nothing else. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(130% 60% at 50% -12%, rgba(30, 64, 106, 0.09), transparent 66%),
    linear-gradient(
      180deg,
      var(--sky-5) 0%,
      var(--sky-4) 20%,
      var(--sky-3) 43%,
      var(--sky-2) 70%,
      var(--sky-1) 100%
    );
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
a:hover {
  color: #ffffff;
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Gutters clear the notch on a landscape phone, matching the app's .container. */
.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

/* ── Header ──────────────────────────────────────────────────────────────
   Sticky and frosted like the site's, so scrolling a long document keeps the
   way back to the brand. Tinted from the TOP of the sky, which is what the bar
   actually overlaps; padding-top carries it clear of the status bar. */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--sky-5) 78%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
}
.top .wrap {
  display: flex;
  align-items: center;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
}
.brand img {
  height: 26px;
  width: auto;
  display: block;
}

/* ── Document ────────────────────────────────────────────────────────── */
main {
  padding: 56px 0 72px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--c-faint);
}
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw + 1rem, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 14px 0 8px;
  hyphens: auto;
}
.updated {
  color: var(--c-faint);
  font-size: 14px;
  margin: 0 0 36px;
}
.intro {
  font-size: 18px;
  color: var(--c-muted);
  margin: 0 0 36px;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  /* An anchored heading must clear the sticky bar it would otherwise hide under. */
  scroll-margin-top: 88px;
}
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin: 22px 0 8px;
}
p {
  margin: 0 0 14px;
}
ul {
  margin: 0 0 14px;
  padding-left: 22px;
}
li {
  margin: 6px 0;
}
li::marker {
  color: var(--c-faint);
}
strong {
  font-weight: 600;
}

/* The page's one raised surface. Same recipe as the app's .card: a translucent
   sheet over the sky plus a catch-light along the top edge — no blur, because
   blurring a smooth gradient returns the same gradient and costs a layer. */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-inset);
  padding: 22px 24px;
  margin: 26px 0;
}
.card > :last-child {
  margin-bottom: 0;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--c-border);
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding-top: 26px;
  padding-bottom: max(26px, env(safe-area-inset-bottom));
}
.foot a {
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--c-muted);
  /* A 44px touch target without moving the baseline of the row. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.foot a:hover {
  color: var(--c-ink);
}
.foot .legal {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-faint);
}

@media (max-width: 560px) {
  main {
    padding: 40px 0 56px;
  }
  .foot .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .foot .legal {
    margin-left: 0;
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  a {
    transition: none;
  }
}
