/* ==== ROOT & GLOBAL ==== */
:root {
  --nav-h: 64px;
  --c-bg: #050505;
  --c-text: #e6e6e6;
  --c-accent: #00bfff;
  --c-accent-soft: #1e90ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Orbitron', sans-serif;
  color: var(--c-text);
  background-color: var(--c-bg);
  scroll-behavior: smooth;
  font-size: 17px;
}

/* Layout guard so footer stays bottom */
body { display: flex; flex-direction: column; }
main, .feature-grid, .visual-strip, .archives { flex: 1 0 auto; }
footer { flex-shrink: 0; }

/* prevent fixed navbar from covering jump targets */
section, h1, h2, h3, [id] { scroll-margin-top: calc(var(--nav-h) + 10px); }

/* ==== NAVBAR ==== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 5%;
  background: rgba(0, 5, 15, 0.9);
  border-bottom: 1px solid var(--c-accent);
  box-shadow: 0 0 15px rgba(0,191,255,0.3);
  z-index: 1000;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--c-accent);
  text-shadow: 0 0 10px var(--c-accent);
  font-size: 1.2rem;
}
.nav-logo img { width: 35px; height: 35px; border-radius: 50%; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 25px;
}
.nav-links a {
  color: #bde8ff;
  text-decoration: none;
  font-weight: 600;
  transition: color .25s, text-shadow .25s;
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--c-accent);
  text-shadow: 0 0 12px var(--c-accent);
  outline: none;
}

/* ==== DROPDOWN (Pure CSS Hover-Bridge) ==== */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Invisible hover bridge between button & menu */
.dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 14px; /* bridge to prevent flicker */
}

/* Button */
.dropbtn {
  background: none;
  border: none;
  color: #bde8ff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  text-transform: none;
  line-height: 1.1;
  padding: 0;
  margin: 0;
  transition: color .25s, text-shadow .25s;
  font-family: 'Orbitron', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  appearance: none;
}
.dropbtn:hover,
.dropbtn:focus-visible {
  color: var(--c-accent);
  text-shadow: 0 0 12px var(--c-accent);
  outline: none;
}

/* Dropdown menu */
.dropdown-content {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  min-width: 180px;
  background: rgba(0, 10, 25, 0.97);
  border: 1px solid var(--c-accent);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,191,255,0.4);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 1100;
}

/* Links inside dropdown */
.dropdown-content a {
  display: block;
  padding: 10px 16px;
  color: #bde8ff;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background .2s, color .2s;
}
.dropdown-content a:hover {
  background: rgba(0,191,255,0.12);
  color: var(--c-accent);
}

/* Keep menu open when hovering button OR menu */
.dropdown:hover .dropdown-content,
.dropdown-content:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

/* Active underline glow */
.dropdown:hover .dropbtn {
  color: var(--c-accent);
  text-shadow: 0 0 12px var(--c-accent);
  border-bottom: 2px solid var(--c-accent);
  padding-bottom: 2px;
}

/* ==== HERO ==== */
.hero {
  position: relative;
  min-height: 100vh;
  padding-top: var(--nav-h);
  background: url('genesis_flag.png') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 90%;
  animation: fadeIn 1.6s ease;
}
.hero h1 {
  font-size: 3.3em;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 30px var(--c-accent);
}
.hero p {
  margin-top: .8em;
  color: #b0c4de;
  font-size: 1.3em;
}
.hero button {
  margin-top: 1.6em;
  padding: 12px 28px;
  border: 2px solid var(--c-accent);
  background: transparent;
  color: var(--c-accent);
  text-transform: uppercase;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: .25s;
}
.hero button:hover {
  background: var(--c-accent);
  color: #000;
  box-shadow: 0 0 25px var(--c-accent);
}

/* ==== FEATURE GRID ==== */
.feature-grid {
  padding: 90px 10%;
  text-align: center;
  background: radial-gradient(circle at top, #0b0b1b, #000);
}
.feature-grid h2 {
  font-size: 2.3em;
  margin-bottom: 45px;
  text-shadow: 0 0 15px var(--c-accent-soft);
}
.feature-grid .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 35px;
}
.feature-grid article {
  background: rgba(15,15,35,0.72);
  border: 1px solid var(--c-accent-soft);
  border-radius: 10px;
  padding: 25px;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.feature-grid article:hover {
  transform: translateY(-8px);
  box-shadow: 0 0 25px var(--c-accent-soft);
  border-color: var(--c-accent);
}
.feature-grid .card-link { color: inherit; text-decoration: none; display: block; }
.card-lore h3 {
  color: var(--c-accent);
  text-shadow: 0 0 15px var(--c-accent);
  font-size: 1.3rem;
}
.card-lore p {
  color: #bde8ff;
  font-size: 1rem;
  line-height: 1.5;
}

/* ==== VISUAL STRIP ==== */
.visual-strip {
  position: relative;
  height: 70vh;
  background: url('eclipsera_landscape.png') center -700px/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.visual-strip .overlay-dark {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
}
.strip-content { position: relative; z-index: 1; text-align: center; }
.strip-content h2 {
  font-size: 1.8em;
  text-shadow: 0 0 20px var(--c-accent);
}

/* ==== IMPERIAL ARCHIVES ==== */
.archives {
  padding: 90px 10%;
  background: #0a0a0a;
  text-align: center;
}
.archives h2 { margin-bottom: 40px; text-shadow: 0 0 15px var(--c-accent); }
.archives .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}
.archives .card {
  background: rgba(15,15,30,0.9);
  border: 1px solid var(--c-accent-soft);
  border-radius: 10px;
  padding: 22px;
  min-height: 180px;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.archives .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 25px var(--c-accent-soft);
  border-color: var(--c-accent);
}
.archives .card h3 {
  margin-top: 0;
  color: var(--c-accent);
  text-shadow: 0 0 10px var(--c-accent);
}
.archives .card p {
  color: #cfe7ff;
  line-height: 1.55;
}

/* ==== FOOTER ==== */
footer {
  background: #000;
  padding: 25px;
  text-align: center;
  font-size: .95em;
  color: #999;
  border-top: 1px solid #003a5a;
}
footer a { color: var(--c-accent); text-decoration: none; margin: 0 5px; }
footer a:hover { text-decoration: underline; }

/* ==== ANIMATIONS ==== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==== LORE POPUP ==== */
.lore-popup {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.lore-popup .lore-content {
  background: #0a0a0a;
  padding: 30px;
  border: 2px solid var(--c-accent);
  border-radius: 12px;
  max-width: 90%; max-height: 80%;
  overflow-y: auto;
  color: var(--c-text);
}
.lore-popup .close-lore-btn {
  margin-top: 20px;
  padding: 10px 20px;
  background: var(--c-accent);
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.25s;
}
.lore-popup .close-lore-btn:hover { background: var(--c-accent-soft); }

/* ==== RESPONSIVE ==== */
@media (max-width: 700px) {
  .nav-links { gap: 14px; }
  .hero h1 { font-size: 2.4rem; }
  .hero p  { font-size: 1rem; }
  .feature-grid, .archives { padding: 70px 6% 60px; }
}
