/* ── Shared marketing styles ── */
/* Used by: index, learn-*, alpha-*, arena-*, tools, partners, EducationHub */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: 'Space Grotesk', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

:root {
  --bg:#060812; --bg2:#090c18; --bg3:#0d1020;
  --card:rgba(255,255,255,0.035); --border:rgba(255,255,255,0.07); --border2:rgba(255,255,255,0.12);
  --text:#e8eaf6; --muted:#8892b0; --green:#00d4aa; --green2:#00b891;
  --purple:#7c3aed; --purple2:#a78bfa; --teal:#2dd4bf; --gold:#fbbf24; --gold2:#f97316;
}
[data-theme="light"] {
  --bg:#f5f7ff; --bg2:#edf0fa; --bg3:#e4e8f5;
  --card:rgba(0,0,0,0.03); --border:rgba(0,0,0,0.08); --border2:rgba(0,0,0,0.14);
  --text:#1a1d2e; --muted:#556080; --green:#00a882; --green2:#008f6e;
  --purple:#6d28d9; --purple2:#7c3aed; --teal:#0d9488; --gold:#d97706; --gold2:#c2410c;
}

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%; height: 68px;
  background: rgba(6,8,18,0.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
[data-theme="light"] nav { background: rgba(245,247,255,0.88); border-bottom-color: rgba(0,0,0,0.09); }

.nav-left { display: flex; align-items: center; gap: 48px; }
.nav-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.nav-logo img { height: 48px; width: auto; border-radius: 8px; display: block; }

.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; }
.nav-admin-mobile-li { display: none; } /* only ever shown inside the <=900px hamburger dropdown, toggled there */
.nav-links li { position: relative; list-style: none; }
.nav-links > li > a {
  display: flex; align-items: center; gap: 3px;
  color: var(--muted); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: color 0.2s; white-space: nowrap;
}
.nav-links > li > a:hover { color: var(--text); }
.nav-chevron { font-size: 9px; opacity: 0.55; transition: transform 0.2s; }
.has-dropdown:hover .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  display: none; position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 10px 0 6px; min-width: 175px;
  list-style: none; z-index: 300; box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.has-dropdown:hover .nav-dropdown { display: block; }
.nav-dropdown li a {
  display: block; padding: 9px 18px;
  color: var(--muted); font-size: 13px; font-weight: 500;
  white-space: nowrap; text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-dropdown li a:hover { color: var(--green); background: rgba(0,212,170,0.06); }

.nav-cta { display: flex; align-items: center; gap: 12px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border2);
  color: var(--text); padding: 9px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.06); }
#navSignIn { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="light"] .btn-ghost { color: var(--text); }

.btn-primary {
  background: var(--green); color: #03130f;
  padding: 9px 22px; border-radius: 8px;
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; border: none; text-decoration: none;
  transition: background 0.2s, transform 0.15s; white-space: nowrap;
}
.btn-primary:hover { background: var(--green2); transform: translateY(-1px); }

.nav-admin-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(251,191,36,0.1); border: 1px solid var(--gold);
  color: var(--gold); padding: 7px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  text-decoration: none; transition: background 0.2s;
  margin-right: 10px; /* separates it from the search/theme/sign-in cluster */
}
.nav-admin-link:hover { background: rgba(251,191,36,0.2); }

/* ── Site search ── */
.nav-search { position: relative; }
.nav-search-toggle {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border2); background: var(--card);
  color: var(--muted); font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.nav-search-toggle:hover { background: var(--border); color: var(--text); }
.nav-search-box {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  width: 340px; max-width: calc(100vw - 40px);
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.35); z-index: 400; overflow: hidden;
}
.nav-search.open .nav-search-box { display: block; }
.nav-search-input-wrap { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.nav-search-input-wrap svg { flex-shrink: 0; opacity: 0.5; }
.nav-search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 14px; font-family: inherit;
}
.nav-search-input::placeholder { color: var(--muted); }
.nav-search-results { max-height: 360px; overflow-y: auto; }
.nav-search-empty { padding: 18px 16px; font-size: 13px; color: var(--muted); text-align: center; }
.nav-search-group-label {
  padding: 10px 14px 4px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.nav-search-result {
  display: block; padding: 9px 14px; text-decoration: none; transition: background 0.15s;
}
.nav-search-result:hover, .nav-search-result.active { background: rgba(0,212,170,0.08); }
.nav-search-result-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.nav-search-result-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .nav-search-box { position: fixed; top: 68px; left: 12px; right: 12px; width: auto; max-width: none; }
}

.theme-toggle {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border2); background: var(--card);
  color: var(--muted); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.theme-toggle:hover { background: var(--border); color: var(--text); }

.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; background: none; border: none;
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.nav-hamburger span { display: block; width: 100%; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-hamburger { display: flex; }
  /* The header pill version is dropped in favour of an Admin row inside the
     hamburger menu (#navAdminMobileLi below) — there just isn't room in the
     top bar for logo + admin pill + search + theme toggle + account +
     hamburger on a phone width without clipping the hamburger off-screen. */
  .nav-admin-link { display: none; }
  .nav-cta { gap: 8px; }
  #navSignIn { max-width: 90px; padding: 9px 12px; }
  .nav-links {
    display: none; position: fixed; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    max-height: calc(100vh - 68px); overflow-y: auto;
    padding: 8px 0; box-shadow: 0 16px 40px rgba(0,0,0,0.3); z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links > li { width: 100%; }
  .nav-links > li > a { padding: 14px 24px; width: 100%; }
  .nav-chevron { padding: 8px 10px; margin: -8px -10px -8px 0; font-size: 17px; opacity: 0.9; }
  .has-dropdown:hover .nav-dropdown { display: none; }
  .has-dropdown.open .nav-dropdown { display: block; }
  .has-dropdown.open .nav-chevron { transform: rotate(180deg); }
  .nav-dropdown {
    position: static; transform: none; background: none; border: none;
    box-shadow: none; border-radius: 0; padding: 0 0 6px 36px; min-width: 0;
  }
}

/* ── Shared footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 5%;
}
[data-theme="light"] footer { border-top-color: rgba(0,0,0,0.09); }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: flex-start;
  flex-wrap: wrap; gap: 20px;
}
.footer-logo img { height: 40px; width: auto; border-radius: 6px; display: block; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; margin-left: 48px; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: rgba(136,146,176,0.5); margin-left: auto; }

@media (max-width: 640px) {
  .footer-inner { justify-content: center; text-align: center; }
  .footer-links { margin-left: 0; margin-top: 20px; justify-content: center; width: 100%; }
  .footer-copy { margin-left: 0; margin-top: 12px; width: 100%; text-align: center; }
}
