/* ==============================================
   CSS CUSTOM PROPERTIES (Variables)
   CONSOLIDATED & ORGANIZED
   ============================================== */
:root {
  /* ======================
     CORE COLOR PALETTE
     ====================== */
  --color-primary: #1c1c1c;
  --color-secondary: #fbe86b;
  --color-accent-1: #fd635a;
  --color-accent-2: var(--color-secondary);
  --color-white: #ffffff;

  /* ======================
     BACKGROUND COLORS
     ====================== */
  --color-page-bg: #f9faf2;
  --color-surface: #fafafa;
  --color-card-bg: var(--color-surface);
  --color-dark-bg: var(--color-primary);

  /* ======================
     TEXT COLORS
     ====================== */
  --color-text-primary: var(--color-primary);
  --color-text-secondary: #6b6b6b;
  --color-text-muted: #555;
  --color-text-light: var(--color-white);
  --color-text-dark: var(--color-primary);

  /* ======================
     BORDER COLORS
     ====================== */
  --color-stroke: #ebe9de;
  --color-border-light: var(--color-stroke);
  --color-card-stroke-light: rgba(235, 233, 222, 0.5);
  --color-card-stroke-lighter: rgba(235, 233, 222, 0.3);

  /* ======================
     BUTTON COLORS
     ====================== */
  --color-button: #000000;
  --color-button-light: rgba(28, 28, 28, 0.15);
  --color-button-lighter: rgba(28, 28, 28, 0.08);
  --color-accent-2-light: rgba(237, 62, 41, 0.08);
  --color-accent-2-lighter: rgba(253, 99, 90, 0.08);

  /* ======================
     SHADOWS & OVERLAYS
     ====================== */
  --shadow-light: rgba(0, 0, 0, 0.08);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --shadow-dark: rgba(28, 28, 28, 0.3);
  --accent-shadow: rgba(253, 99, 90, 0.2);
  --overlay-white: rgba(255, 255, 255, 0.92);

  /* ======================
     TYPOGRAPHY
     ====================== */
  --gh-font-heading: 'Inter', sans-serif;
  --gh-font-body: 'Inter', sans-serif;

  /* ======================
     LAYOUT & SPACING
     ====================== */
  --header-height: 80px;

  /* ======================
     BORDER RADIUS
     ====================== */
  --radius-card: 20px;
  --radius-button: 50px;

  /* ======================
     ANIMATIONS
     ====================== */
  --anim-fast: .3s ease;
  --anim-medium: .5s ease;
  --anim-slow: .6s ease-out;

  /* ======================
     TRANSITION UTILS
     ====================== */
  --nav-transition-out: all 0.1s ease-out;
  --page-load-cover: rgba(249, 250, 242, 0.98);
}

/* ======================================================
   GLOBAL RESET
   ====================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html:not(.js-ready) *,
html:not(.js-ready) *::before,
html:not(.js-ready) *::after {
  transition: none !important;
  animation: none !important;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 0px;
}

/* ======================================================
   GLOBAL TYPOGRAPHY
   ====================================================== */
