/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Open+Sans:wght@300;400;600&display=swap');

:root {
    --primary-color: #1a4f91;
    /* From Logo Blue */
    --secondary-color: #6c757d;
    /* From Logo Grey */
    --accent-color: #f1c40f;
    /* Construction Yellow/Gold */
    --success-color: #27ae60;
    /* Green from Logo */
    --danger-color: #e74c3c;
    /* Red from Logo */
    --dark-bg: #1e1e1e;
    --light-bg: #f8f9fa;
    --header-font: 'Montserrat', sans-serif;
    --body-font: 'Open Sans', sans-serif;
}

/* Global Styles */
body {
    font-family: var(--body-font);
    overflow-x: hidden;
    color: var(--bs-body-color);
    /* Adaptive color */
    background-color: var(--bs-body-bg);
    /* Adaptive background */
    transition: background-color 0.3s, color 0.3s;
}

/* Dark Theme Styles */
[data-bs-theme="dark"] {
    --bs-body-bg: #0d1117;
    --bs-body-color: #e6edf3;
    --dark-bg: #0d1117;
    --light-bg: #161b22;
}

[data-bs-theme="dark"] body {
    background-color: #0d1117;
    color: #e6edf3;
}

[data-bs-theme="dark"] .bg-body {
    background-color: #161b22 !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #161b22 !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #e6edf3 !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #8b949e !important;
}

[data-bs-theme="dark"] .border {
    border-color: #30363d !important;
}

[data-bs-theme="dark"] .service-card {
    background: linear-gradient(145deg, #161b22 0%, #0d1117 100%);
    border-color: rgba(48, 54, 61, 0.5);
}

[data-bs-theme="dark"] .service-card:hover {
    background: #1c2128;
    border-color: var(--primary-color);
}

[data-bs-theme="dark"] .service-card h4 {
    color: #e6edf3;
}

[data-bs-theme="dark"] .service-card p {
    color: #8b949e;
}

[data-bs-theme="dark"] #mainNav .container {
    background-color: rgba(22, 27, 34, 0.9);
    border: 1px solid rgba(48, 54, 61, 0.5);
}

[data-bs-theme="dark"] #mainNav.navbar-scrolled .container {
    background-color: rgba(22, 27, 34, 0.95);
}

[data-bs-theme="dark"] #mainNav .nav-link {
    color: #e6edf3;
}

[data-bs-theme="dark"] #mainNav .nav-link:hover,
[data-bs-theme="dark"] #mainNav .nav-link.active {
    color: var(--accent-color);
}

[data-bs-theme="dark"] .bg-brand-accent {
    background-color: #161b22 !important;
}

[data-bs-theme="dark"] .section-heading,
[data-bs-theme="dark"] .section-subheading {
    color: #e6edf3 !important;
}

[data-bs-theme="dark"] .divider {
    background-color: #30363d !important;
}

[data-bs-theme="dark"] .hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] footer {
    background-color: #0d1117 !important;
    border-top: 1px solid #30363d;
}

[data-bs-theme="dark"] footer h5,
[data-bs-theme="dark"] footer p,
[data-bs-theme="dark"] footer a {
    color: #8b949e !important;
}

[data-bs-theme="dark"] footer a:hover {
    color: var(--accent-color) !important;
}

[data-bs-theme="dark"] .page-header {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #0d1117;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-color: #0d1117;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

[data-bs-theme="dark"] #mainNav .navbar-brand img {
    filter: none;
}

[data-bs-theme="dark"] #mainNav .navbar-brand img:hover {
    filter: brightness(1.1);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--danger-color);
    border-radius: 6px;
    border: 3px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}

body.loading {
    overflow: hidden;
}

a {
    text-decoration: none;
    transition: color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--header-font);
}

section {
    padding: 100px 0;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-family: var(--header-font);
    font-weight: 800;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar::after {
    content: '';
    display: block;
    width: 50%;
    height: 100%;
    background: var(--primary-color);
    animation: loading 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(200%);
    }
}

/* Navbar */
#mainNav {
    padding-top: 20px;
    padding-bottom: 20px;
    transition: padding 0.3s ease;
}

#mainNav .container {
    background-color: rgba(255, 255, 255, 0.9);
    /* 90% opacity */
    backdrop-filter: blur(15px);
    border-radius: 50px;
    padding: 10px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    /* Only the properties the scrolled state actually changes. `all` also
       animated max-width, so every viewport resize re-animated the container
       width across breakpoints. */
    transition: padding 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

