/* =====================================================
   NEXiiO Homepage - refined dark theme
   Font: Vazirmatn (bundled offline)
   Brand tokens (--accent, --accent-2, --gradient, --glow, --bg...)
   remain overridable via admin CustomCss
   ===================================================== */

@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../webfonts/Vazirmatn-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../webfonts/Vazirmatn-Bold.woff2') format('woff2');
}

:root {
    --bg: #0b0a10;
    --bg-2: #0f0d16;
    --surface: rgba(255,255,255,.035);
    --surface-2: rgba(255,255,255,.06);
    --surface-3: rgba(255,255,255,.09);
    --border: rgba(255,255,255,.08);
    --border-strong: rgba(255,255,255,.15);
    --text: #f5f3fa;
    --muted: #a3a0b2;
    --accent: #f59e0b;
    --accent-2: #ff8656;
    --gradient: linear-gradient(135deg, #f59e0b 0%, #ff8656 100%);
    --glow: rgba(245,158,11,.28);
    --on-accent: #1a1005;
    --radius: 20px;
    --radius-sm: 12px;
    --ease: cubic-bezier(.2,.8,.2,1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    text-align: start;
    overflow-x: hidden;
    line-height: 1.9;
    font-size: .97rem;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.4;
}

img {
    max-width: 100%;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

.skip-link {
    position: fixed;
    top: -60px;
    inset-inline-start: 1rem;
    z-index: 2000;
    background: var(--accent);
    color: var(--on-accent);
    padding: .5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    transition: top .2s;
}

    .skip-link:focus {
        top: 1rem;
        color: var(--on-accent);
    }

.scroll-progress {
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: 3px;
    z-index: 1100;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: right;
    pointer-events: none;
}

[dir="ltr"] .scroll-progress {
    transform-origin: left;
}

/* ---------- Buttons ---------- */
.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .8rem 1.8rem;
    border-radius: 14px;
    border: 1px solid transparent;
    font-family: inherit;
    font-weight: 700;
    font-size: .92rem;
    line-height: 1.4;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s, color .25s;
}

    .home-btn i {
        font-size: .8rem;
        transition: transform .25s var(--ease);
    }

    .home-btn:hover i.fa-arrow-left {
        transform: translateX(-4px);
    }

[dir="ltr"] .home-btn i.fa-arrow-left {
    transform: scaleX(-1);
}

[dir="ltr"] .home-btn:hover i.fa-arrow-left {
    transform: scaleX(-1) translateX(-4px);
}

.home-btn-sm {
    padding: .55rem 1.2rem;
    font-size: .85rem;
    border-radius: 11px;
}

.home-btn-primary {
    background: var(--gradient);
    color: var(--on-accent);
    box-shadow: 0 8px 26px var(--glow);
}

    .home-btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 36px var(--glow);
        color: var(--on-accent);
    }

.home-btn-ghost {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
}

    .home-btn-ghost:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

.home-btn-dark {
    background: #16110a;
    color: #fff;
}

    .home-btn-dark:hover {
        transform: translateY(-2px);
        color: #fff;
        box-shadow: 0 12px 30px rgba(0,0,0,.35);
    }

/* ---------- Navbar ---------- */
.home-navbar {
    padding: 1rem 0;
    transition: background .3s, padding .3s, border-color .3s;
    border-bottom: 1px solid transparent;
    z-index: 1050;
}

    .home-navbar.scrolled {
        background: rgba(11,10,16,.78);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        border-bottom-color: var(--border);
        padding: .6rem 0;
    }

    .home-navbar .brand-logo {
        height: 34px;
        width: auto;
        max-width: 180px;
        object-fit: contain;
        display: block;
    }

    .home-navbar .nav-link {
        color: var(--muted) !important;
        font-weight: 600;
        font-size: .92rem;
        padding: .5rem .9rem !important;
        transition: color .2s;
    }

        .home-navbar .nav-link:hover, .home-navbar .nav-link.active {
            color: var(--text) !important;
        }

        .home-navbar .nav-link.active {
            box-shadow: inset 0 -2px 0 var(--accent);
        }

    .home-navbar .navbar-toggler {
        border-color: var(--border-strong);
    }

@media (max-width: 991.98px) {
    .home-navbar .navbar-collapse {
        background: rgba(11,10,16,.96);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 1rem;
        margin-top: .8rem;
    }

    .home-navbar .home-btn {
        width: 100%;
        margin-top: .6rem;
    }
}

/* ---------- Hero ---------- */
.home-hero {
    position: relative;
    padding: 9rem 0 6.5rem;
    min-height: 92vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(70% 70% at 50% 35%, #000 20%, transparent 75%);
    mask-image: radial-gradient(70% 70% at 50% 35%, #000 20%, transparent 75%);
    opacity: .55;
}

.hero-glow {
    position: absolute;
    z-index: 0;
    width: 720px;
    height: 720px;
    top: -280px;
    inset-inline-start: -180px;
    background: radial-gradient(circle, rgba(245,158,11,.22), transparent 65%);
    pointer-events: none;
}

.home-hero .container {
    position: relative;
    z-index: 2;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1.3rem;
    padding: .35rem 1rem;
    border-radius: 50px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: .8rem;
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52,211,153,.6);
    animation: livePulse 2.2s infinite;
}

@keyframes livePulse {
    70% {
        box-shadow: 0 0 0 9px rgba(52,211,153,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52,211,153,0);
    }
}

.home-hero h1 {
    font-size: clamp(2.1rem, 4.4vw, 3.3rem);
    line-height: 1.35;
    margin-bottom: 1.1rem;
    color: #fff;
}

.home-hero .hero-sub {
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 540px;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
}

.hero-visual {
    position: relative;
}

.hero-frame {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    box-shadow: 0 40px 100px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.02);
}

.frame-bar {
    display: flex;
    gap: 6px;
    padding: .7rem 1rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

    .frame-bar i {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--surface-3);
    }

.hero-frame img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.hero-chip {
    position: absolute;
    bottom: -24px;
    inset-inline-start: -20px;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1.2rem;
    border-radius: 16px;
    background: rgba(15,13,22,.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    box-shadow: 0 20px 50px rgba(0,0,0,.5);
}

.hc-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--gradient);
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hc-num {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.hc-label {
    font-size: .78rem;
    color: var(--muted);
}

/* ---------- Stats ---------- */
.home-stats {
    position: relative;
    z-index: 3;
    margin-top: -1.5rem;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.6rem;
    border-inline-start: 1px solid var(--border);
}

    .stat-card:first-child {
        border-inline-start: 0;
    }

.stat-icon {
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: rgba(245,158,11,.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-num {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    color: var(--muted);
    font-size: .85rem;
}

@media (max-width: 575.98px) {
    .stat-card {
        border-inline-start: 0;
        border-top: 1px solid var(--border);
    }

        .stat-card:first-child {
            border-top: 0;
        }
}

/* ---------- Sections ---------- */
.home-section {
    padding: 6rem 0;
    position: relative;
}

.section-head {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 3rem;
}

    .section-head h2, .section-title {
        font-size: clamp(1.6rem, 3vw, 2.2rem);
        margin: 0;
    }

    .section-head p {
        color: var(--muted);
        margin: .8rem 0 0;
    }

/* ---------- Feature cards ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.2rem;
}

.feature-card {
    --mx: 50%;
    --my: 0%;
    position: relative;
    padding: 2rem 1.7rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color .3s, transform .3s var(--ease), opacity .7s var(--ease);
}

    .feature-card::before {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        opacity: 0;
        transition: opacity .3s;
        background: radial-gradient(360px circle at var(--mx) var(--my), rgba(245,158,11,.13), transparent 60%);
    }

    .feature-card:hover {
        border-color: var(--border-strong);
    }

        .feature-card:hover::before {
            opacity: 1;
        }

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin-bottom: 1.3rem;
    overflow: hidden;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    position: relative;
}

    .feature-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.feature-card h3 {
    font-size: 1.08rem;
    margin-bottom: .5rem;
    position: relative;
}

.feature-card p {
    color: var(--muted);
    font-size: .92rem;
    margin: 0;
    position: relative;
}

/* ---------- About ---------- */
.home-about {
    background: var(--bg-2);
    border-block: 1px solid var(--border);
}

.about-frame {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
    background: var(--surface);
}

    .about-frame img {
        width: 100%;
        aspect-ratio: 4 / 3;
        object-fit: cover;
        display: block;
    }

.about-text {
    color: var(--muted);
    margin: 1rem 0 1.8rem;
    max-width: 560px;
}

/* ---------- Video ---------- */
.video-poster {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--surface);
    cursor: pointer;
}

    .video-poster img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform .6s var(--ease);
    }

    .video-poster:hover img {
        transform: scale(1.04);
    }

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11,10,16,.1), rgba(11,10,16,.6));
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--gradient);
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 12px 34px var(--glow);
    transition: transform .3s var(--ease);
}

    .play-btn i {
        margin-inline-start: 4px;
    }

