/* ============================================================
   Endless River — legal pages (Privacy / Terms)
   Shared by privacy.html and terms.html. Same visual system as the
   Countly landing (teal hue + grain), but a calm, readable scrolling
   document: the background is fixed and still so text stays legible.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0; padding: 0;
  background: oklch(0.22 0.05 202);
  color: oklch(0.97 0.005 200);
  font-family: 'Newsreader', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: oklch(0.85 0.02 220 / 0.4); }

/* Fixed atmospheric background */
.bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, oklch(0.67 0.03 196) 0%, transparent 60%),
    linear-gradient(180deg,
      oklch(0.55 0.045 194) 0%,
      oklch(0.36 0.05 198) 46%,
      oklch(0.22 0.05 202) 100%);
}
.bg::after {
  content: ''; position: absolute; left: -10%; right: -10%; top: 6%; height: 30%;
  background: radial-gradient(50% 60% at 50% 50%, oklch(0.82 0.03 190 / 0.22), transparent 72%);
  filter: blur(40px);
}
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url(/grain.png); background-size: 320px 320px;
  opacity: 0.12; mix-blend-mode: overlay;
}

/* Document column */
.doc { max-width: 720px; margin: 0 auto; padding: 56px 28px 96px; }

.doc__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 72px;
}
.back-link {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px; letter-spacing: 0.3em;
  color: inherit; text-decoration: none; opacity: 0.7;
  transition: opacity 0.3s ease;
  display: inline-flex; align-items: center; gap: 12px;
}
.back-link:hover, .back-link:focus-visible { opacity: 1; outline: none; }
.back-link__arrow { font-size: 15px; letter-spacing: 0; }
.head-mark {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 15px; font-weight: 500; letter-spacing: 0.34em; margin-right: -0.34em;
  opacity: 0.9;
}

.doc__title {
  font-style: italic; font-weight: 300;
  font-size: clamp(40px, 7vw, 56px); line-height: 1.08;
  letter-spacing: 0.01em; margin: 0 0 18px;
}
.doc__meta {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  opacity: 0.55; margin: 0;
}
.doc__intro {
  font-size: 20px; line-height: 1.6; font-weight: 300;
  opacity: 0.92; max-width: 62ch; margin: 30px 0 0;
}

/* Sections */
.doc__body { counter-reset: sec; margin-top: 8px; }
.doc__body section { margin-top: 52px; }
.doc__body h2 {
  counter-increment: sec;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0.62; margin: 0 0 18px;
  display: flex; gap: 14px; align-items: baseline;
}
.doc__body h2::before {
  content: counter(sec, decimal-leading-zero);
  font-weight: 500; opacity: 0.7; letter-spacing: 0.08em;
}

.doc__body p, .doc__body li {
  font-size: 18px; line-height: 1.7; font-weight: 300;
  opacity: 0.9; max-width: 64ch;
}
.doc__body p { margin: 0 0 16px; }
.doc__body p:last-child, .doc__body li:last-child { margin-bottom: 0; }
.doc__body strong { font-weight: 500; opacity: 1; }

.doc__body ul { margin: 0 0 16px; padding-left: 0; list-style: none; }
.doc__body li { position: relative; padding-left: 26px; margin-bottom: 10px; }
.doc__body li::before {
  content: ''; position: absolute; left: 2px; top: 0.82em;
  width: 7px; height: 1.5px; background: currentColor; opacity: 0.55;
}

.doc__body a {
  color: inherit; text-decoration: none;
  border-bottom: 1px solid oklch(0.97 0.005 200 / 0.35);
  transition: border-color 0.3s ease;
}
.doc__body a:hover, .doc__body a:focus-visible {
  border-bottom-color: oklch(0.97 0.005 200 / 0.85); outline: none;
}

/* Emphasised callout (e.g. "not legal advice") */
.callout {
  border-left: 1.5px solid oklch(0.97 0.005 200 / 0.45);
  padding: 4px 0 4px 22px; margin: 22px 0;
}
.callout p { opacity: 0.97; }

/* Footer */
.doc__foot {
  margin-top: 76px; padding-top: 28px;
  border-top: 1px solid oklch(0.97 0.005 200 / 0.18);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.55;
}
.doc__foot .foot-links { display: flex; gap: 16px; }
.doc__foot a { color: inherit; text-decoration: none; transition: opacity 0.3s ease; }
.doc__foot a:hover, .doc__foot a:focus-visible { opacity: 0.6; outline: none; }

@media (prefers-reduced-motion: reduce) {
  .back-link, .doc__body a, .doc__foot a { transition: none; }
}
@media (max-width: 560px) {
  .doc { padding: 36px 22px 72px; }
  .doc__head { margin-bottom: 52px; }
  .head-mark { font-size: 13px; }
  .doc__intro { font-size: 18px; }
  .doc__body p, .doc__body li { font-size: 17px; }
  .doc__foot { gap: 14px; }
}
