/* ============================================================
   MenuKor — Modern homepage layer
   Pure enhancement on top of style.css: no markup/section tags
   are changed, so admin settings and the home addons keep working.
   Hidden "before reveal" states only apply once JS adds .hm-js.
   ============================================================ */

:root {
    --hm-ease: cubic-bezier(.22, 1, .36, 1);
    --hm-glow: rgba(201, 169, 97, .55);
}

/* ---------- Scroll progress ---------- */
.hm-progress {
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: 3px;
    z-index: 2000;
    pointer-events: none;
    background: linear-gradient(90deg, var(--c-accent), #f3d98f, var(--c-primary-light));
    transform: scaleX(var(--hm-progress, 0));
    transform-origin: left center;
}
[dir="rtl"] .hm-progress {
    transform-origin: right center;
}

/* ---------- Glass navbar after scrolling ---------- */
body.hm-home .site-navbar {
    transition: background-color .35s ease, box-shadow .35s ease, padding .35s ease, backdrop-filter .35s ease;
}
body.hm-home.hm-scrolled .site-navbar {
    background-color: rgba(250, 246, 240, .78) !important;
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    box-shadow: 0 10px 30px rgba(18, 53, 40, .08);
}

/* ---------- Hero: living background ---------- */
.hero .hm-hero-fx {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    mix-blend-mode: screen;
}
.hm-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .55;
    will-change: transform;
    translate: var(--hm-px, 0) var(--hm-py, 0);
    transition: translate .6s var(--hm-ease);
}
.hm-orb-1 {
    width: 420px;
    height: 420px;
    top: -120px;
    inset-inline-end: -80px;
    background: radial-gradient(circle, rgba(201, 169, 97, .75), transparent 65%);
    animation: hmFloat1 16s ease-in-out infinite;
}
.hm-orb-2 {
    width: 360px;
    height: 360px;
    bottom: -140px;
    inset-inline-start: 8%;
    background: radial-gradient(circle, rgba(45, 110, 84, .9), transparent 65%);
    animation: hmFloat2 19s ease-in-out infinite;
}
.hm-orb-3 {
    width: 240px;
    height: 240px;
    top: 30%;
    inset-inline-start: 45%;
    background: radial-gradient(circle, rgba(243, 217, 143, .45), transparent 65%);
    animation: hmFloat3 13s ease-in-out infinite;
}
.hm-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.2px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%);
    animation: hmGridDrift 40s linear infinite;
}
.hm-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    color: #fff;
    font-size: 1.35rem;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
    animation: hmBob 7s ease-in-out infinite;
}
/* Slide text sits on the start side, so the icons float on the opposite side. */
.hm-chip-1 { top: 20%; inset-inline-end: 9%; animation-delay: -1s; }
.hm-chip-2 { top: 58%; inset-inline-end: 20%; animation-delay: -3s; width: 46px; height: 46px; font-size: 1.1rem; }
.hm-chip-3 { top: 14%; inset-inline-end: 30%; animation-delay: -5s; width: 42px; height: 42px; font-size: 1rem; opacity: .8; }
.hm-chip-4 { bottom: 18%; inset-inline-end: 6%; animation-delay: -2s; }

.hm-scroll-cue {
    position: absolute;
    bottom: 3.6rem;
    left: 50%;
    z-index: 5;
    width: 26px;
    height: 42px;
    margin-left: -13px;
    border: 2px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    pointer-events: none;
}
.hm-scroll-cue::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 4px;
    background: var(--c-accent);
    animation: hmScrollCue 1.8s ease-in-out infinite;
}

/* Hero text entrance (restarts on every slide) */
.hm-js .hero .hero-eyebrow,
.hm-js .hero h1,
.hm-js .hero p.lead,
.hm-js .hero .hero-content .btn {
    opacity: 0;
}
.hm-js .hero .carousel-item.active .hero-eyebrow,
.hm-js .hero > .hero-content .hero-eyebrow { animation: hmRise .8s var(--hm-ease) .1s both; }
.hm-js .hero .carousel-item.active h1,
.hm-js .hero > .hero-content h1 { animation: hmRise .9s var(--hm-ease) .22s both; }
.hm-js .hero .carousel-item.active p.lead,
.hm-js .hero > .hero-content p.lead { animation: hmRise .9s var(--hm-ease) .36s both; }
.hm-js .hero .carousel-item.active .hero-content .btn,
.hm-js .hero > .hero-content .btn { animation: hmRise .9s var(--hm-ease) .5s both; }

