:root {
    --bg-color: #f0f8ff;
    /* Alice Blue - Very Light Ice */
    --text-color: #0d47a1;
    /* Dark Blue Text for Contrast */
    --accent-color: #00b0ff;
    /* Light Blue Accent */
    --secondary-color: #1565c0;
    --card-bg: rgba(255, 255, 255, 0.85);
    /* Frosty White */
    --font-heading: 'Inter', sans-serif;
    --font-code: 'Fira Code', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-heading);
    overflow-x: hidden;
}

body.loading {
    overflow: hidden;
}

/* Preloader - Light Theme */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-content {
    text-align: center;
}

.loader-text {
    font-family: var(--font-code);
    color: var(--secondary-color);
    letter-spacing: 3px;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 20px;
    font-weight: 700;
}

.progress-bar {
    width: 200px;
    height: 3px;
    background: #e3f2fd;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

.progress {
    width: 0%;
    height: 100%;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    animation: loadProgress 2s ease-in-out forwards;
}

@keyframes loadProgress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

canvas#bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

main {
    position: relative;
    z-index: 1;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0.5rem 4rem;
    /* Reduced padding to fit wide animation */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 176, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    height: 80px;
    /* Fixed height for consistency */
}

/* Updated Header Center for Wide Animation */
.header-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    /* Wider track for patrol */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Initial center alignment */
    overflow: hidden;
    /* Keep inside bounds if needed, or remove to fly out */
    pointer-events: none;
    /* Let clicks pass through to potential underlying elements */
}

.santa-icon {
    height: 60px;
    /* Bigger size */
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(13, 71, 161, 0.2));
    animation: santaPatrol 12s linear infinite;
}

/* The Patrol Animation: Left -> Right -> Flip -> Right -> Left -> Flip */
@keyframes santaPatrol {
    0% {
        transform: translateX(-150px) scaleX(1);
        /* Start Left, Face Right */
    }

    45% {
        transform: translateX(150px) scaleX(1);
        /* Reach Right, Face Right */
    }

    50% {
        transform: translateX(150px) scaleX(-1);
        /* Flip to Face Left */
    }

    95% {
        transform: translateX(-150px) scaleX(-1);
        /* Reach Left, Face Left */
    }

    100% {
        transform: translateX(-150px) scaleX(1);
        /* Flip to Face Right (Reset) */
    }
}

.brand-logo {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-code);
    letter-spacing: -1px;
    color: var(--secondary-color);
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(13, 71, 161, 0.1));
}

.accent {
    color: var(--accent-color);
}

nav {
    position: relative;
    z-index: 2;
}

nav a {
    color: #546e7a;
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

nav a:hover,
nav a.active {
    color: var(--secondary-color);
}

/* Nav Active Indicator */
nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-color);
    transition: 0.3s;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}


.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 10%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

/* Hero */
#hero {
    text-align: center;
    align-items: center;
    background: radial-gradient(circle at center, #ffffff 0%, #e3f2fd 100%);
}

.hero-title {
    font-size: 5.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    font-family: var(--font-code);
    font-weight: 900;
    color: var(--secondary-color);
    text-shadow: 0 5px 15px rgba(13, 71, 161, 0.1);
    opacity: 0;
    transform: translateY(30px);
}

.hero-subtitle {
    font-family: var(--font-heading);
    color: #455a64;
    margin-bottom: 3rem;
    font-size: 1.25rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
}

.cta-btn {
    padding: 1rem 3rem;
    background: #fff;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    opacity: 0;
    transform: translateY(20px);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 176, 255, 0.15);
}

.cta-btn:hover {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 176, 255, 0.3);
    transform: translateY(-2px);
}

/* Titles */
h2.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
    font-weight: 800;
    position: relative;
    display: inline-block;
}

h2.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Animations Helper */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
}

/* Grids & Cards - Light Card Design */
.about-grid p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #37474f;
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.projects-grid.single-project {
    display: flex;
    justify-content: start;
    max-width: 100%;
}

