:root {
  --paper: #f6f4ef;
  --red: #a72222;
  --yellow: #eaac42;
  --teal: #4a8295;
  --navy: #233d68;
  --ink: #1c2a44;
  --muted: #5f6b80;
  --line: #e4e0d7;
  --color-error: #a72222;
  --nav-height: 64px;
  --font-sans:
    "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
}

:root[data-theme="dark"] {
  --paper: #141b28;
  --red: #a72222;
  --yellow: #eaac42;
  --teal: #6bb0c4;
  --navy: #233d68;
  --ink: #f6f4ef;
  --muted: #97a1b5;
  --line: #1f2b42;
  --color-error: #c9453d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Image fade-in loader ── */

img.lazy-fade {
  background-color: var(--line);
  opacity: 0;
  transition: opacity 0.35s ease;
}

img.lazy-fade.loaded {
  opacity: 1;
}

html,
body {
  height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

/* ── Nav ── */

.site-banner {
  background: var(--yellow);
  color: var(--navy);
  font: 550 15px var(--font-sans);
  opacity: 0.95;
  text-align: center;
  padding: 8px 1rem;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  padding: 0 2rem;
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-brand img {
  height: 72px;
  width: 72px;
  object-fit: contain;
}

.nav-brand span {
  color: #f0f0f0;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  font-family: var(--font-sans);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  color: #b0b0b0;
  text-decoration: none;
  font-size: 13.5px;
  padding: 6px 13px;
  border-radius: 6px;
  transition:
    color 0.15s,
    background 0.15s;
}

.nav-links a:hover {
  color: #f0f0f0;
  background: rgba(255, 255, 255, 0.07);
}

.nav-links a.active {
  color: #f0f0f0;
  background: rgba(255, 255, 255, 0.1);
}

/* ── Dropdown ── */

.dropdown {
  position: relative;
}

.dropdown button {
  background: none;
  border: none;
  cursor: pointer;
  color: #b0b0b0;
  font-size: 13.5px;
  font-family: var(--font-sans);
  padding: 6px 13px;
  border-radius: 6px;
  transition:
    color 0.15s,
    background 0.15s;
}

.dropdown button:hover {
  color: #f0f0f0;
  background: rgba(255, 255, 255, 0.07);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 8px;
  z-index: 100;
}

.dropdown-menu-inner {
  background: #242424;
  border: 0.5px solid #383838;
  border-radius: 8px;
  min-width: 160px;
  padding: 5px;
}

.dropdown-menu a {
  display: block;
  color: #b0b0b0;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 5px;
  transition:
    color 0.15s,
    background 0.15s;
}

.dropdown-menu a:hover {
  color: #f0f0f0;
  background: rgba(255, 255, 255, 0.07);
}

.dropdown:hover .dropdown-menu {
  display: block;
}

/* ── Join button ── */

.btn-join {
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-join:hover {
  background: var(--yellow);
}

/* Mobile join button (inside nav-links drawer) — hidden on desktop */
.btn-join-mobile {
  display: none;
}

/* Desktop join button — shown on desktop */
.btn-join-desktop {
  display: inline-block;
}

/* ── Hamburger button ── */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  z-index: 210;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #b0b0b0;
  border-radius: 2px;
  transition:
    transform 0.25s,
    opacity 0.25s,
    background 0.15s;
  transform-origin: center;
}

.nav-hamburger:hover span {
  background: #f0f0f0;
}

/* Animate hamburger → X */
.nav-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile overlay ── */

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 190;
  opacity: 0;
  transition: opacity 0.25s;
}

.nav-overlay.visible {
  display: block;
  opacity: 1;
}

/* ── Page wrapper ── */

.page-content {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
}

/* ── Footer ── */

footer {
  background: var(--navy);
  border-top: 1px solid #2a2a2a;
  padding: 3rem 2rem 0;
  margin-top: auto;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 0.5px solid #2e2e2e;
  flex-wrap: wrap;
}

.footer-brand img {
  height: 68px;
  width: 68px;
  object-fit: contain;
  margin-bottom: 6px;
  display: block;
}

.footer-brand span {
  display: block;
  color: #f0f0f0;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.footer-brand p {
  color: #666;
  font-size: 12px;
  max-width: 200px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: #888;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #e0e0e0;
}

.footer-join {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.btn-join-footer {
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-join-footer:hover {
  background: var(--yellow);
}

/* ── Theme toggle switch ── */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #7c7c7c;
  transition: color 0.15s;
}

.theme-toggle:hover {
  color: #d8d8d8;
}

.theme-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
  transition:
    background 0.25s ease,
    border-color 0.25s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #9a9a9a;
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.25s ease;
}

[data-theme="dark"] .theme-toggle-track {
  background: rgba(74, 130, 149, 0.35);
  border-color: rgba(74, 130, 149, 0.6);
}

[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(16px);
  background: var(--teal);
}

.footer-bottom {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 0;
  text-align: center;
}

.footer-bottom span {
  color: #666;
  font-size: 12px;
}

.footer-privacy {
  display: inline-block;
  margin-left: 1rem;
  color: #666;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-privacy:hover {
  color: #222;
}

.green-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #36b37e;
  box-shadow: 0 0 0 3px rgba(54, 179, 126, 0.18);
}

/* ── Mobile styles ── */

@media (max-width: 768px) {
  nav {
    padding: 0 1.25rem;
  }

  /* Show hamburger, hide desktop join button */
  .nav-hamburger {
    display: flex;
  }

  .btn-join-desktop {
    display: none;
  }

  /* Mobile drawer */
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(280px, 80vw);
    background: #1e1e1e;
    border-left: 0.5px solid #2e2e2e;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: calc(var(--nav-height) + 1rem) 1rem 2rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 15px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #c0c0c0;
  }

  .nav-links a.active {
    color: #f0f0f0;
    background: rgba(255, 255, 255, 0.08);
  }

  /* Show join button inside drawer */
  .btn-join-mobile {
    display: block;
    margin-top: 1rem;
    text-align: center;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 8px;
  }

  /* Dropdown becomes inline in mobile drawer */
  .dropdown {
    position: static;
  }

  .dropdown button {
    width: 100%;
    text-align: left;
    font-size: 15px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #c0c0c0;
  }

  .dropdown-menu {
    position: static;
    padding-top: 0;
    display: none;
  }

  .dropdown-menu-inner {
    background: rgba(255, 255, 255, 0.04);
    border: 0.5px solid #333;
    border-radius: 8px;
    margin: 4px 0 4px 12px;
    padding: 4px;
  }

  .dropdown-menu a {
    font-size: 14px;
    padding: 10px 12px;
  }

  /* Disable hover-based dropdown on mobile */
  .dropdown:hover .dropdown-menu {
    display: none;
  }

  /* Footer adjustments */
  footer {
    padding: 2rem 1.25rem 0;
  }

  .footer-inner {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 20px;
  }

  .footer-join {
    width: 100%;
  }

  .btn-join-footer {
    width: 100%;
    text-align: center;
    padding: 12px 18px;
    font-size: 14px;
  }
}

/* ── Donate modal ── */

.donate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 16px var(--font-sans);
  padding: 18px 34px;
  border-radius: 11px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  background: var(--red);
  color: var(--paper);
}

.donate-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.donate-modal-overlay.visible {
  display: flex;
}

.donate-modal {
  position: relative;
  background: var(--paper);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 420px;
  width: calc(100% - 40px);
  text-align: center;
}

.donate-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.donate-modal-title {
  font: 600 20px var(--font-serif);
  margin-bottom: 20px;
}

.donate-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.donate--amount {
  padding: 12px 22px;
}
