/* ============================================================
   Maydok — Motion layer
   Hero carousel, scroll reveals, hover and nav transitions.
   Everything animated here uses transform/opacity only, and is
   switched off under prefers-reduced-motion.
   ============================================================ */

:root {
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --reveal-dist: 28px;
}

/* ------------------------------------------------------------
   HERO CAROUSEL
   ------------------------------------------------------------ */
.hero-carousel { position: relative; isolation: isolate; }
.hero-slides { position: absolute; inset: 0; z-index: 0; background: #0B0830; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s ease, visibility 0s linear 1.2s;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 1.2s ease, visibility 0s;
  z-index: 1;
}
.hero-slide img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: right center;
  transform: scale(1.04);
  transition: transform 7.5s linear;
}
.hero-slide.is-active img { transform: scale(1); }

/* Replaces the old ::before gradient: strong on the copy side so the
   headline, text and buttons stay readable on every photo. */
.hero-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11,8,48,0.94) 0%, rgba(11,8,48,0.84) 36%, rgba(11,8,48,0.35) 66%, rgba(11,8,48,0.1) 100%),
    linear-gradient(0deg, rgba(11,8,48,0.65) 0%, rgba(11,8,48,0) 28%);
}
.home-hero-art.hero-carousel::before { display: none; }
.hero-carousel .home-hero-grid { z-index: 2; }

.hero-controls-wrap {
  position: absolute; left: 0; right: 0; bottom: 88px; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  pointer-events: none;
}
.hero-controls-wrap > * { pointer-events: auto; }
.hero-caption {
  margin: 0; font-size: 0.84rem; font-weight: 500; letter-spacing: 0.01em;
  color: rgba(255,255,255,0.82);
  padding-left: 0.85rem; border-left: 2px solid var(--gold-500);
  max-width: 34ch; min-height: 1.3em;
  transition: opacity 0.45s ease;
}
.hero-caption.is-swapping { opacity: 0; }
.hero-controls { display: flex; align-items: center; gap: 0.55rem; }
.hero-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(11,8,48,0.55); color: #fff;
  border: 1.5px solid rgba(255,255,255,0.45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  cursor: pointer; padding: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease-out);
}
.hero-btn svg { width: 18px; height: 18px; }
.hero-btn:hover { background: var(--gold-500); border-color: var(--gold-500); color: var(--ink-900); transform: scale(1.06); }
.hero-btn:active { transform: scale(0.96); }
.hero-btn:focus-visible, .hero-dot:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }
.hero-playpause .i-play { display: none; }
.hero-playpause.is-paused .i-play { display: block; }
.hero-playpause.is-paused .i-pause { display: none; }

.hero-dots { display: flex; align-items: center; gap: 0.15rem; padding: 0 0.45rem; }
.hero-dot {
  /* 44px hit area, small visible dot */
  position: relative; width: 28px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
}
.hero-dot::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px; border-radius: 99px;
  background: rgba(255,255,255,0.5);
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease-out), background-color 0.25s ease;
}
.hero-dot:hover::before { background: #fff; }
.hero-dot.is-active::before { width: 24px; background: var(--gold-500); }

@media (max-width: 920px) {
  .home-hero.home-hero-art.hero-carousel { padding-bottom: 176px; }
  .hero-scrim {
    background: linear-gradient(180deg, rgba(11,8,48,0.92) 0%, rgba(11,8,48,0.78) 55%, rgba(11,8,48,0.55) 100%);
  }
  .hero-slide img { object-position: 70% center; }
  .hero-caption { display: none; }
  .hero-controls-wrap { justify-content: center; bottom: 76px; }
  .hero-btn { width: 42px; height: 42px; }
}

/* Staggered hero copy entrance (page load) */
.hero-carousel .home-hero-copy > * { opacity: 0; transform: translateY(18px); animation: heroIn 0.8s var(--ease-out) forwards; }
.hero-carousel .home-hero-copy > :nth-child(1) { animation-delay: 0.1s; }
.hero-carousel .home-hero-copy > :nth-child(2) { animation-delay: 0.25s; }
.hero-carousel .home-hero-copy > :nth-child(3) { animation-delay: 0.4s; }
.hero-carousel .home-hero-copy > :nth-child(4) { animation-delay: 0.55s; }
@keyframes heroIn { to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------
   SCROLL REVEALS (applied by js/animations.js)
   Hidden only after JS marks the element, so no-JS users see
   everything and above-the-fold content never flashes.
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(var(--reveal-dist));
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.reveal-left  { transform: translateX(calc(var(--reveal-dist) * -1)); }
.reveal.reveal-right { transform: translateX(var(--reveal-dist)); }
.reveal.reveal-fade  { transform: none; }
.reveal.is-visible { opacity: 1; transform: none; will-change: auto; }

/* ------------------------------------------------------------
   HOVER REFINEMENTS
   ------------------------------------------------------------ */
.btn {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
              transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(240,180,0,0.32); }
.btn-outline-dark:hover { box-shadow: 0 10px 22px rgba(26,17,80,0.2); }
.btn:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }

/* Arrow links nudge forward */
.home-disc-link svg { transition: transform 0.25s var(--ease-out); }
.home-disc-link:hover svg, .home-disc:hover .home-disc-link svg { transform: translateX(4px); }

/* Cards: lift + soft shadow */
.home-disc, .home-why-card, .service-card, .pillar-card, .credential-card, .glance-tile, .stat-tile,
.portfolio-card, .project-card, .detail-card, .team-role-card, .gallery-item {
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
}
.home-disc:hover, .home-why-card:hover, .service-card:hover, .pillar-card:hover, .credential-card:hover,
.portfolio-card:hover, .project-card:hover, .detail-card:hover, .team-role-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(26,17,80,0.12);
}
.home-delivery-item { transition: transform 0.25s var(--ease-out), background-color 0.25s ease; }
.home-delivery-item:hover { transform: translateY(-2px); }