[data-bs-theme="dark"] #mainNav .container {
    background-color: rgba(33, 37, 41, 0.85);
    /* Dark background */
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

#mainNav.navbar-scrolled .container {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 8px 30px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

#mainNav .navbar-brand {
    color: var(--primary-color);
    text-shadow: none;
    transition: color 0.3s;
}

#mainNav .navbar-brand img {
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.9));
    transition: filter 0.3s;
}

#mainNav .navbar-brand img:hover {
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 1));
}

/* Colorful gradient for company name */
.navbar-brand span {
    background: linear-gradient(90deg,
            #e74c3c 0%,
            /* Red */
            #f39c12 12.5%,
            /* Yellow/Orange */
            #95a5a6 25%,
            /* Gray */
            #3498db 37.5%,
            /* Blue */
            #e91e63 50%,
            /* Pink */
            #1e5631 62.5%,
            /* Dark Green */
            #27ae60 75%,
            /* Light Green */
            #2980b9 87.5%,
            /* Blue */
            #e74c3c 100%
            /* Red */
        );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: gradient-shift 8s linear infinite;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.3);
    text-stroke: 0.5px rgba(0, 0, 0, 0.3);
    paint-order: stroke fill;
    /* The wordmark is white-space:nowrap. Without this it keeps its full width
       while the flex parent shrinks, and spills out over the nav links. */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Brand sizing. The logo is wide (~3:1), so its height drives how much room the
   wordmark has left. Sized per breakpoint instead of a fixed inline height. */
.navbar-brand {
    /* Never let the brand be squeezed narrower than its own contents. */
    flex-shrink: 0;
    max-width: 100%;
    overflow: hidden;
}

.navbar-logo {
    height: 52px;
    width: auto;
    flex-shrink: 0;
}

@media (max-width: 1399.98px) {
    .navbar-logo {
        height: 44px;
    }

    .navbar-brand span {
        font-size: 1.05rem;
    }
}

@media (max-width: 575.98px) {
    .navbar-logo {
        height: 38px;
    }

    .navbar-brand span {
        font-size: 0.95rem;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

#mainNav .navbar-nav .nav-link {
    color: var(--bs-body-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 10px 15px;
    position: relative;
    transition: color 0.3s ease;
}

[data-bs-theme="light"] #mainNav .navbar-nav .nav-link {
    color: #333;
}

[data-bs-theme="dark"] #mainNav .navbar-nav .nav-link {
    color: #f8f9fa;
}

/* Tightest expanded breakpoint: trim padding so brand + 6 links + 3 buttons
   still fit the 1140px container without the brand having to shrink. */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    #mainNav .navbar-nav .nav-link {
        padding: 10px 10px;
        font-size: 0.8rem;
    }

    #mainNav .container {
        padding: 10px 20px;
    }
}

#mainNav .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px;
    left: 50%;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

#mainNav .navbar-nav .nav-link:hover,
#mainNav .navbar-nav .nav-link.active {
    color: var(--primary-color);
}

#mainNav .navbar-nav .nav-link:hover::after,
#mainNav .navbar-nav .nav-link.active::after {
    width: 80%;
}

/* Mobile Toggler */
.navbar-toggler {
    border: none;
    color: var(--primary-color);
}


/* Dropdown Menu Styles
   Appearance only. Show/hide is deliberately NOT handled here: inside the
   collapsed navbar the menu is position:static, so keeping it display:block
   while invisible would reserve its full height as dead space in the flow
   (it pushed Projects/Policies/Awards ~390px down the mobile menu). Bootstrap's
   native display:none <-> .show display:block is left in charge, and the fade
   is layered on only at desktop widths where the menu is absolutely positioned. */
.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: rgba(33, 37, 41, 0.95);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

/* --- Desktop (expanded navbar): absolutely positioned, so animating it
       cannot affect layout. --- */
@media (min-width: 1200px) {
    .dropdown-menu {
        margin-top: 15px;
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    }

    /* Invisible bridge across the 15px margin gap, so moving the cursor from
       the toggle down to the menu doesn't drop :hover and snap it shut. */
    .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -15px;
        left: 0;
        width: 100%;
        height: 15px;
    }

    .dropdown:hover .dropdown-menu,
    .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* --- Collapsed navbar: render the submenu as an indented list inside the
       menu, not a floating card stacked on top of one. --- */
