/* =============================================
   Homepage
   ============================================= */

/* ---- Hero ---- */
.hp-hero {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    background: #1c0519; /* fallback behind images */
    padding: 120px 0 90px;
    overflow: hidden;
}

/* Rotating background photos */
.hp-hero-bg-stack {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hp-hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    /* Ken Burns zoom driven by a TRANSITION, not a keyframe animation.
       A keyframe animation snaps to the base transform the instant it is
       removed (transitions only fire when the *specified* value changes), which
       produced a visible jump at every handoff. With a transition the zoom
       simply continues at the same speed for as long as the target is 1.15.
       Resting state: back to the start scale with a 0s transform transition, so
       a slide resets instantly -- while invisible -- ready for its next turn. */
    transform: scale(1.05);
    transition: opacity 1.6s ease, transform 0s linear;
    will-change: opacity, transform;
}
/* Showing, or fading out: zoom towards 1.15 at a constant 0.10 / 8s. The
   outgoing slide keeps the same target and duration (.is-leaving), so the
   running transition is untouched and the motion never changes pace. At the
   6s handoff it has reached ~1.125 and drifts to ~1.145 by the end of the fade. */
.hp-hero-slide.is-active,
.hp-hero-slide.is-leaving {
    transform: scale(1.15);
    transition: opacity 1.6s ease, transform 8s linear;
}
.hp-hero-slide.is-active {
    opacity: 1;
}
/* First slide on page load: shown immediately (no fade-in) but still zooming. */
.hp-hero-slide.is-active.no-fade {
    transition: opacity 0s linear, transform 8s linear;
}

/* Dark purple overlay so text stays legible over any photo */
.hp-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(105deg, rgba(20,4,18,0.92) 0%, rgba(28,5,25,0.78) 38%, rgba(118,35,109,0.40) 100%),
        linear-gradient(to top, rgba(20,4,18,0.85) 0%, rgba(20,4,18,0) 45%);
}

.hp-hero-inner {
    position: relative;
    z-index: 2;
}
.hp-hero-text {
    max-width: 720px;
}

/* Scroll-down cue */
.hp-hero-scroll {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 2;
    width: 26px;
    height: 42px;
    border: 2px solid rgba(255,255,255,0.45);
    border-radius: 14px;
    display: block;
}
.hp-hero-scroll span {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    animation: hp-hero-scroll-dot 1.8s ease-in-out infinite;
}
@keyframes hp-hero-scroll-dot {
    0%   { opacity: 0; transform: translateY(0); }
    35%  { opacity: 1; }
    70%  { opacity: 0; transform: translateY(14px); }
    100% { opacity: 0; transform: translateY(14px); }
}
@media (prefers-reduced-motion: reduce) {
    .hp-hero-slide,
    .hp-hero-slide.is-active,
    .hp-hero-slide.is-leaving { transform: none; transition: opacity 1.6s ease; }
    .hp-hero-scroll span { animation: none; }
}

.hp-hero-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
}

.hp-hero h1 {
    font-size: clamp(2.6rem, 5.2vw, 4.6rem);
    font-weight: 800;
    color: #fff !important;
    line-height: 1.08;
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 30px rgba(0,0,0,0.35);
}

.hp-hero-lead {
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.7;
    margin-bottom: 2.25rem;
    max-width: 580px;
    text-shadow: 0 1px 16px rgba(0,0,0,0.35);
}

