/* ============================================================
   Made in Garage - base / shared chrome
   Navbar, mega menu, hamburger, footer, cursor, hero slider,
   scroll progress. Loaded on every page.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #060606;
  color: #fff;
  overflow-x: hidden;
}

img { max-width: 100%; }

/* ---- Custom cursor ----
   Universal !important: cursor is inheritable, so a plain `body { cursor:none }`
   loses the cascade to any more-specific selector with `cursor: pointer`
   (.nav-item, .mm-name, #hamburger, etc.), which is why the native hand
   cursor was showing through. Matches the proven static-site rule. */
* { cursor: none !important; }
#cursor {
  position: fixed; top: 0; left: 0;
  width: 7px; height: 7px; background: #fff200; border-radius: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%); will-change: transform;
}
#cursor-ring {
  position: fixed; top: 0; left: 0;
  width: 24px; height: 24px; border: 1px solid rgba(255,255,255,0.25); border-radius: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%, -50%); will-change: transform;
}

/* ---- Logo switch ---- */
#logo-stacked-el {
  position: fixed; top: 20px; left: 36px; z-index: 201;
  display: block; width: 120px; transition: opacity 0.4s ease;
}
#logo-stacked-el img { width: 120px; height: auto; display: block; }
#nav-logo { transition: opacity 0.4s ease; }
body:not(.logo-scrolled) #nav-logo { opacity: 0; pointer-events: none; }
body.logo-scrolled #logo-stacked-el { opacity: 0; pointer-events: none; }

