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

html {
  scrollbar-gutter: stable;
}

html, body {
  background: #0a0a0a;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

#embers {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
#constellation {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.page { width: 100%; position: relative; z-index: 1; }

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 2.5rem;
  position: relative;
  z-index: 9999;
  width: 100%;
  isolation: isolate;
}

.logo { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: 1px; text-decoration: none; }

#theme-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 18px; padding: 0; line-height: 1;
  color: rgba(255,255,255,0.8) !important;
}

.nav-links { display: flex; gap: 1.75rem; list-style: none; align-items: center; }
.nav-links a { color: rgba(255,255,255,0.32); font-size: 13px; text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: rgba(255,255,255,0.7); }
.nav-links a.active {
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.9), 0 0 30px rgba(255,255,255,0.4), 0 0 60px rgba(255,255,255,0.15);
}

.nav-links a.nav-login-link { display: flex; align-items: center; font-size: 18px; }

.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  color: rgba(255,255,255,0.32); font-size: 13px;
  text-decoration: none; cursor: pointer;
  background: none; border: none; font-family: inherit;
  padding: 0; padding-top: 2px; display: flex; align-items: center; gap: 4px;
  transition: color 0.2s; line-height: 1; vertical-align: middle;
}
.nav-dropdown-btn:hover { color: rgba(255,255,255,0.7); }
.nav-dropdown-btn.active {
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.9), 0 0 30px rgba(255,255,255,0.4), 0 0 60px rgba(255,255,255,0.15);
}
.nav-dropdown-btn i { font-size: 11px; transition: transform 0.2s; }
.nav-dropdown-btn.open i { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  background: rgba(15,15,15,0.95);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 5px; min-width: 130px;
  display: none; flex-direction: column; gap: 2px;
  z-index: 9999; text-align: center;
}
.nav-dropdown-menu.open { display: flex; animation: dropdownIn 0.18s ease forwards; }
.nav-dropdown-menu a {
  color: rgba(255,255,255,0.55); font-size: 12px;
  text-decoration: none; padding: 7px 10px;
  border-radius: 6px; transition: background 0.15s, color 0.15s;
  letter-spacing: 0.3px; text-align: center;
}
.nav-dropdown-menu a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-dropdown-menu a.active { color: #fff; background: rgba(255,255,255,0.06); }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes dropdownOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-6px); }
}


.page-title { text-align: center; padding: 1rem 0 2.5rem; }
.page-title h1 { font-size: 32px; font-weight: 800; letter-spacing: -1.5px; color: #fff; margin-bottom: 0.4rem; }

@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.93); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes popOut {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.93); }
}
.pop-out { animation: popOut 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) forwards !important; }
.pop { opacity: 0; animation: popIn 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) forwards; }

@keyframes tooltipIn {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes tooltipOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(4px); }
}

@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sectionFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}
.mode-section { animation: sectionFadeIn 0.22s ease forwards; }
.mode-section.hiding { animation: sectionFadeOut 0.15s ease forwards; pointer-events: none; }


#loadbar-track { position: fixed; top: 0; left: 0; width: 100%; height: 2px; z-index: 99999; pointer-events: none; }
#loadbar-fill {
  height: 100%; width: 0%;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 8px rgba(255,255,255,0.6), 0 0 20px rgba(255,255,255,0.3);
  transition: width 0.4s cubic-bezier(0.1,0.5,0.3,1), opacity 1.2s ease;
}
body.light #loadbar-fill {
  background: #111;
  box-shadow: 0 0 10px rgba(0,0,0,0.8), 0 0 30px rgba(0,0,0,0.5);
}

.mobile-login-link { display: none; }

@media (max-width: 520px) {
  nav { padding: 1.5rem 1.25rem; }
  .logo { font-size: 11px; }
  .nav-links { gap: 0.85rem; }

  #theme-toggle { position: absolute; top: 50%; left: calc(50% - 6px); transform: translate(-100%, -50%); font-size: 16px; }

  .nav-links a.nav-login-link { display: none; }
  .mobile-login-link {
    display: flex;
    align-items: center;
    position: absolute;
    top: 50%;
    left: calc(50% + 6px);
    transform: translateY(-50%);
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.2s;
  }
  .mobile-login-link:hover { color: #fff; }
  .mobile-login-link.active {
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.9), 0 0 30px rgba(255,255,255,0.4), 0 0 60px rgba(255,255,255,0.15);
  }
}

body.light { background: #f0f0f0; color: #111; }
body.light .glass { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); }
body.light nav { background: transparent; }
body.light .logo { color: #111; }
body.light .nav-links a:not(.active) { color: rgba(0,0,0,0.45); }
body.light .nav-links a:hover { color: rgba(0,0,0,0.8); }
body.light .nav-links a.active { color: #111 !important; text-shadow: 0 0 8px rgba(0,0,0,0.5), 0 0 20px rgba(0,0,0,0.25) !important; }
body.light .mobile-login-link:not(.active) { color: rgba(0,0,0,0.7); }
body.light .mobile-login-link:hover { color: rgba(0,0,0,0.85); }
body.light .mobile-login-link.active { color: #111 !important; text-shadow: 0 0 8px rgba(0,0,0,0.5), 0 0 20px rgba(0,0,0,0.25) !important; }
body.light .nav-dropdown-btn { color: rgba(0,0,0,0.45); }
body.light .nav-dropdown-btn:hover { color: rgba(0,0,0,0.8); }
body.light .nav-dropdown-btn.active { color: #111 !important; text-shadow: 0 0 8px rgba(0,0,0,0.5), 0 0 20px rgba(0,0,0,0.25) !important; }
body.light .nav-dropdown-menu { background: rgba(240,240,240,0.98); border-color: rgba(0,0,0,0.1); }
body.light .nav-dropdown-menu a { color: rgba(0,0,0,0.55); }
body.light .nav-dropdown-menu a:hover { background: rgba(0,0,0,0.06); color: #111; }
body.light .page-title h1 { color: #111; }
body.light .page-title p { color: rgba(0,0,0,0.4); }
