/* ================================================================
   HOMEPAGE V2 — Cinematic Hero (Rev 5)
   3 crossfading images + word-reveal + mouse parallax + scroll fade
   All rules scoped under #hp-v2
   ================================================================ */

/* ── 0. Global ───────────────────────────────────────────────────── */
#hp-v2 { scroll-behavior: smooth; }
#hp-v2 ::selection { background: rgba(12,192,223,.25); color: #fff; }


/* ══════════════════════════════════════════════════════════════════
   1. HERO
   ══════════════════════════════════════════════════════════════════ */

#hp-v2 .v2-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0F172A;
}

/* ── 1b. Crossfading background layers ───────────────────────────── */
#hp-v2 .v2-hero__bg-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
#hp-v2 .v2-hero__bg {
  position: absolute;
  /* Extra space for parallax + Ken Burns */
  top: -8%;
  left: -4%;
  right: -4%;
  bottom: -8%;
  background-size: cover;
  background-position: center 40%;
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 2s ease-in-out;
  /* Ken Burns slow zoom — restarted each time slide becomes active */
  transform: scale(1);
}
#hp-v2 .v2-hero__bg--active {
  opacity: 1;
  animation: v2-kenburns 8s ease-in-out forwards;
}
@keyframes v2-kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* ── 1c. Gradient overlay ────────────────────────────────────────── */
#hp-v2 .v2-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top,
      rgba(15,23,42,.9) 0%,
      rgba(15,23,42,.65) 30%,
      rgba(15,23,42,.3) 55%,
      rgba(15,23,42,.15) 80%,
      rgba(15,23,42,.25) 100%
    );
}

/* ── 1d. Vignette ────────────────────────────────────────────────── */
#hp-v2 .v2-hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  box-shadow: inset 0 0 200px 60px rgba(0,0,0,.3);
  pointer-events: none;
}

/* ── 1e. Content ─────────────────────────────────────────────────── */
#hp-v2 .v2-hero__content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 1000px;
  padding: 120px 0 80px;
  will-change: transform, opacity;
}

/* ── 1f. Kicker ──────────────────────────────────────────────────── */
#hp-v2 .v2-hero__kicker {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 600;
  color: rgba(255,255,255,.85);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-shadow: 0 2px 20px rgba(0,0,0,.6);
  animation: v2-hero-enter 0.9s cubic-bezier(.16,1,.3,1) 0.3s both;
}

/* ── 1g. Title accent — word-reveal target ───────────────────────── */
#hp-v2 .v2-hero__title {
  margin-bottom: 24px;
}
#hp-v2 .v2-hero__title-accent {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 7.5vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 4px 40px rgba(0,0,0,.5);
}

/* Word-reveal mask spans (injected by JS) */
#hp-v2 .v2-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.06em;
}
#hp-v2 .v2-word-inner {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
  animation: v2-word-rise 1s cubic-bezier(.16,1,.3,1) both;
}
@keyframes v2-word-rise {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}

/* Underline draw after reveal */
#hp-v2 .v2-hero__title-accent::after {
  content: '';
  display: block;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #0CC0DF, rgba(12,192,223,.2));
  margin: 16px auto 0;
  border-radius: 2px;
  transition: width 1s cubic-bezier(.16,1,.3,1);
}
#hp-v2 .v2-hero__title-accent.v2-revealed::after {
  width: 80px;
}

/* ── 1h. Hero entrance keyframe ──────────────────────────────────── */
@keyframes v2-hero-enter {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
#hp-v2 .v2-hero__sub {
  animation: v2-hero-enter 0.8s cubic-bezier(.16,1,.3,1) 1.4s both;
}
#hp-v2 .v2-hero__ctas {
  animation: v2-hero-enter 0.8s cubic-bezier(.16,1,.3,1) 1.7s both;
}

/* ── 1i. Subtitle ────────────────────────────────────────────────── */
#hp-v2 .v2-hero__sub {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: rgba(255,255,255,.75);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.7;
  font-weight: 400;
  text-shadow: 0 1px 12px rgba(0,0,0,.5);
}