.hero-eyebrow {
    padding: .35rem .85rem;
    border-radius: 999px;
    background: rgba(201, 169, 97, .14);
    border: 1px solid rgba(201, 169, 97, .35);
    letter-spacing: .08em;
}
.hero h1 {
    background: linear-gradient(100deg, #fff 0%, #fff 40%, #f3d98f 50%, #fff 60%, #fff 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hm-js .hero .carousel-item.active h1,
.hm-js .hero > .hero-content h1 {
    animation: hmRise .9s var(--hm-ease) .22s both, hmShine 6s ease-in-out 1.4s infinite;
}

/* ---------- Shiny call-to-action buttons ---------- */
.hero .btn-accent,
.home-cta-section .btn,
.plan-card .btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.hero .btn-accent::after,
.home-cta-section .btn::after,
.plan-card.featured .btn::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: hmSweep 3.6s ease-in-out 2s infinite;
}
.hero .btn-accent {
    box-shadow: 0 10px 30px rgba(201, 169, 97, .35);
    border-radius: 999px;
    padding-inline: 2rem;
}
.hero .btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(201, 169, 97, .5);
}

/* ---------- Section headings ---------- */
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}
.section-eyebrow::before,
.section-eyebrow::after {
    content: '';
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--c-accent));
}
.section-eyebrow::after {
    background: linear-gradient(90deg, var(--c-accent), transparent);
}
.col-lg-6 > .section-eyebrow::before {
    display: none;
}

/* ---------- Scroll reveal ---------- */
.hm-js .hm-reveal {
    opacity: 0;
    transform: translateY(34px) scale(.98);
    transition:
        opacity .9s var(--hm-ease) var(--hm-delay, 0s),
        transform .9s var(--hm-ease) var(--hm-delay, 0s);
}
.hm-js .hm-reveal.hm-in {
    opacity: 1;
    transform: none;
}

/* ---------- Cards: spotlight that follows the cursor ---------- */
.hm-spot {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s ease;
    background: radial-gradient(260px circle at var(--hm-mx, 50%) var(--hm-my, 50%), rgba(201, 169, 97, .18), transparent 60%);
}
.hm-spot-host:hover > .hm-spot {
    opacity: 1;
}
.hm-spot-host > *:not(.hm-spot) {
    position: relative;
    z-index: 1;
}

.hm-tilt {
    transition: transform .5s var(--hm-ease);
    transform-style: preserve-3d;
    will-change: transform;
}

/* ---------- Pricing ---------- */
.plan-card {
    transition: transform .45s var(--hm-ease), box-shadow .45s var(--hm-ease);
}
.plan-card:hover {
    box-shadow: 0 28px 60px rgba(18, 53, 40, .14);
}
.plan-card.featured {
    position: relative;
    isolation: isolate;
}
.plan-card.featured::after {
    content: '';
    position: absolute;
    inset: -2px;
    z-index: -1;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(from var(--hm-angle, 0deg), var(--c-accent), transparent 30%, var(--c-primary-light) 50%, transparent 70%, var(--c-accent));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: hmSpin 6s linear infinite;
}
@property --hm-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ---------- Stats ---------- */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: transform .45s var(--hm-ease), box-shadow .45s var(--hm-ease);
}
.stat-card::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--c-accent), var(--c-primary-light));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .8s var(--hm-ease) .2s;
}
.hm-in .stat-card::before,
.stat-card.hm-in::before {
    transform: scaleX(1);
}
.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 44px rgba(18, 53, 40, .12);
}
.stat-card .value {
    font-variant-numeric: tabular-nums;
}

/* ---------- Clients ---------- */
.home-client-card {
    transition: transform .4s var(--hm-ease);
}
.home-client-card:hover {
    transform: translateY(-6px);
}
.home-client-avatar {
    transition: box-shadow .4s var(--hm-ease), transform .4s var(--hm-ease);
}
.home-client-card:hover .home-client-avatar {
    transform: scale(1.06);
    box-shadow: 0 0 0 4px rgba(201, 169, 97, .25), 0 16px 34px rgba(18, 53, 40, .14);
}

