:root {
  --brand-primary: #0A192F; /* deep navy */
  --text-primary: #111827; /* gray-900 */
  --text-secondary: #4B5563; /* gray-600 */
  --border: #E5E7EB; /* gray-200 */
  --bg: #FFFFFF;
  --cta: #007BFF; /* blue */
  --cta-alt: #64FFDA; /* aqua accent */
  --shadow: 0 8px 24px rgba(10, 37, 64, 0.08);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

/* Sticky, elevated navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(240,245,255,0.92));
  backdrop-filter: saturate(130%) blur(6px);
  box-shadow: var(--shadow);
  border-bottom: 1px solid rgba(229, 231, 235, 0.6);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes glowPulse {
  0% { box-shadow: 0 8px 20px rgba(0, 123, 255, 0.20); }
  50% { box-shadow: 0 12px 26px rgba(100, 255, 218, 0.25); }
  100% { box-shadow: 0 8px 20px rgba(0, 123, 255, 0.20); }
}
.navbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cta), var(--cta-alt));
}

.navbar .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: relative;
  z-index: 1000; /* ensure above overlay */
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--brand-primary);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand .logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  margin-right: 10px;
  display: block;
  object-fit: contain;
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.25);
}

.brand .name {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 18px;
  background: linear-gradient(90deg, var(--brand-primary), var(--cta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Primary nav */
.nav-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links > li { position: relative; }

.nav-links a,
.nav-links button.nav-trigger {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  color: var(--text-primary);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
}

.nav-links a:hover,
.nav-links button.nav-trigger:hover { background: linear-gradient(90deg, rgba(0,123,255,0.10), rgba(100,255,218,0.10)); color: var(--brand-primary); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,123,255,0.18); border-image: linear-gradient(90deg, var(--cta), var(--cta-alt)) 1; }
.nav-links a:active,
.nav-links button.nav-trigger:active { transform: translateY(0); }
.nav-links a::after,
.nav-links button.nav-trigger::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 3px;
  background: linear-gradient(90deg, var(--cta), var(--cta-alt));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease;
}
.nav-links a:hover::after,
.nav-links button.nav-trigger:hover::after { transform: scaleX(1); }
.nav-links a.active { background: rgba(0,123,255,0.10); color: var(--brand-primary); }
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { box-shadow: 0 8px 18px rgba(0,123,255,0.18); border-image: linear-gradient(90deg, var(--cta), var(--cta-alt)) 1; }

.nav-links a:focus-visible,
.nav-links button.nav-trigger:focus-visible,
.hamburger:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
}

/* Dropdown / Mega menu */
.has-dropdown .dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 560px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: none;
}

.has-dropdown:hover .dropdown { display: block; /* hover for desktop */ }

.dropdown .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px 24px;
}

.dropdown h4 {
  margin: 0 0 8px 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-primary);
}

.dropdown a.item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 160ms ease;
}

.dropdown a.item:hover { background: linear-gradient(90deg, rgba(0,123,255,0.12), rgba(100,255,218,0.12)); box-shadow: 0 6px 16px rgba(0,123,255,0.14); }

/* Right-side actions */
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sign-in {
  color: var(--text-primary);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}
.sign-in:hover { background: rgba(0,123,255,0.08); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,123,255,0.18); border-image: linear-gradient(90deg, var(--cta), var(--cta-alt)) 1; }
.sign-in:active { transform: translateY(0); }

.cta {
  padding: 10px 16px;
  border-radius: 10px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  background: linear-gradient(90deg, var(--cta), var(--cta-alt));
  background-size: 200% 200%;
  box-shadow: 0 8px 20px rgba(0, 123, 255, 0.25);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  animation: gradientShift 8s ease infinite;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 123, 255, 0.30); filter: saturate(110%); }
.cta:active { transform: translateY(0); }
.cta:focus-visible { animation: glowPulse 2.2s ease infinite; }