.project-card {
    background: #fff;
    padding: 2.5rem;
    border: 1px solid #e1f5fe;
    border-radius: 20px;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(13, 71, 161, 0.08);
    /* Soft blue shadow */
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 15px 50px rgba(0, 176, 255, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.project-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.project-card h3 {
    font-size: 1.6rem;
    color: var(--secondary-color);
    font-weight: 700;
    margin: 0;
}

.project-card p {
    color: #546e7a;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.tags {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.tag {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--secondary-color);
    background: #e3f2fd;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid #bbdefb;
}

/* Skills */
.skills-grid.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: #fff;
    border: 1px solid #e1f5fe;
    padding: 2rem 1rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.skill-card:hover {
    background: #f1f8e9;
    /* Very subtle tint or just white */
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 176, 255, 0.15);
}

.skill-card i {
    font-size: 3rem;
    color: #455a64;
    /* Fallback */
    transition: transform 0.3s ease;
}

.skill-card:hover i {
    transform: scale(1.1);
}

.skill-card span {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* Contact Box */
.contact-box {
    margin-top: 2rem;
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid #e1f5fe;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.email-label {
    font-size: 0.9rem;
    color: #78909c;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.contact-email {
    font-size: 1.5rem;
    font-family: var(--font-code);
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
}

.contact-email:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 10px rgba(0, 176, 255, 0.2);
}

/* Footer */
footer {
    padding: 4rem 0;
    background: transparent;
    margin-top: 2rem;
    position: relative;
    z-index: 10;
    border: none;
}

.footer-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.social-links {
    display: flex;
    gap: 2.5rem;
}

.social-btn {
    color: #90a4ae;
    font-size: 1.6rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-btn:hover {
    color: var(--accent-color);
    transform: translateY(-5px) scale(1.1);
}

footer p {
    font-size: 0.85rem;
    color: #b0bec5;
    letter-spacing: 1px;
}


/* --- RESPONSIVE DESIGN --- */

@media (max-width: 968px) {
    .header-center {
        width: 100%;
        position: static;
        transform: none;
        order: -1;
        margin-bottom: 1rem;
        height: 60px;
    }

    header {
        flex-direction: column;
        height: auto;
        padding-bottom: 1rem;
    }

    .santa-icon {
        height: 50px;
    }

    /* Reduce animation range on mobile to prevent overflow */
    @keyframes santaPatrol {
        0% {
            transform: translateX(-100px) scaleX(1);
        }

        45% {
            transform: translateX(100px) scaleX(1);
        }

        50% {
            transform: translateX(100px) scaleX(-1);
        }

        95% {
            transform: translateX(-100px) scaleX(-1);
        }

        100% {
            transform: translateX(-100px) scaleX(1);
        }
    }

    .hero-title {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem 1.5rem;
    }

    nav {
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        margin: 0;
        font-size: 0.85rem;
    }

    .section {
        padding: 5rem 6%;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    h2.section-title {
        font-size: 2rem;
    }

    .project-card {
        padding: 1.5rem;
    }

    .project-icon {
        width: 48px;
        height: 48px;
    }

    .skills-grid.icon-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Legal / Privacy Page Styles */
.legal-section {
    padding-top: 120px;
    padding-bottom: 4rem;
    min-height: auto;
    text-align: left;
    background: radial-gradient(circle at top center, #ffffff 0%, #f0f8ff 100%);
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(13, 71, 161, 0.05);
    border: 1px solid #e1f5fe;
}

.legal-content h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.legal-date {
    display: block;
    color: #78909c;
    margin-bottom: 2rem;
    font-family: var(--font-code);
    font-size: 0.9rem;
}

.legal-content h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e1f5fe;
    padding-bottom: 0.5rem;
}

.legal-content p {
    color: #455a64;
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.legal-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: #455a64;
}

.legal-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.legal-divider {
    height: 1px;
    background: #e1f5fe;
    margin: 4rem 0;
    border: none;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-code);
    transition: transform 0.3s;
}

.back-link:hover {
    transform: translateX(-5px);
    color: var(--accent-color);
}