:root {
    --accent-orange: #C4582F;
    --accent-blue: #1E3A6D;
    --bg-light: #f8f9fa;
    --text-dark: #333;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding-top: 80px;
}

h1, h2, h3, h4, h5, .brand-text, .serif-font {
    font-family: 'Playfair Display', serif;
}

/* --- Custom Logo (CSS Vector) --- */
.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--accent-blue);
}

.brand-text span { color: var(--accent-orange); }
.brand-subtext {
    font-size: 0.7rem;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    display: block;
    margin-top: -5px;
}

/* --- Navigation --- */
.navbar {
    background: transparent;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 30px rgba(0,0,0,0.03);
    transition: all 0.4s ease;
}
.navbar.scrolled {
    background: transparent ;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    margin: 0 10px;
    transition: color 0.3s, transform 0.3s;
}
.nav-link:hover, .nav-link.active {
    color: var(--accent-orange) !important;
    transform: translateY(-2px);
}


/* --- Buttons --- */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--accent-orange), #a84722);
    border: none;
    color: white;
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(196, 88, 47, 0.2);
}
.btn-primary-custom:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(196, 88, 47, 0.4);
    color: white;
}
.btn-outline-light-custom {
    border: 1px solid rgba(255,255,255,0.6);
    color: white;
    padding: 12px 30px;
    background: transparent;
    transition: all 0.3s;
}
.btn-outline-light-custom:hover {
    background: white;
    color: var(--accent-blue);
    border-color: white;
    transform: translateY(-2px);
}

/* --- Common Sections --- */
.section-title {
    color: var(--accent-blue);
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}
.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 70px;
    height: 4px;
    background: var(--accent-orange);
    border-radius: 2px;
    transition: width 0.5s;
}
.section-title:hover::after {
    width: 100px;
}
.page-header {
    background: var(--accent-blue);
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}
/* .page-header::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: rotateBg 20s linear infinite;
}
@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
} */

/* --- Hero Section (Redesigned) --- */
.hero-modern {
    position: relative;
    padding: 180px 0 120px 0;
    min-height: 90vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #0b1a35; /* Fallback */
}
.hero-modern-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/hero-conference.jpg');
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.hero-modern-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(11, 26, 53, 0.85) 0%, rgba(196, 88, 47, 0.2) 100%);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    color: white;
}
.hero-pill {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 10px 24px;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: white;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(2px);
}
.hero-pill::before {
    content: '●';
    color: var(--accent-orange);
    margin-right: 10px;
    font-size: 0.5rem;
    vertical-align: middle;
}
.hero-modern h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    color: white;
}
.hero-modern h1 span {
    color: var(--accent-orange);
    font-style: italic;
}


.step-number {
    width: 70px;
    height: 70px;
    background: var(--accent-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 auto 15px auto;
    box-shadow: 0 10px 20px rgba(30, 58, 109, 0.2);
    transition: all 0.3s;
}


/* --- Services Section (Redesigned) --- */
#services-home {
    background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
    padding: 80px 0;
}
.service-card-modern {
    background: #ffffff;
    padding: 40px 25px;
    border-radius: 20px;
    height: 100%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 40px -12px rgba(30, 58, 109, 0.08); 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-top: 4px solid var(--accent-orange);
}
.service-card-modern:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px -12px rgba(30, 58, 109, 0.2);
    border-top-color: var(--accent-blue);
}
.service-card-modern h5 {
    font-family: 'Playfair Display', serif;
    color: var(--accent-blue);
    margin-bottom: 15px;
    font-size: 1.3rem;
}
.service-card-modern p {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
}
.service-icon-modern {
    color: var(--accent-orange);
    font-size: 2.8rem;
    margin-bottom: 20px;
    display: inline-block;
    transition: transform 0.3s;
}
.service-card-modern:hover .service-icon-modern {
    transform: scale(1.1) rotate(-5deg);
}