.video-poster:hover .play-btn {
    transform: translate(-50%, -50%) scale(1.08);
}

.video-caption {
    color: var(--muted);
    text-align: center;
    margin: 1rem 0 0;
}

#homeVideoModal .modal-content {
    background: #000;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
}

#homeVideo {
    display: block;
    background: #000;
}

.modal-close {
    position: absolute;
    top: .4rem;
    inset-inline-end: 1rem;
    z-index: 5;
    color: #fff;
    text-shadow: none;
    opacity: .8;
}

/* ---------- CTA ---------- */
.home-cta-wrap {
    padding: 2rem 0 6rem;
}

.home-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 3rem;
    border-radius: 28px;
    background: var(--gradient);
    color: var(--on-accent);
    box-shadow: 0 30px 80px var(--glow);
}

    .home-cta h2 {
        font-size: clamp(1.4rem, 2.6vw, 1.9rem);
        margin: 0 0 .4rem;
    }

    .home-cta p {
        margin: 0;
        opacity: .85;
        max-width: 560px;
    }

@media (max-width: 767.98px) {
    .home-cta {
        padding: 2rem 1.5rem;
    }

        .home-cta .home-btn {
            width: 100%;
        }
}

/* ---------- Footer ---------- */
.home-footer {
    background: #07060b;
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.4rem;
    color: var(--muted);
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.home-footer .brand-logo {
    height: 38px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.home-footer a {
    color: var(--muted);
    transition: color .2s;
}

    .home-footer a:hover {
        color: var(--accent);
    }

.footer-social a {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin-inline-start: .5rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    transition: transform .25s var(--ease), background .25s, color .25s;
}

    .footer-social a:hover {
        background: var(--gradient);
        color: var(--on-accent);
        transform: translateY(-3px);
    }

.home-footer .copyright {
    border-top: 1px solid var(--border);
    padding-top: 1.3rem;
    font-size: .85rem;
    text-align: center;
}

/* ---------- Custom body html ---------- */
.home-body-html img {
    max-width: 100%;
}

.home-body-html {
    color: var(--text);
}

/* ---------- Reveal (one calm fade-up) ---------- */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

    .js .reveal.visible {
        opacity: 1;
        transform: none;
    }

.js .feature-card.reveal.visible:hover {
    transform: translateY(-4px);
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .hero-chip {
        display: none;
    }

    .home-hero {
        min-height: auto;
        padding: 7rem 0 4rem;
    }

    .hero-visual {
        margin-top: 2.5rem;
    }

    .home-section {
        padding: 4.5rem 0;
    }
}

@media (max-width: 575.98px) {
    .hero-actions .home-btn {
        width: 100%;
    }

    .home-hero h1 {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation: none !important;
        transition-duration: .01ms !important;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
    }
}
