/* ═══════════════════════════════════════════════════════════════
   MetaWave — Header & Footer  (Apple-style glassmorphism)
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─────────────────────────────────── */
:root {
  --mw-header-h: 72px;
  --mw-glass-bg: rgba(255, 255, 255, 0.72);
  --mw-glass-border: rgba(255, 255, 255, 0.35);
  --mw-glass-blur: 20px;
  --mw-glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --mw-text-primary: #0F172A;
  --mw-text-secondary: #475569;
  --mw-blue: #1e40af;
  --mw-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --mw-footer-dark: #0a0a0f;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

.mw-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: var(--mw-header-h);
  transition: background 0.5s var(--mw-ease),
              backdrop-filter 0.5s var(--mw-ease),
              -webkit-backdrop-filter 0.5s var(--mw-ease),
              box-shadow 0.5s var(--mw-ease),
              border-color 0.5s var(--mw-ease);
  /* Transparent by default */
  background: transparent;
  border-bottom: 1px solid transparent;
}

/* Scrolled state — frosted glass */
.mw-header.is-scrolled {
  background: var(--mw-glass-bg);
  -webkit-backdrop-filter: saturate(180%) blur(var(--mw-glass-blur));
          backdrop-filter: saturate(180%) blur(var(--mw-glass-blur));
  border-bottom-color: var(--mw-glass-border);
  box-shadow: var(--mw-glass-shadow);
}

.mw-header-spacer {
  height: var(--mw-header-h);
}

/* Inner container */
.mw-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* ── Logo ── */
.mw-header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.3s var(--mw-ease);
}
.mw-header__logo:hover { opacity: 0.8; }
.mw-header__logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

/* ── Desktop Navigation ── */
.mw-header__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

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

.mw-nav-list > .menu-item > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--mw-text-primary);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.25s var(--mw-ease),
              background 0.25s var(--mw-ease);
}

/* Transparent state — white text on dark hero */
.mw-header:not(.is-scrolled) .mw-nav-list > .menu-item > a {
  color: rgba(255, 255, 255, 0.9);
}
.mw-header:not(.is-scrolled) .mw-nav-list > .menu-item > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Scrolled state — dark text on glass */
.mw-header.is-scrolled .mw-nav-list > .menu-item > a:hover {
  color: var(--mw-blue);
  background: rgba(30, 64, 175, 0.06);
}

/* Active/current page */
.mw-nav-list > .current-menu-item > a,
.mw-nav-list > .current-menu-ancestor > a {
  color: var(--mw-blue) !important;
}
.mw-header:not(.is-scrolled) .mw-nav-list > .current-menu-item > a,
.mw-header:not(.is-scrolled) .mw-nav-list > .current-menu-ancestor > a {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.15);
}

/* ── Dropdown (sub-menu) ── */
.mw-nav-list > .menu-item-has-children {
  position: relative;
}
.mw-nav-list > .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s var(--mw-ease);
}
.mw-nav-list > .menu-item-has-children:hover > a::after {
  transform: rotate(225deg) translateY(0);
}

.mw-nav-list .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 260px;
  padding: 8px;
  list-style: none;
  background: var(--mw-glass-bg);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
          backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--mw-glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
              0 1px 2px rgba(0, 0, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--mw-ease),
              transform 0.3s var(--mw-ease),
              visibility 0.3s;
}
.mw-nav-list > .menu-item-has-children:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mw-nav-list .sub-menu .menu-item a {
  display: block;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mw-text-primary);
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.2s var(--mw-ease),
              color 0.2s var(--mw-ease);
}
.mw-nav-list .sub-menu .menu-item a:hover {
  background: rgba(30, 64, 175, 0.08);
  color: var(--mw-blue);
}

/* ── CTA Button ── */
.mw-header__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mw-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s var(--mw-ease);
}

/* Transparent state — outlined CTA */
.mw-header:not(.is-scrolled) .mw-header__cta {
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}
.mw-header:not(.is-scrolled) .mw-header__cta:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

/* Scrolled state — filled CTA */
.mw-header.is-scrolled .mw-header__cta {
  color: #fff;
  background: var(--mw-blue);
  border: 1.5px solid var(--mw-blue);
}
.mw-header.is-scrolled .mw-header__cta:hover {
  background: #1d3faa;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3);
  transform: translateY(-1px);
}

/* ── Hamburger ── */
.mw-header__toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mw-hamburger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 24px;
  height: 24px;
  margin: auto;
}
.mw-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--mw-text-primary);
  transition: all 0.35s var(--mw-ease);
  transform-origin: center;
}
.mw-header:not(.is-scrolled) .mw-hamburger span {
  background: #fff;
}