/* ── 1j. CTA buttons ─────────────────────────────────────────────── */
#hp-v2 .v2-hero__ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
#hp-v2 .v2-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(.4,0,.2,1);
  text-decoration: none;
  border: none;
  position: relative;
  overflow: hidden;
}

#hp-v2 .v2-btn--primary {
  background: linear-gradient(135deg, #0CC0DF, #0A9BB5);
  color: #fff;
  box-shadow: 0 4px 24px rgba(12,192,223,.45);
}
#hp-v2 .v2-btn--primary:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 10px 40px rgba(12,192,223,.55);
  color: #fff;
}
#hp-v2 .v2-btn--primary::after {
  content: '';
  position: absolute;
  top: -50%; left: -100%;
  width: 60%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  transform: skewX(-20deg);
  animation: v2-btn-shimmer 3.5s ease-in-out infinite;
}
@keyframes v2-btn-shimmer {
  0%, 100% { left: -100%; }
  50%      { left: 160%; }
}

#hp-v2 .v2-btn--glass {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
#hp-v2 .v2-btn--glass:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.35);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  color: #fff;
}

/* ── 1k. Scroll indicator ────────────────────────────────────────── */
#hp-v2 .v2-hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  opacity: 0;
  animation: v2-scroll-fade-in 0.6s ease 2.2s forwards;
}
@keyframes v2-scroll-fade-in { to { opacity: 1; } }
#hp-v2 .v2-hero__scroll-mouse {
  width: 24px;
  height: 38px;
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 12px;
  position: relative;
}
#hp-v2 .v2-hero__scroll-mouse::after {
  content: '';
  position: absolute;
  top: 7px; left: 50%;
  width: 3px; height: 8px;
  margin-left: -1.5px;
  background: #0CC0DF;
  border-radius: 2px;
  animation: v2-scroll-dot 2s ease-in-out infinite;
}
@keyframes v2-scroll-dot {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50%      { opacity: .2; transform: translateY(12px); }
}


/* ══════════════════════════════════════════════════════════════════
   2. HEADER
   ══════════════════════════════════════════════════════════════════ */
#hp-v2 .main-header {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 8px rgba(0,0,0,.05);
  transition: all 0.4s ease;
}
#hp-v2 .main-header.scrolled {
  background: rgba(255,255,255,.95);
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
#hp-v2 .main-header .logo img { filter: none; }
#hp-v2 .nav-links a { color: var(--heading, #1E293B); }
#hp-v2 .nav-links a:hover { color: #0CC0DF; }
#hp-v2 .emergency-btn {
  background: linear-gradient(135deg, #0CC0DF, #0A9BB5) !important;
  color: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 15px rgba(12,192,223,.3);
}
#hp-v2 .emergency-btn:hover {
  box-shadow: 0 6px 25px rgba(12,192,223,.45) !important;
  transform: translateY(-2px);
}
#hp-v2 .mobile-menu-toggle { color: var(--heading, #1E293B); }


/* ══════════════════════════════════════════════════════════════════
   3. SECTION ENHANCEMENTS
   ══════════════════════════════════════════════════════════════════ */
#hp-v2 [data-v2-fade] {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(.4,0,.2,1), transform 0.8s cubic-bezier(.4,0,.2,1);
}
#hp-v2 [data-v2-fade="left"] { transform: translateX(-50px); }
#hp-v2 [data-v2-fade="right"] { transform: translateX(50px); }
#hp-v2 [data-v2-fade="up"] { transform: translateY(40px); }
#hp-v2 [data-v2-fade].v2-visible { opacity: 1; transform: translate(0,0); }

/* ── 4. VIDEO GLOW ───────────────────────────────────────────────── */
#hp-v2 .v2-video-glow {
  box-shadow: 0 20px 50px rgba(15,23,42,.15), 0 8px 20px rgba(15,23,42,.08), 0 0 0 1px rgba(12,192,223,.1);
  transition: box-shadow 0.5s ease;
}
#hp-v2 .v2-video-glow:hover {
  box-shadow: 0 24px 60px rgba(12,192,223,.15), 0 8px 20px rgba(15,23,42,.08), 0 0 0 1px rgba(12,192,223,.25);
}