html, body, button, input, textarea, select, a, p, span, div, ul, li, h1, h2, h3, h4, h5, h6 {
  font-family: var(--gh-font-body) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ======================================================
   CRITICAL: HARD BLOCK RAW SUBITEMS
   ====================================================== */
.nebula-nav-horizontal li:has(a[href*="subitem"]),
.nebula-nav-horizontal li:has(a[href*="has_child"]) {
  display: none !important;
}

/* Unblock items ONLY when they are safely inside a submenu */
.nebula-nav-horizontal .ghost-submenu li {
  display: block !important;
}

/* ======================================================
   BASE BODY STYLES
   ====================================================== */
body {
  color: var(--color-text-primary);
  line-height: 1.6;
  background: var(--color-page-bg);
  overflow-x: hidden;
  padding: 0;
}

body.menu-open {
  overflow: hidden;
}

/* ======================================================
   TYPOGRAPHY UTILITIES
   ====================================================== */
.subtitle, .section-title, .card-title, .oasis-subtitle, .oasis-card h3, 
.benefit-content strong, .join-steps.redesigned-steps li::before, 
.testimonial-subheading, strong {
  font-family: var(--gh-font-heading);
  font-weight: 600;
}

/* ======================================================
   BASE ELEMENT STYLES
   ====================================================== */
a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* ==============================================
   HEADER CONTAINER & LAYOUT
   ============================================== */
.nebula-header {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  max-width: 87.5rem;
  height: var(--header-height);
  box-sizing: border-box;
  background: rgba(250, 250, 250, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border-light);
  border-radius: 3.125rem;
  padding: 0.875rem 1.875rem;
  box-shadow: 0 8px 25px var(--shadow-dark);
  z-index: 1000;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  will-change: transform;
  isolation: isolate;
  /* contain: layout paint; */
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  /* CRITICAL: Prevents logo from shrinking on laptop screens */
  flex-shrink: 0; 
}

.logo img {
  height: 3rem;
  width: auto;
  max-width: 180px;
}

.logo span {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  font-family: var(--gh-font-heading);
  white-space: nowrap;
}

/* ==============================================
   NAVIGATION (DESKTOP DEFAULT)
   ============================================== */
.nebula-nav-horizontal {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  visibility: visible;
  min-height: 22px;
  
  /* Initial State for Transition */
  opacity: 0; 
  transform: translateY(-5px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* JS Adds this class to show menu smoothly */
.nebula-nav-horizontal.nav-ready {
  opacity: 1;
  transform: translateY(0);
}

.nebula-nav-horizontal ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nebula-nav-horizontal li {
  position: relative;
}

.nebula-nav-horizontal a {
  font-family: var(--gh-font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-button);
  transition: color var(--anim-fast), background-color var(--anim-fast);
  position: relative;
  display: block;
  white-space: nowrap; /* Prevents wrapping */
}

.nebula-nav-horizontal a:hover,
.nebula-nav-horizontal .nav-current a {
  color: var(--color-accent-1);
  background: var(--color-accent-2-light);
}

/* Submenu Base Styles */
.nebula-nav-horizontal li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-surface);
  min-width: 220px;
  border-radius: var(--radius-card);
  box-shadow: 0 8px 25px var(--shadow-dark);
  border: 1px solid var(--color-border-light);
  padding: 0.5rem 0;
  flex-direction: column;
  gap: 0;
  z-index: 999;
}

@media (min-width: 769px) {
  .nebula-nav-horizontal li:hover > ul {
    display: flex;
  }

  .nebula-nav-horizontal li ul a {
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }
}

/* --- LAPTOP / TABLET RESPONSIVE FIX (769px to 1150px) --- */
/* CRITICAL: Prevents layout breaking on medium screens */
@media (min-width: 769px) and (max-width: 1150px) {
  .nebula-nav-horizontal ul {
    gap: 0.3rem; /* Tighter gap */
  }
  .nebula-nav-horizontal a {
    padding: 0.5rem 0.6rem; /* Smaller padding */
    font-size: 0.9rem;
  }
  .header-content {
    gap: 0.5rem;
  }
}

/* ==============================================
   HEADER RIGHT ACTIONS
   ============================================== */
.header-right-items {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  /* CRITICAL: Prevents buttons from squeezing/jumping */
  flex-shrink: 0; 
}

.mobile-extra-items {
  display: none;
}

.gh-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  font-size: 1.2rem;
  color: inherit;
  background-color: transparent;
  cursor: pointer;
  outline: none;
  border-radius: 50%;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.gh-search-icon:hover {
  background: var(--color-accent-2-light);
  color: var(--color-accent-1);
  transform: scale(1.05);
}

.profile-icon,
.join-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-button);
  background: var(--color-button);
  color: var(--color-text-light);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-icon:hover,
