:root {
  --bg: #020617;
  --surface: #020F2F;
  --text: #E0F2FE;
  --muted: #7DD3FC;
  --primary: #38BDF8;
  --secondary: #818CF8;
  --accent: #22D3EE;
  --border: rgba(224, 242, 254, 0.12);
  --font-academic: Georgia, "Times New Roman", Times, serif;
  --font-mono: "Courier New", Courier, monospace;
  --font-system: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-academic);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(129, 140, 248, 0.06) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, #01040f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(224, 242, 254, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 242, 254, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.disclosure-badge {
  max-width: fit-content;
  margin: 8px auto;
  padding: 5px 18px;
  font-family: var(--font-system);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.15);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 4px;
  text-align: center;
  line-height: 1.4;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 25, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.nav-logo img {
  height: 36px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  font-family: var(--font-system);
  font-size: 14px;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
}

.nav-links a:hover {
  text-shadow: 0 0 8px var(--accent);
}

.burger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.burger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

.burger-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger-btn.active span:nth-child(2) {
  opacity: 0;
}

.burger-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

main {
  flex: 1 0 auto;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 24px 32px;
  margin-top: auto;
  flex-shrink: 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.footer-brand img {
  height: 40px;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--muted);
  max-width: 280px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  list-style: none;
  font-family: var(--font-system);
  font-size: 13px;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.footer-badges a {
  display: block;
}

.footer-badges img {
  height: 48px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.footer-badges a:hover img {
  opacity: 1;
}

.footer-disclosure {
  font-family: var(--font-system);
  font-size: 11px;
  color: rgba(125, 211, 252, 0.7);
  line-height: 1.6;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.modal-box h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text);
}

.modal-box p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  font-family: var(--font-system);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn {
  font-family: var(--font-system);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--text);
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(2, 15, 47, 0.96);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  z-index: 999;
  backdrop-filter: blur(12px);
}

.cookie-banner.hidden {
  display: none;
}

.cookie-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-inner p {
  font-family: var(--font-system);
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 200px;
}

.cookie-inner a {
  color: var(--primary);
  text-decoration: underline;
}

.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 24px;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 12px;
}

.legal-page h2 {
  font-size: 1.25rem;
  margin: 32px 0 12px;
  color: var(--primary);
}

.legal-page h3 {
  font-size: 1.05rem;
  margin: 20px 0 8px;
  color: var(--muted);
}

.legal-page p {
  margin-bottom: 16px;
  color: var(--text);
}

.legal-page ul {
  margin: 0 0 16px 24px;
  color: var(--text);
}

.legal-page li {
  margin-bottom: 8px;
}

.legal-page code {
  font-family: var(--font-mono);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.contact-form {
  margin-top: 32px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.contact-form label {
  display: block;
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-system);
  font-size: 14px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.form-error {
  font-family: var(--font-system);
  font-size: 12px;
  color: #f87171;
  margin: -12px 0 12px;
  display: none;
}

.form-error.visible {
  display: block;
}

.form-success {
  padding: 32px;
  text-align: center;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 8px;
  font-family: var(--font-system);
}

.form-success h3 {
  color: var(--accent);
  margin-bottom: 8px;
}

.science-grid {
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

.research-panel {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
}

.academic-serif {
  font-family: var(--font-academic);
}

.data-mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
}

.papers-footnote {
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 16px;
}

.go-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.go-page > div {
  max-width: 480px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.go-ad {
  display: inline-block;
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.1em;
}

.go-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.go-page h1 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.go-page p {
  color: var(--muted);
  font-family: var(--font-system);
  font-size: 14px;
  margin-bottom: 8px;
}

.go-compliance {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-family: var(--font-system);
  font-size: 12px;
  color: var(--muted);
}

.go-compliance p {
  margin-bottom: 8px;
}

.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}

.error-page h1 {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.error-page p {
  font-family: var(--font-system);
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 1.1rem;
}

@media (max-width: 900px) {
  .burger-btn {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    top: 56px;
    flex-direction: column;
    justify-content: center;
    background: rgba(15, 15, 25, 0.95);
    backdrop-filter: blur(16px);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    gap: 28px;
    font-size: 1.25rem;
  }

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