/* === header.css === */
/* =========================================================
   === HEADER (frosted always, stronger on scroll)
   ========================================================= */

.header{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 20;

  background: rgba(255,255,255,0.40);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);

  border-bottom: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);

  transition:
    background .25s ease,
    backdrop-filter .25s ease,
    box-shadow .25s ease,
    border-color .25s ease;
}

.header.is-scrolled{
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(18px) saturate(1.7);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);

  border-bottom-color: rgba(0,0,0,0.10);
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
}

.header .container{
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Brand */
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; }
.brand__logo{
  width: 34px; height: 34px; border-radius: 10px;
  object-fit: cover; border: 1px solid var(--line);
}
.brand__name{ color: var(--primary); }

/* Right side */
.header__right{ display:flex; align-items:center; gap:16px; }

/* Nav */
.nav a{
  font-size: 14px;
  color: rgba(7,19,15,.72);
  padding: 8px 10px;
  border-radius: 999px;
}
.nav a:hover{
  background: rgba(0,90,187,.10);
  color: rgba(7,19,15,.92);
}

/* === header.css === */
/* =========================================================
   === HEADER (frosted always, stronger on scroll)
   ========================================================= */

.header{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 20;

  background: rgba(255,255,255,0.40);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);

  border-bottom: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);

  transition:
    background .25s ease,
    backdrop-filter .25s ease,
    box-shadow .25s ease,
    border-color .25s ease;
}

.header.is-scrolled{
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(18px) saturate(1.7);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);

  border-bottom-color: rgba(0,0,0,0.10);
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
}

.header .container{
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Brand */
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; }
.brand__logo{
  width: 34px; height: 34px; border-radius: 10px;
  object-fit: cover; border: 1px solid var(--line);
}
.brand__name{ color: var(--primary); }

/* Right side */
.header__right{ display:flex; align-items:center; gap:16px; }

/* Nav */
.nav a{
  font-size: 14px;
  color: rgba(7,19,15,.72);
  padding: 8px 10px;
  border-radius: 999px;
}
.nav a:hover{
  background: rgba(0,90,187,.10);
  color: rgba(7,19,15,.92);
}
/* =========================================================
   === MOBILE HEADER (PHONES ONLY)
   ========================================================= */

/* Default: burger hidden */
.mobile-menu-toggle,
.mobile-menu,
.mobile-menu-overlay {
  display: none;
}

/* Phones only */
@media (max-width: 390px) {

  /* Hide desktop nav + CTA */
  .header .nav,
  .header .btn--primary {
    display: none !important;
  }

  /* Show burger */
  .mobile-menu-toggle {
    display: flex !important;
  }

  /* Ensure header layout allows it */
  .header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .header__right {
    display: none;
  }

  /* Mobile menu system */
  .mobile-menu {
    display: block;
  }

  .mobile-menu-overlay {
    display: block;
  }
}

/* =========================================================
   === MOBILE MENU (PHONES ONLY <= 820px) — FINAL OVERRIDE
   ========================================================= */

/* default hidden */
.mobile-menu-toggle,
.mobile-menu,
.mobile-menu-overlay{ display:none !important; }

/* phones */
@media (max-width: 820px){
  .nav{ display:none !important; }
  .header__right .btn--primary{ display:none !important; }

  .mobile-menu-toggle{ display:flex !important; }

  /* burger button visibility */
  .mobile-menu-toggle{
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.10);
    z-index: 1101;
  }

  /* overlay must be opaque */
  .mobile-menu-overlay{
    display:block !important;
    position: fixed;
    inset: 0;
    background: rgba(7,19,15,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 1100;
  }
  .mobile-menu-overlay.is-open{
    opacity: 1;
    pointer-events: auto;
  }

  /* panel must be solid */
  .mobile-menu{
    display:block !important;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #ffffff;
    opacity: 1;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: -10px 0 30px rgba(0,0,0,0.18);
    transition: right .28s ease;
    z-index: 1102;
    padding: 84px 18px 18px;
  }
  .mobile-menu.is-open{ right: 0; }

  /* IMPORTANT: do NOT kill header__right entirely, just hide nav+cta above */
  .header__right{ display:flex !important; }
}
/* ================================
   MOBILE MENU — HARD OVERRIDE
   ================================ */

/* default hidden */
.mobile-menu-toggle,
.mobile-menu,
.mobile-menu-overlay { display: none !important; }

@media (max-width: 820px){
  .nav { display: none !important; }
  .header__right .btn--primary { display: none !important; }

  .mobile-menu-toggle{
    display: grid !important;
    place-items: center !important;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fff !important;
    border: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
    z-index: 100000 !important;
    position: relative;
  }

  /* OVERLAY */
  .mobile-menu-overlay{
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.55) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .25s ease !important;
    z-index: 99990 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .mobile-menu-overlay.is-open{
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* PANEL */
  .mobile-menu{
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 280px !important;
    height: 100vh !important;
    background: #ffffff !important;
    opacity: 1 !important;
    box-shadow: -12px 0 30px rgba(0,0,0,.18) !important;
    transition: right .28s ease !important;
    z-index: 99999 !important;
    padding: 84px 18px 18px !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .mobile-menu.is-open{ right: 0 !important; }
}
/* =========================================================
   === MOBILE MENU: PHONES ONLY (<= 820px)
   === Tablets (>= 821px) keep desktop nav + CTA
   ========================================================= */

/* Default (tablet/desktop): burger system OFF */
.mobile-menu-toggle,
.mobile-menu,
.mobile-menu-overlay{
  display: none !important;
}

/* Phones: burger ON, desktop nav/CTA OFF */
@media (max-width: 820px){
  .header__right{ display: none !important; }   /* hides nav + CTA block */
  .mobile-menu-toggle{ display: grid !important; }

  /* Burger button visible and clickable */
  .mobile-menu-toggle{
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.88);
    box-shadow: 0 10px 26px rgba(0,0,0,0.12);
    padding: 0;
  }

  .mobile-menu-toggle span{
    display: block;
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: rgba(7,19,15,0.82);
    margin: 2px 0;
  }

  /* Overlay: NOT transparent */
  .mobile-menu-overlay{
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(7,19,15,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    z-index: 999;
  }
  .mobile-menu-overlay.is-open{
    opacity: 1;
    pointer-events: auto;
  }

  /* Panel: solid background */
  .mobile-menu{
    display: block !important;
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid rgba(0,0,0,0.08);
    box-shadow: -14px 0 40px rgba(0,0,0,0.18);
    padding: calc(var(--header-h) + 18px) 18px 18px;
    transition: right .22s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  .mobile-menu.is-open{ right: 0; }

  .mobile-menu nav{
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .mobile-menu nav a{
    padding: 12px 12px;
    border-radius: 12px;
    color: rgba(7,19,15,0.90);
    text-decoration: none;
    font-weight: 600;
  }
  .mobile-menu nav a:hover{
    background: rgba(0,90,187,0.08);
  }

  /* Animate burger → X */
  .mobile-menu-toggle.is-open span:nth-child(1){
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-menu-toggle.is-open span:nth-child(2){
    opacity: 0;
  }
  .mobile-menu-toggle.is-open span:nth-child(3){
    transform: translateY(-7px) rotate(-45deg);
  }
}