@media (max-width: 1199.98px) {
    #mainNav .dropdown-menu {
        background-color: transparent;
        backdrop-filter: none;
        /* Beats the .shadow-lg utility on the markup, which is !important and
           only makes sense for the floating desktop card. */
        box-shadow: none !important;
        border-radius: 0;
        /* Also beats the .border-0 utility on the markup. */
        border-left: 2px solid rgba(26, 79, 145, 0.25) !important;
        margin: 4px 0 10px;
        padding: 2px 0 2px 14px;
    }

    [data-bs-theme="dark"] #mainNav .dropdown-menu {
        border-left-color: rgba(255, 255, 255, 0.2) !important;
    }

    #mainNav .dropdown-item {
        padding: 9px 12px;
        white-space: normal;
    }

    /* The nudge-right hover is a pointer affordance; it just looks twitchy
       under a finger. */
    #mainNav .dropdown-item:hover {
        transform: none;
    }

    #mainNav .dropdown-divider {
        margin: 6px 0;
    }
}

/* Note: no :focus-within rule here on purpose. The toggle keeps focus after a
   click, so :focus-within would hold the menu open after Bootstrap closes it.
   Bootstrap's own keyboard handling adds .show, which is covered above. */

.dropdown-item {
    font-weight: 500;
    padding: 8px 15px;
    font-size: 0.9rem;
    color: #555;
    border-radius: 5px;
    transition: all 0.2s;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.dropdown-item:hover {
    background-color: rgba(26, 79, 145, 0.1);
    /* Light primary */
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Navbar Action Buttons (Theme & Language) */
#theme-toggle {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(248, 249, 250, 0.8);
    color: var(--primary-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#theme-toggle:hover {
    transform: rotate(360deg);
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 15px rgba(26, 79, 145, 0.4);
    border-color: transparent;
}

/* Language Toggle Customization */
#navbarResponsive .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Primary navbar CTA. Sized to sit on the same 36px line as the theme and
   language buttons, and pinned to a single line - at the tighter expanded
   widths "Get In Touch" was wrapping to two rows and doubling the height. */
#navbarResponsive .navbar-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 18px;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    #navbarResponsive .navbar-cta {
        padding: 0 14px;
        font-size: 0.75rem;
    }
}

#navbarResponsive .btn-outline-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(26, 79, 145, 0.2);
}

/* Collapsed Menu Overrides */
@media (max-width: 1199.98px) {
    #mainNav .container {
        border-radius: 1rem;
        /* More standard corners on mobile */
        padding: 10px 20px;
    }

    #mainNav .navbar-nav {
        margin-top: 15px;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        padding-top: 10px;
    }

    #mainNav .navbar-nav .nav-link {
        padding: 10px 0;
    }

    /* The underline sweep is a desktop hover affordance and looks broken on a
       full-width stacked link. */
    #mainNav .navbar-nav .nav-link::after {
        display: none;
    }
}

/* Scrolled state cleanup */
#mainNav.navbar-scrolled {
    /* No changing background on wrapper */
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Services Section - Elegant Design */
.service-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 40px 30px;
    transition: all 0.5s ease;
    border: 1px solid rgba(26, 79, 145, 0.1);
    position: relative;
    overflow: visible;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* Gradient border ring. Masked to the 2px perimeter so it frames the card
   instead of covering it - a plain z-index:-1 layer renders behind the
   section background and never shows at all. */
.service-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color), var(--success-color));
    border-radius: 20px;
    padding: 2px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(26, 79, 145, 0.2);
    background: #ffffff;
}

.service-card .icon-box {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #1a4f91 0%, #3498db 50%, #27ae60 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 30px rgba(26, 79, 145, 0.25);
    position: relative;
}

.service-card .icon-box i {
    font-size: 2.2rem;
    color: #fff;
    transition: all 0.4s;
}

