/* light-theme: manual
   Modern navbar (all pages, loaded after light-theme.css).
   Desktop: full-width glass bar with a thin glowing bottom line, links
   left-aligned next to the logo. The "nexplace.net" hover text always keeps
   its space (just invisible until hover), so nothing shifts. Links get a
   sliding underline instead of boxes; the current page keeps it. The bar
   has a fixed height; after scrolling (html.nav-scrolled, set by
   assets/js/theme.js) only the background gets more opaque.
   Mobile (<= 900px) keeps the burger menu from main.css. */

@media (min-width: 901px) {
  :root header {
    box-sizing: border-box;
    height: 65px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    background: rgba(3, 6, 20, 0.62);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: none;
    transition: background 0.35s ease, box-shadow 0.35s ease;
  }

  /* hairline at the bottom that glows in the brand colours */
  :root header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.45) 20%, rgba(168, 85, 247, 0.45) 80%, transparent);
    opacity: 0.6;
    transition: opacity 0.35s ease;
    pointer-events: none;
  }

  :root.nav-scrolled header {
    background: rgba(3, 6, 20, 0.86);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
  }

  :root.nav-scrolled header::after { opacity: 1; }

  /* brand + nav in one left-aligned row */
  /* fixed height (65px bar): never changes with scrolling or content */
  :root .header-flex { gap: 1.4rem; height: 100%; }

  :root .header-brand {
    position: static;
    transform: none;
    flex: none;
  }

  :root .brand-logo { gap: 0.6rem; }

  :root .brand-logo .logo-mark { width: auto; height: 40px; }
  :root .brand-logo .logo-mark img { width: auto; height: 24px; }

  /* the hover text keeps its width at all times (invisible), so the links
     never move; on hover it fades/slides in */
  :root .brand-logo .brand-text {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0;
    background: linear-gradient(110deg, #fff, #7dd3fc 60%, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }

  :root .brand-logo:hover .brand-text,
  :root .brand-logo:focus-visible .brand-text { opacity: 1; transform: none; }

  :root .nav-center {
    width: auto;
    flex: 1;
    justify-content: flex-start;
    min-width: 0;
  }

  :root nav,
  :root #main-nav { justify-content: flex-start; gap: 1.6rem; }

  :root #main-nav > a,
  :root #main-nav .dropdown-toggle {
    position: relative;
    padding: 0.5rem 0;
    color: #a7b4c8;
    font-size: 0.93rem;
    font-weight: 600;
    transition: color 0.2s ease;
  }

  /* underline that grows from the centre */
  :root #main-nav > a::after,
  :root #main-nav .dropdown-toggle::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #38bdf8, #a78bfa);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  :root #main-nav > a:hover,
  :root #main-nav .dropdown:hover .dropdown-toggle,
  :root #main-nav .dropdown.active .dropdown-toggle,
  :root #main-nav .is-current { color: #fff; transform: none; }

  :root #main-nav > a:hover::after,
  :root #main-nav .dropdown:hover .dropdown-toggle::after,
  :root #main-nav .is-current::after { transform: scaleX(1); }

  :root #main-nav .is-current::after { box-shadow: 0 0 10px rgba(56, 189, 248, 0.7); }

  :root #main-nav > a i,
  :root #main-nav .dropdown-toggle > i:first-child { color: #7dd3fc; opacity: 0.85; }

  /* dropdowns: glass panel with rounded items, opening from the left */
  :root .dropdown-menu {
    left: -0.8rem;
    margin-top: 0.75rem;
    min-width: 230px;
    padding: 0.4rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(6, 10, 28, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 22px 50px rgba(2, 6, 23, 0.65);
    transform: translateY(-6px) scale(0.98);
    transform-origin: top left;
  }

  /* invisible bridge so the menu doesn't close in the gap */
  :root .dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -0.9rem;
    height: 0.9rem;
  }

  :root .dropdown:hover .dropdown-menu,
  :root .dropdown.active .dropdown-menu { transform: translateY(0) scale(1); }

  :root .dropdown-menu a {
    gap: 0.1rem;
    padding: 0.65rem 0.8rem;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.92rem;
    font-weight: 600;
  }

  :root .dropdown-menu a:hover { background: rgba(56, 189, 248, 0.12); color: #fff; }
  :root .dropdown-menu a .nav-project-icon { width: 24px; height: 24px; max-width: 24px; max-height: 24px; }

  /* --- light theme --- */
  html[data-theme="light"] header { background: rgba(255, 255, 255, 0.72); }
  html[data-theme="light"].nav-scrolled header { background: rgba(255, 255, 255, 0.92); box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08); }
  html[data-theme="light"] header::after { background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.45) 20%, rgba(147, 51, 234, 0.4) 80%, transparent); }
  html[data-theme="light"] .brand-logo .brand-text { background-image: linear-gradient(110deg, #0f172a, #0369a1 60%, #7c3aed); }
  html[data-theme="light"] #main-nav > a,
  html[data-theme="light"] #main-nav .dropdown-toggle { color: #475569; background: transparent; border: 0; }
  html[data-theme="light"] #main-nav > a:hover,
  html[data-theme="light"] #main-nav .dropdown:hover .dropdown-toggle,
  html[data-theme="light"] #main-nav .dropdown.active .dropdown-toggle,
  html[data-theme="light"] #main-nav .is-current { color: #0f172a; }
  html[data-theme="light"] #main-nav > a i,
  html[data-theme="light"] #main-nav .dropdown-toggle > i:first-child { color: #0284c7; }
  html[data-theme="light"] .dropdown-menu { background: rgba(255, 255, 255, 0.97); border-color: rgba(15, 23, 42, 0.1); box-shadow: 0 22px 50px rgba(15, 23, 42, 0.15); }
  html[data-theme="light"] .dropdown-menu a { color: #334155; background: transparent; border: 0; }
  html[data-theme="light"] .dropdown-menu a:hover { background: rgba(14, 165, 233, 0.1); color: #0f172a; }
}

@media (min-width: 901px) and (prefers-reduced-motion: reduce) {
  :root header,
  :root .brand-logo .brand-text,
  :root #main-nav > a::after,
  :root #main-nav .dropdown-toggle::after { transition: none; }
}

/* =====================================================================
   Footer - counterpart to the navbar: same glass, fixed 65px height on
   desktop, glowing hairline on top, text links with the navbar underline
   and round social buttons that light up in their brand colour.
   Reveal behaviour (fixed, shown at the page end) stays in footer.css /
   script.js; mobile keeps its static stacked layout.
   ===================================================================== */
:root .site-footer {
  background: rgba(3, 6, 20, 0.86);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 0;
  box-shadow: 0 -10px 30px rgba(2, 6, 23, 0.45);
}

:root .site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.5) 20%, rgba(168, 85, 247, 0.5) 80%, transparent);
  pointer-events: none;
}