/* --- NEW PREMIUM BLACK FOOTER STYLES --- */
.footer {
    background-color: #050505; /* Pure Black */
    color: #ffffff;
    padding: 80px 0 30px 0;
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
/* The "Connection Lines" Tech Background */
.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    z-index: 0;
    pointer-events: none;
}
/* Floating decorative dots */
.footer-dot {
    position: absolute;
    width: 4px; height: 4px;
    background: var(--accent-orange);
    border-radius: 50%;
    opacity: 0.4;
    z-index: 1;
    animation: pulseDot 4s infinite ease-in-out;
}
.footer-dot:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.footer-dot:nth-child(2) { top: 60%; left: 85%; animation-delay: 1s; }
.footer-dot:nth-child(3) { top: 80%; left: 25%; animation-delay: 2s; }
@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(3); opacity: 0.8; background: #ffffff; }
}
.footer-content { position: relative; z-index: 2; }

/* White Footer Logo CSS */
.footer-logo-wrapper { display: flex; align-items: center; margin-bottom: 20px; }

.footer-logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}
.footer-logo-text span { color: #ffffff; }
.footer-tagline {
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-top: -5px;
}
.footer h5 { color: #ffffff; font-weight: 600; margin-bottom: 25px; font-size: 1rem; letter-spacing: 1px; }
.footer ul { padding-left: 0; list-style: none; }
.footer ul li { margin-bottom: 12px; }
.footer ul li a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
}
.footer ul li a:hover {
    color: var(--accent-orange);
    transform: translateX(5px);
}

/* Glowing Social Icons */
.social-icons { display: flex; gap: 15px; margin-top: 20px; }
.social-icon {
    display: flex; align-items: center; justify-content: center;
    width: 45px; height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}
.social-icon:hover {
    background: var(--accent-orange);
    color: #ffffff;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(196, 88, 47, 0.4);
    border-color: var(--accent-orange);
}
.footer-bottom {
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}
.footer-bottom span { color: var(--accent-orange); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-modern h1 { font-size: 2.8rem; }
    .hero-modern { padding: 140px 0 80px 0; }
}

/* --- MOBILE RESPONSIVENESS FIX FOR NAVBAR --- */
@media (max-width: 991px) { /* Targets Tablets and Mobile Phones */
    
    /* 1. Force the Logo and Hamburger to stay on the same line */
    .navbar-brand {
        max-width: 75%; /* Prevents the text from pushing the menu button off-screen */
        white-space: normal; /* Allows text to wrap gracefully */
        margin-right: auto; /* Pushes the menu button to the far right */
        display: flex;
        align-items: center; /* Ensures image and text align vertically */
    }

    /* 2. Shrink the Logo Image on mobile */
    .navbar-brand img {
        height: 40px !important; /* Makes the image smaller on phones */
        margin-right: 10px !important;
    }

    /* 4. Make the main 'AfriCrest' text smaller */
    .brand-text {
        font-size: 1.2rem;
    }

    /* 5. Ensure the hamburger button has enough space */
    .navbar-toggler {
        padding: 8px 12px;
        border: none;
        margin-left: 10px;
    }
}

/* ============================================================
   SIDE-SLIDING MOBILE NAVIGATION (Bootstrap Offcanvas, themed)
   ============================================================ */

/* Toggler: transparent pill so it reads on any header background,
   with a white icon so it stays visible on the dark hero / blue headers */
.navbar-toggler {
    border: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 11px;
    transition: background 0.3s ease;
}
.navbar-toggler:hover { background: rgba(255, 255, 255, 0.2); }
.navbar-toggler:focus { box-shadow: none; outline: none; }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    color:#050505;
}

/* Offcanvas panel styling — only kicks in below the lg breakpoint,
   where Bootstrap's navbar-expand-lg + .offcanvas combo turns the
   panel into a slide-in drawer instead of the inline nav row */