.service-card:hover .icon-box {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 15px 40px rgba(26, 79, 145, 0.35);
    background: linear-gradient(135deg, #27ae60 0%, #3498db 50%, #f1c40f 100%);
}

.service-card:hover .icon-box i {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.service-card h4 {
    color: #0d284b;
    font-size: 1.35rem;
    margin-bottom: 18px;
    font-weight: 700;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.service-card:hover h4 {
    color: var(--primary-color);
    transform: translateX(5px);
}

.service-card p {
    line-height: 1.9;
    margin-bottom: 25px;
    color: #6c757d;
    font-size: 0.95rem;
}

.service-card .btn-link {
    font-size: 0.95rem;
    font-weight: 600;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(26, 79, 145, 0.05);
    transition: all 0.3s;
}

.service-card:hover .btn-link {
    background: var(--primary-color);
    color: #fff !important;
    padding-right: 25px;
}

.service-card .btn-link i {
    transition: transform 0.3s;
    font-size: 0.85rem;
}

.service-card:hover .btn-link i {
    transform: translateX(8px);
}

/* Add subtle pattern */
.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(26, 79, 145, 0.03) 1px, transparent 1px);
    background-size: 10px 10px;
    border-radius: 0 20px 0 0;
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Hero slider =====
   Everything below is scoped to #heroCarousel. These rules used to target
   .carousel-item globally, which also hit the testimonials slider further down
   the page and forced it to 100vh - leaving ~580px of dead space under the
   quote and dragging the hero's texture overlay along with it. */
header.masthead {
    height: 100vh;
    min-height: 600px;
    background-color: #212529;
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* dvh tracks the collapsing mobile browser chrome; vh above is the fallback. */
@supports (height: 100dvh) {
    header.masthead {
        height: 100dvh;
    }
}

/* A definite height all the way down the chain. Without it the item falls back
   to min-height, percentage heights inside it stop resolving, and the slide
   image collapses to its intrinsic aspect ratio (it rendered 275px tall inside
   a 600px slide on mobile, leaving a dark band under the photo). */
#heroCarousel,
#heroCarousel .carousel-inner,
#heroCarousel .carousel-item {
    height: 100%;
}

#heroCarousel .carousel-item {
    position: relative;
    overflow: hidden;
}

/* Absolute fill, so the photo always covers the slide regardless of how the
   percentage height chain resolves. */
#heroCarousel .carousel-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform 6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: contrast(1.05) brightness(0.95);
}

#heroCarousel .carousel-item.active img {
    transform: scale(1.1);
    /* Slow zoom effect */
}

/* Texture overlay on hero slides */
#heroCarousel .carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(200, 200, 200, 0.15) 2px, rgba(200, 200, 200, 0.15) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(200, 200, 200, 0.15) 2px, rgba(200, 200, 200, 0.15) 4px),
        radial-gradient(circle at 50% 50%, rgba(200, 200, 200, 0.1) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 3px 3px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.5;
}

/* Darkening scrim for caption legibility. The .overlay-dark class sits on the
   <img> itself, and pseudo-elements don't generate boxes on replaced elements,
   so that overlay never actually rendered - the hero relied on the photo
   happening to be dark. Put it on the slide instead. */
#heroCarousel .carousel-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
    pointer-events: none;
}

.overlay-dark {
    position: relative;
}

.overlay-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.8) 100%);
    background-color: rgba(0, 0, 0, 0.65);
    /* darkened base opacity for better text visibility */
    z-index: 1;
}

/* Dotted Pattern Overlay */
.overlay-dark::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(rgba(0, 0, 0, 0.6) 1.5px, transparent 1.5px),
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255, 255, 255, 0.08) 2px, rgba(255, 255, 255, 0.08) 4px),
        repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(255, 255, 255, 0.08) 2px, rgba(255, 255, 255, 0.08) 4px);
    background-size: 5px 5px, 8px 8px, 8px 8px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.7;
}

.carousel-caption {
    z-index: 2;
    bottom: 0;
    top: 0;
    display: flex;
    align-items: center;
    /* Reserve the fixed navbar's height at the top. The block is centred across
       the whole masthead, so without this it rides up under the navbar as the
       viewport gets shorter - the subtitle pill was tucking behind it below
       roughly 700px of height. */
    padding-top: 132px;
    padding-bottom: 72px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    /* Strong shadow for text */
}

.carousel-caption h1 {
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 3rem;
    /* Reduced from display-3 default */
}

/* The heading is fixed at 3rem, which is far too heavy on a phone - it ran to
   three lines and pushed the buttons toward the fold. */