/* Hamburger X state */
.mw-header__toggle[aria-expanded="true"] .mw-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mw-header__toggle[aria-expanded="true"] .mw-hamburger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mw-header__toggle[aria-expanded="true"] .mw-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Drawer ── */
.mw-mobile-drawer {
  display: none;
  position: absolute;
  top: var(--mw-header-h);
  left: 0;
  right: 0;
  max-height: calc(100dvh - var(--mw-header-h));
  overflow-y: auto;
  background: var(--mw-glass-bg);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
          backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--mw-glass-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  padding: 16px 24px 24px;
  animation: mwDrawerSlide 0.35s var(--mw-ease) forwards;
}
.mw-mobile-drawer.is-open {
  display: block;
}
@keyframes mwDrawerSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mw-mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mw-mobile-nav-list .menu-item a {
  display: block;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--mw-text-primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: color 0.2s;
}
.mw-mobile-nav-list .menu-item a:hover {
  color: var(--mw-blue);
}
.mw-mobile-nav-list .sub-menu {
  list-style: none;
  padding: 0 0 0 16px;
}
.mw-mobile-nav-list .sub-menu .menu-item a {
  font-size: 14px;
  color: var(--mw-text-secondary);
  padding: 10px 0;
}

.mw-mobile-drawer__cta {
  padding-top: 16px;
}
.mw-header__cta--mobile {
  display: flex;
  width: 100%;
  justify-content: center;
  color: #fff !important;
  background: var(--mw-blue) !important;
  border: none !important;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.mw-footer {
  position: relative;
  background: var(--mw-footer-dark);
  color: #fff;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Glossy glow orbs */
.mw-footer__glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
}
.mw-footer__glow--1 {
  width: 500px;
  height: 500px;
  top: -20%;
  left: -5%;
  background: radial-gradient(circle, rgba(30, 64, 175, 0.15) 0%, transparent 70%);
}
.mw-footer__glow--2 {
  width: 400px;
  height: 400px;
  bottom: -15%;
  right: -5%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
}

/* Glass overlay on the footer (subtle) */
.mw-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.01) 100%
  );
  pointer-events: none;
}

.mw-footer__main {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px 48px;
}

.mw-footer__grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1.2fr;
  gap: 40px;
}

/* ── Brand column ── */
.mw-footer__heading-lg {
  font-family: 'Phudu', sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 32px;
}
.mw-footer__heading-accent {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mw-footer__label {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

/* ── Newsletter ── */
.mw-footer__newsletter-form {
  margin: 0;
}
.mw-footer__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s;
}
.mw-footer__input-wrap:focus-within {
  border-color: rgba(96, 165, 250, 0.5);
}
.mw-footer__input-icon {
  position: absolute;
  left: 16px;
  opacity: 0.35;
  pointer-events: none;
}
.mw-footer__input-wrap input {
  flex: 1;
  padding: 14px 16px 14px 48px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.mw-footer__input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.mw-footer__input-wrap button {
  flex-shrink: 0;
  width: 52px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.mw-footer__input-wrap button:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ── Links ── */
.mw-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mw-footer__links li + li {
  margin-top: 12px;
}
.mw-footer__links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.25s var(--mw-ease);
}
.mw-footer__links a:hover {
  color: #fff;
}

/* ── Contact ── */
.mw-footer__contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mw-footer__contact a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.25s;
}
.mw-footer__contact a:hover {
  color: #fff;
}
.mw-footer__contact p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.7;
  margin: 4px 0 0;
}

/* ── Bottom bar ── */
.mw-footer__bottom {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.mw-footer__bottom-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.mw-footer__bottom-logo img {
  height: 32px;
  width: auto;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 0.3s;
}
.mw-footer__bottom-logo:hover img {
  opacity: 1;
}
.mw-footer__copyright {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}

/* Scroll-to-top */
.mw-footer__scroll-top {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}
.mw-footer__scroll-top:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .mw-header__nav { display: none; }
  .mw-header__toggle { display: flex; }
  .mw-header__cta:not(.mw-header__cta--mobile) { display: none; }

  .mw-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px 32px;
  }
  .mw-footer__col--brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  :root {
    --mw-header-h: 64px;
  }
  .mw-header__logo img { height: 30px; }
  .mw-header__inner { padding: 0 16px; }

  .mw-footer__main { padding: 48px 16px 32px; }
  .mw-footer__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .mw-footer__heading-lg { font-size: 26px; }
  .mw-footer__bottom-inner { padding: 16px; }
  .mw-footer__bottom-inner {
    flex-wrap: wrap;
    justify-content: center;
  }
  .mw-footer__copyright { order: 3; width: 100%; text-align: center; }
}