@media (max-width: 991.98px) {
    .offcanvas {
        background: linear-gradient(160deg, var(--accent-blue) 0%, #0b1a35 100%);
        width: min(310px, 82vw);
        border: none;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);
    }
    .offcanvas-header {
        padding: 18px 22px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .offcanvas-header .brand-text { color: #fff; font-size: 1.2rem; }
    .offcanvas-header .brand-text span { color: var(--accent-orange); }
    .offcanvas .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
        opacity: 0.7;
    }
    .offcanvas .btn-close:hover { opacity: 1; }
    .offcanvas-body { padding: 20px; display:flexbox; flex-direction: column; }
    .offcanvas .navbar-nav { gap: 2px; }
    .offcanvas .nav-link {
        color: rgba(255, 255, 255, 0.85) !important;
        padding: 15px 14px !important;
        font-size: 1.05rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 8px;
        margin: 0 !important;
        transition: all 0.3s ease;
    }
    .offcanvas .nav-link:hover,
    .offcanvas .nav-link.active {
        color: var(--accent-orange) !important;
        background: rgba(255, 255, 255, 0.06);
        padding-left: 20px !important;
        transform: none;
    }
    .offcanvas .nav-item.ms-lg-3 { margin: 20px 0 0 0 !important; }
    .offcanvas .btn-primary-custom { display: block; width: 100%; text-align: center; }
}

/* ============================================================
   GENERAL RESPONSIVE / ADAPTABILITY IMPROVEMENTS
   ============================================================ */

/* Fluid headings — scale smoothly with viewport instead of
   jumping only at fixed breakpoints */
.hero-modern h1 { font-size: clamp(2.1rem, 5vw + 1rem, 4.5rem); }
.page-header-about h1 { font-size: clamp(1.9rem, 4vw + 1rem, 3.5rem); }
.page-header h1.display-4 { font-size: clamp(1.9rem, 4vw + 1rem, 3.5rem); }
.ceo-quote { font-size: clamp(1.05rem, 1.5vw + 0.8rem, 1.3rem); }
.section-title { font-size: clamp(1.5rem, 1.5vw + 1.1rem, 2rem) !important; }
.cta-band-home h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2rem) !important; }

@media (max-width: 767.98px) {
    /* Trim the very generous section padding on small screens */
    section.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
    section.py-5 > .container.py-5,
    main.container.py-5 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }

    .hero-modern { min-height: auto; padding: 130px 0 60px 0; }
    .hero-pill { font-size: 0.68rem; padding: 8px 16px; }

    /* Two-column feature/goal lists become single column */
    .why-list { grid-template-columns: 1fr !important; }
    .footer ul[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

    .ceo-portrait-frame { width: 130px; height: 130px; }
}

@media (max-width: 575.98px) {
    /* Hero stat trio (delegates / years / countries) stays legible on small phones */
    .hero-modern .row.mt-5 { max-width: 100% !important; }
    .hero-modern .row.mt-5 h3 { font-size: 1.35rem; }
    .hero-modern .row.mt-5 small { font-size: 0.66rem; }

    .cta-band-home, .cta-service-banner { padding: 30px 22px !important; text-align: center; }
    .cta-band-home .col-md-4, .cta-band-home .text-md-end { text-align: center !important; margin-top: 15px; }
}

/* ============================================================
   FINAL RESPONSIVE / NAVIGATION POLISH
   ============================================================ */

html {
    overflow-x: hidden;
    scroll-padding-top: 90px;
}

body {
    min-width: 320px;
    overflow-x: hidden;
}

img, video, svg {
    max-width: 100%;
}

.navbar {
    min-height: 76px;
    background: rgba(197, 234, 255, 0.39);
    border-bottom: 1px solid rgba(30, 58, 109, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1030;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.253);
    box-shadow: 0 6px 24px rgba(30, 58, 109, 0.10);
}

.navbar > .container {
    min-height: 76px;
}

.navbar-brand.logo-container {
    flex: 0 1 auto;
    min-width: 0;
    padding: 4px 0;
}

.navbar-brand.logo-container img {
    height: 58px;
    width: auto;
    object-fit: contain;
    flex: 0 0 auto;
    margin-right: 8px;
}

.brand-text {
    font-size: clamp(1.35rem, 1.8vw, 1.75rem);
    line-height: 1;
    white-space: nowrap;
    font-weight: 700;
}

.navbar-nav {
    gap: 4px;
}

.navbar-nav .nav-link {
    padding: 10px 12px !important;
    margin: 0 !important;
    border-radius: 8px;
    white-space: nowrap;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background: rgba(196, 88, 47, 0.07);
    transform: none;
}

.nav-cta-item {
    margin-left: 10px;
}

.nav-cta {
    white-space: nowrap;
}

.navbar-toggler {
    border: 1px solid rgba(30, 58, 109, 0.16);
    background: rgba(30, 58, 109, 0.05);
    border-radius: 10px;
    padding: 8px 10px;
    flex: 0 0 auto;
}

.navbar-toggler:hover {
    background: rgba(30, 58, 109, 0.10);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(196, 88, 47, 0.16);
}

