/* ===== CSS Custom Properties ===== */
:root {
    --color-bg: #f5f7fb;
    --color-surface: #ffffff;
    --color-border: #dde3ef;
    --color-primary: #1a56db;
    --color-primary-hover: #1e40af;
    --color-accent: #e06020;
    --color-text: #1a1a2e;
    --color-text-muted: #5a6a7e;
    --font-stack: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --max-width: 1200px;
    --nav-height: 64px;
    --section-gap: 120px;
    --card-radius: 12px;

    /* Section-specific backgrounds — blue-white palette */
    --section-bg-hero: #0d2247;
    --section-bg-projects: #ffffff;
    --section-bg-clients: #edf2fa;
    --section-bg-contact: #1a3a6e;
    --section-bg-footer: #0d2247;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-stack);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid var(--color-border);
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
}
.nav-name {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--section-bg-hero);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: calc(var(--nav-height) + 40px) 24px 40px;
    overflow: hidden;
}
.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 34, 71, 0.45);
    z-index: 2;
}
.hero-content {
    position: relative;
    text-align: center;
    max-width: 800px;
    z-index: 3;
}
.hero-slogan {
    font-size: clamp(28px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 1px;
    margin-bottom: 24px;
    color: #fff;
}
.hero-intro {
    font-size: clamp(16px, 2vw, 20px);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Sections ===== */
.section {
    padding: var(--section-gap) 24px;
    position: relative;
}
.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}
.section-heading {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: 1px;
}

/* Section background variants */
#projects {
    background: var(--section-bg-projects);
}
#clients {
    background: var(--section-bg-clients);
}
#contact {
    background: var(--section-bg-contact);
}

/* Section dividers — sharp hard borders */
#projects {
    border-bottom: 4px solid var(--color-primary);
}
#clients {
    border-bottom: 4px solid var(--color-accent);
}
#contact {
    border-top: 4px solid rgba(255, 255, 255, 0.15);
}

/* Section heading accent bars */
.section-heading {
    position: relative;
}
.section-heading::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    margin: 16px auto 0;
    border-radius: 2px;
}
#projects .section-heading {
    color: var(--color-text);
}
#projects .section-heading::after {
    background: var(--color-primary);
}
#clients .section-heading {
    color: var(--color-text);
}
#clients .section-heading::after {
    background: var(--color-accent);
}
#contact .section-heading {
    color: #ffffff;
}
#contact .section-heading::after {
    background: rgba(255, 255, 255, 0.6);
}

/* Clients section — subtle dot texture for material differentiation */
#clients {
    background-color: var(--section-bg-clients);
    background-image: radial-gradient(circle, rgba(26, 86, 219, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Dark-bg sections override text to white */
#contact {
    color: rgba(255, 255, 255, 0.9);
}
#contact .contact-item a {
    color: #ffffff;
    text-decoration: underline;
}
#contact .contact-item a:hover {
    color: rgba(255, 255, 255, 0.75);
}

/* ===== Gallery Grid ===== */
.gallery {
    display: grid;
    gap: 24px;
}
.gallery-large {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.gallery-small {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ===== Cards ===== */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.card-project {
    cursor: default;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(26, 86, 219, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(26, 86, 219, 0.25);
}
.card-img-wrap {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e8ecf4;
}
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.card:hover .card-img {
    transform: scale(1.03);
}
.card-body {
    padding: 20px;
}
.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}
.card-text {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ===== Client Cards ===== */
.card-client {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    gap: 16px;
    text-align: center;
}
.card-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
}
.card-client-name {
    font-size: 15px;
    font-weight: 500;
}

/* ===== Contact ===== */
.contact-info {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}
.contact-item {
    font-size: 18px;
    margin-bottom: 16px;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 40px 24px;
    background: var(--section-bg-footer);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
}
.footer-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    :root {
        --section-gap: 80px;
    }
    .gallery-large {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    :root {
        --section-gap: 60px;
    }
    .gallery-large {
        grid-template-columns: 1fr;
    }
    .gallery-small {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .hero {
        min-height: 80vh;
    }
    .section-heading {
        margin-bottom: 40px;
    }
}
