@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #ffffff;
  --ink-dim: rgba(255, 255, 255, 0.75);
  --ink-faint: rgba(255, 255, 255, 0.55);
  --pill-bg: rgba(255, 255, 255, 0.12);
  --pill-active: #ffffff;
  --pill-active-text: #111111;
  --dark-btn: #0e0e0e;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-ui: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ================= PAGE TRANSITIONS (View Transitions API) ================= */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

::view-transition-old(root) {
  animation-name: page-fade-out;
}

::view-transition-new(root) {
  animation-name: page-fade-in;
}

@keyframes page-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

html {
  /* Matches the top color of .hero-img-placeholder's gradient (home.css)
     so any subpixel gap from the -74px hero offset blends in instead of
     showing a white strip above the topbar. */
  background: #7fa9c9;
}

body {
  font-family: var(--font-ui);
  background: #ffffff;
  color: var(--ink);
}

/* ================= TOP BAR (shared, centered nav) ================= */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  view-transition-name: site-topbar;
  padding: 20px 40px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  height: 50px;
  width: auto;
  max-width: 200px;
  margin: -8px 0;
  object-fit: contain;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-info {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: flex;
  gap: 8px;
  color: var(--ink);
  white-space: nowrap;
}

.brand-info .dot { color: var(--ink-faint); }

.pillnav {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: center;
}

.pill-item {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--ink-dim);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--pill-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.pill-item:hover {
  color: var(--ink);
  border-color: rgba(255,255,255,0.35);
}

.pill-item.active {
  background: var(--pill-active);
  color: var(--pill-active-text);
  border-color: var(--pill-active);
}

/* Grievance link inside the nav: shown in the mobile menu only */
.pill-item-mobile {
  display: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-self: end;
}

.register-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.signup-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}

.signin-pill {
  background: var(--dark-btn);
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 999px;
  white-space: nowrap;
}

.help-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}

.help-link-strong {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topbar.tinted .help-link { color: #111; }
.topbar.tinted .help-link svg path { stroke: #111; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar.tinted { background: #ffffff; }
}

/* ---------- Tinted topbar state — toggled by home.js once the user ---------- */
/* ---------- scrolls past the hero into About/PMSG/Services         ---------- */
.topbar.tinted {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.topbar.tinted .brand-mark { border-color: rgba(0,0,0,0.35); }
.topbar.tinted .brand-mark svg circle,
.topbar.tinted .brand-mark svg path { stroke: #111; }
.topbar.tinted .brand-info { color: #111; }
.topbar.tinted .brand-info .dot { color: rgba(0,0,0,0.35); }

.topbar.tinted .pillnav { background: transparent; }

.topbar.tinted .pill-item {
  color: rgba(0,0,0,0.55);
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
}

.topbar.tinted .pill-item:hover { color: #111; border-color: rgba(0,0,0,0.2); }

.topbar.tinted .pill-item.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.topbar.tinted .register-link { color: #111; }
.topbar.tinted .icon-btn { border-color: rgba(0,0,0,0.3); }
.topbar.tinted .signup-link { color: #111; }

/* ================= MOBILE MENU TOGGLE ================= */
.menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: transparent;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  flex-direction: column;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 15px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.topbar.tinted .menu-toggle { border-color: rgba(0,0,0,0.3); }
.topbar.tinted .menu-toggle span { background: #111; }

.menu-toggle.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ================= SHARED RESPONSIVE ================= */
@media (max-width: 900px) {
  .pillnav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0b0b0b;
    padding: 16px 20px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.25s ease;
  }

  .pillnav.open {
    max-height: min(470px, calc(100vh - 74px));
    overflow-y: auto;
    opacity: 1;
    pointer-events: auto;
  }

  .topbar.tinted .pillnav {
    background: #ffffff;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
  }

  .pill-item {
    width: 100%;
    text-align: center;
  }

  .pill-item-mobile {
    display: block;
  }

  .topbar {
    position: sticky;
    top: 0;
    grid-template-columns: 1fr auto;
    padding: 20px 20px;
  }
  .topbar-right {
    gap: 10px;
    justify-self: end;
  }
  .help-link { display: none; }
  .menu-toggle { display: flex; }
}

@media (max-width: 520px) {
  .brand-logo { height: 38px; max-width: 120px; margin: -4px 0; }
  .brand-info { font-size: 11px; gap: 5px; }
  .topbar-right { gap: 10px; }
  .signup-link { display: none; }
  .topbar-light { padding: 16px 20px; }
}