/* ============================================
   De-Extinct: Jurassic Dinosaurs — Site Codex
   Main Stylesheet
   Dark sci-fi / paleo aesthetic
   ============================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-0: #050704;
  --bg-1: #0a0d06;
  --bg-2: #11150a;
  --bg-3: #181d10;
  --bg-card: rgba(20, 26, 14, 0.7);
  --bg-card-hover: rgba(30, 40, 20, 0.85);

  --text-primary: #e8e4d8;
  --text-secondary: #9a9789;
  --text-muted: #5a5d52;

  --accent: #b8d432;        /* toxic green */
  --accent-glow: #c9f24a;
  --accent-dim: #5a7a18;
  --amber: #e8a434;
  --red: #d94c3a;
  --teal: #3ad9b0;

  --border: rgba(184, 212, 50, 0.12);
  --border-strong: rgba(184, 212, 50, 0.25);
  --border-white: rgba(232, 228, 216, 0.08);

  --phase-build: #3ad9b0;
  --phase-grow: #b8d432;
  --phase-fight: #d94c3a;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Inter", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;

  --max-w: 1200px;
  --nav-h: 64px;

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

/* ---- Ambient Background ---- */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}
.glow-1 {
  width: 600px; height: 600px;
  top: -200px; right: -100px;
  background: radial-gradient(circle, #4a6a1a 0%, transparent 70%);
  animation: floatSlow 20s ease-in-out infinite;
}
.glow-2 {
  width: 500px; height: 500px;
  bottom: -150px; left: -150px;
  background: radial-gradient(circle, #1a4a3a 0%, transparent 70%);
  animation: floatSlow 25s ease-in-out infinite reverse;
}
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.1); }
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  background: rgba(5, 7, 4, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}
.nav.scrolled {
  background: rgba(5, 7, 4, 0.85);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 13px;
}
.nav-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
  filter: drop-shadow(0 2px 8px rgba(184, 212, 50, 0.3));
}
.nav-title {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Language Switcher ---- */
.lang-switcher {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.lang-btn:hover { color: var(--text-primary); }
.lang-btn.active {
  background: var(--accent);
  color: #0a0d06;
  box-shadow: 0 0 20px rgba(184, 212, 50, 0.4);
}

/* ---- Layout ---- */
main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-head {
  margin-bottom: 48px;
  max-width: 720px;
}
.section-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(184, 212, 50, 0.06);
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---- Hero ---- */
.hero {
  padding: calc(var(--nav-h) + 80px) 0 60px;
  position: relative;
}
.hero-logo-wrap {
  margin-bottom: 36px;
  display: flex;
  justify-content: center;
}
.hero-logo {
  max-width: 480px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(184, 212, 50, 0.3));
  animation: logoPulse 4s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(184, 212, 50, 0.25)); }
  50% { filter: drop-shadow(0 0 40px rgba(184, 212, 50, 0.5)); }
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 5px 12px;
  border: 1px solid var(--border-white);
  border-radius: 999px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
}
.hero-title {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 50%, var(--accent-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: var(--accent);
  color: #0a0d06;
  font-weight: 600;
  font-size: 15px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  transition: all var(--transition);
  box-shadow: 0 4px 24px rgba(184, 212, 50, 0.3), 0 0 0 0 rgba(184, 212, 50, 0.4);
}
.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(184, 212, 50, 0.5), 0 0 40px rgba(184, 212, 50, 0.2);
  background: var(--accent-glow);
}
.cta-btn-lg {
  padding: 18px 32px;
  font-size: 16px;
}

/* Hero Stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 56px 0;
  max-width: 600px;
}
.stat { text-align: left; }
.stat-num {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Hero shot */
.hero-shot {
  margin-top: 60px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
}
.hero-shot.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.shot-img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5), 0 0 80px rgba(184, 212, 50, 0.08);
}
.shot-caption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  font-style: italic;
  text-align: center;
}

