/* ======================================
   Header + Mobile Drawer (Clean & Fancy)
   ====================================== */

/* Base */
body{ margin:0; }
html.no-scroll, body.no-scroll{ overflow:hidden; }

/* Header */
.site-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 14px 0;
  background: rgba(10,12,24,.55);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner{
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Header cleanup (scope) */
.site-header *, .site-header *::before, .site-header *::after{ box-sizing:border-box; }
.site-header a{ text-decoration:none; }
.site-header ul, .site-header ol{ list-style:none; margin:0; padding:0; }
.site-header img{ display:block; max-width:100%; height:auto; }
.site-header .custom-logo-link{ display:inline-flex; align-items:center; line-height:1; }

/* Logo */
.site-logo,
.site-branding img{
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .12em;
  color: #fff;
}

/* Desktop nav */
.site-nav{ flex: 1 1 auto; min-width: 0; }
.site-nav .nav-menu{ display:flex; gap:16px; }
.site-nav .nav-menu > li > a{
  display:inline-flex;
  align-items:center;
  line-height:1;
  font-size:13px;
  padding:8px 12px;
  border-radius:999px;
  color: rgba(255,255,255,.75);
  transition: .2s;
}
.site-nav .nav-menu > li > a:hover{
  background: rgba(255,255,255,.08);
  color:#fff;
}

/* CTA buttons */
.header-cta{
  display:flex;
  gap:10px;
  flex: 0 0 auto;
}
.header-cta .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  line-height:1;
  padding:9px 14px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
  border:1px solid rgba(255,255,255,.18);
}
.btn-ghost{ background: rgba(255,255,255,.05); color:#fff; }
.btn-primary{
  background: linear-gradient(135deg,#7c3aed,#22d3ee);
  color:#fff;
  border:none;
  box-shadow: 0 8px 30px rgba(124,58,237,.4);
}

/* Moon/Sun button */
.nav-toggle{
  display:none; /* mobile only */
  width:44px;
  height:44px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.05);
  align-items:center;
  justify-content:center;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  font:inherit;
  color:inherit;
}
.nav-toggle__icon{
  display:inline-block;
  font-size:18px;
  line-height:1;
  transform-origin:50% 50%;
}
.nav-toggle.is-spin .nav-toggle__icon{
  animation: moon-spin .55s ease;
}
@keyframes moon-spin{ from{transform:rotate(0)} to{transform:rotate(360deg)} }

/* ======================================
   Mobile Drawer (overlay + slide + stagger)
   ====================================== */
.mobile-nav{
  position:fixed;
  inset:0;
  z-index:2000;
  pointer-events:none; /* closed: click-through */
}
.mobile-nav.is-open{ pointer-events:auto; }

.mobile-nav__overlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.42);
  opacity:0;
  transition: opacity .22s ease;
  backdrop-filter: blur(3px);
}
.mobile-nav.is-open .mobile-nav__overlay{ opacity:1; }

.mobile-nav__panel{
  position:absolute;
  top:0;
  right:0;
  height:100%;
  width: min(360px, 88vw);
  background: rgba(10,12,24,.94);
  border-left: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 20px 80px rgba(0,0,0,.45);

  padding:16px;
  display:flex;
  flex-direction:column;
  gap:14px;

  transform: translateX(18px) scale(.98);
  opacity:0;
  transition: transform .26s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
}
.mobile-nav.is-open .mobile-nav__panel{
  transform: translateX(0) scale(1);
  opacity:1;
}

.mobile-nav__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-bottom:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.mobile-nav__title{
  font-weight:900;
  letter-spacing:.08em;
  color:#fff;
  font-size:13px;
  opacity:.95;
}
.mobile-nav__close{
  width:42px;
  height:42px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color:#fff;
  font-size:22px;
  line-height:1;
  cursor:pointer;
  transition: transform .18s ease, background .18s ease;
}
.mobile-nav__close:hover{
  background: rgba(255,255,255,.10);
  transform: rotate(6deg);
}

/* Menu list */
.mobile-menu{
  margin:6px 0 0;
  padding:0;
  display:grid;
  gap:10px;
}

