/* Navbar and navigation styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
  background: linear-gradient(to bottom, rgba(0,0,0,.45) 0%, transparent 100%);
}

.navbar.scrolled {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 4px 24px rgba(0,0,0,.08);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: min(1200px, 100% - 3rem);
  margin-inline: auto;
  position: relative;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--white);
  transition: opacity .2s, color var(--transition);
}

.navbar.scrolled .nav-logo { color: var(--grey-900); }
.nav-logo:hover { opacity: .8; }
.logo-icon { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.nav-logo .logo-text { width: 65px; height: 22px; flex-shrink: 0; object-fit: contain; }

.nav-links {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}

.nav-standard-links {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .35rem;
  max-width: 360px;
  overflow: hidden;
  transition: opacity .3s ease, transform .3s ease, max-width .35s ease;
}

.nav-link {
  padding: .52rem .72rem;
  color: var(--grey-800);
  border-radius: 12px;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover { color: var(--orange); background: rgba(249,115,22,.07); }
.navbar:not(.scrolled) .nav-link { color: var(--white); }
.navbar:not(.scrolled) .nav-link:hover { color: var(--white); background: rgba(255,255,255,.15); }

.nav-item {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  line-height: 1;
}

.nav-text {
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav-item-simple { justify-content: center; }
.nav-item-simple .nav-text { font-size: .92rem; }

.nav-item-simple.section-active {
  color: #166534;
  background: rgba(134,239,172,.32);
  box-shadow: inset 0 0 0 1px rgba(22,101,52,.34);
}

.nav-item-simple.section-active .nav-text {
  color: #166534;
  font-weight: 700;
}

.navbar:not(.scrolled) .nav-item-simple.section-active {
  color: #14532d;
  background: rgba(134,239,172,.86);
  box-shadow: inset 0 0 0 1px rgba(20,83,45,.34);
}

.navbar:not(.scrolled) .nav-item-simple.section-active .nav-text {
  color: #14532d;
}

.nav-interest-zone {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid rgba(249,115,22,.3);
  background: rgba(249,115,22,.08);
  transition: background .35s ease, border-color .35s ease, max-width .35s cubic-bezier(.22,1,.36,1);
}

.nav-interest-zone:hover {
  background: rgba(249,115,22,.13);
  border-color: rgba(249,115,22,.5);
}

.navbar:not(.scrolled) .nav-interest-zone {
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.12);
}

.navbar:not(.scrolled) .nav-interest-zone:hover {
  background: rgba(255,255,255,.2);
}

.nav-interest-trigger {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 42px;
  padding: .48rem .76rem;
  max-width: 360px;
  overflow: hidden;
  border: none;
  background: transparent;
  color: var(--grey-900);
  transition: max-width .35s cubic-bezier(.22,1,.36,1), opacity .25s ease, padding .35s ease;
  white-space: nowrap;
}

.navbar:not(.scrolled) .nav-interest-trigger {
  color: var(--white);
}

.interest-label {
  font-size: .94rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: .92;
}

.interest-word-wrap {
  position: relative;
  height: 1.6em;
  width: 128px;
  overflow: hidden;
  text-align: center;
  font-size: .94rem;
  line-height: 1.6;
}

.interest-word {
  display: inline-block;
  font-size: .94rem;
  font-weight: 700;
  white-space: nowrap;
  transform: translateY(0);
  opacity: 1;
  transition: transform .42s cubic-bezier(.22,1,.36,1), opacity .42s ease;
}

.navbar.public-mode .interest-word {
  color: #22c55e;
}

.navbar.public-mode .nav-interest-zone {
  border-color: rgba(34,197,94,.45);
  background: rgba(34,197,94,.1);
}

.navbar.public-mode:not(.scrolled) .nav-interest-zone {
  border-color: rgba(134,239,172,.65);
  background: rgba(34,197,94,.22);
}

.interest-word.is-changing {
  transform: translateY(-130%);
  opacity: 0;
}

.interest-word.is-entering {
  animation: interestWordEnter .44s cubic-bezier(.22,1,.36,1);
}

@keyframes interestWordEnter {
  from {
    transform: translateY(130%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.interest-expanded {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: 0;
  border: none;
  background: transparent;
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: max-width .35s cubic-bezier(.22,1,.36,1), opacity .25s ease, padding .35s ease;
}

.nav-links.interests-open .interest-expanded {
  padding: .28rem .34rem;
  max-width: 980px;
  opacity: 1;
}

.nav-links.interests-fully-open .interest-expanded {
  overflow: visible;
  pointer-events: auto;
}

.nav-links.interests-open .nav-interest-trigger {
  opacity: 0;
  pointer-events: none;
  max-width: 0;
  padding-inline: 0;
  margin: 0;
}

.nav-links.interests-open .nav-standard-links {
  opacity: 0;
  pointer-events: none;
}

.nav-dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(.97);
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.05);
  min-width: 300px;
  max-width: 340px;
  max-height: min(72vh, 32rem);
  padding: .5rem;
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  transition: opacity .22s ease, transform .22s cubic-bezier(.22,1,.36,1);
  z-index: 100;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0) scale(1);
}

.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0) scale(1);
}

.interest-expanded .nav-link.public-active {
  color: #15803d;
  background: rgba(34,197,94,.14);
  box-shadow: inset 0 0 0 1px rgba(21,128,61,.35);
}

.interest-expanded .nav-link.public-active .nav-text {
  font-weight: 700;
}

.interest-expanded .nav-link.public-active:hover {
  color: #f0fdf4;
  background: #16a34a;
}

.interest-expanded .nav-link.public-active:hover .nav-text {
  color: inherit;
}

.dropdown-menu a {
  display: block;
  padding: .55rem .85rem;
  font-size: .88rem;
  line-height: 1.25;
  white-space: normal;
  color: #374151;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}

.dropdown-menu a:hover { background: var(--grey-100); color: var(--orange); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .4rem;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

.navbar.scrolled .hamburger span { background: var(--grey-800); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.search-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--white);
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.1);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform .2s;
}

.search-toggle:hover { transform: translateY(-1px); }

.navbar.scrolled .search-toggle {
  color: var(--grey-900);
  background: rgba(15,23,42,.04);
  border-color: rgba(15,23,42,.12);
}

.navbar:not(.scrolled) .search-toggle:hover { background: rgba(255,255,255,.2); }

.navbar.scrolled .search-toggle:hover {
  background: rgba(249,115,22,.08);
  color: var(--orange-dark);
  border-color: rgba(249,115,22,.25);
}

.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem 1.5rem;
  gap: .2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .28s ease, visibility .28s ease, transform .28s cubic-bezier(.22,1,.36,1);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-menu a {
  padding: .75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--grey-800);
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}

.mobile-menu a:hover { background: var(--grey-100); color: var(--orange); }

.mobile-nav-item {
  display: flex;
  align-items: center;
}

.mobile-nav-item.public-active {
  background: rgba(34,197,94,.12);
}

.mobile-nav-item.section-active {
  background: rgba(134,239,172,.34);
  box-shadow: inset 0 0 0 1px rgba(22,101,52,.24);
}

.mobile-nav-item.public-active .mobile-nav-text {
  color: #15803d;
  font-weight: 700;
}

.mobile-nav-item.section-active .mobile-nav-text {
  color: #166534;
  font-weight: 700;
}

.mobile-nav-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--grey-900);
}

.mobile-nav-item-simple .mobile-nav-text { font-size: 1rem; }

.mobile-cta {
  margin-top: .5rem;
  background: var(--orange) !important;
  color: var(--white) !important;
  text-align: center;
  border-radius: 999px !important;
}

.mobile-cta .mobile-nav-text { color: var(--white); }

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}

.search-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-modal {
  width: min(680px, calc(100% - 2rem));
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow-xl);
  padding: 1.1rem 1.1rem 0.6rem;
  transform: translateY(10px) scale(.98);
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
  position: relative;
}

.search-overlay.open .search-modal {
  transform: translateY(0) scale(1);
}

.search-close {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--grey-800);
  background: var(--white);
  font-size: 1.8rem;
  line-height: 1;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background 0.2s, color 0.2s;
}

.search-close:hover {
  background: var(--grey-100);
  color: var(--grey-900);
}

.search-form { margin-top: 0; }

.search-results-container {
  max-height: 50vh;
  overflow-y: auto;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-result-item {
  display: block;
  padding: 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--grey-900);
  transition: background 0.2s;
}
.search-result-item:hover {
  background: var(--grey-50);
}
.search-result-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}
.search-result-meta {
  font-size: 0.85rem;
  color: var(--grey-500);
}

.search-input {
  width: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid var(--grey-200);
  border-radius: 12px;
  font-size: 1rem;
  color: var(--grey-900);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.search-input:focus {
  border-color: rgba(249,115,22,.7);
  box-shadow: 0 0 0 4px rgba(249,115,22,.15);
}

@media (max-width: 980px) {
  .nav-links { display: none; }
  .interest-expanded,
  .nav-links.interests-open .interest-expanded { max-width: 0; }
  .hamburger { display: flex; }
  .nav-container { width: min(1200px, 100% - 1.4rem); }
}

@media (max-width: 480px) {
  .nav-logo .logo-text { width: 59px; height: 20px; }
  .search-modal { width: calc(100% - 1rem); padding: .95rem; }
}
