/* --- CINEMATIC SOLUTIONS PAGE --- */

/* Clean Reset / Base overrides */
body {
  overflow-x: hidden;
}

/* HERO SECTION */
.cinematic-hero {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--bg-dark);
  background-image: url('../assets/images/solutions_page_bg.jpeg');
  background-size: cover;
  background-position: center;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 0;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: brightness(0.6);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 11, 11, 0.3), var(--bg-dark));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 60px;
  /* Offset for header */
}

.hero-title {
  font-size: 5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #ccc;
  max-width: 600px;
  margin-bottom: 40px;
  font-weight: 300;
}

.reveal-text {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

.delay-4 {
  animation-delay: 0.8s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hover Glow Button */
.glow-hover {
  position: relative;
  box-shadow: 0 0 20px rgba(245, 196, 0, 0);
  /* using accent color logic roughly */
  transition: 0.4s ease;
}

.glow-hover:hover {
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
  transform: scale(1.05);
}

/* STICKY SERVICES SECTION */
.services-wrapper {
  padding: 120px 0;
  background: var(--bg-dark);
}

.sticky-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 80px;
  align-items: start;
}

.sticky-side {
  position: sticky;
  top: 120px;
}

.section-title {
  font-size: 3rem;
  margin-bottom: 20px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 400px;
}

.scroll-cards {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.service-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.15);
  padding: 40px;
  border-radius: 12px;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
  position: relative;
  /* needed for absolute card-img */
  overflow: hidden;
  /* clips image within card */
}

.service-card:hover {
  border-color: var(--accent);
  /* only the border color changes */
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #fff;
}

.service-card p {
  color: var(--text-muted);
}

/* Card image — absolutely positioned inside card, follows finger on mobile */
.card-img {
  display: none;
  position: absolute;
  width: 240px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transform: translate(-50%, -50%);
  /* center on touch point */
  transition: opacity 0.2s ease;
  opacity: 0;
  z-index: 10;
}

/* JS adds this class on touchstart, removes on touchend */
.card-img.show {
  display: block;
  opacity: 1;
}

.btn-text {
  font-weight: 600;
  display: inline-block;
  margin-top: 25px;

  text-decoration: none;
  color: #fff;
  font-size: 15px;

  transition: color 0.3s ease;
  /* only color change */
}

/* ================= CURSOR MINI IMAGE PREVIEW ================= */
.cursor-preview {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.cursor-preview img {
  width: 260px;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

/* VISUAL BREAK (PARALLAX) */
.visual-break {
  height: 60vh;
  background: url('../assets/images/overall house 5.jpeg') center/cover no-repeat fixed;
  /* Fixed = CSS Parallax */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-break::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.center-text {
  position: relative;
  z-index: 2;
  text-align: center;
}

.center-text h2 {
  font-size: 3.5rem;
  font-weight: 700;
}

/* STICKY STACK (FEATURED PROJECTS) */
.stack-wrapper {
  padding: 120px 0 200px;
  /* Extra padding at bottom for scroll room */
  background: #000;
}

.text-center {
  text-align: center;
}

.stack-area {
  position: relative;
  /* Not sticky itself, holds content */
  width: 100%;
}

.stack-card {
  position: sticky;
  top: 150px;
  /* Sticky trigger point */
  margin-bottom: 20px;
  /* Gap for static flow if JS fails, usually controlled by height */
  transform-origin: center top;
  transition: transform 0.5s ease, opacity 0.5s ease;
  perspective: 1000px;
}

/* Stacking offset handled by top value in CSS or we can use the --i variable for calculated top */
.stack-card:nth-child(1) {
  top: 120px;
}

.stack-card:nth-child(2) {
  top: 150px;
}

.stack-card:nth-child(3) {
  top: 180px;
}

.stack-card:nth-child(4) {
  top: 210px;
}

.stack-content {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: 500px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: 0.4s;
}

.stack-content:hover {
  border-color: var(--accent);
  box-shadow: 0 -10px 50px rgba(255, 215, 0, 0.1);
}

.stack-text h3 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.stack-cat {
  color: var(--accent);
  display: block;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.stack-img {
  height: 400px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.stack-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.stack-card:hover .stack-img img {
  transform: scale(1.05);
}

/* Alternate Layout for visual variety */
.stack-card:nth-child(even) .stack-content {
  grid-template-columns: 1fr 1fr;
  /* Keep standard grid but we might swap order in media query if needed, or stick to consistency */
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .sticky-layout {
    grid-template-columns: 1fr;
  }

  .sticky-side {
    position: relative;
    top: 0;
    margin-bottom: 40px;
    height: auto;
  }

  .services-wrapper {
    padding: 60px 0;
  }


  .hero-title {
    font-size: 3rem;
  }

  /* Stack Mobile */
  .stack-content,
  .stack-card:nth-child(even) .stack-content,
  .stack-card:nth-child(odd) .stack-content {
    grid-template-columns: 1fr !important;
    padding: 30px;
    gap: 30px;
    text-align: center;
    /* Optional: Center text on mobile for better look */
  }

  .stack-img {
    height: 250px;
    order: -1;
    /* Image first on mobile */
    width: 100%;
  }

  .stack-text h3 {
    font-size: 1.8rem;
  }

  /* Disable Sticky Stacking on Mobile for clean scroll */
  .stack-card {
    position: relative;
    top: 0 !important;
    margin-bottom: 40px;
    transform: none !important;
  }

  .stack-card:nth-child(n) {
    top: 0 !important;
  }

  .center-text h2 {
    font-size: 2rem;
  }

  .stack-wrapper {
    padding: 60px 0 100px;
  }

  /* ── Service Cards ── */
  .service-card {
    padding: 40px;
    border-radius: 10px;
  }

  /* Show image inside card on tap — JS toggles .show class */
  .service-card:active {
    border-color: var(--accent);
  }

  /* Hide the floating cursor preview on mobile */
  .cursor-preview {
    display: none !important;
  }
}