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

:root {
  --bg:        #ececec;
  --surface:   #f0f0f0;
  --white:     #ffffff;
  --text:      #2a2a2a;
  --text-muted:#888888;
  --text-soft: #aaaaaa;
  --shadow-out: 6px 6px 14px #d1d1d1, -6px -6px 14px #ffffff;
  --shadow-in:  inset 4px 4px 10px #d1d1d1, inset -4px -4px 10px #ffffff;
  --shadow-sm:  3px 3px 8px #d1d1d1, -3px -3px 8px #ffffff;
  --radius:     14px;
  --radius-sm:  8px;
  --radius-pill:50px;
  --nav-h:      64px;
  --transition: 0.15s ease;
  --font:       'Outfit', sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAVBAR ─────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 0;
  box-shadow: 0 2px 8px #d1d1d1, 0 -1px 0 #fff;
}

/* Logo + brand name — single consolidated block */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.nav-brand:hover { opacity: 0.75; }

.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-self: center;
}

/* Divider between brand and nav links */
.nav-divider {
  display: block;
  width: 1px;
  height: 18px;
  background: var(--text-soft);
  margin: 0 1rem;
  flex-shrink: 0;
  align-self: center;
  opacity: 0.6;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}
.nav-link:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.nav-link.active {
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow-in);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* ── SWITCHER ───────────────────────────────────── */
.switcher-wrap { position: relative; }

.switcher-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.switcher-btn:hover { color: var(--text); box-shadow: var(--shadow-out); }
.switcher-btn:active { box-shadow: var(--shadow-in); }

.switcher-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-out);
  padding: 0.75rem;
  z-index: 200;
}
.switcher-dropdown.open { display: block; }

.switcher-label {
  font-size: 0.7rem;
  text-transform: lowercase;
  color: var(--text-soft);
  padding: 0 0.4rem 0.5rem;
  letter-spacing: 0.03em;
}

.switcher-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.switcher-item:hover { background: rgba(0,0,0,0.04); }
.switcher-item.active { box-shadow: var(--shadow-in); }

.brand-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.brand-item-name {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text);
  flex: 1;
}
.switcher-item.active .brand-item-name { font-weight: 500; }

.active-arrow {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── HAMBURGER ──────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE NAV ─────────────────────────────────── */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: relative;
  z-index: 99;
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link { font-size: 1rem; padding: 0.6rem 1rem; }

/* ── MAIN APP ───────────────────────────────────── */
#app {
  flex: 1;
  min-height: calc(100vh - var(--nav-h) - 120px);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}
.loader-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-soft);
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100%{opacity:0.3;transform:scale(0.8)} 50%{opacity:1;transform:scale(1)} }

/* ── PAGE SECTIONS ──────────────────────────────── */
.page-wrap { padding: 4rem 2rem; max-width: 1100px; margin: 0 auto; }

.hero { text-align: center; padding: 6rem 2rem 4rem; max-width: 800px; margin: 0 auto; }
.hero-logo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 2rem;
  display: block;
}
.hero-wordmark {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 1.5rem;
  text-shadow: 4px 4px 10px #d1d1d1, -2px -2px 6px #ffffff;
}
.hero-tag { font-size: 1.1rem; color: var(--text-muted); font-weight: 300; margin-bottom: 0.5rem; }
.hero-sub { font-size: 0.9rem; color: var(--text-soft); margin-bottom: 2.5rem; }

.btn-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  padding: 0.65rem 1.75rem;
  border-radius: var(--radius-pill);
  border: none;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-out);
  text-decoration: none;
  display: inline-block;
  transition: all var(--transition);
}
.btn:hover { box-shadow: 8px 8px 18px #c8c8c8, -8px -8px 18px #ffffff; }
.btn:active { box-shadow: var(--shadow-in); }

.card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-out);
  padding: 1.75rem;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: 8px 8px 20px #cccccc, -8px -8px 20px #ffffff; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-top: 2rem; }

.section-title { font-size: 1.5rem; font-weight: 500; color: var(--text); margin-bottom: 0.5rem; }
.section-sub   { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; }

.inset-box {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-in);
  padding: 1.5rem;
}

/* ── FOOTER ─────────────────────────────────────── */
footer {
  background: var(--bg);
  box-shadow: 0 -2px 8px #d1d1d1, 0 1px 0 #fff;
  padding: 2rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}
.footer-origin { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.03em; }
.footer-links  { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: 0.8rem; color: var(--text-soft); text-decoration: none; transition: color var(--transition); }
.footer-links a:hover { color: var(--text); }
.footer-note  { font-size: 0.75rem; color: var(--text-soft); }

.error-msg { text-align: center; padding: 4rem; color: var(--text-muted); }

/* ── DONATE DISABLED ────────────────────────────── */
.donate-btn-disabled { pointer-events: none; }

/* ── SCROLL TO TOP ──────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow-out);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow var(--transition), color var(--transition);
  pointer-events: none;
  z-index: 90;
}
.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top:hover { box-shadow: var(--shadow-sm); color: var(--text); }
.scroll-top:active { box-shadow: var(--shadow-in); }

/* ── FOCUS / TAP HIGHLIGHT ──────────────────────── */
/* Set at html level — some browsers apply tap highlight before element rules */
html { -webkit-tap-highlight-color: transparent; }

/* Belt-and-suspenders: every element, every state */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
}

/* Anchors need their own explicit rule — some browsers treat <a> separately */
a, a:link, a:visited, a:hover, a:active, a:focus {
  -webkit-tap-highlight-color: transparent;
  outline: none;
  outline-color: transparent;
}

*:focus,
*:focus-visible,
*:focus-within {
  outline: none !important;
  outline-color: transparent !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* No text selection on interactive UI elements */
button,
.nav-brand,
.nav-link,
.switcher-btn,
.switcher-item,
.hamburger,
.scroll-top,
.btn {
  user-select: none;
  -webkit-user-select: none;
}

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links  { display: none; }
  .nav-divider { display: none; }
  .hamburger  { display: flex; }
  .hero       { padding: 3rem 1.5rem 2rem; }
  .page-wrap  { padding: 2rem 1.25rem; }
}
