/* ======== VARIABLES ======== */
:root {
  --bg-dark: #0A0C12;
  --surface: #141824;
  --lines: #1E2636;
  --text-main: #E9ECF3;
  --text-muted: #8A93A6;
  --accent-teal: #2FE0C8;
  --accent-amber: #F5A623;
  
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition: all 0.3s ease;
}

/* ======== RESET & BASE ======== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-shadow: 0 0 8px rgba(47, 224, 200, 0.4);
}

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

/* ======== BACKGROUND EFFECTS ======== */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background: radial-gradient(circle at 15% 50%, rgba(47, 224, 200, 0.05), transparent 25%),
              radial-gradient(circle at 85% 30%, rgba(20, 24, 36, 0.5), transparent 25%);
  animation: bgPulse 15s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; }
}

.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-image: 
    linear-gradient(to right, var(--lines) 1px, transparent 1px),
    linear-gradient(to bottom, var(--lines) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.15;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(50px); }
}

/* ======== LAYOUT & UTILITIES ======== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
}

.text-teal { color: var(--accent-teal); }
.text-amber { color: var(--accent-amber); }
.text-muted { color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.btn-primary {
  background-color: transparent;
  color: var(--accent-teal);
  border-color: var(--accent-teal);
  box-shadow: 0 0 10px rgba(47, 224, 200, 0.1);
}

.btn-primary:hover {
  background-color: rgba(47, 224, 200, 0.1);
  box-shadow: 0 0 20px rgba(47, 224, 200, 0.3);
  text-shadow: none;
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text-main);
  border-color: var(--lines);
}

.btn-secondary:hover {
  background-color: var(--lines);
  text-shadow: none;
}

/* Glass Card */
.glass-card {
  background: rgba(20, 24, 36, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--lines);
  border-radius: 8px;
  padding: 2rem;
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(47, 224, 200, 0.3);
  box-shadow: 0 10px 30px rgba(0,0,0, 0.5), 0 0 15px rgba(47, 224, 200, 0.05);
  transform: translateY(-5px);
}

/* Scroll Animation Classes */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ======== NAVBAR ======== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(10, 12, 18, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--lines);
  z-index: 1000;
  padding: 1rem 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand img {
  height: 30px;
}

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

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

.nav-links a:hover, .nav-links a.active {
  color: var(--accent-teal);
}

.nav-social {
  display: flex;
  gap: 1rem;
}

.nav-social a {
  color: var(--text-muted);
}
.nav-social a:hover { color: var(--text-main); text-shadow: none; }
.nav-social svg { width: 20px; height: 20px; fill: currentColor; }

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ======== HERO SECTION ======== */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  background-size: cover;
  background-position: center;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(10, 12, 18, 0.95) 0%, rgba(10, 12, 18, 0.6) 100%);
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

/* ======== INTRO (ABOUT) SECTION ======== */
.intro-band {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.intro-image {
  flex: 1;
}
.intro-image img {
  border-radius: 8px;
  border: 1px solid var(--lines);
}

.intro-text {
  flex: 1;
}
.intro-text h2 { margin-bottom: 1.5rem; }
.intro-text p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem;}

.stat-box {
  background: var(--surface);
  border-left: 4px solid var(--accent-teal);
  padding: 1.5rem;
  display: inline-block;
}
.stat-box .number {
  font-size: 3rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--accent-teal);
  line-height: 1;
}
.stat-box .label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  margin-top: 0.5rem;
}

/* ======== SERVICES GRID ======== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.service-card {
  text-align: center;
}
.service-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
}
.service-card h3 { margin-bottom: 1rem; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; }

/* ======== SPLIT FEATURE ======== */
.split-feature {
  display: flex;
  align-items: center;
  gap: 4rem;
}
.split-feature.reverse { flex-direction: row-reverse; }
.split-feature-img { flex: 1; }
.split-feature-img img { border-radius: 8px; border: 1px solid var(--lines); }
.split-feature-text { flex: 1; }
.split-feature-text h2 { margin-bottom: 1.5rem; }
.split-feature-text p { color: var(--text-muted); font-size: 1.1rem; }

