
/* ════════════════════════════════════════════════════════
   ROOT CAUSE FIX — kill horizontal overflow at every level
   This stops the page from being scrollable sideways, which
   stops the drawer from drifting when scrolled.
   ════════════════════════════════════════════════════════ */
* { max-width: 100vw; }
html, body {
  overflow-x: clip !important;
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100vw !important;
  position: relative;
}
/* Constrain the cosmos / ambient backdrop blobs */
.cosmos, .cosmos::before, .cosmos::after,
.stars, .ambient,
.home-cta-portal {
  max-width: 100vw !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  contain: strict !important;
}
/* If any blob still tries to be larger than viewport, clip the container */
.cosmos { overflow: hidden !important; }

/* Prevent any section from breaking out horizontally */
section, main, article, header, footer, aside, nav, div {
  max-width: 100vw;
}

/* ANTI-OVERFLOW — prevent horizontal scroll on mobile */
html, body {
  overflow-x: hidden !important;
  position: relative;
  width: 100%;
  max-width: 100vw;
}
* {
  max-width: 100%;
}
/* Anything fixed/absolute that uses transforms should stay within viewport */
.cosmos, .stars, #particles {
  contain: strict;
}
/* Drawer should always be fixed and not affected by parent transforms */
.drawer-backdrop, .drawer {
  contain: layout style;
}

/* CRITICAL CSS — Always loaded, survives LiteSpeed minification */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient backdrop */
.cosmos {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 30% 20%, #0a1828 0%, #000 60%);
  pointer-events: none;
}

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 1.25rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 0.5px solid rgba(255,255,255,0.05);
}
.nav-brand {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 22px;
  color: #fff;
  text-decoration: none;
}
.nav-brand .glow {
  color: #5a92c2;
  text-shadow: 0 0 30px rgba(90,146,194,0.7);
}
.nav-brand em { font-style: italic; }

.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
@media (min-width: 900px) {
  .nav-links { display: flex; }
}
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: #5a92c2;
}

.nav-cta {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
}
@media (max-width: 900px) {
  .nav-cta { display: none; }
}

/* Hamburger */
.nav-burger {
  display: none;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
}
.nav-burger span {
  display: block;
  width: 16px; height: 1.5px;
  background: #fff;
  border-radius: 1px;
}
@media (max-width: 900px) { .nav-burger { display: flex; } }

/* Drawer — bulletproof iOS fixed positioning */
.drawer-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0,0,0,0.6);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  /* Force own compositing layer for iOS */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: opacity;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 86%;
  max-width: 420px;
  height: 100vh;
  height: 100dvh;
  z-index: 1300;
  background: #0d121c;
  background: linear-gradient(180deg, #0d121c 0%, #060a14 100%);
  border-left: 0.5px solid rgba(255,255,255,0.1);
  box-shadow: -30px 0 80px rgba(0,0,0,0.6);
  transform: translate3d(100%, 0, 0);
  -webkit-transform: translate3d(100%, 0, 0);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Force own compositing layer for iOS */
  will-change: transform;
}
.drawer.open {
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

/* Body lock for iOS — prevents background scroll/drift when drawer is open */
body.drawer-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}


/* External links (Portfolio) — slightly muted, never active */
.nav-links a[target="_blank"] {
  color: rgba(255,255,255,0.55);
}
.nav-links a[target="_blank"]:hover {
  color: #5a92c2;
}


/* DRAWER DRIFT FIX v3 — Direct body manipulation, no parent stacking contexts */
html { -webkit-text-size-adjust: 100%; }

/* When drawer open, body itself locks completely */
html.drawer-locked,
html.drawer-locked body {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  left: 0 !important;
  -webkit-overflow-scrolling: auto !important;
}

/* Drawer must be a direct child of body, with NO transformed/filtered parents */
.drawer-backdrop {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0,0,0,0.7) !important;
  z-index: 99998 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  /* CRITICAL: no backdrop-filter, no transform on parent */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 86% !important;
  max-width: 420px !important;
  height: 100% !important;
  height: 100dvh !important;
  z-index: 99999 !important;
  background: #0d121c !important;
  background: linear-gradient(180deg, #0d121c 0%, #060a14 100%) !important;
  border-left: 0.5px solid rgba(255,255,255,0.1) !important;
  box-shadow: -30px 0 80px rgba(0,0,0,0.6) !important;
  transform: translate3d(100%, 0, 0);
  -webkit-transform: translate3d(100%, 0, 0);
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
}
.drawer.open {
  transform: translate3d(0, 0, 0) !important;
  -webkit-transform: translate3d(0, 0, 0) !important;
}

/* NAV must use sticky-style positioning that doesn't fight iOS */
.nav {
  /* keep nav simple — no backdrop-filter that creates new stacking context */
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 50;
}


/* ════════════════════════════════════════════════════════
   FINAL DRAWER FIX — highest priority, last word
   ════════════════════════════════════════════════════════ */