/* Home project cards: image eases in, tag + title respond */
.home-proj { transition: transform 0.35s var(--ease-out); }
.home-proj img { transition: filter 0.4s ease, transform 0.7s var(--ease-out); }
.home-proj:hover { transform: translateY(-4px); }
.home-proj:hover img { transform: scale(1.025); filter: brightness(1.08); }
.home-proj h3 { transition: color 0.25s ease; }
.home-proj-tag { transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease; }
.home-proj:hover .home-proj-tag { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,0.25); }

/* Projects page cards: zoom the photo inside its frame */
.portfolio-card-media { overflow: hidden; }
.portfolio-card-media img { transition: transform 0.7s var(--ease-out); }
.portfolio-card:hover .portfolio-card-media img { transform: scale(1.05); }

/* Photo frames elsewhere */
.home-shot, .gallery-item { overflow: hidden; }
.home-shot img, .gallery-item img { transition: transform 0.7s var(--ease-out); }
.home-shot:hover img, .gallery-item:hover img { transform: scale(1.04); }

/* Links in footer slide slightly */
.footer-col a { transition: color 0.2s ease, transform 0.2s var(--ease-out); display: inline-block; }
.footer-col a:hover { transform: translateX(3px); }

/* Form fields */
.enquiry-form input, .enquiry-form select, .enquiry-form textarea,
.form-field input, .form-field select, .form-field textarea {
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
}

/* Header shadow eases in */
.site-header { transition: box-shadow 0.3s ease, background-color 0.3s ease; }

/* ------------------------------------------------------------
   MOBILE NAVIGATION
   Panel slides in, links cascade, page behind dims.
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .main-nav {
    visibility: hidden;
    transition: transform 0.38s var(--ease-out), visibility 0s linear 0.38s;
    box-shadow: -12px 0 30px rgba(26,17,80,0);
  }
  .main-nav.is-open {
    visibility: visible;
    transition: transform 0.38s var(--ease-out), visibility 0s;
    box-shadow: -12px 0 30px rgba(26,17,80,0.12);
  }
  .main-nav > a { opacity: 0; transform: translateX(18px); transition: opacity 0.3s ease, transform 0.4s var(--ease-out), color 0.2s ease; }
  .main-nav.is-open > a { opacity: 1; transform: none; }
  .main-nav.is-open > a:nth-child(1) { transition-delay: 0.08s; }
  .main-nav.is-open > a:nth-child(2) { transition-delay: 0.13s; }
  .main-nav.is-open > a:nth-child(3) { transition-delay: 0.18s; }
  .main-nav.is-open > a:nth-child(4) { transition-delay: 0.23s; }
  .main-nav.is-open > a:nth-child(5) { transition-delay: 0.28s; }
  .main-nav.is-open > a:nth-child(6) { transition-delay: 0.33s; }
  .main-nav.is-open > a:nth-child(7) { transition-delay: 0.38s; }
  .nav-toggle { transition: transform 0.2s ease; }
  .nav-toggle:active { transform: scale(0.92); }
}

/* ------------------------------------------------------------
   REDUCED MOTION — content simply appears, nothing travels
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.reveal-left, .reveal.reveal-right { opacity: 1; transform: none; transition: none; }
  .hero-carousel .home-hero-copy > * { opacity: 1; transform: none; animation: none; }
  .hero-slide, .hero-slide.is-active { transition: none; }
  .hero-slide img, .hero-slide.is-active img { transform: none; transition: none; }
  .hero-dot::before, .hero-btn, .hero-caption { transition: none; }
  .btn:hover, .home-proj:hover, .home-disc:hover, .home-why-card:hover, .service-card:hover,
  .pillar-card:hover, .credential-card:hover, .portfolio-card:hover, .project-card:hover,
  .detail-card:hover, .team-role-card:hover, .home-delivery-item:hover { transform: none; }
  .home-proj:hover img, .portfolio-card:hover .portfolio-card-media img, .home-shot:hover img, .gallery-item:hover img { transform: none; }
  .main-nav, .main-nav > a { transition: none !important; }
}