.join-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(28, 28, 28, 0.25);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 1.75rem;
  height: 1.25rem;
  background: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.hamburger span {
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ==============================================
   RESPONSIVE NAVIGATION (MOBILE <= 768px)
   ============================================== */
@media (max-width: 768px) {
  .header-right-items {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .nebula-header {
    border-radius: 1rem;
    padding: 0.75rem 1rem; 
    min-height: 60px;
    top: 0.5rem; 
  }

  .logo img {
    height: 2.2rem;
  }

  .nebula-nav-horizontal {
    display: none;
  }

  /* Active Menu State */
  .nebula-nav-horizontal.active {
    display: flex !important;
    position: fixed;
    top: calc(var(--header-height) + 0.5rem);
    left: 0;
    width: 100%;
    /* CSS Height Fallback & Dynamic Height */
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height)); 
    background: rgba(250, 250, 250, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-y: auto;
    padding: 1rem 1.5rem 6rem;
    z-index: 999;
    flex-direction: column;
    justify-content: flex-start;
    border-top: 1px solid var(--color-border-light);
    /* Safe area for iPhone home bar */
    padding-bottom: calc(env(safe-area-inset-bottom) + 4rem);
    opacity: 1 !important; /* Force visible on mobile active */
    transform: none !important;
  }

  .nebula-nav-horizontal.active ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    align-items: flex-start;
  }

  .nebula-nav-horizontal.active ul li {
    width: 100%;
    border-bottom: 1px solid var(--color-border-light);
    margin: 0;
    position: relative; /* Context for arrow */
  }

  .nebula-nav-horizontal.active ul li a {
    width: 100%;
    padding: 1.1rem 3rem 1.1rem 0; /* Padding Right for Arrow space */
    font-size: 1.15rem;
    text-align: left;
    border-radius: 0;
    background: transparent !important;
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }

  /* Dropdown Arrows (SVG) */
  .nebula-nav-horizontal.active .menu-item-has-children > a > svg {
    display: block !important;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: absolute;
    right: 0;
    top: 1.1rem;
    width: 24px;
    height: 24px;
    z-index: 50; /* Ensure clickability */
    padding: 4px; /* Touch target size */
    box-sizing: content-box;
  }

  .nebula-nav-horizontal.active .menu-item-has-children.open > a > svg {
    transform: rotate(180deg);
  }

  /* Submenus */
  .nebula-nav-horizontal.active li ul,
  .nebula-nav-horizontal.active ul.ghost-submenu {
    position: relative;
    top: 0;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0.5rem 0;
    display: none;
  }
  
  /* Show submenu when 'open' class is added via JS */
  .nebula-nav-horizontal.active .menu-item-has-children.open > ul {
    display: block !important;
  }

  .nebula-nav-horizontal.active li ul li {
    border-bottom: none;
  }

  .nebula-nav-horizontal.active li ul a {
    padding: 0.75rem 0 0.75rem 1.5rem;
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-weight: 500;
  }

  /* Mobile Extra Items (Search & Join) */
  .nebula-nav-horizontal.active .mobile-extra-items {
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-border-light);
    width: 100%;
  }

  .nebula-nav-horizontal.active .mobile-extra-items .gh-search-icon {
    width: 100%;
    height: auto;
    padding: 0.8rem;
    border-radius: var(--radius-button);
    border: 1px solid var(--color-border-light);
    font-size: 1.1rem;
    justify-content: flex-start; 
    gap: 10px;
    color: var(--color-text-primary);
  }
  
  .gh-search-icon span {
    font-family: var(--gh-font-body);
    font-weight: 600;
  }

  .nebula-nav-horizontal.active .mobile-extra-items .profile-icon,
  .nebula-nav-horizontal.active .mobile-extra-items .join-cta {
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem;
    display: block;
    color: var(--color-text-light);
  }
}

/* Small Mobile Tweak (iPhone SE size) */
@media (max-width: 400px) {
  .logo span {
    font-size: 1.2rem;
  }
  .nebula-header {
    padding: 0.75rem;
  }
}

/* ==============================================
   BUTTON STYLES
   ============================================== */
.hero-cta, .event-btn {
  background: var(--color-button);
  color: var(--color-text-light);
  padding: 1rem 2.5rem;
  border-radius: var(--radius-button);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-cta:hover, .event-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(28, 28, 28, 0.25);
}

.view-all {
  display: inline-block;
  margin-top: 30px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-decoration: none;
}

.view-all-btn {
  display: block;
  width: fit-content;
  margin: 2rem auto 0;
  padding: 0.8rem 1.8rem;
  font-size: 0.95rem;
  background: var(--color-button);
  color: var(--color-text-light);
  border-radius: var(--radius-button);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.view-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(28, 28, 28, 0.25);
}

