/* ============================================================
   MM Geomatics Surveys — Hero Section Animations
   Auto-cycling service slider, floating particles
   ============================================================ */

/* ---------- Hero background overlay (replaces old .banner) ---------- */
.hero-wrap {
    background:
        radial-gradient(1200px 600px at 20% 20%, rgba(255,67,46,0.18), transparent 60%),
        radial-gradient(900px 500px at 80% 80%, rgba(17,0,166,0.18), transparent 60%),
        linear-gradient(135deg, #0b1020 0%, #14182b 50%, #0b1020 100%);
    color: #fff;
}

.hero-wrap .overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 100%);
    z-index: 2;
}

/* ---------- Hero Layout ---------- */
.hero-wrap {
    position: relative;
    overflow: hidden;
    min-height: 720px;
    display: flex;
    align-items: center;
}

.hero-wrap .bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at 30% 50%, #000 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle at 30% 50%, #000 30%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.hero-wrap .container {
    position: relative;
    z-index: 3;
    padding: 80px 0 60px;
}

.hero-text { color: #fff; }
.hero-text h1 {
    font-size: 56px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 20px;
    text-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
.hero-text h1 .accent {
    color: #ff432e;
    position: relative;
    display: inline-block;
}
.hero-text h1 .accent::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ff432e, #ffa089);
    border-radius: 2px;
    animation: underlinePulse 3s ease-in-out infinite;
}
@keyframes underlinePulse {
    0%, 100% { transform: scaleX(1); opacity: 0.8; }
    50% { transform: scaleX(0.85); opacity: 1; }
}
.hero-text .lead {
    font-size: 22px;
    margin-bottom: 12px;
    color: rgba(255,255,255,0.92);
    font-weight: 300;
    letter-spacing: 1px;
}
.hero-text .sub {
    font-size: 16px;
    margin-bottom: 28px;
    color: rgba(255,255,255,0.75);
    max-width: 560px;
    line-height: 1.6;
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.hero-cta .btn-ghost {
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.5);
    padding: 10px 22px;
    border-radius: 4px;
    font-size: 15px;
    transition: all 0.3s ease;
    text-decoration: none;
    background: transparent;
}
.hero-cta .btn-ghost:hover {
    border-color: #ff432e;
    color: #ff432e;
    transform: translateY(-2px);
}

/* ---------- Service Slider (right side of hero) ---------- */
.hero-slider {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 1;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(0.85) rotate(-8deg);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.slide.is-active {
    opacity: 1;
    transform: scale(1) rotate(0);
    pointer-events: auto;
}

.slide-graphic {
    position: relative;
    width: 240px;
    height: 240px;
    margin-bottom: 20px;
}

.slide-graphic svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 12px 30px rgba(255,67,46,0.35));
}

/* Outer rotating ring */
.slide-graphic::before {
    content: "";
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.18);
    animation: spinSlow 22s linear infinite;
}

/* Inner pulse ring */
.slide-graphic::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(255,67,46,0.35);
    animation: pulseRing 2.8s ease-out infinite;
}

.slide.is-active .slide-graphic::after { animation-play-state: running; }
.slide:not(.is-active) .slide-graphic::after { animation-play-state: paused; }

@keyframes spinSlow {
    to { transform: rotate(360deg); }
}
@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.7; }
    80% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

.slide-label {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.slide-sublabel {
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Per-slide accent tint behind graphic */
.slide-graphic .bg-glow {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,67,46,0.18) 0%, transparent 70%);
    z-index: -1;
}

/* ---------- Slider dots ---------- */
.hero-dots {
    position: absolute;
    left: 50%;
    bottom: -36px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 4;
}
.hero-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}
.hero-dots .dot:hover { background: rgba(255,255,255,0.5); }
.hero-dots .dot.is-active {
    background: #ff432e;
    width: 28px;
    border-radius: 5px;
}

/* Pause on hover */
.hero-slider:hover .slide-graphic::before { animation-play-state: paused; }

/* ---------- Floating particles (decoration) ---------- */
.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    background: rgba(255,67,46,0.4);
    border-radius: 50%;
    filter: blur(1px);
    animation: floatUp linear infinite;
    will-change: transform, opacity;
}
@keyframes floatUp {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(40px); opacity: 0; }
}

/* ---------- Animated section divider ---------- */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto 30px;
    gap: 14px;
}
.section-divider::before,
.section-divider::after {
    content: "";
    flex: 1;
    max-width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff432e, transparent);
}
.section-divider .diamond {
    width: 10px;
    height: 10px;
    background: #ff432e;
    transform: rotate(45deg);
    animation: diamondPulse 2.4s ease-in-out infinite;
}
@keyframes diamondPulse {
    0%, 100% { transform: rotate(45deg) scale(1); box-shadow: 0 0 0 0 rgba(255,67,46,0.5); }
    50% { transform: rotate(45deg) scale(1.25); box-shadow: 0 0 0 8px rgba(255,67,46,0); }
}

/* ---------- Per-slide SVG micro-animations ---------- */
.slide.is-active .reticle {
    transform-origin: 100px 70px;
    animation: reticlePulse 2.4s ease-in-out infinite;
}
@keyframes reticlePulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.08); opacity: 1; }
}
.slide.is-active .beam {
    animation: beamBlink 1.2s ease-in-out infinite;
}
@keyframes beamBlink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
.slide.is-active .leg-l { animation: legWiggle 3s ease-in-out infinite; transform-origin: 100px 70px; }
.slide.is-active .leg-r { animation: legWiggle 3s ease-in-out infinite; animation-delay: .15s; transform-origin: 100px 70px; }
.slide.is-active .leg-c { animation: legWiggle 3s ease-in-out infinite; animation-delay: .3s; transform-origin: 100px 70px; }
@keyframes legWiggle {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.97); }
}

