/* ═══════════════════════════════════════════════════════════
   FRACTAL METASCIENCE FOUNDATION — Design System v2.0
   Brand Identity: Dark cosmos · Cyan accent · Fractal geometry
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:          #080c14;
  --bg-2:        #0d1220;
  --bg-card:     #111827;
  --bg-card-2:   #1a2235;
  --border:      #1e2d45;
  --border-2:    #2d4060;
  --cyan:        #00b4d8;
  --cyan-dim:    rgba(0,180,216,0.15);
  --cyan-glow:   rgba(0,180,216,0.35);
  --text:        #e2e8f0;
  --text-muted:  #7a90b0;
  --text-dim:    #4a6080;
  --gold:        #c9a84c;
  --gold-dim:    rgba(201,168,76,0.15);
  --green:       #4ade80;
  --green-dim:   rgba(74,222,128,0.12);
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --shadow-cyan:  0 0 40px rgba(0,180,216,0.2);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* ── Selection ─────────────────────────────────────────── */
::selection { background: var(--cyan-dim); color: var(--cyan); }

/* ── Progress Bar ──────────────────────────────────────── */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  z-index: 1000; width: 0%; transition: width 0.1s linear;
}

/* ── Navigation ────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 900;
  background: rgba(8,12,20,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 800;
  color: var(--text); letter-spacing: 0.02em;
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.nav-logo::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  flex-shrink: 0;
}
.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-muted);
  text-decoration: none; letter-spacing: 0.04em;
  padding: 8px 14px; border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  text-transform: uppercase;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--cyan);
  background: var(--cyan-dim);
}
.nav-right {
  display: flex; align-items: center; gap: 12px;
}
.lang-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); font-family: var(--font-mono);
  font-size: 0.75rem; padding: 5px 10px; border-radius: 4px;
  cursor: pointer; transition: all 0.2s;
}
.lang-btn:hover, .lang-btn.active {
  border-color: var(--cyan); color: var(--cyan);
}

/* ── Page Header (inner pages) ─────────────────────────── */
.page-header {
  padding: 80px 40px 60px;
  max-width: 1100px; margin: 0 auto;
  position: relative;
}
.page-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-glow), transparent);
}
.page-label {
  font-family: var(--font-mono);
  font-size: 0.75rem; color: var(--cyan);
  letter-spacing: 0.15em; text-transform: uppercase;
  margin-bottom: 16px; display: block;
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800; color: var(--text);
  line-height: 1.15; margin-bottom: 20px;
}
.page-subtitle {
  font-size: 1.1rem; color: var(--text-muted);
  max-width: 640px; font-weight: 300;
}

/* ── Section ───────────────────────────────────────────── */
.section {
  max-width: 1100px; margin: 0 auto;
  padding: 0 40px 80px;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 12px; display: block;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700;
  color: var(--text); margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-accent {
  border-left: 3px solid var(--cyan);
}

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 0.68rem;
  padding: 3px 10px; border-radius: 4px;
  letter-spacing: 0.05em; font-weight: 500;
}
.badge-cyan   { background: var(--cyan-dim);  color: var(--cyan);  border: 1px solid rgba(0,180,216,0.3); }
.badge-gold   { background: var(--gold-dim);  color: var(--gold);  border: 1px solid rgba(201,168,76,0.3); }
.badge-green  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74,222,128,0.25); }
.badge-muted  { background: rgba(255,255,255,0.04); color: var(--text-dim); border: 1px solid var(--border); }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600;
  font-size: 0.85rem; letter-spacing: 0.04em;
  padding: 12px 24px; border-radius: var(--radius);
  border: none; cursor: pointer; text-decoration: none;
  transition: all 0.25s;
}
.btn-primary {
  background: var(--cyan); color: #080c14;
}
.btn-primary:hover {
  background: #00ccf5; box-shadow: 0 0 24px var(--cyan-glow);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-2); color: var(--text-muted);
}
.btn-outline:hover {
  border-color: var(--cyan); color: var(--cyan);
  background: var(--cyan-dim);
}

/* ── DOI Link ──────────────────────────────────────────── */
.doi-link {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--cyan); text-decoration: none;
  transition: opacity 0.2s;
}
.doi-link:hover { opacity: 0.7; text-decoration: underline; }

/* ── Divider ───────────────────────────────────────────── */
.divider {
  border: none; border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ── Stat Grid ─────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 48px;
}
.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px; text-align: center;
}
.stat-number {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 800;
  color: var(--cyan); line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 0.75rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── Footer ────────────────────────────────────────────── */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 60px 40px 40px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
}
.footer-brand .logo-text {
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 800; color: var(--text);
  margin-bottom: 10px;
}
.footer-brand p {
  font-size: 0.85rem; color: var(--text-muted); line-height: 1.6;
}
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-dim); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 16px;
}
.footer-col a {
  display: block; font-size: 0.875rem;
  color: var(--text-muted); text-decoration: none;
  margin-bottom: 8px; transition: color 0.2s;
}
.footer-col a:hover { color: var(--cyan); }
.footer-bottom {
  max-width: 1100px; margin: 0 auto;
  padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--text-dim);
}
.footer-orcid {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-dim);
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fade-up { animation: fadeUp 0.6s ease forwards; }
.fade-in { animation: fadeIn 0.4s ease forwards; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .nav-links { display: none; }
  .page-header, .section { padding-left: 20px; padding-right: 20px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
