/* Shared across index.html, privacy.html, credits.html */

:root {
  --bg: #f5f7fc;
  --surface: #ffffff;
  --text: #12172b;
  --text-muted: #5c6478;
  --border: rgba(18, 23, 43, 0.12);
  --accent: #0d9488;
  --primary: #1897b3;
  --shadow: 0 20px 44px rgba(18, 23, 43, 0.1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #05070c;
    --surface: #182540;
    --text: #f5f7ff;
    --text-muted: #b8c0d9;
    --border: rgba(245, 247, 255, 0.14);
    --accent: #2dd4bf;
    --primary: #6ee7ff;
    --shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
a {
  color: var(--primary);
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 1000;
  background: var(--surface);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* External-link icon: reveal-on-hover without reserving layout space
   when hidden, otherwise it leaves a permanent gap before whatever
   text follows the link. */
.external-icon {
  width: 0;
  height: 12px;
  margin-left: 0;
  opacity: 0;
  overflow: hidden;
  flex-shrink: 0;
  vertical-align: middle;
  transform: translateX(-2px);
  transition:
    width 0.15s ease,
    margin-left 0.15s ease,
    opacity 0.15s ease,
    transform 0.15s ease;
}
a:hover .external-icon,
a:focus-visible .external-icon {
  width: 12px;
  margin-left: 4px;
  opacity: 1;
  transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
  .external-icon {
    transition: none;
  }
}

/* ---- nav ---- */
nav.top {
  padding: 22px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
}

/* ---- footer (identical on every page) ---- */
footer {
  padding: 40px 0 64px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}
footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13.5px;
  margin: 0 0 14px;
}
footer .links a {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
}
footer .links a:hover,
footer .links a:focus-visible {
  color: var(--primary);
}
footer .fine {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
footer .fine a {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  text-decoration: underline;
}
footer .fine a:hover,
footer .fine a:focus-visible {
  color: var(--primary);
}
