/**
 * MotionMind Child — Hero Section, Logo & Visualization SEO Styles
 * Resolves header logo sizing, 3D WebGL docking, mobile layout, and semantic captions.
 */

/* 1. Header Brand & Logo Sizing (Applies to both custom-logo and brand-logo-img) */
.site-header .brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
}

.site-header .brand .custom-logo,
.site-header .brand .brand-logo-img {
    display: block !important;
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 9px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4) !important;
    border: 1px solid rgba(124, 108, 255, 0.35) !important;
    background: #070711 !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

.site-header .brand:hover .custom-logo,
.site-header .brand:hover .brand-logo-img {
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(124, 108, 255, 0.55);
}

.site-header .brand .brand-name {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
    color: #ffffff;
    white-space: nowrap;
}

/* Ensure mobile header brand is always visible and accessible */
@media (max-width: 1000px) {
    body.has-transparent-header .site-header .brand {
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
    }
    body.has-transparent-header .header-inner > .brand {
        order: 1 !important;
    }
    body.has-transparent-header .header-inner > .site-nav {
        order: 2 !important;
    }
    body.has-transparent-header .header-inner > .nav-toggle {
        order: 3 !important;
    }
}

/* 2. Hero Section Semantic Structure & Centerpiece */
.hero-visual-centerpiece {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
    z-index: 1;
}

h1.hero-wordmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 0;
    font-weight: normal;
}

/* Hero fallback brand logo */
.hero-brand-logo {
    display: block;
    width: clamp(90px, 13vw, 140px);
    height: clamp(90px, 13vw, 140px);
    border-radius: 24px;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.45), 0 0 50px rgba(69, 202, 255, 0.25);
    border: 1px solid rgba(124, 108, 255, 0.4);
    background: radial-gradient(circle at 30% 30%, #15152a, #070711);
    filter: drop-shadow(0 15px 35px rgba(124, 108, 255, 0.4));
    transition: transform 0.4s ease;
    margin: 0 auto;
}

/* 3. Hero Desktop vs Mobile Harmony (Preventing Double-Logo or Overlap) */
.hero-stage {
    position: relative;
    min-height: max(100svh, 720px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

@media (min-width: 1001px) and (min-height: 701px) {
    .hero-logo-fallback {
        position: absolute;
        left: 50%;
        top: 28%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        transition: opacity 0.6s ease;
    }
    .hero-logo-fallback .logo-hero-mark {
        display: none;
    }
    /* When WebGL is ready, the 3D rotating canvas renders; hide fallback to prevent duplicate overlapping logo */
    html.gl-ready .hero-logo-fallback {
        opacity: 0 !important;
        pointer-events: none !important;
        visibility: hidden;
    }
    html.no-webgl .hero-logo-fallback,
    html.mm-static .hero-logo-fallback {
        opacity: 1 !important;
        pointer-events: auto !important;
        visibility: visible;
    }
}

@media (max-width: 1000px) {
    .hero-stage {
        min-height: 100svh;
        justify-content: flex-start;
        padding-top: 115px;
        padding-bottom: 40px;
    }
    .hero-visual-centerpiece {
        position: relative;
        inset: auto;
        display: flex;
        justify-content: center;
        margin-bottom: 18px;
        z-index: 2;
    }
    .hero-logo-fallback {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        opacity: 1 !important;
        visibility: visible !important;
        display: flex;
        justify-content: center;
    }
    .hero-logo-fallback .logo-hero-mark {
        display: none;
    }
    .hero-brand-logo {
        width: 90px;
        height: 90px;
        border-radius: 20px;
    }
    .hero-ui {
        padding-bottom: 20px;
    }
}

/* 4. Semantic SEO Visualizations (Service Previews) */
figure.mm-preview {
    margin: 0;
    position: relative;
}

.mm-preview-caption {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
    padding: 9px 14px;
    margin-top: 10px;
    background: rgba(17, 17, 34, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    transition: color 0.25s, border-color 0.25s;
}

.mm-home-service:hover .mm-preview-caption {
    color: #a5c2ff;
    border-color: rgba(124, 108, 255, 0.35);
}
