/* global.css
   Global menu + title + homepage title animation CSS (safe defaults)
*/

/* =============== RESET =============== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: black;
  color: white;
  font-family: "Lexend", sans-serif;
  overflow-x: hidden;
}

/* ================================
   FIXED TITLE — DEFAULT FOR ALL PAGES
================================= */
#titleWrapper {
  position: fixed;
  top: 2px;
  left: 30px;
  z-index: 5000;
}
#mainTitleLottie {
  width: 220px;
  height: auto;
  pointer-events: auto;
}

/* ===========================================================
      ⭐ HOMEPAGE TITLE ANIMATION (EXACT ORIGINAL VALUES)
   =========================================================== */

body.home-page {
  --scrollProgress: 0;
}

body.home-page #titleWrapper {
  position: fixed;
  z-index: 5000;
  transform-origin: top left;

  /* ORIGINAL VALUES (DO NOT CHANGE) */
  top: calc(35% + var(--scrollProgress) * (11.5% - 35%));
  left: calc(39% + var(--scrollProgress) * (170px - 39%));
  transform: scale(calc(1 + var(--scrollProgress) * (0.55 - 1)));
}

body.home-page #mainTitleLottie {
  width: 350px;
}

/* ================================
   MENU ICON
================================= */
#menuLottie {
  position: fixed;
  top: 15px;
  right: 25px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 9999;
}

/* menu overlay circle */
#menuOverlay {
  position: fixed;
  top: 15px;
  right: 25px;
  width: 40px;
  height: 40px;
  background: var(--menuCircleColor, #d9ccb8);
  border-radius: 50%;
  transform: scale(0);
  transform-origin: center;
  z-index: 9990;
  pointer-events: none;
  transition: transform 0.95s cubic-bezier(1,0,0.1,1), opacity 1s ease-in-out;
}

/* ================================
   MENU CONTENT
================================= */
#menuContent {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 9991;
  transition: opacity 0.45s ease;
}
body.menu-circle-done #menuContent { opacity: 1; pointer-events: auto; }

.menu-sections {
  position: absolute;
  top: 33%;
  left: 14%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.menu-item {
  font-size: 48px;
  font-family: "Lexend";
  font-weight: 100;
  color: black;
  opacity: 0;
  transform: translateY(8px);
  transition: transform 0.35s cubic-bezier(1,0,0.1,1), opacity 0.35s, filter 0.35s;
  cursor: pointer;
}

body.menu-circle-done .menu-item { opacity: 1; transform: translateY(0); }

.menu-item:hover { transform: scale(1.08); opacity: 1; filter: blur(0); }
.menu-sections:hover .menu-item:not(:hover) { opacity: 0.4; filter: blur(4px); }

.menu-item[data-section="home"]   { left: 100px; top:-70px;  position:relative; }
.menu-item[data-section="about"]  { left: 800px; top:-190px; position:relative; }
.menu-item[data-section="work"]   { left: 500px; top:-40px;  position:relative; }
.menu-item[data-section="play"]   { left:1000px; top:-70px;  position:relative; }
.menu-item[data-section="ashram"] { left: -30px; top:30px;   position:relative; }

/* SOCIALS */
.menu-socials {
  position: absolute;
  bottom: 20%;
  left: 75%;
  display: flex;
  gap: 15px;
}
.social-link {
  color: black;
  font-size: 16px;
  font-weight: 100;
  text-decoration: none;
  opacity: 0;
  transform: translateY(8px);
  transition: .45s;
  pointer-events: auto;
}
body.menu-circle-done .social-link { opacity: 1; transform: translateY(0); }

/* ================================
   SAFETY FALLBACKS — ENSURE VISIBILITY
================================ */

/* Always visible containers */
#titleWrapper, #mainTitleLottie, #menuLottie {
  display: block;
  opacity: 1 !important;
}

/* Ensure SVGs render */
#mainTitleLottie svg, #menuLottie svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ================================
   COLOR BEHAVIOR
================================ */

/* ⭐ ALL NON-HOMEPAGE PAGES → PURE WHITE ALWAYS */
body:not(.home-page) #menuLottie svg *,
body:not(.home-page) #mainTitleLottie svg * {
  stroke: #ffffff !important;
  fill: #ffffff !important;
}

/* ⭐ HOMEPAGE → JS will control color, so use currentColor here */
body.home-page #menuLottie svg *,
body.home-page #mainTitleLottie svg * {
  stroke: currentColor !important;
  fill: currentColor !important;
}

/* Initial homepage color → white before JS updates */
body.home-page #titleWrapper,
body.home-page #menuLottie {
  color: white;
}
