/* ==========================================================================
   HASSAN AL-NOUBANI FOR DECORATION AND ROOF TILES
   Cinematic Motion & Visual Storytelling Stylesheet
   ========================================================================== */

/* Cinematic Hero Container */
.cinematic-hero {
  position: relative;
  min-height: 88vh;
  height: clamp(620px, 92vh, 940px);
  width: 100%;
  overflow: hidden;
  background-color: var(--deep-brown);
  display: flex;
  align-items: center;
  padding-top: 84px;
}

/* Hero Visual Canvas & Slides */
.hero-slider-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.4s ease;
  overflow: hidden;
  will-change: opacity, transform;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.hero-slide.exiting {
  opacity: 0;
  z-index: 1;
}

/* Cinematic Video Layer */
.hero-slide-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  background-color: var(--deep-brown);
}

/* Fallback picture sits behind the video as an immediate visual */
.hero-fallback-picture {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Ken Burns Camera Movement */
.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05) translate(0, 0);
  will-change: transform;
}

/* Alternating gentle camera motions for visual rhythm */
.hero-slide[data-motion="zoom-in"].active .hero-slide-img {
  animation: kbZoomIn 8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.hero-slide[data-motion="pan-left"].active .hero-slide-img {
  animation: kbPanLeft 8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.hero-slide[data-motion="pan-right"].active .hero-slide-img {
  animation: kbPanRight 8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.hero-slide[data-motion="zoom-out"].active .hero-slide-img {
  animation: kbZoomOut 8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes kbZoomIn {
  0% { transform: scale(1.04) translate(0, 0); }
  100% { transform: scale(1.16) translate(-1.5%, -1%); }
}

@keyframes kbPanLeft {
  0% { transform: scale(1.10) translate(2%, 0); }
  100% { transform: scale(1.05) translate(-2%, 0); }
}

@keyframes kbPanRight {
  0% { transform: scale(1.06) translate(-2%, 1%); }
  100% { transform: scale(1.14) translate(2%, -1%); }
}

@keyframes kbZoomOut {
  0% { transform: scale(1.15) translate(1%, -1%); }
  100% { transform: scale(1.05) translate(0, 0); }
}

/* Cinematic Gradient Overlays (High Contrast Architectural Grade) */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: 
    linear-gradient(180deg, rgba(33, 19, 16, 0.82) 0%, rgba(43, 26, 22, 0.55) 35%, rgba(33, 19, 16, 0.88) 100%),
    linear-gradient(90deg, rgba(33, 19, 16, 0.92) 0%, rgba(33, 19, 16, 0.72) 45%, rgba(33, 19, 16, 0.25) 100%);
}

/* Subtle Film Grain Texture Overlay */
.hero-texture {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0.04;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Hero Content Layer */
.hero-content {
  position: relative;
  z-index: 10;
  max-width: 780px;
  color: var(--warm-off-white);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.15rem;
  background-color: rgba(56, 35, 29, 0.75);
  border: 1px solid var(--border-copper);
  border-radius: var(--radius-full);
  color: var(--copper-light);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards 0.2s;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--terracotta);
  box-shadow: 0 0 10px var(--terracotta);
}

.hero-title {
  color: var(--pure-white);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.22;
  margin-bottom: 1.25rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards 0.35s;
}

.hero-title-accent {
  background: linear-gradient(135deg, var(--pure-white) 30%, var(--copper-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  line-height: 1.85;
  color: rgba(247, 243, 238, 0.92);
  margin-bottom: 2.25rem;
  max-width: 660px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards 0.5s;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards 0.65s;
}

@keyframes heroFadeUp {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero Controls & Film Sequence Indicators */
.hero-controls {
  position: absolute;
  bottom: 2.25rem;
  left: 0;
  right: 0;
  z-index: 15;
}

.hero-controls-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.hero-indicators {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.indicator-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: none;
  border: none;
  color: rgba(247, 243, 238, 0.65);
  cursor: pointer;
  padding: 0.3rem 0;
  text-align: right;
  transition: all var(--transition-normal);
}

.indicator-line {
  width: 52px;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  transition: background-color var(--transition-fast);
}

.indicator-progress {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 0;
  background-color: var(--copper);
  border-radius: 2px;
}

.indicator-item.active .indicator-line {
  background-color: rgba(255, 255, 255, 0.4);
}

.indicator-item.active .indicator-progress {
  /* Dynamic timing driven by JavaScript to match actual video clip duration */
}

.indicator-label {
  font-size: 0.78rem;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.indicator-item.active .indicator-label,
.indicator-item:hover .indicator-label {
  color: var(--pure-white);
}

/* Play/Pause & Nav Arrows */
.hero-action-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-ctrl-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: rgba(56, 35, 29, 0.7);
  border: 1px solid var(--border-copper);
  color: var(--pure-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(6px);
}

.hero-ctrl-btn:hover {
  background-color: var(--terracotta);
  border-color: var(--terracotta);
  transform: scale(1.05);
}

/* Architectural Card & Hover Transitions */
.arch-card {
  background-color: var(--card-bg-light);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.arch-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-copper);
}

.arch-card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-color: var(--deep-brown);
}

.arch-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-cinematic);
}

.arch-card:hover .arch-card-img {
  transform: scale(1.07);
}

.arch-card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgba(43, 26, 22, 0.85);
  border: 1px solid var(--border-copper);
  color: var(--copper-light);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(6px);
  z-index: 2;
}

/* Image Reveal on Scroll */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-cinematic), transform 0.8s var(--ease-cinematic);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Copper Decorative Border Accents */
.copper-frame {
  position: relative;
}

.copper-frame::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid var(--border-copper);
  border-radius: calc(var(--radius-md) + 4px);
  pointer-events: none;
  opacity: 0.6;
  transition: opacity var(--transition-normal);
}

.copper-frame:hover::after {
  opacity: 1;
  border-color: var(--copper);
}

/* Accessible Reduced Motion Compliance */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-slide-img {
    animation: none !important;
    transform: none !important;
  }

  .hero-slide-video {
    display: none !important;
  }

  .hero-badge,
  .hero-title,
  .hero-description,
  .hero-buttons {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .indicator-item.active .indicator-progress {
    transition: none !important;
    width: 100% !important;
  }
}

/* Responsive Cinematic Styles */
@media (max-width: 768px) {
  .cinematic-hero {
    min-height: 84vh;
    padding-bottom: 5rem;
  }

  .hero-controls {
    bottom: 1.25rem;
  }

  .indicator-item {
    padding: 0.5rem 0.25rem;
  }

  .indicator-line {
    width: 40px;
    height: 4px;
  }

  .hero-overlay {
    background: 
      linear-gradient(180deg, rgba(33, 19, 16, 0.88) 0%, rgba(43, 26, 22, 0.75) 50%, rgba(33, 19, 16, 0.95) 100%);
  }
}
