/* =====================================================
   HEADER — Floating Pill Navigation
   ===================================================== */

:root {
  --header-pill-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-exit-ease: cubic-bezier(0.45, 0, 0.2, 1);
  --header-nav-font-size: 15px;
  --header-nav-line-height: 20px;
  --header-nav-font-weight: 400;
  --header-button-font-size: 15px;
  --header-label-font-size: 12px;
  --header-label-line-height: 15px;
}

/* Outer wrapper: fixed, full-width, no bg — clicks pass through transparent areas */
.site-header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  pointer-events: none;
  padding: 0;
  transform: translateY(0) scale(1);
  transform-origin: top center;
  transition:
    transform 440ms var(--header-exit-ease),
    padding   380ms var(--header-exit-ease);
}

.site-header-wrapper.scrolled {
  padding: 0 1rem;
  transform: translateY(0.75rem) scale(0.992);
  transition:
    transform 520ms var(--header-pill-ease),
    padding   420ms var(--header-pill-ease);
}

/* Inner pill container */
.header-inner {
  pointer-events: auto;
  margin: 0 auto;
  width: 100%;
  max-width: 78rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  transform: translateY(-0.125rem);
  transform-origin: top center;
  will-change: max-width, border-radius, background-color, box-shadow, transform;
  transition:
    max-width        420ms var(--header-exit-ease),
    border-radius    420ms var(--header-exit-ease),
    transform        420ms var(--header-exit-ease),
    background-color 320ms var(--header-exit-ease),
    border-color     260ms var(--header-exit-ease),
    box-shadow       260ms var(--header-exit-ease),
    backdrop-filter  300ms var(--header-exit-ease);
}

.site-header-wrapper.scrolled .header-inner {
  max-width: 74rem;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(226, 232, 240, 0.85);
  box-shadow:
    0 18px 48px -28px rgba(15, 23, 42, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(14px) saturate(1.6);
  transform: translateY(0);
  transition:
    max-width        520ms var(--header-pill-ease),
    border-radius    520ms var(--header-pill-ease),
    transform        520ms var(--header-pill-ease),
    background-color 300ms ease,
    border-color     280ms ease,
    box-shadow       520ms var(--header-pill-ease) 60ms,
    backdrop-filter  320ms ease;
}

/* Main nav row */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 1.5rem;
  height: 76px;
  transition:
    padding 420ms var(--header-exit-ease),
    height  420ms var(--header-exit-ease);
}

.site-header-wrapper.scrolled .main-nav {
  padding: 0 10px 0 1.25rem;
  height: 64px;
  transition:
    padding 420ms var(--header-pill-ease),
    height  420ms var(--header-pill-ease);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
}

.logo-img-wrap {
  position: relative;
  height: 44px;
  width: 76px;
  flex-shrink: 0;
}

.logo-img-wrap img {
  height: 100%;
  width: 100%;
  object-fit: contain;
}

/* Dual logo switching: color vs white */
.logo .logo-color,
.logo .logo-white {
  display: block;
  height: 100%;
  width: 100%;
  transition: opacity 280ms var(--header-pill-ease);
}

.logo .logo-white {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

/* Hero: transparent header → show white logo */
.site-header-wrapper:not(.scrolled) .logo .logo-color { opacity: 0; }
.site-header-wrapper:not(.scrolled) .logo .logo-white { opacity: 1; }

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.logo-title {
  font-size: 12.5px;
  line-height: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--color-primary, #0033b3);
  transition: color 280ms ease;
  white-space: nowrap;
}

.logo-subtitle {
  font-size: 10.5px;
  line-height: 13px;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: #64748b;
  transition: color 280ms ease;
  white-space: nowrap;
}

/* Hero: transparent header */
.site-header-wrapper:not(.scrolled) .logo-title {
  color: #ffffff;
}

.site-header-wrapper:not(.scrolled) .logo-subtitle {
  color: rgba(255, 255, 255, 0.78);
}

/* Desktop nav links */
.main-nav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}

.main-nav-links a {
  padding: 9px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: var(--header-nav-font-size);
  line-height: var(--header-nav-line-height);
  font-weight: var(--header-nav-font-weight);
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.18s ease;
}

.site-header-wrapper.scrolled .main-nav-links a {
  color: #4b5563;
}

.main-nav-links a:hover {
  color: #ffffff;
  background: transparent;
  text-decoration: none;
}

.site-header-wrapper.scrolled .main-nav-links a:hover {
  color: #0033b3;
  background: transparent;
  text-decoration: none;
}

/* Progressive hide on narrower screens */
@media (max-width: 900px) {
  .main-nav-links a[href="#faq"],
  .main-nav-links a[href="#kanka"] { display: none; }
}
@media (max-width: 780px) {
  .main-nav-links a[href="#modules"] { display: none; }
}
@media (max-width: 640px) {
  .main-nav-links { display: none; }
}

/* Right action area */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Nav Login Button specific sizing ── */
.nav-login-button {
  padding: 9px 20px;
  font-size: 14.5px;
  min-height: 40px;
}

/* ── Responsive tweaks ── */
@media (max-width: 1200px) {
  .main-nav { padding: 0 16px 0 1.25rem; }
  .site-header-wrapper.scrolled .main-nav { padding: 0 10px 0 1.25rem; }
}

@media (max-width: 768px) {
  .main-nav { padding: 0 1.25rem; height: 64px; }
  .logo-img-wrap { height: 38px; width: 66px; }
  .logo-title { font-size: 11.5px; line-height: 14px; }
  .logo-subtitle { font-size: 9.5px; line-height: 12px; }
}

@media (max-width: 480px) {
  .main-nav { padding: 0 1rem; height: 58px; }
  .logo-img-wrap { height: 32px; width: 55px; }
  .logo-title { font-size: 10.5px; line-height: 13px; }
  .logo-subtitle { font-size: 8.5px; line-height: 11px; }
  .nav-login-button { font-size: 13px; }
}