/* ---- Navbar ---- */
#navbar {
  position: fixed; top: 20px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; z-index: 200; pointer-events: none;
}
#nav-logo { pointer-events: all; text-decoration: none; }
#nav-logo img { height: 34px; width: auto; display: block; }
#nav-pill {
  pointer-events: all;
  display: flex; align-items: center; gap: 2px;
  padding: 0 16px; height: 44px;
}
.nav-item {
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.38); text-decoration: none;
  padding: 6px 12px; cursor: pointer;
  transition: color 0.2s; white-space: nowrap;
  background: none; border: none; font-family: inherit;
}
.nav-item:hover { color: #fff200; }
.nav-item.active { color: #fff200; }
.nav-item.has-sub::after {
  content: ''; display: inline-block; width: 3px; height: 3px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  margin-left: 5px; opacity: 0.4; vertical-align: middle;
}
.nav-sep { width: 1px; height: 12px; background: rgba(255,255,255,0.1); margin: 0 2px; }

/* ---- Hamburger (mobile) ---- */
#hamburger {
  display: none; position: fixed; top: 16px; right: 20px; z-index: 210;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(10,10,10,0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.12);
  align-items: center; justify-content: center;
  cursor: pointer; flex-direction: column; gap: 5px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.ham-line { width: 18px; height: 1px; background: rgba(255,255,255,0.7); border-radius: 2px; }

/* ---- Mega menu (desktop) ---- */
#megamenu {
  position: fixed; inset: 0; z-index: 150; pointer-events: none;
  background: rgba(5,5,5,0.9);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  display: flex; flex-direction: column; justify-content: center;
  padding: 100px 10vw 80px; opacity: 0;
  /* Closed menus stay out of the compositor: a full-viewport backdrop-filter is
     expensive to composite every frame even at opacity 0. */
  visibility: hidden;
}
#megamenu.open { pointer-events: all; visibility: visible; }
.mm-section { display: none; }
.mm-section.active { display: block; }
.mm-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 52px; }
.mm-label { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255,255,255,0.65); }
.mm-x { font-size: 18px; color: rgba(255,255,255,0.35); cursor: pointer; padding-left: 24px; line-height: 1; transition: color 0.2s; }
.mm-x:hover { color: #fff; }
.mm-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.mm-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 52px; font-weight: 300; letter-spacing: -0.025em;
  color: rgba(255,255,255,0.65);
  padding: 14px 0; padding-right: 28px;
  border-bottom: 0.5px solid rgba(255,255,255,0.055);
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  text-decoration: none; transition: color 0.18s, padding-left 0.2s;
}
.mm-name:hover { color: #fff200; padding-left: 10px; }
.mm-name.current { color: #fff200; }
.mm-name .arr { font-size: 16px; opacity: 0; color: rgba(255,255,255,0.35); transform: translateX(-6px); transition: opacity 0.18s, transform 0.18s; }
.mm-name:hover .arr { opacity: 1; transform: translateX(0); }
#mm-main { display: none; }
.mm-back { display: none; }

/* ---- Hero slider ---- */
.hero-slides { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease-in-out; will-change: opacity; }
.hero-slide.active { opacity: 1; }
.hero-slide picture { display: block; width: 100%; height: 100%; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

/* ---- Scroll progress ---- */
#progress { position: fixed; bottom: 0; left: 0; right: 0; height: 2px; background: rgba(255,255,255,0.04); z-index: 50; pointer-events: none; }
#progress-fill { height: 100%; width: 0%; background: #fff200; }

/* ---- Footer ---- */
#site-footer {
  background: #060606; border-top: 0.5px solid rgba(255,255,255,0.07);
  padding: 56px 40px 60px; position: relative; z-index: 10;
}
.footer-inner {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 40px; width: 76vw; margin: 0 auto;
}
.footer-logo img { width: 100px; height: auto; display: block; }
.footer-social { justify-self: center; display: flex; gap: 8px; }
.footer-contact { justify-self: end; display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }
.footer-contact a {
  font-size: 11px; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.32); text-decoration: none; transition: color 0.2s;
}
.footer-contact a:hover { color: #fff200; }
.footer-si {
  width: 34px; height: 34px; background: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7); text-decoration: none; cursor: pointer;
  transition: background 0.2s, color 0.2s; flex-shrink: 0;
}
.footer-si:hover { background: #fff200; color: #060606; }
.footer-si svg { width: 15px; height: 15px; display: block; }

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 768px) {
  * { cursor: auto !important; }
  #cursor, #cursor-ring { display: none !important; }

  #navbar { padding: 0 20px; top: 16px; }
  #nav-logo img { height: 28px; }
  #logo-stacked-el { left: 20px; top: 16px; width: 90px; }
  #logo-stacked-el img { width: 90px; }
  #nav-pill { display: none; }
  #hamburger { display: flex; }

  #megamenu { padding: 0; justify-content: flex-start; }
  .mm-head { display: none; }
  #mm-main {
    position: absolute; inset: 0; background: rgba(5,5,5,0.96);
    display: flex; flex-direction: column; justify-content: center; padding: 80px 28px 40px;
  }
  #mm-main.hidden { display: none; }
  .mm-main-item {
    font-size: 38px; font-weight: 300; letter-spacing: -0.02em; color: rgba(255,255,255,0.7);
    padding: 14px 0; border-bottom: 0.5px solid rgba(255,255,255,0.06);
    cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: color 0.2s;
  }
  .mm-main-item:last-child { border-bottom: none; }
  .mm-main-item .sub-arrow { font-size: 18px; color: rgba(255,255,255,0.2); }
  .mm-section {
    position: absolute; inset: 0; display: none; flex-direction: column;
    padding: 120px 28px 40px; overflow-y: auto; background: rgba(5,5,5,0.96);
  }
  .mm-section.active { display: flex; }
  .mm-back {
    display: flex; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
    color: rgba(255,255,255,0.3); margin-bottom: 36px; cursor: pointer; align-items: center; gap: 8px;
  }
  .mm-back::before { content: '\2190'; font-size: 14px; }
  .mm-grid { grid-template-columns: 1fr; }
  .mm-name { font-size: 34px; padding: 13px 0; padding-right: 0; }
  .mm-name .arr { opacity: 0.3; transform: none; }

  #site-footer { padding: 60px 24px 62px; }
  .footer-inner { grid-template-columns: 1fr; justify-items: center; gap: 40px; width: 92vw; }
  .footer-social { justify-self: center; gap: 18px; }
  .footer-contact { justify-self: center; align-items: center; }
}

/* ---- Page transition overlay ----
   Driven by CSS, never by JS: if the GSAP CDN is slow or fails, the overlay
   must still clear. Otherwise it would sit opaque at z-index 100000 and black
   out the whole site. */
#page-overlay {
  position: fixed; inset: 0;
  background: #060606;
  z-index: 100000;
  opacity: 1; pointer-events: all;
  transition: opacity 0.5s ease-in-out;
}
#page-overlay.is-hidden { opacity: 0; pointer-events: none; }