html.menu-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}
html.menu-open body {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  -webkit-overflow-scrolling: auto !important;
}

.drawer-backdrop {
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  background: rgba(0,0,0,0.65) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 99998 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: min(86%, 420px) !important;
  height: 100% !important;
  height: 100dvh !important;
  z-index: 99999 !important;
  background: linear-gradient(180deg, #0d121c 0%, #060a14 100%) !important;
  border-left: 0.5px solid rgba(255,255,255,0.08) !important;
  box-shadow: -30px 0 80px rgba(0,0,0,0.6) !important;
  transform: translate3d(100%, 0, 0) !important;
  -webkit-transform: translate3d(100%, 0, 0) !important;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
.drawer.open {
  transform: translate3d(0, 0, 0) !important;
  -webkit-transform: translate3d(0, 0, 0) !important;
}


/* ════════════════════════════════════════════════════════
   DRAWER — complete styling (interior + lock)
   ════════════════════════════════════════════════════════ */

/* Body lock when drawer open */
html.menu-open,
html.menu-open body {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  left: 0 !important;
}

/* Backdrop */
.drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.65) !important;
  z-index: 99998 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer panel */
.drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: min(86%, 420px) !important;
  height: 100% !important;
  height: 100dvh !important;
  z-index: 99999 !important;
  background: linear-gradient(180deg, #0d121c 0%, #060a14 100%) !important;
  border-left: 0.5px solid rgba(255,255,255,0.08) !important;
  box-shadow: -30px 0 80px rgba(0,0,0,0.6) !important;
  transform: translate3d(100%, 0, 0) !important;
  -webkit-transform: translate3d(100%, 0, 0) !important;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
.drawer.open {
  transform: translate3d(0, 0, 0) !important;
  -webkit-transform: translate3d(0, 0, 0) !important;
}

.drawer-inner {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Top — brand + close */
.drawer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.drawer-brand {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 22px;
  color: #fff;
  text-decoration: none !important;
}
.drawer-brand em {
  color: #5a92c2;
  font-style: italic;
}
.drawer-close {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.drawer-close:hover { transform: rotate(90deg); }
.drawer-close svg { width: 16px; height: 16px; }

/* Greeting block */
.drawer-greeting {
  margin-bottom: 0.5rem;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(37,211,102,0.12);
  border: 0.5px solid rgba(37,211,102,0.35);
  border-radius: 999px;
  color: #25d366;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  margin-bottom: 1.25rem;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 0 10px #25d366;
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
.drawer-greeting h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(2rem, 7vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.75rem;
}
.drawer-greeting h2 em {
  font-style: italic;
  color: #5a92c2;
}
.drawer-greeting .sub {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

/* WhatsApp card */
.drawer-wa {
  display: flex !important;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(37,211,102,0.18), rgba(37,211,102,0.06)) !important;
  border: 0.5px solid rgba(37,211,102,0.3) !important;
  border-radius: 18px;
  text-decoration: none !important;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.drawer-wa:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(37,211,102,0.25);
}
.drawer-wa-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #25d366, #128c7e);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 24px rgba(37,211,102,0.4);
}
.drawer-wa-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #25d366;
  margin-bottom: 4px;
}
.drawer-wa-number {
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  color: #fff;
}

/* Email card */
.drawer-email {
  display: flex !important;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)) !important;
  border: 0.5px solid rgba(255,255,255,0.1) !important;
  border-radius: 18px;
  text-decoration: none !important;
  color: inherit;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.drawer-email:hover {
  transform: translateY(-2px);
  border-color: rgba(90,146,194,0.4) !important;
}
.drawer-email-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(90,146,194,0.25), rgba(58,106,152,0.15));
  border: 0.5px solid rgba(90,146,194,0.3);
  color: #5a92c2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drawer-email-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #5a92c2;
  margin-bottom: 4px;
}
.drawer-email-addr {
  font-size: 14px;
  color: #fff;
}

/* Nav sections */
.drawer-nav-section {
  border-top: 0.5px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  margin-top: 0.5rem;
}
.drawer-nav-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: #5a92c2;
  margin-bottom: 1rem;
}
.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.drawer-nav-list a {
  display: block !important;
  padding: 14px 0;
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  color: #fff !important;
  text-decoration: none !important;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
  transition: color 0.3s ease, padding 0.3s ease;
}
.drawer-nav-list a:last-child {
  border-bottom: none;
}
.drawer-nav-list a:hover {
  color: #5a92c2 !important;
  padding-left: 10px;
}

/* Social icons */
.drawer-social {
  display: flex;
  gap: 10px;
}
.drawer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 0.5px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  transition: all 0.3s ease;
}
.drawer-social a:hover {
  background: rgba(90,146,194,0.15);
  border-color: #5a92c2;
  color: #5a92c2 !important;
  transform: translateY(-2px);
}