.navbar-toggler-icon {
    width: 1.45em;
    height: 1.45em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231E3A6D' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }
    .navbar-expand-lg .navbar-toggler {
        display: none;
    }
}

@media (max-width: 991.98px) {
    body {
        padding-top: 72px;
    }

    .navbar,
    .navbar > .container {
        min-height: 72px;
    }

    .navbar > .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .navbar-brand.logo-container img {
        height: 45px;
        margin-right: 7px;
    }

    .brand-text {
        font-size: 1.25rem;
    }

    .navbar-collapse {
        margin: 8px -16px -1px;
        padding: 10px 16px 18px;
        background: rgba(255, 255, 255, 0.99);
        border-top: 1px solid rgba(30, 58, 109, 0.07);
        box-shadow: 0 12px 24px rgba(30, 58, 109, 0.08);
    }

    .navbar-nav {
        gap: 2px;
    }

    .navbar-nav .nav-link {
        padding: 13px 14px !important;
        font-size: 0.98rem;
    }

    .nav-cta-item {
        margin: 10px 0 0;
    }

    .nav-cta {
        display: block;
        width: 100%;
        text-align: center;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .container {
        max-width: 94%;
    }

    .hero-modern {
        padding-top: 120px;
        padding-bottom: 80px;
    }
}

@media (max-width: 767.98px) {
    .container {
        width: 100%;
        padding-left: 18px;
        padding-right: 18px;
    }

    .hero-modern {
        min-height: calc(100svh - 72px);
        padding: 90px 0 55px;
    }

    .hero-modern h1 {
        font-size: clamp(2.15rem, 9vw, 3rem);
        line-height: 1.08;
    }

    .hero-modern h1 br {
        display: none;
    }

    .hero-modern .lead {
        font-size: 0.98rem;
        line-height: 1.65;
        margin-bottom: 1.75rem !important;
    }

    .hero-pill {
        max-width: 100%;
        line-height: 1.4;
        text-align: center;
    }

    .hero-modern .d-flex.flex-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-modern .d-flex.flex-wrap .btn {
        width: 100%;
        text-align: center;
    }

    .hero-modern .row.mt-5 {
        margin-top: 2.5rem !important;
        padding-top: 1.25rem !important;
    }

    .hero-modern .row.mt-5 > div {
        padding-left: 8px;
        padding-right: 8px;
    }

    .hero-modern .row.mt-5 h3 {
        font-size: 1.15rem;
        margin-bottom: 4px;
    }

    .hero-modern .row.mt-5 small {
        display: block;
        font-size: 0.62rem;
        line-height: 1.3;
    }

    .page-header,
    .page-header-about {
        padding: 65px 0 50px !important;
    }

    .page-header h1,
    .page-header-about h1 {
        line-height: 1.12;
    }

    .page-header p,
    .page-header-about p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    section.py-5 > .container.py-5,
    main.container.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .service-card-modern,
    .service-detail-card,
    .mvv-card {
        padding: 28px 22px;
    }

    .about-frame img {
        height: 280px;
    }

    .goal-grid {
        grid-template-columns: 1fr !important;
    }

    .goal-item {
        padding: 14px 16px;
    }

    .ceo-quote {
        padding-left: 15px;
        border-left-width: 3px;
    }

    .footer {
        padding: 55px 0 25px;
    }

    .footer-logo-wrapper {
        flex-wrap: wrap;
    }

    .footer-logo-wrapper img {
        height: 90px !important;
    }

    .footer-logo-text {
        font-size: 1.7rem;
    }

    .footer-bottom {
        margin-top: 35px;
        font-size: 0.75rem;
        line-height: 1.6;
    }

    .social-icons {
        gap: 10px;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand.logo-container img {
        height: 40px;
    }

    .brand-text {
        font-size: 1.1rem;
    }

    .navbar-toggler {
        padding: 7px 9px;
    }

    .hero-modern {
        padding-top: 75px;
    }

    .hero-pill {
        font-size: 0.62rem;
        letter-spacing: 1px;
        padding: 8px 12px;
    }

    .hero-modern .row.mt-5 > div {
        width: 33.333%;
    }

    .hero-modern .row.mt-5 h3 {
        font-size: 1rem;
    }

    .hero-modern .row.mt-5 small {
        font-size: 0.58rem;
    }

    .page-header h1,
    .page-header-about h1 {
        font-size: 2rem;
    }

    .page-header p,
    .page-header-about p {
        font-size: 0.88rem;
    }

    .about-frame img {
        height: 230px;
    }

    .mvv-card {
        padding: 25px 18px;
    }

    .cta-band-home,
    .cta-service-banner {
        padding: 25px 18px !important;
    }

    .footer ul[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

@media (hover: none) {
    .service-card-modern:hover,
    .service-detail-card:hover,
    .mvv-card:hover,
    .goal-item:hover {
        transform: none;
    }
}

a, button, .nav-link {
    -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   PREMIUM SIDE-DRAWER MOBILE NAVIGATION
   Reference: dark editorial side panel with large spaced labels
   ============================================================ */

/* Keep the desktop navigation clean and horizontal. */
@media (min-width: 992px) {
    .navbar-expand-lg .offcanvas {
        position: static;
        visibility: visible !important;
        transform: none !important;
        width: auto;
        height: auto;
        background: transparent;
        border: 0;
    }

    .navbar-expand-lg .offcanvas-body {
        display: flex;
        padding: 0;
        overflow: visible;
    }

    .navbar-expand-lg .mobile-nav-close {
        display: none;
    }

    .navbar-expand-lg .mobile-nav-inner {
        width: 100%;
    }

    .navbar-expand-lg .navbar-nav {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
    }

    .navbar-expand-lg .nav-link {
        color: var(--text-dark) !important;
        text-transform: none;
        letter-spacing: normal;
        font-size: 1rem;
    }

    .navbar-expand-lg .mobile-nav-cta {
        background: linear-gradient(135deg, var(--accent-orange), #a84722);
        border: 0;
        color: #fff;
        padding: 10px 26px;
        border-radius: 50px;
        text-transform: none;
        letter-spacing: normal;
        font-size: .92rem;
        font-weight: 600;
        white-space: nowrap;
        box-shadow: 0 4px 15px rgba(196, 88, 47, .2);
    }
}

/* Mobile/tablet drawer */
@media (max-width: 991.98px) {
    body {
        overflow-x: hidden;
    }

    .navbar-toggler {
        width: 48px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 8px;
        background: rgba(30, 58, 109, .07);
        padding: 0;
    }

    .navbar-toggler:hover,
    .navbar-toggler:focus {
        background: rgba(30, 58, 109, .11);
        box-shadow: none;
    }

    .navbar-toggler-icon {
        width: 1.55rem;
        height: 1.55rem;
    }

    /* The panel itself */
    .offcanvas.mobile-nav,
    .offcanvas#mainNavbar {
        --drawer-width: min(520px, 68vw);
        width: max(300px, var(--drawer-width));
        max-width: 520px;
        height: 100dvh;
        background: #202020;
        color: #fff;
        border: 0;
        border-radius: 0;
        box-shadow: -18px 0 50px rgba(0, 0, 0, .28);
        z-index: 1055;
    }

    .offcanvas-backdrop {
        background: rgba(0, 0, 0, .52);
        backdrop-filter: blur(1.5px);
        -webkit-backdrop-filter: blur(1.5px);
    }

    .offcanvas#mainNavbar .offcanvas-body {
        padding: 0;
        height: 100%;
        overflow-y: auto;
        scrollbar-width: none;
    }

    .offcanvas#mainNavbar .offcanvas-body::-webkit-scrollbar {
        display: none;
    }

    .mobile-nav-inner {
        min-height: 100%;
        display: flex;
        align-items: flex-start;
        padding: clamp(105px, 17vh, 155px) clamp(34px, 5vw, 70px) 55px;
    }

    .offcanvas#mainNavbar .navbar-nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .offcanvas#mainNavbar .nav-item {
        margin: 0 !important;
        padding: 0;
    }

    .offcanvas#mainNavbar .nav-link {
        display: block;
        width: fit-content;
        padding: 8px 0 !important;
        margin: 0 !important;
        color: rgba(255,255,255,.92) !important;
        background: transparent !important;
        border: 0;
        border-radius: 0;
        font-family: 'Poppins', sans-serif;
        font-size: clamp(.95rem, 1.5vw + .35rem, 1.25rem);
        font-weight: 500;
        line-height: 1.25;
        letter-spacing: .19em;
        text-transform: uppercase;
        white-space: nowrap;
        transform: none !important;
        transition: color .25s ease, opacity .25s ease, transform .25s ease;
    }

    .offcanvas#mainNavbar .nav-link:hover {
        color: #fff !important;
        transform: translateX(4px) !important;
    }

    .offcanvas#mainNavbar .nav-link.active {
        color: #fff !important;
        font-weight: 600;
        position: relative;
    }

    .offcanvas#mainNavbar .nav-link.active::after {
        content: '';
        display: block;
        width: 26px;
        height: 2px;
        margin-top: 7px;
        background: var(--accent-orange);
    }

    /* Large outlined CTA, matching the reference */
    .offcanvas#mainNavbar .nav-cta-item {
        margin-top: 20px !important;
        padding-top: 8px;
    }

    .offcanvas#mainNavbar .mobile-nav-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        width: min(365px, 100%);
        min-height: 68px;
        padding: 15px 28px;
        border: 2.5px solid rgba(255,255,255,.95);
        border-radius: 999px;
        color: #fff;
        background: transparent;
        font-family: 'Poppins', sans-serif;
        font-size: clamp(.82rem, 1.2vw + .35rem, 1.05rem);
        font-weight: 600;
        line-height: 1.15;
        letter-spacing: .17em;
        text-transform: uppercase;
        text-align: center;
        text-decoration: none;
        transition: all .25s ease;
    }

    .offcanvas#mainNavbar .mobile-nav-cta:hover,
    .offcanvas#mainNavbar .mobile-nav-cta:focus-visible {
        color: #202020;
        background: #fff;
        border-color: #fff;
        transform: translateY(-2px);
    }

    /* Close button sits just outside the panel, like the reference image. */
    .mobile-nav-close {
        position: absolute;
        top: 62px;
        left: -76px;
        width: 52px;
        height: 52px;
        padding: 0;
        border: 0;
        background: transparent;
        z-index: 4;
        cursor: pointer;
    }

    .mobile-nav-close span,
    .mobile-nav-close span::after {
        position: absolute;
        left: 10px;
        top: 25px;
        width: 34px;
        height: 2px;
        content: '';
        background: #fff;
        border-radius: 999px;
        transform: rotate(45deg);
    }

    .mobile-nav-close span::after {
        left: 0;
        top: 0;
        transform: rotate(90deg);
    }

    .mobile-nav-close:hover {
        opacity: .72;
    }

    .mobile-nav-close:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 4px;
        border-radius: 50%;
    }
}