@media (max-width: 767.98px) {
    .carousel-caption {
        /* Navbar is shorter here (smaller logo), so it needs less clearance. */
        padding-top: 104px;
        padding-bottom: 40px;
        padding-left: 0;
        padding-right: 0;
    }

    .carousel-caption h1 {
        font-size: 1.9rem;
        letter-spacing: 0.5px;
        margin-bottom: 1.25rem !important;
    }

    /* The <br> tags are tuned for desktop line breaks and read badly here. */
    .carousel-caption h1 br {
        display: none;
    }

    .carousel-caption .slider-subtitle {
        font-size: 0.75rem;
        padding: 8px 16px;
    }
}

@media (max-width: 575.98px) {
    .carousel-caption h1 {
        font-size: 1.6rem;
    }
}

.carousel-caption p {
    font-weight: 500;
    color: #fff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    margin-bottom: 30px;
}

/* Hero Buttons */
.carousel-caption .btn {
    position: relative;
    overflow: hidden;
    z-index: 5;
    /* Flex centering keeps the pair on a shared baseline no matter how their
       label lengths differ, instead of relying on inline-block alignment. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    min-height: 62px;
    /* The caption sets a heavy text-shadow for legibility over the photo; on a
       solid button it just smears the label. */
    text-shadow: none;
    border-width: 2px;
}

/* Once the pair wraps onto separate rows the horizontal me-3 does nothing and
   the two pills sit flush against each other. */
@media (max-width: 767.98px) {
    .carousel-caption .btn {
        margin-bottom: 0.75rem;
        min-height: 54px;
        font-size: 0.95rem;
    }
}

/* Dot texture belongs only on the solid brand button - over a white face it
   reads as speckle. */
.carousel-caption .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1px);
    background-size: 6px 6px;
    opacity: 0.3;
    pointer-events: none;
}

/* Secondary hero CTA: solid white face with brand-blue label, so it reads as a
   real button against the photo rather than a faint outline. */
.carousel-caption .btn-light {
    background-color: #fff;
    border-color: #fff;
    color: var(--primary-color);
}

.carousel-caption .btn-light:hover,
.carousel-caption .btn-light:focus,
.carousel-caption .btn-light:active {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: #10233f !important;
}

/* Base Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #133b6e !important;
    /* Darker shade of primary */
    border-color: #133b6e !important;
}

.btn-outline-light:hover {
    color: var(--primary-color);
    background-color: #fff;
    border-color: #fff;
}

/* Projects */
.portfolio-item {
    cursor: pointer;
}

/* Project card thumbnail. The markup carried both `h-100` and an inline
   height:250px - the utility is !important so it won it, and each image sized
   to whatever its own wrapper happened to be (227 / 237 / 534px), leaving the
   grid ragged. One fixed height here, no competing declarations. */
.project-thumb {
    display: block;
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 575.98px) {
    .project-thumb {
        height: 200px;
    }
}

/* Keeps every card in a row the same height so the rows line up even when
   titles or descriptions wrap differently. */
.portfolio-item .card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.portfolio-item .card-body .btn {
    margin-top: auto;
}

.portfolio-link .portfolio-hover {
    background-color: rgba(26, 79, 145, 0.9) !important;
    /* Using Primary Color */
}

.portfolio-link:hover .portfolio-hover {
    opacity: 1 !important;
}

.portfolio-link img {
    transition: transform 0.5s ease;
}

.portfolio-link:hover img {
    transform: scale(1.1);
}

/* Footer */
footer {
    background-color: #1a1a1a;
}

footer .social-links a {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s;
    border: none;
}

footer .social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

footer .footer-links li a:hover {
    color: var(--primary-color) !important;
    padding-left: 5px;
}

/* Back to Top */
#btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    /* Hidden until the page is scrolled; main.js toggles .show */
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#btn-back-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

[data-bs-theme="dark"] #mainNav.navbar-scrolled {
    background-color: rgba(22, 27, 34, 0.95);
}

/* Breadcrumb Styles */
.breadcrumb-item+.breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
}

/* Brand Footer */
.bg-brand-footer {
    background-color: #0d284b !important;
    /* Deep Blue from Logo */
}

