/**
 * Balochistan Minerals - Premium UI Polish
 * Earth-Tech Design System
 */

:root {
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 12px;
  --premium-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  --beam-color: var(--primary-gold-glow);
}

/* 1. DIGITAL NOISE OVERLAY */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-loader);
  opacity: 0.04;
  /* Very subtle */
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  animation: noise-shift 0.2s infinite;
}

@keyframes noise-shift {
  0% {
    transform: translate(0, 0);
  }

  10% {
    transform: translate(-1%, -1%);
  }

  20% {
    transform: translate(1%, 1%);
  }

  30% {
    transform: translate(-2%, 1%);
  }

  40% {
    transform: translate(1%, -2%);
  }

  50% {
    transform: translate(-1%, 1%);
  }

  60% {
    transform: translate(1%, 2%);
  }

  70% {
    transform: translate(-2%, 1%);
  }

  80% {
    transform: translate(2%, 1%);
  }

  90% {
    transform: translate(1%, 1%);
  }

  100% {
    transform: translate(0, 0);
  }
}

/* 2. GLASS-BENTO DASHBOARD */
.glass-bento {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg, 12px);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.4s ease;
}

.glass-bento:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
}

/* 4. TYPOGRAPHY STANDARDIZATION */
.about__title,
.about__story-title,
.section-title,
.zigzag__title,
.asymmetrical-grid .zigzag__title {
  font-size: var(--h1-size);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-family: var(--font-heading);
}


/* 3. BORDER BEAM EFFECT */
.border-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: inherit;
  z-index: 2;
}

.border-beam::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: conic-gradient(from var(--current-angle, 0deg),
      transparent 0%,
      transparent 40%,
      var(--beam-color) 50%,
      transparent 60%,
      transparent 100%);
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  padding: 1px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.glass-bento:hover .border-beam::before {
  opacity: 1;
}

/* 4. PREMIUM GRADIENTS */
.gradient-text-industrial {
  background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Remove GSAP Magnetic Wrap interaction */
.magnetic-wrap {
  display: inline-block;
  transform: none !important;
}

/* NOTE: Navbar styles consolidated in css/components/navbar.css for maintainability.
   Mobile smooth animations implemented via visibility/opacity/transform pattern.
   Do not override here; use components/navbar.css as authoritative source. */

/* NOTE: Mobile navbar fixes consolidated in css/components/navbar.css.
   Refer to components/navbar.css for @media (max-width: 1024px) navbar rules. */

/* 9. MINIMALIST WHITE PRELOADER */
body.is-loading {
  overflow: hidden !important;
}

#bm-hill-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-critical-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: #ffffff;
  /* Premium Clean White */
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s ease;
}

.bm-hill-content {
  position: relative;
  z-index: 10;
  text-align: center;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bm-hill-container {
  width: 120px;
  margin: 0 auto 1.25rem;
}

.bm-hill-svg {
  width: 100%;
  height: auto;
}

.hill-path {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: drawHill 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes drawHill {
  to {
    stroke-dashoffset: 0;
  }
}

.bm-hill-brand-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #111827;
  /* Deep Charcoal */
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUpBM 1s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}

.bm-hill-tagline {
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--primary-gold-500);
  /* Yellow Logo Color */
  margin-top: 0.75rem;
  opacity: 0;
  animation: fadeIn 1s ease 1.2s forwards;
}

@keyframes fadeUpBM {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile adjustments for loader */
@media (max-width: 768px) {
  .bm-hill-container {
    width: 80px;
    margin-bottom: 1rem;
  }
  
  .bm-hill-brand-text {
    font-size: 1.1rem;
    letter-spacing: 0.12em;
  }
  
  .bm-hill-tagline {
    font-size: 0.6rem;
    letter-spacing: 0.3em;
  }
}


@keyframes fadeIn {
  to {
    opacity: 0.6;
  }
}

/* The Reveal Trigger */
body.loaded #bm-hill-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.loaded .bm-hill-content {
  opacity: 0;
  transform: translateY(-20px) scale(0.98);
}

/* ============================================ */
/* 12. MOBILE AUTHORITY & RESPONSIVENESS (Synced) */
/* ============================================ */
@media (max-width: 768px) {
  :root {
    --mobile-content-heading-size: clamp(1.65rem, 8vw, 2.2rem);
    --mobile-content-heading-line: 1.08;
  }

  /* Site-wide Typography Synchronization 
     (Controlled by Symmetry Engine in variables.css) */
  .hero-headline,
  .logistics-hero__title,
  .investors-hero__title,
  .about-hero__title,
  .contact-hero__title,
  .products-hero__title,
  .projects-hero__title,
  .sustainability-hero__title {
    font-size: var(--display-size) !important;
    line-height: 1.1 !important;
  }

  .section-title,
  .route-overview__title,
  .about__title,
  .about__story-title,
  .projects__title,
  .products__title,
  .sustainability__title,
  .compliance__title,
  .section-header-light__title,
  .financial-dashboard__title,
  .reports-section__header h2,
  .pillars-section__title,
  .certifications-section__header h2,
  .impact-section__header h2,
  .zigzag__title,
  .product-overview-title,
  .product-comparison__title {
    font-size: var(--mobile-content-heading-size);
    line-height: var(--mobile-content-heading-line);
    text-transform: uppercase;
  }

  /* Catch non-hero semantic headings that do not use shared section classes yet */
  main h1:not([class*="hero"]):not(.hero-headline),
  main h2:not([class*="hero"]) {
    font-size: var(--mobile-content-heading-size) !important;
    line-height: var(--mobile-content-heading-line) !important;
  }

  /* Headings with spans should maintain consistent sizing */
  h1 span,
  .section-title span,
  .hero-headline span {
    font-size: inherit !important;
  }

  /* Avoid global section overrides here: they tend to cause hard-to-debug layout regressions.
     If a specific page needs extra padding/overflow fixes, scope it in that page's CSS. */

}

@media (max-width: 480px) {
  :root {
    --mobile-content-heading-size: clamp(1.45rem, 9vw, 1.85rem);
  }
}