/* ==============================================
   MAIN CONTENT & UTILITIES
   ============================================== */
.cosmic-flow {
  padding-top: 7rem;
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.loading-state {
  display: none;
}

.form-loading .loading-state,
.form-success .success-state,
.form-error .error-state {
  display: block;
}

.benefits-stack {
  display: flex;
  flex-direction: column;
  gap: 3.75rem;
  max-width: 53.125rem;
  margin: 3.75rem auto;
}

.benefits-stack .oasis-card {
  padding: 2.5rem 2.2rem;
  border-radius: var(--radius-card);
  background: var(--color-card-bg);
}

@media (max-width: 600px) {
  .benefits-stack {
    gap: 1.5rem;
    padding: 0 1rem;
  }
}

.kg-width-wide {
  max-width: 75rem;
  margin: 0 auto;
}

.kg-width-full {
  width: 100%;
  margin: 0;
}

/* ==============================================
   FOOTER STYLES (Refined & Perfected)
   ============================================== */
.stack-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  padding: 2rem 2rem;
  margin-top: auto; /* Ensures footer sits at bottom if page content is short */
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  /* Left (Socials) | Center (Copy) | Right (Mail) */
  grid-template-columns: 1fr auto 1fr; 
  align-items: center;
  gap: 1.5rem;
}

/* --- COLUMN 1: BRAND & SOCIALS --- */
.footer-brand-social {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Aligns to far left */
}

.footer-social {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary); /* Default: Muted text color */
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  background: transparent;
}

.footer-social a svg {
  /* width: 20px;
  height: 20px; */
  fill: currentColor;
}

.footer-social a:hover {
  color: var(--color-accent-1); /* Hover: Brand Color */
  background: var(--color-accent-2-light); /* Hover: Light background bubble */
  transform: translateY(-2px);
}

/* --- COLUMN 2: COPYRIGHT --- */
.footer-copy {
  grid-column: 2;
  text-align: center;
  font-size: 1.0rem;
  color: var(--color-text-secondary);
  margin: 0;
  white-space: nowrap; /* Keeps copyright on one line */
  font-weight: 1000;
}

/* --- COLUMN 3: EMAIL --- */
.footer-mail {
  grid-column: 3;
  justify-self: end; /* Aligns to far right */
  font-size: 1.0rem;
  font-weight: 1000;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 0.5rem 0; /* Increases hit area */
}

.footer-mail:hover {
  color: var(--color-accent-1);
}

/* --- MOBILE RESPONSIVE (Stacking) --- */
@media (max-width: 800px) {
  .stack-footer {
    padding: 2.5rem 1.5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr; /* Single column stack */
    text-align: center;
    gap: 1.5rem;
  }

  /* Reset Grid Positions for Stack */
  .footer-brand-social,
  .footer-copy,
  .footer-mail {
    grid-column: 1;
    justify-self: center; /* Center everything */
    width: 100%;
  }

  /* Specific Order for Mobile Layout */
  .footer-brand-social {
    justify-content: center;
    order: 1; /* Icons on top */
    margin-bottom: 0.5rem;
  }

  .footer-mail {
    order: 2; /* Email middle */
    font-size: 1rem;
  }

  .footer-copy {
    order: 3; /* Copyright bottom */
    white-space: normal; /* Allow text wrapping on very small screens */
    font-size: 0.85rem;
    opacity: 0.8;
  }
}

/* ==============================================
   PAGE UTILS & TRANSITIONS
   ============================================== */
body * .nebula-header,
body:not(.loaded) .nebula-header {
  visibility: visible !important;
}

/* PAGE LOAD COVER */
body {
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--page-load-cover);
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.08s cubic-bezier(0.4, 0, 1, 1);
}

body.loaded::before,
body *::before {
  opacity: 0 !important;
  pointer-events: none !important;
}


/* ==============================================
   FINAL FIX: Remove page-load overlay from render tree
   (Prevents scroll jump under fixed header)
   ============================================== */

body.loaded::before {
  display: none !important;
}
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--header-height) + 1.5rem);
  background: var(--color-page-bg);
  z-index: 999;      /* below header (1000), above content */
  pointer-events: none;
}
