/*
 * NexScaleX Motion & Wayfinding UX v6 (1.3.77)
 * Executive neutral palette (#111418, #f4f2ef, #dce0e5, #39424e) + Poppins / Alexandria.
 * Zero purple/neon gradients. Zero mirroring of founder portrait.
 */

/* 1. Viewport Stability (overflow-x: clip preserves position: sticky everywhere) */
html {
    scroll-padding-top: 102px;
}
body {
    overflow-x: clip;
}

/* 2. CRITICAL LIVE FIX: Keep Google AdSense Auto-Ads completely out of Header, Dark Heroes, Hub Controls & Top of Main */
.nxs-site-header :is(.google-auto-placed, ins.adsbygoogle),
.nxs-page-hero :is(.google-auto-placed, ins.adsbygoogle),
.nxs-heritage-hero :is(.google-auto-placed, ins.adsbygoogle),
.nxs-hero :is(.google-auto-placed, ins.adsbygoogle),
.nxs-blog-hub-hero :is(.google-auto-placed, ins.adsbygoogle),
.nxs-hub-controls :is(.google-auto-placed, ins.adsbygoogle),
.nxs-wayfinding-strip :is(.google-auto-placed, ins.adsbygoogle),
main > .google-auto-placed,
main > ins.adsbygoogle.adsbygoogle-noablate {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 3. Sticky Blurred Glass Executive Header + Reading Progress Bar */
.nxs-site-header {
    position: sticky !important;
    top: 0;
    z-index: 340 !important;
    background: rgba(17, 20, 24, 0.92) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    transition: box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}
@media (min-width: 601px) {
    body.admin-bar .nxs-site-header {
        top: var(--wp-admin--admin-bar--height, 32px);
    }
}
.nxs-site-header.is-scrolled {
    background: rgba(17, 20, 24, 0.96) !important;
    border-bottom-color: rgba(220, 224, 229, 0.16) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
}

/* Smooth Article Reading Progress Bar inside Sticky Header */
.nxs-reading-progress {
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 2.5px;
    background: transparent;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.nxs-reading-progress.is-active {
    opacity: 1;
}
.nxs-reading-progress > span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #b8bec6 0%, #f4f2ef 100%);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}
body.nxs-ar .nxs-reading-progress > span,
[dir="rtl"] .nxs-reading-progress > span {
    transform-origin: right center;
}

/* Header AI Concierge Button & Nav Actions Balance */
.nxs-site-header .nxs-nav-actions {
    gap: 14px;
    flex-wrap: nowrap;
}
.nxs-nav-concierge-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    color: #f4f2ef;
    border: 1px solid rgba(220, 224, 229, 0.26);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.nxs-nav-concierge-btn:hover {
    background: #dce0e5;
    color: #111418;
    border-color: #dce0e5;
}
.nxs-nav-concierge-btn:focus-visible {
    outline: 2px solid #dce0e5 !important;
    outline-offset: 3px;
}
.nxs-concierge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #dce0e5;
    box-shadow: 0 0 0 0 rgba(220, 224, 229, 0.65);
    flex: none;
    animation: nxs-subtle-pulse 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.nxs-nav-concierge-btn:hover .nxs-concierge-dot {
    background: #111418;
    animation: none;
}
@keyframes nxs-subtle-pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 224, 229, 0.55); }
    70% { box-shadow: 0 0 0 6px rgba(220, 224, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 224, 229, 0); }
}

@media (min-width: 961px) and (max-width: 1260px) {
    .nxs-site-header .nxs-header-inner { gap: 18px; }
    .nxs-site-header .nxs-nav-list { gap: 15px; }
    .nxs-site-header .nxs-nav-actions { gap: 10px; }
    .nxs-nav-concierge-btn { padding: 7px 11px; font-size: 12px; }
    .nxs-site-header .nxs-header-cta { padding: 9px 12px; font-size: 12.5px; gap: 8px; }
}
@media (max-width: 960px) {
    .nxs-primary-nav .nxs-nav-actions {
        flex-wrap: wrap;
        gap: 10px 12px;
    }
    .nxs-nav-concierge-btn {
        min-height: 46px;
        padding: 10px 16px;
        font-size: 14px;
        background: rgba(255, 255, 255, 0.08);
    }
}