/* Hamburger for mobile */
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f2f7ff);
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  z-index: 1001; /* clickable above overlay */
  box-shadow: 0 8px 20px rgba(0, 123, 255, 0.15);
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: linear-gradient(90deg, var(--cta), var(--cta-alt));
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease, background-color 160ms ease;
  transform-origin: center;
}

.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.hamburger.is-active span:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }
.hamburger:hover span, .hamburger:focus-visible span { background: linear-gradient(90deg, var(--brand-primary), var(--cta)); }

/* Mobile panel default hidden (prevents duplicate links on desktop) */
.nav-panel { display: none; }

/* Overlay for mobile menu */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 47, 0.4); /* navy tint */
  backdrop-filter: saturate(120%) blur(2px);
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 900; /* below nav container/panel */
}
.navbar.open .nav-overlay { display: block; opacity: 1; }

/* Caret indicator for dropdown triggers */
button.nav-trigger::after {
  content: '▾';
  margin-left: 6px;
  color: var(--text-secondary);
  transition: transform 160ms ease;
}
.has-dropdown.open button.nav-trigger::after { transform: rotate(180deg); }

/* Responsive behavior */
@media (max-width: 992px) {
  .navbar .container { height: 64px; }
  .nav-wrap { display: none; }
  .hamburger { display: inline-flex; }
  /* Hide header actions on mobile; they appear in panel */
  .navbar .container .actions { display: none; }

  /* Menu panel */
.nav-panel {
  display: block; /* override global hidden on mobile */
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,250,255,0.98));
  box-shadow: var(--shadow);
  width: 100%;
  /* Slide-down animation */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 220ms ease, opacity 220ms ease, transform 220ms ease;
  position: relative;
  z-index: 1001; /* panel above overlay */
}
.navbar.open .nav-panel { max-height: 75vh; opacity: 1; transform: translateY(0); }
.navbar.open .nav-panel { overflow: auto; }
.nav-panel .nav-links {
  flex-direction: column;
  align-items: stretch;
  padding: 8px 12px;
}
/* Larger tap targets */
.nav-panel .nav-links a,
.nav-panel .nav-links button.nav-trigger { padding: 14px 16px; }
.nav-panel .actions { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.nav-panel .cta { width: 100%; text-align: center; }
.nav-panel .sign-in { text-align: center; }
.nav-panel .cta { background-size: 200% 200%; animation: gradientShift 8s ease infinite; }
.nav-panel .cta:hover { transform: translateY(-1px); }
.nav-panel .sign-in:hover { transform: translateY(-1px); }

  /* Dropdowns become inline blocks toggled by button */
.has-dropdown .dropdown { position: static; display: none; min-width: unset; box-shadow: none; border: none; padding: 4px 0; }
.has-dropdown.open .dropdown { display: block; }
.dropdown .grid { grid-template-columns: 1fr; }

/* Mobile colorful link styling */
.nav-panel .nav-links a {
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: 12px;
  margin: 4px 0;
  background: linear-gradient(90deg, rgba(0,123,255,0.06), rgba(100,255,218,0.06));
}
.nav-panel .nav-links a:hover {
  background: linear-gradient(90deg, rgba(0,123,255,0.16), rgba(100,255,218,0.16));
  border-image: linear-gradient(90deg, var(--cta), var(--cta-alt)) 1;
  box-shadow: 0 8px 18px rgba(0,123,255,0.18);
  transform: translateY(-1px);
}
.nav-panel .dropdown .item {
  border-radius: 10px;
  margin: 2px 0;
  background: rgba(255,255,255,0.8);
}
.nav-panel .dropdown .item:hover {
  background: linear-gradient(90deg, rgba(0,123,255,0.12), rgba(100,255,218,0.12));
  box-shadow: 0 6px 16px rgba(0,123,255,0.14);
  transform: translateY(-1px);
}
}

/* Demo page spacing */
.page {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px 48px;
  color: var(--text-secondary);
}
.page h1 { font-family: 'Poppins', 'Inter', sans-serif; color: var(--brand-primary); font-size: 28px; margin: 24px 0 8px; }
.page p { margin: 0 0 12px 0; }
