:root {
    --font-main: "Fira Sans", sans-serif;
    
    /* Blue to White Glossy Effect */
    --primary-blue: #0066CC;
    --primary-light-blue: #1E90FF;
    --secondary-blue: #4DA6FF;
    --white: #FFFFFF;
    --light-gray: #F5F7FA;
    --dark-gray: #1A1A2E;
    
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(30, 102, 204, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(30, 102, 204, 0.15);
    --text-color: #1A1A2E;
    --text-shadow: none;
    --icon-bg: rgba(30, 102, 204, 0.1);
    --service-item-bg: rgba(255, 255, 255, 0.85);
    --service-item-shadow: 0 10px 30px rgba(30, 102, 204, 0.12);
    --service-item-highlight: rgba(30, 102, 204, 0.08);
    --link-color: #0066CC;
    --accent-gradient: linear-gradient(135deg, #0066CC 0%, #1E90FF 100%);

    /* Prevent white flash before background images render */
    --page-bg: #071424;
}

body.theme-light {
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(30, 102, 204, 0.35);
    --text-color: #1A1A2E;
    --text-shadow: none;
    --icon-bg: rgba(30, 102, 204, 0.12);
    --service-item-bg: rgba(255, 255, 255, 0.90);
    --service-item-shadow: 0 12px 40px rgba(30, 102, 204, 0.18);
    --service-item-highlight: rgba(30, 102, 204, 0.12);
    --link-color: #0066CC;
    --page-bg: #071424;
}

body.theme-dark {
    --page-bg: #071424;
}

html {
    background: var(--page-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-main);
    overflow-x: hidden;
    background: var(--page-bg);
}

a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    position: relative;
}

a:hover,
a:focus-visible {
    color: var(--primary-light-blue);
    text-shadow: 0 0 8px rgba(30, 102, 204, 0.3);
}

h1, h2, p {
    margin-top: 0;
}

h1,
h2 {
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 0.5rem;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

p {
    font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.6;
    color: var(--text-color);
    transition: color 0.5s ease;
}

#scroll-container {
    min-height: 100vh;
}

.glass-container {
    width: min(88vw, 980px);
    margin: 2rem auto;
    padding: clamp(2rem, 4vw, 3.5rem);
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow), inset 0 1px 1px rgba(255, 255, 255, 0.5);
    color: var(--text-color);
    text-shadow: var(--text-shadow);
    opacity: 0;
    transform: translateY(32px) scale(0.98);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

body.is-ready .glass-container {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.glass-container > * {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-ready .glass-container > * {
    opacity: 1;
    transform: translateY(0);
}

body.is-ready .glass-container > :nth-child(1) { transition-delay: 0.15s; }
body.is-ready .glass-container > :nth-child(2) { transition-delay: 0.25s; }
body.is-ready .glass-container > :nth-child(3) { transition-delay: 0.35s; }

.section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

.section-nav a {
    padding: 0.7rem 1.2rem;
    border: 1.5px solid rgba(30, 102, 204, 0.3);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(30, 102, 204, 0.08) 0%, rgba(30, 144, 255, 0.05) 100%);
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: background-color, border-color, box-shadow, transform;
}

.section-nav a:hover,
.section-nav a:focus-visible {
    background: linear-gradient(135deg, rgba(30, 102, 204, 0.15) 0%, rgba(30, 144, 255, 0.1) 100%);
    border-color: rgba(30, 102, 204, 0.5);
    box-shadow: 0 8px 20px rgba(30, 102, 204, 0.15);
    transform: translateY(-2px);
}

.panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
    padding: 2rem 1rem;
}

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--page-bg);
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.05);
    filter: blur(5px) brightness(1.1) saturate(0.7);
    transition: opacity 1.2s ease-in-out, transform 1.4s ease-out, filter 1.2s ease;
    z-index: 0;
    will-change: opacity, transform, filter;
}

.bg-layer.active {
    opacity: 1;
    transform: scale(1);
    filter: blur(0) brightness(0.9) saturate(0.85);
}