/* ── 5. FORM GLASS ───────────────────────────────────────────────── */
#hp-v2 .v2-form-glass {
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(12,192,223,.12);
  box-shadow: 0 10px 40px rgba(15,23,42,.06);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
#hp-v2 .v2-form-glass:hover {
  border-color: rgba(12,192,223,.2);
  box-shadow: 0 16px 50px rgba(15,23,42,.08), 0 0 40px rgba(12,192,223,.06);
}
#hp-v2 .v2-form-glass .form-input:focus {
  border-color: #0CC0DF;
  box-shadow: 0 0 0 4px rgba(12,192,223,.12), 0 0 20px rgba(12,192,223,.08);
}
#hp-v2 .v2-form-glass .submit-btn {
  border-radius: 14px; font-weight: 700; position: relative; overflow: hidden;
}
#hp-v2 .v2-form-glass .submit-btn::after {
  content: '';
  position: absolute; top: -50%; left: -100%;
  width: 60%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  transform: skewX(-20deg);
  animation: v2-btn-shimmer 4s ease-in-out infinite;
}

/* ── 6. SERVICE CARDS ────────────────────────────────────────────── */
#hp-v2 .service-card {
  transition: all 0.4s cubic-bezier(.4,0,.2,1);
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
#hp-v2 .service-card::before {
  content: '';
  position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, rgba(12,192,223,.06) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.4s ease;
  pointer-events: none;
}
#hp-v2 .service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(12,192,223,.1), 0 8px 20px rgba(15,23,42,.06);
  border-color: rgba(12,192,223,.2);
}
#hp-v2 .service-card:hover::before { opacity: 1; }
#hp-v2 .service-card .service-icon { transition: transform 0.4s cubic-bezier(.4,0,.2,1); }
#hp-v2 .service-card:hover .service-icon { transform: scale(1.15) translateY(-2px); }
#hp-v2 .service-card .btn { border-radius: 12px; transition: all 0.3s ease; }
#hp-v2 .service-card:hover .btn { box-shadow: 0 4px 16px rgba(12,192,223,.3); }
#hp-v2 .services-grid .service-card { opacity: 0; transform: translateY(30px); }
#hp-v2 .services-grid .service-card.v2-visible {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.6s cubic-bezier(.4,0,.2,1), transform 0.6s cubic-bezier(.4,0,.2,1);
}
#hp-v2 .client-logo { transition: all 0.3s ease; filter: grayscale(1); opacity: 0.6; }
#hp-v2 .client-logo:hover { filter: grayscale(0); opacity: 1; transform: scale(1.05); }

/* ── 7. AREAS ────────────────────────────────────────────────────── */
#hp-v2 .areas-column { opacity: 0; transform: translateY(30px); }
#hp-v2 .areas-column.v2-visible {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.6s cubic-bezier(.4,0,.2,1), transform 0.6s cubic-bezier(.4,0,.2,1);
}
#hp-v2 .areas-column li::before {
  width: auto; height: auto; background: none; border-radius: 0;
  content: '\203A';
  font-size: 1rem; font-weight: 700; color: var(--primary);
  transform: translateY(-50%); line-height: 1;
}
#hp-v2 .areas-column li {
  transition: all 0.25s ease;
  padding: 0.4rem 0 0.4rem 1.25rem; border-radius: 8px;
}
#hp-v2 .areas-column li:hover { color: #0CC0DF; padding-left: 1.6rem; }

