html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-image: url('images/CompanyLogos.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    color: #222;
}

/* Make images responsive and avoid layout shifts */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

header {
    background: #1565c0;
    color: #fff;
    text-align: center;
    padding: 2rem 1rem 1rem 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 0.5rem 1rem 0 1rem;
}
.header-titles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.logo {
    width: 240px;
    height: auto;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 6px 28px rgba(21,101,192,0.22);
    border: 4px solid #fff;
    border-radius: 16px;
    background: #fff;
    transition: transform 0.25s, box-shadow 0.25s;
    display: inline-block;
}
.logo:hover {
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 8px 32px rgba(21,101,192,0.28);
}

.navbar {
    background: #0d47a1;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.navbar li {
    display: inline;
}

.navbar a {
    color: #fff;
    font-weight: 500;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.navbar a:hover, .navbar a:focus {
    background: #1565c0;
    color: #e3f2fd;
    transform: translateY(-2px) scale(1.05);
}

@media (max-width: 800px) {
    .navbar ul {
        gap: 1rem;
    }
    main {
        padding: 0 0.5rem;
    }
}

@media (max-width: 600px) {
    .navbar ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    .navbar a {
        display: block;
        text-align: center;
    }
    .logo {
        width: 160px;
        margin-bottom: 1rem;
    }
    h1 {
        font-size: 1.5rem;
    }
    .services-list {
        grid-template-columns: 1fr;
    }
    section {
        padding: 1rem 0.5rem;
    }
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.5rem 0 0.5rem;
    }
    .header-titles {
        align-items: center;
    }
}

main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(21,101,192,0.08);
    margin-bottom: 2rem;
    padding: 2rem 1.5rem;
    opacity: 0;
    transform: translateY(30px);
    animation: sectionFadeIn 0.8s forwards;
    /* Improve initial render performance for long pages */
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

@keyframes sectionFadeIn {
    to {
        opacity: 1;
        transform: none;
    }
}

h1 {
    margin: 0.2rem 0 0.5rem 0;
    font-size: 2.5rem;
    letter-spacing: 1px;
}

.tagline {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 0;
}

h2 {
    color: #1565c0;
    margin-top: 0;
}

.services-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.services-list li {
    background: #e3f2fd;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 1px 4px rgba(21,101,192,0.05);
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}

.services-list li:hover {
    box-shadow: 0 4px 16px rgba(21,101,192,0.15);
    transform: translateY(-4px) scale(1.03);
}

.services-list h3 {
    margin-top: 0;
    color: #0d47a1;
}

.service-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    outline: none;
    transition: color 0.2s;
}

.service-btn h3 {
    transition: color 0.2s;
}

.service-btn:hover h3,
.service-btn:focus h3 {
    color: #1565c0;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay[style*="display: flex"] {
    opacity: 1;
    pointer-events: auto;
    animation: modalFadeIn 0.3s;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal {
    background: #fff;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    padding: 2rem 1.5rem;
    box-shadow: 0 4px 24px rgba(21,101,192,0.15);
    position: relative;
    text-align: left;
    animation: modalSlideIn 0.4s;
}
@keyframes modalSlideIn {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: none; opacity: 1; }
}
.modal h3 {
    margin-top: 0;
    color: #1565c0;
}
.modal .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1565c0;
    cursor: pointer;
    transition: color 0.2s;
}
.modal .close-btn:hover {
    color: #0d47a1;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-width: 400px;
    margin: 0 auto;
    animation: sectionFadeIn 0.8s forwards;
}
.contact-form input,
.contact-form textarea {
    padding: 0.6rem;
    border: 1px solid #b3c6e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: border 0.2s, box-shadow 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
    border: 1.5px solid #1565c0;
    box-shadow: 0 0 4px #90caf9;
    outline: none;
}
.contact-form button {
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.7rem 1.2rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s, transform 0.2s;
}
.contact-form button:hover {
    background: #0d47a1;
    transform: scale(1.04);
}

footer {
    background: #1565c0;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    font-size: 1rem;
    position: relative;
    bottom: 0;
    width: 100%;
}

a {
    color: #1565c0;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    text-decoration: underline;
    color: #0d47a1;
}

/* Leadership / CEO profile styles */
.leader-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid rgba(21,101,192,0.06);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(21,101,192,0.06);
}

.leader-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 4px solid #fff;
    box-shadow: 0 6px 20px rgba(21,101,192,0.14);
    transition: transform 0.25s, box-shadow 0.25s;
}
.leader-photo:hover,
.leader-photo:focus {
    transform: scale(1.03);
    box-shadow: 0 8px 28px rgba(21,101,192,0.18);
    outline: none;
}

.leader-profile h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    color: #0d47a1;
}

.leader-profile .title {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: #1565c0;
}

.leader-profile .bio {
    margin: 0;
    line-height: 1.55;
    color: #333;
}

.leader-profile .cta {
    margin-top: 0.5rem;
}
.leader-profile .cta a {
    color: #0d47a1;
    font-weight: 600;
}

@media (max-width: 600px) {
    .leader-profile {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem;
    }
    .leader-photo {
        width: 140px;
        height: 140px;
    }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