/* Smaller phones: keep the drawer comfortable without making it feel cramped. */
@media (max-width: 575.98px) {
    .offcanvas#mainNavbar {
        --drawer-width: 78vw;
        width: max(292px, var(--drawer-width));
        max-width: 390px;
    }

    .mobile-nav-inner {
        padding: 92px 34px 40px;
    }

    .offcanvas#mainNavbar .navbar-nav {
        gap: 5px;
    }

    .offcanvas#mainNavbar .nav-link {
        padding: 7px 0 !important;
        font-size: .98rem;
        letter-spacing: .16em;
    }

    .offcanvas#mainNavbar .nav-cta-item {
        margin-top: 16px !important;
    }

    .offcanvas#mainNavbar .mobile-nav-cta {
        min-height: 62px;
        padding: 13px 18px;
        font-size: .78rem;
        letter-spacing: .13em;
    }

    .mobile-nav-close {
        top: 38px;
        left: -62px;
        width: 48px;
        height: 48px;
    }

    .mobile-nav-close span,
    .mobile-nav-close span::after {
        left: 9px;
        top: 23px;
        width: 32px;
    }
}

/* Very narrow phones: place the close icon inside the panel so it can never be clipped. */
@media (max-width: 340px) {
    .offcanvas#mainNavbar {
        width: 100vw;
        max-width: 100vw;
    }

    .mobile-nav-inner {
        padding-left: 28px;
        padding-right: 28px;
    }

    .mobile-nav-close {
        left: auto;
        right: 22px;
        top: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .offcanvas,
    .offcanvas .nav-link,
    .mobile-nav-cta,
    .mobile-nav-close {
        transition: none !important;
    }
}