/* ── 8. REVIEWS ──────────────────────────────────────────────────── */
#hp-v2 .review-card {
  transition: all 0.4s cubic-bezier(.4,0,.2,1); border: 1px solid var(--border);
}
#hp-v2 .review-card.v2-visible { opacity: 1 !important; transform: translateY(0) !important; }
#hp-v2 .review-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 40px rgba(15,23,42,.08); border-color: rgba(12,192,223,.15);
}
#hp-v2 .review-card .review-stars i { transition: transform 0.2s ease; }
#hp-v2 .review-card:hover .review-stars i { animation: v2-star-pop 0.4s ease forwards; }
@keyframes v2-star-pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1.1); } }
#hp-v2 .google-rating-badge { transition: box-shadow 0.3s ease; }
#hp-v2 .google-rating-badge:hover { box-shadow: 0 4px 20px rgba(66,133,244,.15); }

/* ── 9. CTA SECTION ──────────────────────────────────────────────── */
#hp-v2 .v2-cta-section { position: relative; overflow: hidden; }
#hp-v2 .v2-cta-glow {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(12,192,223,.15) 0%, transparent 70%);
  pointer-events: none; animation: v2-cta-breathe 4s ease-in-out infinite;
}
@keyframes v2-cta-breathe {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.15); }
}
#hp-v2 .v2-cta-section h2 { position: relative; z-index: 2; }
#hp-v2 .v2-btn-magnetic { transition: all 0.35s cubic-bezier(.4,0,.2,1); position: relative; }
#hp-v2 .v2-btn-magnetic:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 30px rgba(12,192,223,.25); }

/* ── 10. GALLERY ─────────────────────────────────────────────────── */
#hp-v2 .gallery-section { position: relative; }
#hp-v2 .gallery-nav { transition: all 0.3s ease; }
#hp-v2 .gallery-nav:hover { background: rgba(12,192,223,.9); box-shadow: 0 4px 15px rgba(12,192,223,.3); }


/* ══════════════════════════════════════════════════════════════════
   11. RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  #hp-v2 .v2-hero__content { padding: 100px 0 60px; }
  #hp-v2 .v2-hero__title-accent { font-size: clamp(2.4rem, 6vw, 3.8rem); }
}
@media (max-width: 768px) {
  #hp-v2 .v2-hero { min-height: 100svh; }
  #hp-v2 .v2-hero__content { padding: 100px 0 50px; }
  #hp-v2 .v2-hero__kicker { font-size: 0.85rem; }
  #hp-v2 .v2-hero__title-accent { font-size: clamp(2rem, 9vw, 3.2rem); line-height: 1.08; }
  #hp-v2 .v2-hero__sub { font-size: 0.95rem; margin-bottom: 24px; }
  #hp-v2 .v2-hero__ctas { flex-direction: column; align-items: center; gap: 12px; }
  #hp-v2 .v2-btn { width: 100%; max-width: 320px; justify-content: center; }
  #hp-v2 .v2-hero__scroll { display: none; }
  #hp-v2 .v2-hero__bg { background-position: center 30%; }
}
@media (max-width: 480px) {
  #hp-v2 .v2-hero__kicker { font-size: 0.75rem; }
  #hp-v2 .v2-hero__title-accent { font-size: 1.9rem; }
}


/* ── 12. JS FALLBACK ─────────────────────────────────────────────── */
@keyframes v2-fallback-show { to { opacity: 1; transform: none; } }
#hp-v2:not(.v2-js-ready) [data-v2-fade],
#hp-v2:not(.v2-js-ready) .services-grid .service-card,
#hp-v2:not(.v2-js-ready) .areas-column {
  animation: v2-fallback-show 0.6s ease 3s forwards;
}


/* ── 13. REDUCED MOTION ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #hp-v2 .v2-hero__bg--active,
  #hp-v2 .v2-hero__scroll,
  #hp-v2 .v2-hero__scroll-mouse::after,
  #hp-v2 .v2-btn--primary::after,
  #hp-v2 .v2-cta-glow,
  #hp-v2 .v2-form-glass .submit-btn::after {
    animation: none !important;
  }
  #hp-v2 .v2-hero__kicker,
  #hp-v2 .v2-hero__sub,
  #hp-v2 .v2-hero__ctas,
  #hp-v2 .v2-word-inner {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
  #hp-v2 [data-v2-fade],
  #hp-v2 .services-grid .service-card,
  #hp-v2 .areas-column {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
}