/* Stagger enter */
.mobile-nav .mobile-menu > li{
  transform: translateY(8px);
  opacity:0;
  transition: transform .26s ease, opacity .26s ease;
}
.mobile-nav.is-open .mobile-menu > li{
  transform: translateY(0);
  opacity:1;
}
.mobile-nav.is-open .mobile-menu > li:nth-child(1){ transition-delay:.04s; }
.mobile-nav.is-open .mobile-menu > li:nth-child(2){ transition-delay:.06s; }
.mobile-nav.is-open .mobile-menu > li:nth-child(3){ transition-delay:.08s; }
.mobile-nav.is-open .mobile-menu > li:nth-child(4){ transition-delay:.10s; }
.mobile-nav.is-open .mobile-menu > li:nth-child(5){ transition-delay:.12s; }
.mobile-nav.is-open .mobile-menu > li:nth-child(6){ transition-delay:.14s; }
.mobile-nav.is-open .mobile-menu > li:nth-child(7){ transition-delay:.16s; }
.mobile-nav.is-open .mobile-menu > li:nth-child(8){ transition-delay:.18s; }

/* Menu link cards */
.mobile-menu a{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;

  padding:14px 14px;
  border-radius:16px;

  color: rgba(255,255,255,.88);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.10);

  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.mobile-menu a::before{
  content:"";
  width:10px;
  height:10px;
  border-radius:999px;
  background: rgba(255,255,255,.35);
  box-shadow: 0 0 0 4px rgba(255,255,255,.06);
  flex:0 0 auto;
}
.mobile-menu a::after{
  content:"›";
  margin-left:auto;
  font-size:20px;
  opacity:.75;
  transform: translateX(-2px);
  transition: transform .18s ease, opacity .18s ease;
}
.mobile-menu a:hover{
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border-color: rgba(255,255,255,.18);
}
.mobile-menu a:hover::after{ transform: translateX(0); opacity:1; }

/* Current page highlight */
.mobile-menu .current-menu-item > a,
.mobile-menu .current_page_item > a{
  border-color: rgba(34,211,238,.35);
  background: linear-gradient(135deg, rgba(124,58,237,.22), rgba(34,211,238,.16));
}

/* Submenu */
.mobile-menu .sub-menu{
  margin:8px 0 0;
  padding:0 0 0 10px;
  display:grid;
  gap:8px;
}
.mobile-menu .sub-menu a{
  padding:12px 12px;
  border-radius:14px;
  opacity:.95;
}
.mobile-menu .sub-menu a::before{
  width:8px;
  height:8px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}
.mobile-menu .sub-menu a::after{ font-size:18px; }

/* Drawer CTA */
.mobile-nav__cta{
  margin-top:auto;
  padding-top:12px;
  border-top:1px solid rgba(255,255,255,.08);
  display:grid;
  gap:10px;
}
.mobile-nav__cta .btn{
  text-align:center;
  padding:12px 14px;
  border-radius:16px;
}

/* ======================================
   Responsive
   ====================================== */
@media (max-width:1024px){
  .header-inner{
    width: min(960px, calc(100% - 24px));
    gap:12px;
  }
  .site-nav .nav-menu{ gap:10px; }
  .site-nav .nav-menu > li > a{
    padding:8px 10px;
    font-size:12.5px;
  }
  .header-cta{ gap:8px; }
  .header-cta .btn{
    padding:8px 12px;
    font-size:12.5px;
  }
}

@media (max-width:768px){
  .site-header{ padding:10px 0; }

  .header-inner{
    flex-wrap:wrap;
    row-gap:10px;
  }

  .site-nav{ display:none !important; }
  .nav-toggle{ display:inline-flex !important; }

  .site-branding{ flex:1 1 auto; min-width:160px; }

  .header-cta{
    flex:0 0 100%;
    flex-wrap:wrap;
    gap:8px;
  }
  .header-cta .btn{
    flex:1 1 calc(50% - 4px);
    min-height:40px;
    padding:10px 12px;
    font-size:13px;
  }
  .header-cta .btn-primary{ flex:1 1 100%; }
}

@media (max-width:420px){
  .site-logo,
  .site-branding img{
    font-size:14px;
    letter-spacing:.08em;
  }
  .header-cta .btn{
    padding:10px 10px;
    font-size:12.5px;
  }
}

/* Admin bar offset */
body.admin-bar .site-header{ top:32px; }
@media (max-width:782px){
  body.admin-bar .site-header{ top:46px; }
}

/* Blur fallback */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))){
  .site-header{ background: rgba(10,12,24,.9); }
}