.slide.is-active .doc {
    animation: docFloat 4s ease-in-out infinite;
}
@keyframes docFloat {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-4px) rotate(-1deg); }
}
.slide.is-active .stamp {
    animation: stampPress 3.2s ease-in-out infinite;
}
@keyframes stampPress {
    0%, 60%, 100% { transform: scale(1) rotate(0); opacity: 1; }
    30% { transform: scale(1.18) rotate(-6deg); opacity: 1; }
    45% { transform: scale(1) rotate(0); opacity: 1; }
}

.slide.is-active .globe {
    transform-origin: 100px 100px;
    animation: globeSpin 14s linear infinite;
}
@keyframes globeSpin {
    to { transform: rotate(360deg); }
}
.ping {
    transform-origin: center;
    transform-box: fill-box;
    animation: ringExpand 1.8s ease-out infinite;
}
@keyframes ringExpand {
    0% { transform: scale(0.6); opacity: 1; }
    80% { transform: scale(2.4); opacity: 0; }
    100% { transform: scale(2.4); opacity: 0; }
}

.slide.is-active .hub {
    transform-origin: 100px 100px;
    animation: hubBeat 1.4s ease-in-out infinite;
}
@keyframes hubBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
.slide.is-active .node {
    transform-origin: center;
    transform-box: fill-box;
    animation: nodeFloat 3.2s ease-in-out infinite;
}
.slide.is-active .node:nth-child(2) { animation-delay: 0s; }
.slide.is-active .node:nth-child(3) { animation-delay: .4s; }
.slide.is-active .node:nth-child(4) { animation-delay: .8s; }
.slide.is-active .node:nth-child(5) { animation-delay: 1.2s; }
@keyframes nodeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.slide.is-active .conn {
    stroke-dasharray: 4 4;
    animation: connDash 1.6s linear infinite;
}
@keyframes connDash {
    to { stroke-dashoffset: -16; }
}
.slide.is-active .data-stream path {
    animation: streamBlink 1s ease-in-out infinite;
}
@keyframes streamBlink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.slide.is-active .drone {
    animation: droneHover 2.4s ease-in-out infinite;
}
@keyframes droneHover {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.slide.is-active .prop ellipse {
    transform-origin: center;
    transform-box: fill-box;
    animation: propSpin .35s linear infinite;
}
@keyframes propSpin {
    to { transform: rotate(360deg) scaleX(0.4); }
}
.slide.is-active .drop {
    transform-origin: center;
    transform-box: fill-box;
    animation: dropFall 1.4s ease-in infinite;
    opacity: 0;
}
@keyframes dropFall {
    0% { transform: translateY(-30px); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}

.slide.is-active .terrain {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: terrainDraw 3s ease-out forwards;
}
@keyframes terrainDraw {
    to { stroke-dashoffset: 0; }
}
.slide.is-active .plane {
    animation: planeFly 5s ease-in-out infinite;
}
@keyframes planeFly {
    0% { transform: translateX(-30px) translateY(0); }
    50% { transform: translateX(20px) translateY(-3px); }
    100% { transform: translateX(-30px) translateY(0); }
}
.slide.is-active .scan line {
    animation: scanBlink 1.4s ease-in-out infinite;
}
@keyframes scanBlink {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.8; }
}
.slide.is-active .mp {
    transform-origin: center;
    transform-box: fill-box;
    animation: mpBlink 1.4s ease-in-out infinite;
}
@keyframes mpBlink {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0.5; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .slide,
    .slide-graphic::before,
    .slide-graphic::after,
    .particle,
    .section-divider .diamond,
    .hero-text h1 .accent::after,
    .slide.is-active .reticle,
    .slide.is-active .beam,
    .slide.is-active .leg-l,
    .slide.is-active .leg-r,
    .slide.is-active .leg-c,
    .slide.is-active .doc,
    .slide.is-active .stamp,
    .slide.is-active .globe,
    .slide.is-active .hub,
    .slide.is-active .node,
    .slide.is-active .conn,
    .slide.is-active .data-stream path,
    .slide.is-active .drone,
    .slide.is-active .prop ellipse,
    .slide.is-active .drop,
    .slide.is-active .terrain,
    .slide.is-active .plane,
    .slide.is-active .scan line,
    .slide.is-active .mp,
    .ping {
        animation: none !important;
        transition: none !important;
    }
    .slide.is-active { transform: scale(1); }
}

/* ---------- Mobile ---------- */
@media (max-width: 991px) {
    .hero-wrap { min-height: auto; padding-top: 40px; }
    .hero-text h1 { font-size: 40px; }
    .hero-text .lead { font-size: 18px; }
    .hero-slider { max-width: 360px; margin-top: 40px; }
    .slide-graphic { width: 200px; height: 200px; }
}
@media (max-width: 576px) {
    .hero-text h1 { font-size: 32px; }
    .hero-text .lead { font-size: 16px; }
    .hero-slider { max-width: 280px; }
    .slide-graphic { width: 170px; height: 170px; }
    .slide-label { font-size: 18px; }
}