/* 4. Homepage 10-Second Wayfinding Compass Strip */
.nxs-wayfinding-strip {
    background: #15191e;
    color: #f4f2ef;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid #2e353e;
    padding-block: clamp(28px, 3.8vw, 46px);
    position: relative;
    z-index: 2;
}
.nxs-wayfinding-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 24px;
    margin-bottom: clamp(18px, 2.4vw, 26px);
}
.nxs-wayfinding-kicker {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b8bec6;
    margin-bottom: 6px;
}
body.nxs-ar .nxs-wayfinding-kicker {
    font-size: 12.5px;
    letter-spacing: 0;
    text-transform: none;
}
.nxs-wayfinding-title {
    margin: 0 !important;
    font-size: clamp(21px, 2.2vw, 29px) !important;
    line-height: 1.3 !important;
    font-weight: 600;
    color: #ffffff;
}
.nxs-wayfinding-bot-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 8px 16px;
    background: #1e242c;
    color: #dce0e5;
    border: 1px solid #3c4550;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.nxs-wayfinding-bot-btn:hover {
    background: #dce0e5;
    color: #111418;
    border-color: #dce0e5;
}
.nxs-wayfinding-bot-btn:hover .nxs-concierge-dot {
    background: #111418;
}
.nxs-wayfinding-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.nxs-wayfinding-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px 20px 20px;
    background: #1b2027;
    border: 1px solid #323a44;
    border-radius: 6px;
    color: #f4f2ef !important;
    text-decoration: none !important;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.28s ease;
}
.nxs-wayfinding-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(320px circle at var(--nxs-mx, 50%) var(--nxs-my, 0%), rgba(220, 224, 229, 0.09), transparent 65%);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
    z-index: -1;
}
.nxs-wayfinding-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.nxs-wayfinding-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    background: rgba(220, 224, 229, 0.08);
    border: 1px solid rgba(220, 224, 229, 0.16);
    color: #dce0e5;
    transition: background-color 0.22s ease, color 0.22s ease;
}
.nxs-wayfinding-num {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #8f9aa7;
    font-variant-numeric: tabular-nums;
}
.nxs-wayfinding-card-title {
    margin: 0 0 8px !important;
    font-size: 17.5px !important;
    line-height: 1.38 !important;
    font-weight: 600;
    color: #ffffff;
}
body.nxs-ar .nxs-wayfinding-card-title {
    font-size: 17px !important;
    line-height: 1.55 !important;
}
.nxs-wayfinding-card-sub {
    margin: 0 0 18px !important;
    font-size: 13.5px;
    line-height: 1.68;
    color: #bcc5d0;
}
body.nxs-ar .nxs-wayfinding-card-sub {
    font-size: 14px;
    line-height: 1.8;
}
.nxs-wayfinding-card-cta {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    font-weight: 600;
    color: #dce0e5;
}
.nxs-wayfinding-arrow {
    display: inline-block;
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) and (pointer: fine) {
    .nxs-wayfinding-card:hover {
        transform: translateY(-3px);
        background: #212730;
        border-color: #dce0e5;
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
    }
    .nxs-wayfinding-card:hover::before {
        opacity: 1;
    }
    .nxs-wayfinding-card:hover .nxs-wayfinding-icon {
        background: #dce0e5;
        color: #111418;
    }
    .nxs-wayfinding-card:hover .nxs-wayfinding-arrow {
        transform: translate(3px, -3px);
    }
    body.nxs-ar .nxs-wayfinding-card:hover .nxs-wayfinding-arrow {
        transform: translate(-3px, -3px);
    }
}
.nxs-wayfinding-card:focus-visible {
    outline: 2px solid #dce0e5 !important;
    outline-offset: 3px;
    border-color: #dce0e5;
}
@media (max-width: 1120px) {
    .nxs-wayfinding-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .nxs-wayfinding-strip {
        padding-block: 24px 28px;
    }
    .nxs-wayfinding-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
    .nxs-wayfinding-card {
        padding: 18px 16px;
    }
    .nxs-wayfinding-bot-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 5. Progressive Scroll-Reveal Choreography (100% Visible by Default; Zero opacity: 0 Pre-Hide) */
[data-nxs-reveal] {
    opacity: 1;
}
@keyframes nxs-v6-enter {
    from {
        opacity: 0.85;
        transform: translate3d(0, 12px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}
html.nxs-motion-ready [data-nxs-reveal].is-revealed {
    animation: nxs-v6-enter 480ms cubic-bezier(0.22, 1, 0.36, 1) var(--nxs-stagger, 0ms) both;
}

/* 6. Infographic Bar Choreography ([data-nxs-bar] animates width 0 -> target %) */
[data-nxs-bar] {
    transition: width 0.92s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 7. Tactile Card Micro-Interactions & Crisp Focus Rings Across Phone & Desktop */
@media (hover: hover) and (pointer: fine) {
    :is(.nxs-tool-card, .nxs-deliverable-card, .nxs-project-card, .nxs-post-card, .nxs-blog-card, .nxs-series-card, .nxs-affiliate-card) {
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.24s ease;
    }
    :is(.nxs-deliverable-card, .nxs-project-card, .nxs-post-card):hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 30px rgba(17, 20, 24, 0.08);
    }
}

body :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--nxs-focus, #39424e) !important;
    outline-offset: 3px;
}

/* Portrait Integrity Safeguard: Never mirror founder hero artwork */
.nxs-heritage-hero .nxs-cinematic-image :is(picture, img) {
    transform: none !important;
}

/* Mobile 375px Ergonomics & Breathing Room */
@media (max-width: 420px) {
    :root {
        --nxs-gutter: 18px;
    }
    .nxs-hero-cta-row {
        flex-direction: column;
        align-items: stretch;
    }
    .nxs-hero-cta-row > a {
        justify-content: center;
        text-align: center;
        width: 100%;
    }
    .nxs-growth-audit-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .nxs-growth-audit-actions > a {
        justify-content: center;
        width: 100%;
    }
}

/* 8. Full Reduced-Motion Compliance */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }
    html.nxs-motion-ready [data-nxs-reveal],
    html.nxs-motion-ready [data-nxs-reveal].is-revealed {
        opacity: 1 !important;
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }
    [data-nxs-bar],
    .nxs-wayfinding-card,
    .nxs-wayfinding-arrow,
    .nxs-concierge-dot,
    .nxs-site-header {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
