/* Port of src/components/shared/Navigation.astro styles.
   SCSS :global() wrappers flattened to plain selectors. */

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--primary);
  z-index: 1100;
  pointer-events: none;
  transform-origin: left;
  transition: width 0.1s linear;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 6px 10px;
  background: transparent;
  pointer-events: none;
}

@media (min-width: 901px) {
  .header { padding: 10px; }
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: min(96vw, 1200px);
  height: 52px;
  padding: 4px 4px 4px 10px;
  background-color: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--nav-border);
  border-radius: 9999px;
  box-shadow: var(--shadow-md);
  pointer-events: all;
  position: relative;
  z-index: 1;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

@media (min-width: 901px) {
  .nav-pill {
    height: auto;
    min-height: 52px;
    max-width: min(96vw, 1300px);
    padding: 10px;
  }
}

.nav-pill:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(27, 84, 216, 0.15);
}

.desktop-nav { display: none; }

@media (min-width: 901px) {
  .desktop-nav { display: block; }
}

.nav-list {
  display: flex;
  gap: 15px;
  list-style: none;
  position: relative;
}

@media (min-width: 901px) and (max-width: 1050px) {
  .nav-list { gap: 8px; }
}

.nav-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  height: 32px;
  background: var(--nav-active-bg);
  border: 1px solid var(--nav-active-border);
  border-radius: 9999px;
  transform: translate3d(0, -50%, 0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.nav-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--nav-text);
  transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 6px 10px;
  white-space: nowrap;
  border-radius: 9999px;
  position: relative;
  z-index: 1;
  display: block;
}

@media (min-width: 1051px) {
  .nav-link {
    font-size: var(--fs-small);
    padding: 6px 12px;
  }
}

.nav-link:hover { color: var(--nav-hover-text); }

.nav-link.active {
  color: var(--nav-active-text);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

@media (min-width: 901px) {
  .header-actions { gap: 8px; }
}

.header-theme-toggle {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-theme-toggle .theme-toggle {
  width: 40px;
  height: 40px;
  border: 1.5px solid #1a2332;
  background: #1a2332;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(26, 35, 50, 0.22);
  border-radius: 9999px;
}

.header-theme-toggle .theme-toggle:hover {
  background: #243044;
  border-color: #243044;
  box-shadow: 0 4px 16px rgba(26, 35, 50, 0.28);
}

.header-theme-toggle .theme-toggle .theme-icon-sun,
.header-theme-toggle .theme-toggle .theme-icon-moon {
  color: #fbbf24;
}

html[data-theme='dark'] .header-theme-toggle .theme-toggle {
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-radius: 9999px;
}

html[data-theme='dark'] .header-theme-toggle .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.55);
}

html[data-theme='dark'] .header-theme-toggle .theme-icon-sun { color: #fbbf24; }
html[data-theme='dark'] .header-theme-toggle .theme-icon-moon { color: #f8fafc; }

.desktop-cta {
  font-weight: var(--fw-extrabold) !important;
  display: none;
  padding: 0 14px 0 16px !important;
}

@media (min-width: 901px) {
  .desktop-cta { display: inline-flex; }
}

.mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 40px;
  height: 40px;
  background: #1a2332;
  border: 1.5px solid #1a2332;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  border-radius: 9999px;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(26, 35, 50, 0.22);
  transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.mobile-toggle:hover {
  background: #243044;
  border-color: #243044;
}

.mobile-toggle:active { transform: scale(0.96); }

[data-theme='dark'] .mobile-toggle {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme='dark'] .mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.55);
}

@media (min-width: 901px) {
  .mobile-toggle { display: none; }
}

.mobile-toggle .toggle-icon {
  position: absolute;
  color: #ffffff;
  stroke: #ffffff;
  stroke-width: 2;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-toggle .menu-icon {
  opacity: 1;
  transform: scale(1);
}

.mobile-toggle .close-icon {
  opacity: 0;
  transform: scale(0.85);
}

.mobile-toggle.active .menu-icon {
  opacity: 0;
  transform: scale(0.85);
}

.mobile-toggle.active .close-icon {
  opacity: 1;
  transform: scale(1);
}

/* Mobile drawer */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
  visibility: hidden;
}

.mobile-menu.open {
  pointer-events: auto;
  visibility: visible;
}

.mobile-menu.open .mobile-menu-backdrop { opacity: 1; }
.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }

.mobile-menu.open .mobile-nav-list li {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: none;
  padding: 0;
  background: rgba(8, 12, 20, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.35s ease;
}

.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(90vw, 380px);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--nav-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--nav-border);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.28);
  transform: translateX(100%);
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  z-index: 2;
}

.mobile-menu-panel::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: var(--hero-orb-blue);
  border-radius: 50%;
  pointer-events: none;
}

.mobile-menu-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--nav-border);
}

.mobile-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-theme-toggle {
  display: flex;
  align-items: center;
}

.mobile-theme-toggle .theme-toggle {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--nav-border);
  background: var(--nav-active-bg);
  color: var(--nav-heading);
  box-shadow: none;
}

.mobile-theme-toggle .theme-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.mobile-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 9999px;
  background: var(--primary-light);
  color: var(--nav-heading);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mobile-panel-close:hover {
  background: rgba(27, 84, 216, 0.16);
  color: var(--primary-hover);
}

.mobile-panel-close:active { transform: scale(0.96); }

.mobile-menu-head {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--nav-border);
}

.mobile-menu-eyebrow {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-hover);
  margin-bottom: 6px;
}

.mobile-menu-tagline {
  font-size: var(--fs-small);
  color: var(--nav-muted);
  font-weight: var(--fw-medium);
  margin: 0;
}

.mobile-menu-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  justify-content: space-between;
  gap: 20px;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.mobile-nav-list li {
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-list li:nth-child(1) { transition-delay: 0.09s; }
.mobile-nav-list li:nth-child(2) { transition-delay: 0.13s; }
.mobile-nav-list li:nth-child(3) { transition-delay: 0.17s; }
.mobile-nav-list li:nth-child(4) { transition-delay: 0.21s; }
.mobile-nav-list li:nth-child(5) { transition-delay: 0.25s; }
.mobile-nav-list li:nth-child(6) { transition-delay: 0.29s; }
.mobile-nav-list li:nth-child(7) { transition-delay: 0.33s; }

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  font-weight: var(--fw-semibold);
  color: var(--nav-heading);
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mobile-nav-link svg {
  flex-shrink: 0;
  color: var(--nav-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.mobile-nav-link:hover {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
  color: var(--nav-hover-text);
}

.mobile-nav-link:hover svg {
  color: var(--nav-hover-text);
  transform: translateX(2px);
}

.mobile-nav-link.active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
  color: var(--nav-active-text);
  font-weight: var(--fw-bold);
}

.mobile-nav-link.active svg { color: var(--nav-active-text); }

.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.mobile-menu-actions .btn {
  font-weight: var(--fw-extrabold) !important;
}

.mobile-menu-actions-label {
  margin: 0 0 4px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Disable body scroll when mobile menu is open */
body.menu-open { overflow: hidden; }