/* ---------- Articles ---------- */
.article-card {
    transition: transform .45s var(--hm-ease), box-shadow .45s var(--hm-ease);
}
.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 26px 50px rgba(18, 53, 40, .12);
}
.article-card-image img {
    transition: transform 1.1s var(--hm-ease);
}
.article-card:hover .article-card-image img {
    transform: scale(1.07);
}

/* ---------- Final call to action ---------- */
.home-cta-section {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    background: linear-gradient(120deg, var(--c-primary-dark), var(--c-primary), #2d6e54, var(--c-primary-dark));
    background-size: 300% 300%;
    animation: hmGradient 14s ease infinite;
}
.home-cta-section .section-title {
    color: #fff;
}
.home-cta-section .section-subtitle {
    color: rgba(250, 246, 240, .85);
}
.home-cta-section .btn-primary {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: var(--c-ink);
    border-radius: 999px;
    padding-inline: 2.2rem;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}
.home-cta-section .btn-primary:hover {
    background: #f3d98f;
    border-color: #f3d98f;
    color: var(--c-ink);
    transform: translateY(-2px) scale(1.02);
}
.home-cta-section .hm-cta-ring {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .14);
    pointer-events: none;
    animation: hmPulseRing 6s ease-out infinite;
}
.home-cta-section .hm-cta-ring:nth-child(1) { width: 260px; height: 260px; top: -90px; inset-inline-start: -60px; }
.home-cta-section .hm-cta-ring:nth-child(2) { width: 380px; height: 380px; bottom: -200px; inset-inline-end: -100px; animation-delay: -2s; }
.home-cta-section .hm-cta-ring:nth-child(3) { width: 160px; height: 160px; top: 30%; inset-inline-end: 18%; animation-delay: -4s; }

/* ---------- Back to top ---------- */
.hm-top {
    position: fixed;
    bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
    inset-inline-end: 1.2rem;
    z-index: 1500;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 14px 30px rgba(18, 53, 40, .3);
    opacity: 0;
    transform: translateY(16px) scale(.8);
    pointer-events: none;
    transition: opacity .35s ease, transform .35s var(--hm-ease), background .2s ease;
}
.hm-top.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.hm-top:hover {
    background: var(--c-primary-dark);
}
.hm-top svg {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    transform: rotate(-90deg);
}
.hm-top circle {
    fill: none;
    stroke: var(--c-accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 151;
    stroke-dashoffset: calc(151 - 151 * var(--hm-progress, 0));
}

/* ---------- Keyframes ---------- */
@keyframes hmRise {
    from { opacity: 0; transform: translateY(28px); filter: blur(6px); }
    to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes hmShine {
    0%, 70%, 100% { background-position: 100% 0; }
    85% { background-position: 0% 0; }
}
@keyframes hmFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, 50px) scale(1.12); }
}
@keyframes hmFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(70px, -40px) scale(.92); }
}
@keyframes hmFloat3 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(40px, -30px); }
    66% { transform: translate(-30px, 25px); }
}
@keyframes hmGridDrift {
    from { background-position: 0 0; }
    to { background-position: 260px 260px; }
}
@keyframes hmBob {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-18px) rotate(4deg); }
}
@keyframes hmScrollCue {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(14px); }
}
@keyframes hmSweep {
    0% { transform: translateX(-120%); }
    35%, 100% { transform: translateX(120%); }
}
@keyframes hmSpin {
    to { --hm-angle: 360deg; }
}
@keyframes hmGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes hmPulseRing {
    0% { transform: scale(.85); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: scale(1.25); opacity: 0; }
}

/* ---------- Small screens ---------- */
@media (max-width: 767.98px) {
    .hm-chip-3,
    .hm-chip-4,
    .hm-scroll-cue {
        display: none;
    }
    .hm-orb {
        filter: blur(48px);
    }
    .hm-orb-1 { width: 280px; height: 280px; }
    .hm-orb-2 { width: 240px; height: 240px; }
    .hm-chip { width: 42px; height: 42px; font-size: 1rem; border-radius: 13px; }
    .hm-chip-1 { top: 8%; inset-inline-end: 6%; }
    .hm-chip-2 { top: auto; bottom: 12%; inset-inline-end: 8%; }
    .hm-top { width: 44px; height: 44px; }
}

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
    .hm-js .hm-reveal,
    .hm-js .hero .hero-eyebrow,
    .hm-js .hero h1,
    .hm-js .hero p.lead,
    .hm-js .hero .hero-content .btn {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
    .hm-orb,
    .hm-grid,
    .hm-chip,
    .hm-scroll-cue::before,
    .hero .btn-accent::after,
    .home-cta-section,
    .home-cta-section .btn::after,
    .home-cta-section .hm-cta-ring,
    .plan-card.featured::after,
    .plan-card.featured .btn::after {
        animation: none !important;
    }
}