:root .site-footer .footer-inner {
  max-width: none;
  gap: 1rem;
  padding: 0 2rem;
}

:root .site-footer p {
  color: #8796ad;
  font-size: 0.85rem;
  font-weight: 500;
}

:root .site-footer p span[aria-hidden] { display: inline-block; animation: footerBeat 1.6s ease-in-out infinite; }

@keyframes footerBeat {
  0%, 60%, 100% { transform: scale(1); }
  20% { transform: scale(1.22); }
  40% { transform: scale(0.95); }
}

/* social: round buttons, brand colour on hover */
:root .site-footer .footer-center { gap: 0.5rem; }

:root .site-footer .social {
  --brand: 148, 163, 184;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.6);
  color: rgb(var(--brand));
  font-size: 0.95rem;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

:root .site-footer .social.discord { --brand: 114, 137, 218; }
:root .site-footer .social.tiktok { --brand: 0, 242, 234; }
:root .site-footer .social.youtube { --brand: 255, 51, 51; }

:root .site-footer .social:hover {
  transform: translateY(-3px);
  background: rgba(var(--brand), 0.16);
  border-color: rgba(var(--brand), 0.6);
  box-shadow: 0 8px 22px rgba(var(--brand), 0.28);
}

/* links: plain text with the navbar's growing underline */
:root .site-footer .footer-right { gap: 1.6rem; }

:root .site-footer .footer-right a {
  position: relative;
  gap: 0.45rem;
  padding: 0.4rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #a7b4c8;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
}

:root .site-footer .footer-right a i { color: #7dd3fc; opacity: 0.85; font-size: 0.85em; }

:root .site-footer .footer-right a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

:root .site-footer .footer-right a:hover {
  color: #fff;
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: none;
}

:root .site-footer .footer-right a:hover::after { transform: scaleX(1); }

@media (min-width: 769px) {
  :root .site-footer { height: 65px; min-height: 0; box-sizing: border-box; }
  :root .site-footer .footer-inner { height: 100%; }
}

@media (max-width: 768px) {
  :root .site-footer .footer-inner { padding: 0.9rem 4vw; gap: 0.6rem; }
  :root .site-footer .social { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }
}

@media (max-width: 768px) {
  /* phones/tablets: links become round icon buttons (labels stay for screen
     readers via font-size 0 + the title attribute), next to the socials */
  :root .site-footer .footer-inner { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 0.4rem; }
  :root .site-footer .footer-left { flex-basis: 100%; justify-content: center; }
  :root .site-footer .footer-right { gap: 0.4rem; }
  :root .site-footer .footer-right a {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    gap: 0;
    font-size: 0;
    line-height: 0;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.6);
  }
  :root .site-footer .footer-right a i { font-size: 0.85rem; opacity: 1; }
  :root .site-footer .footer-right a::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  :root .site-footer p span[aria-hidden] { animation: none; }
}