/* ---- Filters ---- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.filter-btn {
  appearance: none;
  border: 1px solid var(--border-white);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.filter-btn.active {
  background: var(--accent);
  color: #0a0d06;
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(184, 212, 50, 0.3);
}

/* ---- Entries Grid ---- */
.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  cursor: default;
  opacity: 0;
  transform: translateY(20px);
}
.entry-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.entry-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 40px rgba(184, 212, 50, 0.08);
}
.entry-img-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.entry-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.entry-card:hover .entry-img {
  transform: scale(1.05);
}
.entry-num {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.entry-meta {
  padding: 16px 20px 0;
}
.entry-phase {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
}
.phase-build {
  color: var(--phase-build);
  background: rgba(58, 217, 176, 0.12);
  border: 1px solid rgba(58, 217, 176, 0.25);
}
.phase-grow {
  color: var(--phase-grow);
  background: rgba(184, 212, 50, 0.12);
  border: 1px solid rgba(184, 212, 50, 0.25);
}
.phase-fight {
  color: var(--phase-fight);
  background: rgba(217, 76, 58, 0.12);
  border: 1px solid rgba(217, 76, 58, 0.25);
}
.entry-title {
  padding: 12px 20px 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.entry-desc {
  padding: 0 20px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Fauna ---- */
.fauna-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.fauna-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  background: var(--bg-card);
  transition: background var(--transition);
  opacity: 0;
  transform: translateX(-10px);
}
.fauna-item.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.fauna-item:hover {
  background: var(--bg-card-hover);
}
.fauna-name {
  font-size: 16px;
  font-weight: 600;
}
.fauna-type {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- Dossier ---- */
.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.dossier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(20px);
}
.dossier-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.dossier-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}
.dossier-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.dossier-value {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ---- FAQ ---- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(10px);
}
.faq-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.faq-item:hover {
  border-color: var(--border-strong);
}
.faq-item[open] {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}
.faq-item summary {
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  transition: color var(--transition);
  padding-right: 48px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--accent);
  transition: transform var(--transition);
  font-weight: 300;
}
.faq-item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}
.faq-item p {
  padding: 0 24px 20px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Footer CTA ---- */
.footer-cta {
  text-align: center;
  padding: 120px 0;
  border-top: 1px solid var(--border);
}
.footer-cta .section-head {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.footer-cta .cta-btn {
  margin-top: 20px;
}

/* ---- Site Footer ---- */
.site-footer {
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.back-top {
  color: var(--accent);
  transition: color var(--transition);
}
.back-top:hover {
  color: var(--accent-glow);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav-title { display: none; }
  main { padding: 0 16px; }

  .hero { padding-top: calc(var(--nav-h) + 50px); }
  .hero-logo { max-width: 320px; }
  .hero-title { font-size: 40px; }
  .hero-desc { font-size: 16px; }
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 36px 0;
  }
  .stat-num { font-size: 24px; }
  .stat-label { font-size: 11px; }

  .section { padding: 64px 0; }
  .section-head { margin-bottom: 32px; }

  .entries-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .dossier-grid { gap: 12px; }

  .lang-switcher {
    overflow-x: auto;
    max-width: 220px;
    scrollbar-width: none;
  }
  .lang-switcher::-webkit-scrollbar { display: none; }
  .lang-btn {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 10px;
  }

  .footer-cta { padding: 80px 0; }
}

@media (max-width: 480px) {
  .hero-stats {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }
  .stat-num { font-size: 20px; }
  .fauna-list { grid-template-columns: 1fr; }
}

/* ---- Staggered entrance animations ---- */
.entry-card:nth-child(1) { transition-delay: 0.05s; }
.entry-card:nth-child(2) { transition-delay: 0.1s; }
.entry-card:nth-child(3) { transition-delay: 0.15s; }
.entry-card:nth-child(4) { transition-delay: 0.2s; }
.entry-card:nth-child(5) { transition-delay: 0.25s; }
.entry-card:nth-child(6) { transition-delay: 0.3s; }

.dossier-card:nth-child(1) { transition-delay: 0.05s; }
.dossier-card:nth-child(2) { transition-delay: 0.1s; }
.dossier-card:nth-child(3) { transition-delay: 0.15s; }
.dossier-card:nth-child(4) { transition-delay: 0.2s; }

.fauna-item:nth-child(1) { transition-delay: 0.05s; }
.fauna-item:nth-child(2) { transition-delay: 0.1s; }
.fauna-item:nth-child(3) { transition-delay: 0.15s; }
.fauna-item:nth-child(4) { transition-delay: 0.2s; }
.fauna-item:nth-child(5) { transition-delay: 0.25s; }

.faq-item:nth-child(1) { transition-delay: 0.05s; }
.faq-item:nth-child(2) { transition-delay: 0.1s; }
.faq-item:nth-child(3) { transition-delay: 0.15s; }
.faq-item:nth-child(4) { transition-delay: 0.2s; }
.faq-item:nth-child(5) { transition-delay: 0.25s; }

/* ---- Selection ---- */
::selection {
  background: var(--accent);
  color: #0a0d06;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }
