/* Shared styles for navbar, theme, and content pages */

:root {
  --brand: rgb(0, 122, 194);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] {
  --text: #f0f4f8;
  --text-secondary: #9aa8b8;
  --bg: #000000;
  --navbar-scrolled: rgba(0, 0, 0, 0.6);
  --icon-bg: rgba(255, 255, 255, 0.06);
  --card-bg: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.1);
}
[data-theme="light"] {
  --text: #000000;
  --text-secondary: #1a1a1a;
  --bg: #ffffff;
  --navbar-scrolled: rgba(255, 255, 255, 0.7);
  --icon-bg: rgba(0, 0, 0, 0.05);
  --card-bg: rgba(0, 0, 0, 0.02);
  --border: rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s ease, color 0.4s ease;
}
/* Fixed gradient glow — stays put while scrolling, like Synqus */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--brand) 55%, transparent) 0%,
    color-mix(in srgb, var(--brand) 38%, transparent) 18%,
    color-mix(in srgb, var(--brand) 22%, transparent) 40%,
    color-mix(in srgb, var(--brand) 12%, transparent) 68%,
    color-mix(in srgb, var(--brand) 6%, transparent) 88%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
  transition: background 0.5s ease;
}
main, nav, footer { position: relative; z-index: 2; }

.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; padding: 16px 40px;
  transition: background 0.5s ease, backdrop-filter 0.5s ease;
}
.navbar.scrolled {
  background: var(--navbar-scrolled);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.navbar.nav-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.navbar {
  transition: background 0.5s ease, backdrop-filter 0.5s ease,
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img {
  height: 40px; width: auto; object-fit: contain;
  transition: filter 0.4s ease;
}
[data-theme="light"] .logo img { filter: brightness(0); }
.nav-links {
  display: flex; gap: 28px; align-items: center;
}
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }

.theme-toggle {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative; color: var(--text-secondary);
  transition: color 0.3s ease, background 0.3s ease, transform 0.4s var(--ease-out-expo);
}
.theme-toggle:hover { color: var(--text); background: var(--icon-bg); }
.theme-toggle:active { transform: scale(0.9); }
.theme-icon {
  position: absolute; width: 20px; height: 20px;
  transition: opacity 0.35s ease, transform 0.45s var(--ease-out-expo);
}
[data-theme="dark"] .theme-icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] .theme-icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="light"] .theme-icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="light"] .theme-icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* Content pages (legal, faq) */
.page {
  max-width: 820px; margin: 0 auto;
  padding: 140px 24px 80px;
}
.page h1 {
  font-family: var(--font-heading);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.05; margin: 0 0 32px;
}
.page h2 {
  font-family: var(--font-heading);
  font-size: 24px; font-weight: 600;
  margin: 40px 0 12px;
}
.page h3 { font-size: 18px; font-weight: 600; margin: 24px 0 8px; }
.page p, .page li {
  font-size: 16px; line-height: 1.7;
  color: var(--text-secondary);
}
.page a { color: var(--brand); text-decoration: none; }
.page a:hover { text-decoration: underline; }
.page ul, .page ol { padding-left: 22px; }
.page hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.page code {
  background: var(--card-bg); padding: 2px 6px;
  border-radius: 4px; font-size: 14px;
}
.page pre {
  background: var(--card-bg); padding: 16px;
  border-radius: 8px; overflow-x: auto;
}
.page-loading, .page-error {
  text-align: center; padding: 60px 20px; color: var(--text-secondary);
}

/* Reveal animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.page.revealed h1,
.page.revealed h2,
.page.revealed h3,
.page.revealed p,
.page.revealed li,
.page.revealed hr,
.page.revealed .faq-list,
.page.revealed .faq-category {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.page.revealed > *:nth-child(1) { animation-delay: 0.00s; }
.page.revealed > *:nth-child(2) { animation-delay: 0.04s; }
.page.revealed > *:nth-child(3) { animation-delay: 0.08s; }
.page.revealed > *:nth-child(4) { animation-delay: 0.12s; }
.page.revealed > *:nth-child(n+5) { animation-delay: 0.16s; }
.faq-item {
  opacity: 0; transform: translateY(8px);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.faq-list .faq-item:nth-child(1) { animation-delay: 0.05s; }
.faq-list .faq-item:nth-child(2) { animation-delay: 0.12s; }
.faq-list .faq-item:nth-child(3) { animation-delay: 0.19s; }
.faq-list .faq-item:nth-child(4) { animation-delay: 0.26s; }
.faq-list .faq-item:nth-child(n+5) { animation-delay: 0.33s; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  transition: background 0.2s ease;
}
.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 16px;
  list-style: none; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 22px; font-weight: 300;
  color: var(--text-secondary); transition: transform 0.2s ease;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item .answer {
  margin-top: 12px; color: var(--text-secondary);
  line-height: 1.6; white-space: pre-wrap;
}
.faq-category {
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brand); margin: 32px 0 12px;
}

@media (max-width: 768px) {
  .navbar { padding: 14px 20px; }
  .nav-links { gap: 18px; }
  .nav-links a { display: none; }
  .page { padding: 110px 20px 60px; }
}
