/* ==========================================================================
   SETIA AMAN SECURITY SERVICES SDN BHD - CINEMATIC INTRO & HERO
   Pure Dark Canvas, 16:9 Shield Animation Video, Smooth Transition & Hero
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Full-Screen Intro Screen Container
   -------------------------------------------------------------------------- */
.intro-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: 
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

/* Intro leaving state triggered when video finishes or when SKIP is clicked */
.intro-screen.is-leaving {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

/* Hidden state once transition ends or when intro was already completed */
.intro-screen.is-hidden,
.intro-already-seen .intro-screen {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Prevent background scrolling while intro is visible */
body.intro-active {
  overflow: hidden !important;
}

/* --------------------------------------------------------------------------
   2. Cinematic Video Presentation (Centered 16:9, Pure Black Blend)
   -------------------------------------------------------------------------- */
.intro-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
}

.intro-video {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background-color: #000000;
  display: block;
  transform: translateY(0) scale(1);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
  will-change: transform;
}

/* Gracefully shift shield upward & scale slightly when welcome appears to eliminate overlap */
.intro-screen.is-revealed .intro-video,
.intro-screen.is-revealed .intro-fallback {
  transform: translateY(-13%) scale(0.82);
}

@media (max-width: 768px) {
  .intro-screen.is-revealed .intro-video,
  .intro-screen.is-revealed .intro-fallback {
    transform: translateY(-16%) scale(0.76);
  }
}

/* --------------------------------------------------------------------------
   3. Post-Animation Welcome & EXPLORE US Button
   -------------------------------------------------------------------------- */
.intro-welcome {
  position: absolute;
  bottom: clamp(18px, 4.5vh, 44px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 92%;
  max-width: 640px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: 
    opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.intro-welcome.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.intro-welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.welcome-line {
  display: block;
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d4af37);
}

.welcome-line:last-child {
  background: linear-gradient(90deg, #d4af37, transparent);
}

.welcome-label {
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: #f7d268;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.intro-welcome-sub {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 2.8px;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0 0 6px 0;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 0, 0, 0.8);
}

.intro-welcome-sub .brand-gold {
  color: #f7d268;
  background: linear-gradient(180deg, #ffffff 0%, #fff0b8 30%, #f7d268 65%, #d4af37 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.intro-welcome-tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 600;
  color: #f7df94;
  margin: 0 0 16px 0;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}

.intro-welcome-action {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* EXPLORE US Button */
.intro-explore-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 44px;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #050811;
  background: linear-gradient(135deg, #fff3b0 0%, #f7d268 45%, #d4af37 75%, #aa7c11 100%);
  border: 1px solid #ffe899;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 
    0 4px 22px rgba(212, 175, 55, 0.45),
    0 0 35px rgba(212, 175, 55, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.explore-btn-shine {
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  transform: skewX(-25deg);
  animation: exploreBtnShine 3s infinite ease-in-out 0.8s;
  pointer-events: none;
}

@keyframes exploreBtnShine {
  0% { left: -120%; }
  35% { left: 160%; }
  100% { left: 160%; }
}

.intro-explore-btn:hover {
  transform: translateY(-3px) scale(1.02);
  background: linear-gradient(135deg, #ffffff 0%, #fff1ba 40%, #f7d268 80%, #c5931b 100%);
  box-shadow: 
    0 8px 32px rgba(212, 175, 55, 0.65),
    0 0 50px rgba(212, 175, 55, 0.4);
  color: #000000;
}

.intro-explore-btn:active {
  transform: translateY(-1px) scale(0.99);
}

.intro-explore-btn:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 4px;
}

.explore-btn-icon {
  transition: transform 0.25s ease;
}

.intro-explore-btn:hover .explore-btn-icon {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   4. Graceful Fallback (If Video is Blocked or Fails to Load)
   -------------------------------------------------------------------------- */
.intro-fallback {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  z-index: 5;
  padding: 20px;
  text-align: center;
}

.intro-fallback.is-visible {
  display: flex;
}

.intro-fallback-logo {
  max-width: 190px;
  max-height: 205px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.45));
  animation: fallbackLogoPulse 3s ease-in-out infinite alternate;
}

@keyframes fallbackLogoPulse {
  0% { transform: scale(0.98); opacity: 0.9; }
  100% { transform: scale(1.02); opacity: 1; }
}

/* --------------------------------------------------------------------------
   5. Small, Elegant "SKIP INTRO" Control in Bottom Corner
   -------------------------------------------------------------------------- */
.intro-skip-btn {
  position: absolute;
  bottom: 32px;
  right: 36px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 14, 27, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.38);
  color: #f7d268;
  padding: 9px 20px;
  border-radius: 9999px;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.intro-skip-btn:hover {
  background: rgba(212, 175, 55, 0.24);
  border-color: #ffd875;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.intro-skip-btn:active {
  transform: translateY(0);
}

.intro-skip-btn:focus-visible {
  outline: 2px solid #fbe089;
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   5. Homepage Cinematic Hero Animations (Triggered After Intro)
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
}

/* Guard background image slow reveal and cinematic zoom */
.hero-bg-img {
  transform: scale(1.06);
  opacity: 0;
  transition: 
    transform 3.5s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 1.4s ease-out;
  will-change: transform, opacity;
}

.page-ready .hero-bg-img,
.intro-already-seen .hero-bg-img {
  transform: scale(1.0);
  opacity: 1;
}

/* Lead Corporate Headline: PROTECTING WHAT MATTERS MOST */
.hero-headline-protecting {
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: clamp(1.2rem, 2.3vw, 1.65rem);
  font-weight: 800;
  letter-spacing: 2.2px;
  color: #ffffff;
  text-transform: uppercase;
  margin-top: 4px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-headline-protecting .text-gold-accent {
  color: #f7d268;
  background: linear-gradient(135deg, #fff3b0 0%, #f7d268 50%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 6px rgba(212, 175, 55, 0.35));
}

/* Hero Content Elements Entrance Sequence */
.hero-content > * {
  opacity: 0;
  transform: translateY(22px);
  transition: 
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-ready .hero-category,
.intro-already-seen .hero-category {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

.page-ready .hero-brand-name,
.intro-already-seen .hero-brand-name {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.page-ready .hero-brand-sub,
.intro-already-seen .hero-brand-sub {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.page-ready .hero-headline-protecting,
.intro-already-seen .hero-headline-protecting {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}

.page-ready .hero-tagline-quote,
.intro-already-seen .hero-tagline-quote {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.5s;
}

.page-ready .hero-tagline-pillars,
.intro-already-seen .hero-tagline-pillars {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.58s;
}

.page-ready .hero-trust-block,
.intro-already-seen .hero-trust-block {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.68s;
}

.page-ready .hero-actions-row,
.intro-already-seen .hero-actions-row,
.page-ready .hero-btn-group,
.intro-already-seen .hero-btn-group {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition-delay: 0.8s;
}

/* Docked Angled Badge Bar entrance */
.hero-docked-badge-bar {
  opacity: 0;
  transform: translateX(30px);
  transition: 
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-ready .hero-docked-badge-bar,
.intro-already-seen .hero-docked-badge-bar {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.95s;
}

/* Header Slide-Down on Entry */
.site-header {
  transform: translateY(-20px);
  opacity: 0;
  transition: 
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-ready .site-header,
.intro-already-seen .site-header {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 0.05s;
}

/* --------------------------------------------------------------------------
   6. Scroll-Triggered Restrained Homepage Animations (IntersectionObserver)
   -------------------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: 
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.from-left {
  transform: translateX(-28px);
}

.reveal-on-scroll.from-right {
  transform: translateX(28px);
}

.reveal-on-scroll.scale-up {
  transform: scale(0.94);
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Services 6 Cards Staggered Animation */
.service-gold-card,
.service-card {
  opacity: 0;
  transform: translateY(30px);
  transition: 
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-gold-card.is-revealed,
.service-card.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Why Choose Us Feature Cards */
.why-feature-card,
.feature-card {
  opacity: 0;
  transform: translateY(24px);
  transition: 
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.why-feature-card.is-revealed,
.feature-card.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Protecting Pillars */
.protecting-pillar-item {
  opacity: 0;
  transform: translateY(22px);
  transition: 
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.protecting-pillar-item.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Footer Columns */
.footer-col {
  opacity: 0;
  transform: translateY(20px);
  transition: 
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-col.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Additional Extended Sections Support */
.highlight-item,
.vm-card,
.industry-card,
.process-step-item,
.cta-banner-content {
  opacity: 0;
  transform: translateY(24px);
  transition: 
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.highlight-item.is-revealed,
.vm-card.is-revealed,
.industry-card.is-revealed,
.process-step-item.is-revealed,
.cta-banner-content.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   7. Accessibility: Prefers-Reduced-Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .intro-screen {
    transition: opacity 0.1s linear !important;
  }
  .intro-video {
    display: none !important;
  }
  .intro-fallback {
    display: flex !important;
  }
  .intro-fallback-logo {
    animation: none !important;
    opacity: 1 !important;
  }
  .hero-bg-img,
  .hero-content > *,
  .hero-docked-badge-bar,
  .site-header,
  .reveal-on-scroll,
  .service-gold-card,
  .service-card,
  .why-feature-card,
  .feature-card,
  .protecting-pillar-item,
  .footer-col,
  .highlight-item,
  .vm-card,
  .industry-card,
  .process-step-item,
  .cta-banner-content {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   8. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .intro-welcome {
    bottom: 5%;
    padding: 14px 18px 18px;
    width: 95%;
  }
  .intro-welcome-title {
    font-size: 2.2rem;
    letter-spacing: 4px;
  }
  .intro-welcome-sub {
    font-size: 0.88rem;
    letter-spacing: 2px;
  }
  .intro-welcome-tagline {
    font-size: 1.15rem;
    margin-bottom: 12px;
  }
  .intro-explore-btn {
    padding: 13px 34px;
    font-size: 0.92rem;
    width: 100%;
    max-width: 300px;
  }
  .intro-skip-btn {
    bottom: 24px;
    right: 24px;
    padding: 7px 16px;
    font-size: 0.75rem;
  }
  .intro-fallback-logo {
    max-width: 150px;
    max-height: 165px;
  }
}

@media (max-width: 480px) {
  .intro-welcome {
    bottom: 4%;
    padding: 12px 14px 16px;
  }
  .intro-welcome-title {
    font-size: 1.85rem;
    letter-spacing: 3px;
  }
  .intro-welcome-sub {
    font-size: 0.78rem;
    letter-spacing: 1.5px;
  }
  .intro-welcome-tagline {
    font-size: 1.05rem;
    margin-bottom: 10px;
  }
  .intro-skip-btn {
    bottom: 16px;
    right: 16px;
    padding: 6px 14px;
    font-size: 0.72rem;
    letter-spacing: 1.2px;
  }
  .intro-fallback-logo {
    max-width: 125px;
    max-height: 140px;
  }
}
