/* Shared styles for Grainly legal pages (Terms, Privacy) */
:root {
  --paper: #15130f;
  --ink: #ece6d7;
  --ink-dim: rgba(236, 230, 215, 0.6);
  --accent: #0A84FF;
  --line: rgba(236, 230, 215, 0.85);
  --line-faint: rgba(236, 230, 215, 0.14);
  --grain-opacity: 0.16;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.45s ease, color 0.45s ease;
}

/* Film grain — same texture as the rest of the site */
body::after {
  content: "";
  position: fixed;
  inset: -24px;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.5s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-4px, 3px); }
  66% { transform: translate(3px, -2px); }
  100% { transform: translate(0, 0); }
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.4rem 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
}
.brand img { width: 1.7rem; height: 1.7rem; display: block; }

/* Legal content */
.legal { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }
.legal h1 {
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  font-stretch: condensed;
  letter-spacing: -0.01em;
}
.legal .updated {
  margin-top: 0.7rem;
  color: var(--ink-dim);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.legal .intro { margin-top: 1.6rem; font-size: 1.12rem; }
.legal h2 {
  margin-top: 2.4rem;
  font-size: 1.3rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.legal p, .legal li { margin-top: 0.9rem; color: var(--ink); opacity: 0.92; font-size: 1.02rem; }
.legal ul { margin-top: 0.4rem; padding-left: 1.3rem; }
.legal li { margin-top: 0.5rem; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal strong { font-weight: 800; }
.legal .note {
  margin-top: 2.4rem;
  padding: 1rem 1.2rem;
  border: 2px dashed var(--line-faint);
  border-radius: 12px 4px 11px 5px / 5px 11px 4px 12px;
  font-size: 0.92rem;
  color: var(--ink-dim);
}

/* Footer */
.site-footer { border-top: 1px solid var(--line-faint); padding: 2.4rem 1.5rem 3rem; text-align: center; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; max-width: 52rem; margin: 0 auto; }
.footer-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 900; font-size: 1.05rem; text-transform: uppercase; }
.footer-brand img { width: 1.5rem; height: 1.5rem; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--ink-dim); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: color .15s ease; }
.footer-links a:hover { color: var(--ink); }
.copyright { color: var(--ink-dim); font-size: 0.8rem; }

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