/* Tilt must react instantly, without the reveal delay. */
.hm-js .hm-reveal.hm-in.hm-tilt,
.hm-tilt {
    transition: transform .5s var(--hm-ease), opacity .9s var(--hm-ease);
}

@media (max-width: 767.98px) {
    /* Bootstrap's g-5 gutter is wider than the container padding on phones. */
    .section .row.g-5 {
        --bs-gutter-x: 1.5rem;
    }
    /* Keep slide text clear of the previous/next arrows. */
    .hero .carousel-item .hero-content .container {
        padding-inline: 3.6rem;
    }
}

/* ============================================================
   Phone layout: shorter page, swipeable rows, lighter effects
   ============================================================ */
@media (max-width: 767.98px) {
    .section {
        padding: 3.5rem 0;
    }
    .section-subtitle {
        margin-bottom: 2rem;
    }

    /* Feature cards: compact two-column grid instead of one tall card per row. */
    html body #features .features-showcase-grid,
    html body .addon-extra-features-section .ahf-showcase-grid {
        --bs-gutter-x: .75rem;
        --bs-gutter-y: .75rem;
    }
    html body #features .features-showcase-item,
    html body .addon-extra-features-section .ahf-showcase-item {
        flex: 0 0 50%;
        max-width: 50%;
    }
    html body #features .feature-card,
    html body .addon-extra-features-section .ahf-card {
        padding: 1.1rem .8rem 1rem;
        border-radius: 18px;
        animation: none;
    }
    html body #features .feature-icon,
    html body .addon-extra-features-section .ahf-icon {
        width: 56px;
        height: 56px;
        font-size: 1.35rem;
        margin-bottom: .75rem;
    }
    html body .addon-extra-features-section .ahf-icon::after {
        inset: -6px;
    }
    html body #features .feature-card h4,
    html body .addon-extra-features-section .ahf-card h4 {
        font-size: .98rem;
        margin-bottom: .4rem;
        line-height: 1.45;
    }
    html body #features .feature-card p,
    html body .addon-extra-features-section .ahf-card p {
        font-size: .82rem;
        line-height: 1.65;
    }

    /* Pricing and articles: swipe sideways, next card peeks in. */
    #pricing .row,
    .home-articles-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 1rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -.5);
        padding: 1.4rem 1rem 1.2rem;
    }
    #pricing .row::-webkit-scrollbar,
    .home-articles-grid::-webkit-scrollbar {
        display: none;
    }
    #pricing .row > [class*="col-"] {
        flex: 0 0 84%;
        max-width: 84%;
        margin-top: 0;
        padding-inline: .45rem;
        scroll-snap-align: center;
    }
    .home-articles-grid > .article-card {
        flex: 0 0 80%;
        max-width: 80%;
        margin-inline: .45rem;
        scroll-snap-align: center;
    }
    #pricing .plan-card {
        height: 100%;
    }

    .hm-swipe-dots {
        display: flex;
        justify-content: center;
        gap: .4rem;
        margin-top: .35rem;
    }
    .hm-swipe-dots button {
        width: 8px;
        height: 8px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: rgba(26, 77, 58, .22);
        transition: width .3s var(--hm-ease), background .3s ease;
    }
    .hm-swipe-dots button.is-active {
        width: 22px;
        background: var(--c-accent);
    }

    /* Cheaper hero effects for phones. */
    .hero .hm-hero-fx {
        mix-blend-mode: normal;
        opacity: .8;
    }
    .hm-orb-3 {
        display: none;
    }
    .hm-chip {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: rgba(255, 255, 255, .12);
    }
}

@media (min-width: 768px) {
    .hm-swipe-dots {
        display: none;
    }
}