.bg-brand-footer .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.bg-brand-footer .border-secondary {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Portfolio Hover Effects */
.portfolio-item:hover .overlay {
    opacity: 1 !important;
}

.portfolio-item:hover .card-img-top {
    transform: scale(1.1);
}

.transition-transform {
    transition: transform 0.5s ease;
}

.transition-all {
    transition: all 0.3s ease;
}

/* Brand Accent Background */
.bg-brand-accent {
    background-color: #f1c40f !important;
    /* Gold/Yellow from logo */
    color: #212529;
}

.bg-brand-accent .section-heading,
.bg-brand-accent .section-subheading {
    color: #212529 !important;
    /* Ensure text is dark on yellow */
}

.bg-brand-accent .divider {
    background-color: #212529 !important;
    /* Dark divider on yellow */
}

.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

/* Featured Project Card Hover Effects */
.card-hover .card-img-top {
    transition: transform 0.5s ease;
}

.card-hover:hover .card-img-top {
    transform: scale(1.1);
}

.card-hover:hover .overlay-hover {
    opacity: 1 !important;
}

/* Custom Text Color for Slider */
.text-logo-green {
    color: var(--success-color) !important;
}

/* Project Filter Buttons */
.project-filter-btn {
    border: 2px solid #e9ecef !important;
    color: #6c757d !important;
    background-color: transparent !important;
    transition: all 0.3s ease;
}

.project-filter-btn:hover {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.project-filter-btn.active {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 10px rgba(26, 79, 145, 0.3);
}

/* Slider Subtitle Style */
.slider-subtitle {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 30px;
    text-shadow: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.bg-brand-primary {
    background-color: var(--primary-color) !important;
}

/* ===== About cards: Vision / Mission / Quality =====
   Replaces a fa-stack where the glyph and the circle behind it were both
   .text-primary at full opacity, so the icon was invisible against its own
   badge (the intended .opacity-10 isn't a Bootstrap class - the scale is
   0/25/50/75/100). White glyph on a brand-gradient disc instead. */
.about-icon {
    width: 88px;
    height: 88px;
    margin-inline: auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c6fbb 100%);
    box-shadow: 0 10px 24px rgba(26, 79, 145, 0.28);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), box-shadow 0.4s ease;
}

.about-icon i {
    font-size: 2.1rem;
    color: #fff;
    line-height: 1;
}

.about-icon--mission {
    background: linear-gradient(135deg, #1a7f5a 0%, var(--success-color) 100%);
    box-shadow: 0 10px 24px rgba(39, 174, 96, 0.28);
}

.about-icon--quality {
    background: linear-gradient(135deg, #c79a06 0%, var(--accent-color) 100%);
    box-shadow: 0 10px 24px rgba(241, 196, 15, 0.3);
}

.about-icon--quality i {
    color: #3d2f00;
}

.hover-shadow:hover .about-icon,
.about-icon:hover {
    transform: translateY(-4px) scale(1.06);
}

/* ===== Testimonials slider =====
   Sizes to its own content. Previously it inherited the hero's 100vh/600px
   rules and rendered ~900px tall with the quote stranded at the top. */
#testimonials {
    padding: 80px 0;
}

#testimonialCarousel .carousel-inner {
    /* Holds a steady height as quotes of different lengths cycle, so the
       section doesn't jump - sized to the longest quote, not to a viewport. */
    min-height: 330px;
}

#testimonialCarousel .carousel-item {
    /* Clear of the prev/next controls. */
    padding: 0 3.5rem;
}

#testimonialCarousel .carousel-control-prev,
#testimonialCarousel .carousel-control-next {
    width: 3rem;
    opacity: 0.6;
}

#testimonialCarousel .carousel-control-prev:hover,
#testimonialCarousel .carousel-control-next:hover {
    opacity: 1;
}

/* Flowed in under the quote rather than pinned to the bottom of a tall box. */
#testimonialCarousel .carousel-indicators {
    position: static;
    margin: 1.75rem 0 0;
}

@media (max-width: 575.98px) {
    #testimonials {
        padding: 60px 0;
    }

    #testimonialCarousel .carousel-item {
        padding: 0 1.5rem;
    }

    #testimonialCarousel .carousel-control-prev,
    #testimonialCarousel .carousel-control-next {
        width: 2rem;
    }

    #testimonialCarousel .carousel-inner {
        min-height: 380px;
    }
}

/* Newsletter Input Placeholder */
footer .form-control::placeholder {
    color: #c0c0c0 !important;
    opacity: 1;
}

footer .form-control::-webkit-input-placeholder {
    color: #c0c0c0 !important;
    opacity: 1;
}

footer .form-control::-moz-placeholder {
    color: #c0c0c0 !important;
    opacity: 1;
}

footer .form-control:-ms-input-placeholder {
    color: #c0c0c0 !important;
    opacity: 1;
}