/* ======== RESEARCH GRID ======== */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.research-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.research-img {
  height: 200px;
  overflow: hidden;
}
.research-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.research-card:hover .research-img img {
  transform: scale(1.05);
}
.research-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.research-content h4 { margin-bottom: 0.5rem; color: var(--accent-teal); }
.research-content p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; flex-grow: 1;}
.research-content .link { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; margin-top: auto; display: inline-block;}

/* ======== JOURNAL GRID ======== */
.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.journal-card { padding: 0; overflow: hidden; }
.journal-img { height: 200px; }
.journal-img img { width: 100%; height: 100%; object-fit: cover; }
.journal-content { padding: 1.5rem; }
.journal-content h3 { font-size: 1.2rem; }

/* ======== SUPPORT / CRYPTO ======== */
.crypto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.crypto-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.crypto-card h4 { display: flex; align-items: center; gap: 0.5rem; color: var(--text-main);}
.address-box {
  background: var(--bg-dark);
  border: 1px solid var(--lines);
  padding: 0.8rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.copy-btn {
  background: none;
  border: none;
  color: var(--accent-teal);
  cursor: pointer;
  padding: 0.2rem;
}
.copy-btn:hover { color: var(--text-main); }

/* ======== CONTACT FORM ======== */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 1.5rem;
}
.form-control {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--lines);
  color: var(--text-main);
  padding: 1rem;
  border-radius: 4px;
  font-family: var(--font-body);
  transition: border-color 0.3s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-teal);
}
textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* ======== FOOTER ======== */
.footer {
  border-top: 1px solid var(--lines);
  padding: 4rem 0 2rem;
  background: var(--bg-dark);
  text-align: center;
}
.footer-logo {
  height: 40px;
  margin-bottom: 1.5rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
}
.footer-links a:hover {
  color: var(--accent-teal);
}
.footer-disclosure {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 1.5rem;
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--lines);
}

/* ======== TOOLTIPS ======== */
.tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--accent-teal);
  color: var(--text-main);
  font-weight: 500;
}
.tooltip:hover {
  color: var(--accent-teal);
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--surface);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 400;
  white-space: normal;
  width: max-content;
  max-width: 300px;
  border: 1px solid var(--lines);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
  pointer-events: none;
  text-align: left;
  line-height: 1.4;
}
[dir="rtl"] .tooltip::after {
  text-align: right;
}
.tooltip::before {
  content: "";
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--lines) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
  pointer-events: none;
}
.tooltip:hover::after,
.tooltip:hover::before {
  opacity: 1;
  visibility: visible;
}

/* ======== RTL SUPPORT ======== */
[dir="rtl"] .nav-links {
  /* RTL adjustments */
}
[dir="rtl"] .stat-box {
  border-left: none;
  border-right: 4px solid var(--accent-teal);
}
[dir="rtl"] .hero h1 { letter-spacing: 0; }
[dir="rtl"] .btn { letter-spacing: 0; }

/* ======== RESPONSIVE ======== */
@media (max-width: 992px) {
  .intro-band, .split-feature { flex-direction: column; }
  .split-feature.reverse { flex-direction: column; }
  .services-grid, .research-grid, .journal-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 3rem; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--surface);
    flex-direction: column;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--lines);
  }
  .nav-links.active { display: flex; }
  .mobile-toggle { display: block; }
  
  .services-grid, .research-grid, .journal-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.5rem; }
  .section { padding: 4rem 0; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .bg-mesh, .bg-grid, .reveal { animation: none; transition: none; opacity: 1; transform: none; }
}


/* --- nav additions: language switch, donate button, Hugging Face --- */
.lang-switch{border:1px solid var(--lines,#1E2636);border-radius:6px;padding:4px 9px;font-size:.8rem;font-weight:600;color:var(--text-muted,#8A93A6);margin-inline-start:8px;text-decoration:none}
.lang-switch:hover{color:var(--accent-teal,#2FE0C8);border-color:var(--accent-teal,#2FE0C8)}
.nav-donate{margin-inline-start:10px;padding:.5rem 1.1rem;font-size:.85rem}
.hf-link{font-size:19px;line-height:1;text-decoration:none;margin-inline-start:2px}
@media (max-width:820px){ .nav-donate{margin:8px 0} .lang-switch{display:inline-block;margin:8px 0} }