.hp-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.btn-hp-primary {
    background: #fff;
    color: #76236d !important;
    border: none;
    border-radius: 50px;
    padding: 14px 32px;
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-hp-primary:hover {
    background: #f0e6ef;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    color: #76236d !important;
}

.btn-hp-secondary {
    background: transparent;
    color: rgba(255,255,255,0.85) !important;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50px;
    padding: 13px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.btn-hp-secondary:hover {
    border-color: rgba(255,255,255,0.85);
    color: #fff !important;
}

.hp-hero-reassurance {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.hp-hero-reassurance i {
    color: #c77dc0;
}

.hp-hero-img {
    width: 100%;
    display: block;
    margin-top: 40px;
    filter: drop-shadow(0 -8px 40px rgba(0,0,0,0.4));
}

/* ---- Trust bar ---- */
.hp-trust-bar {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 0;
}

/* Offset in-page anchor jumps so the target clears the fixed navbar */
#hp-stats,
#find-your-fit,
#products {
    scroll-margin-top: 72px;
}

.hp-trust-item {
    text-align: center;
    padding: 10px 16px;
}

.hp-trust-item strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: #76236d;
    line-height: 1.2;
}

.hp-trust-item .hp-counter {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.hp-trust-item span {
    font-size: 0.78rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ---- Who is it for / Find your fit ---- */
.hp-fit {
    padding: 80px 0 88px;
    background: #f8f5f8;
}
.hp-fit-eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #76236d;
    margin-bottom: 10px;
}
.hp-fit h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #1a0618;
    margin-bottom: 14px;
}
.hp-fit > .container > .row > .col-lg-7 > p {
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
}
.hp-fit-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 32px 28px 28px;
    border-radius: 14px;
    border: 2px solid #e8dde7;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    border-top: 4px solid #76236d;
}
.hp-fit-card:hover {
    border-color: #76236d;
    box-shadow: 0 8px 32px rgba(118,35,109,0.14);
    transform: translateY(-4px);
    text-decoration: none;
    color: inherit;
}
.hp-fit-card-pro { border-top-color: #3d1138; }
.hp-fit-card-pro:hover { border-color: #3d1138; box-shadow: 0 8px 32px rgba(61,17,56,0.14); }
.hp-fit-card-doors { border-top-color: #c85d00; }
.hp-fit-card-doors:hover { border-color: #c85d00; box-shadow: 0 8px 32px rgba(200,93,0,0.14); }

.hp-fit-card-icon {
    font-size: 1.8rem;
    color: #76236d;
    margin-bottom: 14px;
}
.hp-fit-card-pro .hp-fit-card-icon { color: #3d1138; }
.hp-fit-card-doors .hp-fit-card-icon { color: #c85d00; }

.hp-fit-card-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #76236d;
    background: #f3e8f2;
    padding: 3px 10px;
    border-radius: 50px;
    margin-bottom: 14px;
}
.hp-fit-card-pro .hp-fit-card-tag { color: #3d1138; background: #ede3ed; }
.hp-fit-card-doors .hp-fit-card-tag { color: #c85d00; background: #fdf0e6; }

.hp-fit-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a0618;
    margin-bottom: 10px;
    line-height: 1.35;
}
.hp-fit-card p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.65;
    flex: 1;
    margin-bottom: 20px;
}
.hp-fit-card-cta {
    font-size: 0.88rem;
    font-weight: 700;
    color: #76236d;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
}
.hp-fit-card-pro .hp-fit-card-cta { color: #3d1138; }
.hp-fit-card-doors .hp-fit-card-cta { color: #c85d00; }

/* ---- Products intro ---- */
.hp-products-intro {
    padding: 75px 0 45px;
}

.hp-products-intro h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e !important;
    margin-bottom: 1rem;
}

.hp-products-intro p {
    font-size: 1.05rem;
    color: #666;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.75;
}

/* ---- Product sections ---- */
.hp-product {
    padding: 70px 0;
}

.hp-product.hp-product-alt {
    background: #f8f9fa;
}

.hp-product-badge {
    display: inline-block;
    background: #f3e8f2;
    color: #76236d;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 20px;
    padding: 5px 14px;
    margin-bottom: 1rem;
}

.hp-badge-pro {
    background: #e8f0f9;
    color: #2c5282;
}

.hp-badge-doors {
    background: #fef3e2;
    color: #b45309;
}

.hp-badge-cloud {
    background: #e8f5e9;
    color: #276749;
}

.hp-product h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a2e !important;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.hp-product p {
    font-size: 1rem;
    color: #555;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.hp-product-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hp-product-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: #444;
}

.hp-product-features li i {
    color: #76236d;
    font-size: 0.85rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.hp-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-hp-product {
    background: #76236d;
    color: #fff !important;
    border: none;
    border-radius: 50px;
    padding: 11px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}

.btn-hp-product:hover {
    background: #5a1a53;
    transform: translateY(-1px);
    color: #fff !important;
}

.btn-hp-product-outline {
    background: transparent;
    color: #76236d !important;
    border: 2px solid #76236d;
    border-radius: 50px;
    padding: 10px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.btn-hp-product-outline:hover {
    background: #76236d;
    color: #fff !important;
}

.hp-product-img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 12px 50px rgba(0,0,0,0.12);
}
/* Square artwork (JMS 2D): cap it so it sits level with the text column
   rather than towering over it, and keep it centred in its half. */
.hp-product-img--square {
    max-width: 520px;
    display: block;
    margin: 0 auto;
}

/* ---- Why Joinerysoft ---- */
.hp-why {
    padding: 80px 0;
    background: #fff;
}

.hp-why h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e !important;
    margin-bottom: 1rem;
}

.hp-why > .container > .row > .col-lg-7 p {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.75;
}

.hp-why-card {
    padding: 28px 24px;
    background: #f8f9fa;
    border-radius: 14px;
    height: 100%;
    transition: box-shadow 0.15s, transform 0.15s;
}

.hp-why-card:hover {
    box-shadow: 0 8px 30px rgba(118,35,109,0.1);
    transform: translateY(-3px);
}

.hp-why-icon {
    width: 48px;
    height: 48px;
    background: #f3e8f2;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #76236d;
    font-size: 1.15rem;
    margin-bottom: 1.1rem;
}

.hp-why-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e !important;
    margin-bottom: 0.6rem;
}

.hp-why-card p {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.65;
    margin: 0;
}

/* ---- Latest news ---- */
.hp-news {
    padding: 75px 0;
    background: #f8f9fa;
}

.hp-news h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e !important;
    margin-bottom: 0;
}

.hp-news-all {
    font-size: 0.875rem;
    font-weight: 600;
    color: #76236d;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hp-news-all:hover {
    color: #5a1a53;
    text-decoration: underline;
}

.hp-news-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.15s, transform 0.15s;
}

.hp-news-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.hp-news-img-link {
    display: block;
    overflow: hidden;
}

.hp-news-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.hp-news-card:hover .hp-news-img {
    transform: scale(1.03);
}

.hp-news-body {
    padding: 20px 20px 0;
    flex: 1;
}

.hp-news-date {
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.hp-news-body h5 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 0.6rem;
}

.hp-news-body h5 a {
    color: #1a1a2e;
    text-decoration: none;
}

.hp-news-body h5 a:hover {
    color: #76236d;
}

.hp-news-desc {
    font-size: 0.84rem;
    color: #777;
    line-height: 1.6;
    margin: 0;
}

.hp-news-footer {
    padding: 14px 20px 18px;
}

.hp-news-read {
    font-size: 0.82rem;
    font-weight: 600;
    color: #76236d;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hp-news-read:hover {
    color: #5a1a53;
    text-decoration: underline;
}

/* ---- CTA banner ---- */
.hp-cta {
    background: linear-gradient(135deg, #76236d 0%, #5a1a53 100%);
    padding: 90px 0;
    color: #fff;
}

.hp-cta h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #fff !important;
    margin-bottom: 1rem;
}

.hp-cta p {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.85);
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.75;
}

.hp-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

.btn-hp-cta-primary {
    background: #fff;
    color: #76236d !important;
    border: none;
    border-radius: 50px;
    padding: 16px 42px;
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-hp-cta-primary:hover {
    background: #f0e6ef;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    color: #76236d !important;
}

.btn-hp-cta-secondary {
    background: transparent;
    color: rgba(255,255,255,0.85) !important;
    border: 2px solid rgba(255,255,255,0.45);
    border-radius: 50px;
    padding: 15px 42px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.btn-hp-cta-secondary:hover {
    border-color: #fff;
    color: #fff !important;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .hp-hero { min-height: 80vh; padding: 110px 0 80px; }
    .hp-product { padding: 55px 0; }
    .hp-products-intro { padding: 55px 0 30px; }
}

@media (max-width: 767px) {
    .hp-hero { min-height: 78vh; padding: 100px 0 70px; }
    .hp-hero-img { margin-top: 30px; }
    .hp-why { padding: 55px 0; }
    .hp-news { padding: 55px 0; }
    .hp-cta { padding: 65px 0; }
    .hp-cta h2 { font-size: 1.75rem; }
    .hp-products-intro h2 { font-size: 1.6rem; }
}

/* =============================================
   Homepage animations
   ============================================= */

/* 1. Hero entrance */
.hp-hero-text {
    animation: hp-hero-fade-up 0.7s ease both;
}
.hp-hero-img {
    animation: hp-hero-img-in 0.9s ease both 0.2s;
}
@keyframes hp-hero-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes hp-hero-img-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Subtle float loop on the hero image after entrance */
@keyframes hp-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}
.hp-hero-img.hp-float {
    animation: hp-float 5s ease-in-out infinite;
}

/* 2. Scroll-triggered fade-up — base state (hidden) */
.hp-animate {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.hp-animate.hp-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for card groups */
.hp-animate-delay-1 { transition-delay: 0.1s; }
.hp-animate-delay-2 { transition-delay: 0.2s; }
.hp-animate-delay-3 { transition-delay: 0.3s; }
.hp-animate-delay-4 { transition-delay: 0.4s; }

/* 3. Counter — just needs the JS, no special CSS needed */

/* =============================================
   Transparent navbar over the hero
   (homepage only, desktop only — mobile & other
   pages keep the normal solid white nav)
   ============================================= */

@media (min-width: 992px) {
    /* Overlay the hero instead of taking flow space above it */
    body.template-homepage .nav-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: transparent;
        border-bottom-color: transparent;
        box-shadow: none;
        transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    }
    body.template-homepage .nav-wrapper:not(.scrolled) .navbar {
        background: transparent !important;
    }

    /* --- Transparent (top of page) state: light treatment --- */
    body.template-homepage .nav-wrapper:not(.scrolled) .nav-link {
        color: #fff !important;
    }
    body.template-homepage .nav-wrapper:not(.scrolled) .nav-link:hover,
    body.template-homepage .nav-wrapper:not(.scrolled) .nav-link.active {
        color: #fff !important;
        opacity: 0.7;
    }
    /* Swap to the white logo in the transparent state. The white logo
       (logo_white_nav.svg) is cropped to the SAME 262x50 box as the dark one,
       so the geometry is identical and nothing shifts when it flips. */
    body.template-homepage .nav-wrapper:not(.scrolled) .nav-logo-dark { display: none; }
    body.template-homepage .nav-wrapper:not(.scrolled) .nav-logo-light { display: inline-block; }
    body.template-homepage .nav-wrapper:not(.scrolled) .btn-nav-secondary {
        color: #fff !important;
        border-color: rgba(255, 255, 255, 0.5);
    }
    body.template-homepage .nav-wrapper:not(.scrolled) .btn-nav-secondary:hover {
        border-color: #fff;
        color: #fff !important;
    }

    /* --- Scrolled state: back to the normal solid white bar --- */
    body.template-homepage .nav-wrapper.scrolled {
        background: #fff;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
    }
}
