:root {
  --bg: #ffffff;
  --text: #0e1116;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #e5e7eb;
  --link: #0d6efd;
  --link-hover: #0b5ed7;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f13;
    --text: #e8eaed;
    --muted: #9aa0a6;
    --card: #0f141a;
    --border: #1f2937;
    --link: #78a6ff;
    --link-hover: #9bbdff;
    color-scheme: dark;
  }
}

/* Manual override via [data-theme] for the toggle */
html[data-theme="light"] {
  --bg: #ffffff;
  --text: #0e1116;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #e5e7eb;
  --link: #0d6efd;
  --link-hover: #0b5ed7;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0b0f13;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --card: #0f141a;
  --border: #1f2937;
  --link: #78a6ff;
  --link-hover: #9bbdff;
  color-scheme: dark;
}

/* Apply to page */
body {
  background: var(--bg);
  color: var(--text);
}

/* Cards/containers you already use */
.card, .container .card, .content-card {
  background: var(--card);
  border-color: var(--border);
}

/* Links */
a { color: var(--link); }
a:hover, a:focus { color: var(--link-hover); }

/* Make Bootstrap components inherit tokens */
.navbar, .dropdown-menu, .modal-content {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

/* Make Bootstrap navbar follow tokens even if 'navbar-light bg-light' are present */
.navbar a, .navbar .navbar-brand, .navbar .nav-link { color: var(--text) !important; }
.navbar { background: var(--card) !important; border-bottom: 1px solid var(--border); }

/* Focus visibility for a11y */
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* Flowing lines background */
.terms-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Ensure the SVG itself has the stroke color (some browsers don't inherit into <svg>) */
.terms-bg-svg { color: rgba(13, 110, 253, .6); } /* light mode stroke color */
/* If user explicitly toggles dark theme */
html[data-theme="dark"] .terms-bg-svg { color: rgba(120, 166, 255, .35); }

/* If no explicit toggle, respect system dark */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .terms-bg-svg { color: rgba(120, 166, 255, .35); }
}

/* Make the waves actual lines, not filled shapes */
.terms-bg-svg .wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  opacity: .25;
  stroke-linecap: round;
  stroke-dasharray: 200 800;
  vector-effect: non-scaling-stroke;
}

/* Animate the dash for a flowing effect */
@keyframes dashMove { to { stroke-dashoffset: -1000; } }
.terms-bg-svg .wave { animation: dashMove 18s linear infinite; }
.terms-bg-svg .wave:nth-child(2) { animation-duration: 20s; animation-delay: -2s; opacity: .22; }
.terms-bg-svg .wave:nth-child(3) { animation-duration: 22s; animation-delay: -4s; opacity: .20; }
.terms-bg-svg .wave:nth-child(4) { animation-duration: 24s; animation-delay: -6s; opacity: .18; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .terms-bg-svg .wave { animation: none; }
}

/* Lift terms card closer to the top and give breathing room at bottom */
.content-wrap { padding-top: clamp(2rem, 6vh, 4rem); padding-bottom: clamp(3rem, 10vh, 6rem); }

/* Foreground readability */
.content-card {
  backdrop-filter: blur(2px);
  background: color-mix(in oklab, var(--card) 92%, transparent);
}