.services-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 0;
    margin: 3rem 0 0 0;
    list-style: none;
}

.services-list li {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.services-list li:hover {
    transform: translateY(-10px);
}

.services-list li:hover i {
    box-shadow: 
        0 16px 50px rgba(30, 102, 204, 0.25),
        inset -2px -2px 6px rgba(30, 102, 204, 0.12),
        inset 2px 2px 6px rgba(255, 255, 255, 0.6);
}

.services-list i {
    font-size: 2.5rem;
    color: var(--primary-blue);
    background: linear-gradient(135deg, rgba(30, 102, 204, 0.15) 0%, rgba(30, 144, 255, 0.08) 100%);
    padding: 1.2rem;
    border-radius: 50%;
    box-shadow: 
        0 12px 40px rgba(30, 102, 204, 0.18),
        inset -2px -2px 6px rgba(30, 102, 204, 0.1),
        inset 2px 2px 6px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(30, 102, 204, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    will-change: transform, box-shadow;
}

.services-list span {
    font-size: 1.1rem;
    font-weight: 600;
}

.work-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    align-items: start;
}

.gallery-item {
    position: relative;
    padding: 0;
    border: 1.5px solid rgba(30, 102, 204, 0.25);
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 100%);
    box-shadow: 
        0 18px 40px rgba(30, 102, 204, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.6);
    cursor: pointer;
    aspect-ratio: 4 / 3;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.28s ease, 
                border-color 0.28s ease, 
                background 0.28s ease;
    will-change: transform, box-shadow, border-color;
}

.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 35%, rgba(30, 102, 204, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.gallery-item:hover,
.gallery-item:focus-visible {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 
        0 28px 50px rgba(30, 102, 204, 0.28),
        inset 0 1px 2px rgba(255, 255, 255, 0.7);
    border-color: rgba(30, 102, 204, 0.4);
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
    opacity: 1;
}

.gallery-item.is-expanded {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.75) 100%);
    border-color: rgba(30, 102, 204, 0.35);
    box-shadow: 
        0 32px 60px rgba(30, 102, 204, 0.25),
        inset 0 1px 2px rgba(255, 255, 255, 0.7);
    aspect-ratio: auto;
}

.gallery-item.is-expanded::after {
    opacity: 1;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(30, 102, 204, 0.05) 100%);
}

.gallery-item:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 4px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.gallery-item.is-expanded img {
    height: clamp(260px, 42vw, 460px);
    object-fit: contain;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
}
#contact ul {
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
}

#contact ul li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.2rem;
    background: linear-gradient(135deg, rgba(30, 102, 204, 0.1) 0%, rgba(30, 144, 255, 0.05) 100%);
    border: 1px solid rgba(30, 102, 204, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

#contact ul li:hover {
    background: linear-gradient(135deg, rgba(30, 102, 204, 0.15) 0%, rgba(30, 144, 255, 0.1) 100%);
    box-shadow: 0 8px 20px rgba(30, 102, 204, 0.15);
    transform: translateY(-2px);
}

#contact ul li i {
    color: var(--primary-blue);
    font-size: 1.3rem;
}

@media (max-width: 900px) {
    .services-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem 1.5rem;
    }
}

@media (max-width: 560px) {
    .services-list {
        grid-template-columns: repeat(2, 1fr);

        gap: 2rem;
        margin-top: 2rem;
    }

    .services-list i {
        font-size: 2rem;
        width: 70px;
        height: 70px;
        padding: 1rem;
    }
    
    .glass-container {
        text-align: center;
    }

    .section-nav {
        justify-content: center;
    }

    .work-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
        margin-top: 2rem;
    }

    .gallery-item.is-expanded {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .glass-container,
    .glass-container > *,
    .bg-layer,
    .gallery-item,
    .gallery-item::after {
        transition: none;
        transform: none;
    }

    .glass-container,
    .glass-container > *,
    .bg-layer.active {
        opacity: 1;
    }
}