/* footer light theme */
html[data-theme="light"] .site-footer { background: rgba(255, 255, 255, 0.9); border-top: 0; box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.07); color: #0f172a; }
html[data-theme="light"] .site-footer::before { background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.45) 20%, rgba(147, 51, 234, 0.4) 80%, transparent); }
html[data-theme="light"] .site-footer p { color: #64748b; }
html[data-theme="light"] .site-footer .social { background: #fff; border: 1px solid rgba(15, 23, 42, 0.1); box-shadow: none; }
html[data-theme="light"] .site-footer .social.discord { color: #5865f2; border: 1px solid rgba(15, 23, 42, 0.1); }
html[data-theme="light"] .site-footer .social.tiktok { color: #0891b2; }
html[data-theme="light"] .site-footer .social.youtube { color: #dc2626; }
html[data-theme="light"] .site-footer .social:hover { background: rgba(var(--brand), 0.1); border-color: rgba(var(--brand), 0.5); box-shadow: 0 8px 20px rgba(var(--brand), 0.2); }
html[data-theme="light"] .site-footer .footer-right a { color: #475569; border: 0; background: transparent; }
html[data-theme="light"] .site-footer .footer-right a:hover { color: #0f172a; border: 0; box-shadow: none; }
html[data-theme="light"] .site-footer .footer-right a i { color: #0284c7; }

@media (max-width: 480px) {
  html[data-theme="light"] .site-footer .footer-right a { border: 1px solid rgba(15, 23, 42, 0.1); background: #fff; }
}

/* =====================================================================
   Mobile menu (<= 900px, burger): a plain list below the bar. The dropdowns
   are always open: their header is a small section label, the links are rows.
   ===================================================================== */
@media (max-width: 900px) {
  :root header { background: rgba(3, 6, 20, 0.86); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }

  /* burger: 40px to tap, three thin lines that turn into a clean X */
  :root .burger-menu {
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    margin-right: -6px;
  }
  :root .header-flex .burger-menu { margin-left: 0; }

  :root .burger-menu span { flex: none; width: 22px; height: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
  :root .burger-menu.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  :root .burger-menu.active span:nth-child(2) { opacity: 0; }
  :root .burger-menu.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  :root .burger-menu:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; border-radius: 8px; }

  :root nav.active,
  :root #main-nav.active {
    bottom: 0;
    height: auto;
    gap: 0;
    padding: 8px 16px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    align-items: stretch;
    border-bottom: 0;
    background: #030614;
    box-shadow: none;
    animation: navSheetIn 0.2s ease-out both;
  }

  @keyframes navSheetIn { from { opacity: 0; transform: translateY(-6px); } }

  /* rows */
  :root #main-nav > a,
  :root #main-nav .dropdown-menu a {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 48px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
  }

  :root #main-nav > a:hover,
  :root #main-nav .dropdown-menu a:hover,
  :root #main-nav > a.is-current,
  :root #main-nav .dropdown-menu a.is-current { background: rgba(148, 163, 184, 0.1); color: #fff; }

  :root #main-nav > a { margin-top: 12px; }
  :root #main-nav > a::after,
  :root #main-nav .dropdown-toggle::after { display: none; }

  :root #main-nav > a i { flex: none; width: 28px; color: #7dd3fc; font-size: 1.125rem; text-align: center; opacity: 1; }

  /* section label */
  :root #main-nav .dropdown { display: block; }
  :root #main-nav .dropdown + .dropdown { margin-top: 12px; }

  :root #main-nav .dropdown-toggle,
  :root #main-nav .dropdown-toggle.is-current {
    justify-content: flex-start;
    min-height: 0;
    padding: 12px 12px 4px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    pointer-events: none;
  }

  :root #main-nav .dropdown-toggle i { display: none; }

  :root #main-nav .dropdown-menu,
  :root #main-nav .dropdown.active .dropdown-menu {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: auto;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  :root #main-nav .dropdown-menu a .nav-project-icon {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    margin: 0;
    border-radius: 0;
  }

  /* light theme */
  html[data-theme="light"] header { background: rgba(255, 255, 255, 0.9); }
  html[data-theme="light"] nav.active,
  html[data-theme="light"] #main-nav.active { background: #f8fafc; border-bottom: 0; box-shadow: none; }
  html[data-theme="light"] #main-nav > a,
  html[data-theme="light"] #main-nav .dropdown-menu a { background: transparent; border: 0; color: #0f172a; }
  html[data-theme="light"] #main-nav > a:hover,
  html[data-theme="light"] #main-nav .dropdown-menu a:hover,
  html[data-theme="light"] #main-nav > a.is-current,
  html[data-theme="light"] #main-nav .dropdown-menu a.is-current { background: rgba(15, 23, 42, 0.06); color: #0f172a; }
  html[data-theme="light"] #main-nav > a i { color: #0369a1; background: transparent; }
  html[data-theme="light"] #main-nav .dropdown-toggle { background: transparent; border: 0; color: #64748b; }
  html[data-theme="light"] #main-nav .dropdown-menu { border: 0; box-shadow: none; background: transparent; }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  :root #main-nav.active { animation: none; }
  :root .burger-menu span { transition: none; }
}
