@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;900&family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap');

:root {
    --primary-blue: #0044cc;
    --deep-blue: #001a4d;
    /* Darker for more contrast */
    --accent-blue: #3388ff;
    --cyan-pop: #00f2ff;
    /* New accent for flashy effects */
    --pale-blue: #f4f9ff;
    --white: #ffffff;
    --text-dark: #0a0f1c;
    --text-gray: #556677;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(51, 136, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--cyan-pop));
    z-index: 9999;
    box-shadow: 0 0 10px var(--accent-blue);
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 25px 5%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 15px 5%;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.nav-logo {
    height: 50px;
    width: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.5s ease;
    object-fit: cover;
}

header.scrolled .nav-logo {
    border-color: var(--deep-blue);
    transform: rotate(360deg);
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.5px;
    text-transform: uppercase;
    transition: color 0.4s;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

header.scrolled .logo-text {
    color: var(--deep-blue);
    text-shadow: none;
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s;
    position: relative;
    padding: 5px 0;
    opacity: 0.9;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: var(--cyan-pop);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 8px var(--cyan-pop);
}

.nav-links a:hover {
    color: var(--cyan-pop);
    opacity: 1;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

.nav-links a:hover::after {
    width: 100%;
}

header.scrolled .nav-links a {
    color: var(--deep-blue);
}

header.scrolled .nav-links a:hover {
    color: var(--primary-blue);
}

/* Hero Section */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    overflow: hidden;
    perspective: 1000px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transform: scale(1.1);
    /* Standard smooth zoom */
    animation: smoothZoom 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 34, 102, 0.4) 0%, rgba(0, 10, 30, 0.9) 100%);
    z-index: -1;
}

.hero-content {
    z-index: 1;
    max-width: 900px;
    padding: 0 20px;
}

.hero-title {
    font-size: 5rem;
    font-weight: 900;
    margin-bottom: 25px;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(50px) rotateX(10deg);
    animation: heroTextReveal 1s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s;
    background: linear-gradient(45deg, #ffffff 30%, #3388ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(51, 136, 255, 0.3));
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards 0.8s;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.btn {
    display: inline-block;
    padding: 18px 50px;
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-blue));
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s ease;
    border: none;
    opacity: 0;
    animation: fadeInUp 1s forwards 1.1s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(51, 136, 255, 0.4);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

.btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 50px rgba(51, 136, 255, 0.6);
}

.btn:hover::before {
    left: 100%;
}

/* Sections General */
section {
    padding: 120px 5%;
    position: relative;
    overflow: hidden;
}

/* Background elements for flashiness */
section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(51, 136, 255, 0.03) 0%, transparent 60%);
    z-index: -1;
    animation: spinSlow 60s linear infinite;
    pointer-events: none;
}

.section-title {
    text-align: center;
    margin-bottom: 100px;
    position: relative;
}

.section-title h2 {
    font-size: 3.5rem;
    color: var(--deep-blue);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 5px;
    background: var(--accent-blue);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s;
}

.section-title:hover h2::after {
    width: 100%;
}

/* Feature Cards with 3D Float */
.features {
    background: linear-gradient(180deg, var(--white) 0%, var(--pale-blue) 100%);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    perspective: 1000px;
    /* For 3D JS Tilt */
}

.feature-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 50px 40px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
    transition: all 0.1s ease-out;
    /* Fast transition for JS tilt */
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    z-index: 1;
}

/* Inner glow effect */
.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(51, 136, 255, 0.06), transparent 40%);
    z-index: -1;
}

.icon-box {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--pale-blue), #ffffff);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    color: var(--primary-blue);
    font-size: 2rem;
    box-shadow: 0 10px 20px rgba(0, 68, 204, 0.1);
    transition: transform 0.5s;
}

.feature-card:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: 0 10px 30px rgba(0, 68, 204, 0.3);
}

/* About Section */
.about {
    display: flex;
    align-items: center;
    gap: 60px;
    flex-wrap: wrap;
}

.about-content {
    flex: 1;
    min-width: 300px;
}

.about-image {
    flex: 1;
    min-width: 300px;
    position: relative;
    perspective: 1000px;
}

.about-image img {
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.about-image:hover img {
    transform: rotateY(5deg) scale(1.02);
}

.floating-card {
    position: absolute;
    bottom: -40px;
    left: -40px;
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 20px;
    animation: float 6s ease-in-out infinite;
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 2;
}

/* Team Grid Enhanced */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.team-member {
    position: relative;
    border-radius: 25px;
    overflow: hidden;
    height: 480px;
    /* Slight adjustment */
    max-width: 380px;
    /* Prevent full width zoom */
    margin: 0 auto;
    /* Center if single column */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s;
    background-color: #f0f4f8;
    /* Fallback bg */
}

.team-member:hover {
    transform: translateY(-15px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.2);
}

.team-member img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    /* Safest for headshots */
    transition: transform 0.8s;
}

.team-member:hover img {
    transform: scale(1.15);
}

.member-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 10, 40, 0.9), rgba(0, 10, 40, 0.6), transparent);
    padding: 30px 20px;
    color: white;
    z-index: 2;
    transform: translateY(10px);
    transition: transform 0.3s;
}

.team-member:hover .member-info {
    transform: translateY(0);
}

.member-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.member-info p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Footer modern */
footer {
    background: linear-gradient(135deg, #001133 0%, #002266 100%);
    position: relative;
    color: rgba(255, 255, 255, 0.8);
    padding: 80px 5% 30px;
    /* More spacing */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 50px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto 50px;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.footer-col ul {
    list-style: none;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.6;
}

footer h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

footer ul li {
    margin-bottom: 12px;
}

footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--cyan-pop);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--accent-blue), var(--cyan-pop), var(--primary-blue));
}

/* Animations Keyframes */
@keyframes heroTextReveal {
    from {
        opacity: 0;
        transform: translateY(80px) rotateX(20deg);
        letter-spacing: -2px;
    }

    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
        letter-spacing: 0;
    }
}

@keyframes smoothZoom {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.15);
    }
}

@keyframes spinSlow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Reveal on Scroll Class */
.reveal {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    filter: blur(5px);
    transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* Page Headers for Subpages */
.page-header,
.projects-header,
.asem-hero {
    position: relative;
    overflow: hidden;
}

.page-header::after,
.projects-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, var(--white), transparent);
}

/* =========================================
   Tablet/Laptop Responsiveness (Max-Width: 1200px)
   ========================================= */
@media (max-width: 1200px) {

    /* Prevent overlap in split sections like About */
    .about {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .about-image,
    .about-content {
        min-width: 100%;
        max-width: 800px;
        /* Constrain width for aesthetics */
        margin: 0 auto;
    }

    /* Adjust floating card position for vertical layout */
    .floating-card {
        bottom: -30px;
        left: 50%;
        transform: translateX(-50%);
    }

    .section-title h2 {
        font-size: 2.8rem;
    }
}

/* =========================================
   Mobile Responsiveness (Max-Width: 768px)
   ========================================= */
@media (max-width: 768px) {

    /* 1. Header & Navigation */
    header {
        padding: 15px 20px;
        background: rgba(255, 255, 255, 0.95);
        /* Always opaque on mobile */
    }

    nav {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        gap: 15px;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        font-size: 0.9rem;
        padding: 0;
    }

    .nav-links a {
        color: var(--deep-blue) !important;
        /* Force dark color on mobile white header */
    }

    /* 2. Typography Adjustment */
    html {
        font-size: 14px;
        /* Base scale down */
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    /* 3. Layout Adjustments */
    section {
        padding: 60px 5%;
    }

    /* About Section Stacking */
    .about {
        flex-direction: column;
        gap: 40px;
    }

    .about-image,
    .about-content {
        min-width: 100%;
        width: 100%;
    }

    /* Force full image visibility */
    .about-image img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .office-grid {
        grid-template-columns: 1fr;
        /* Single column */
        gap: 30px;
    }

    .team-member {
        height: 400px;
        /* Slightly shorter on mobile */
        max-width: 100%;
    }

    /* 5. Footer Adjustments */
    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-col {
        min-width: 100%;
    }

    /* 6. A-SEM Hero Fix */
    .asem-hero {
        flex-direction: column;
        padding-top: 100px;
    }

    .asem-title {
        font-size: 2rem;
    }

    .feature-row {
        flex-direction: column !important;
        gap: 30px;
        text-align: center;
    }

    .contact-grid {
        flex-direction: column;
    }

    .contact-info {
        padding-right: 0;
    }

    /* 7. Home & About Image Fixes */
    .team-member {
        height: 350px;
        /* Reduced height */
        max-width: 300px;
        /* Limit width */
        margin: 0 auto;
        /* Center */
    }

    .reveal {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
        filter: blur(5px);
        transition: all 1s cubic-bezier(0.5, 0, 0, 1);
    }

    .reveal.active {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }

    /* Page Headers for Subpages */
    .page-header,
    .projects-header,
    .asem-hero {
        position: relative;
        overflow: hidden;
    }

    .page-header::after,
    .projects-header::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100px;
        background: linear-gradient(to top, var(--white), transparent);
    }

    /* =========================================
   Tablet/Laptop Responsiveness (Max-Width: 1200px)
   ========================================= */
    @media (max-width: 1200px) {

        /* Prevent overlap in split sections like About */
        .about {
            flex-direction: column;
            text-align: center;
            gap: 40px;
        }

        .about-image,
        .about-content {
            min-width: 100%;
            max-width: 800px;
            /* Constrain width for aesthetics */
            margin: 0 auto;
        }

        /* Adjust floating card position for vertical layout */
        .floating-card {
            bottom: -30px;
            left: 50%;
            transform: translateX(-50%);
        }

        .section-title h2 {
            font-size: 2.8rem;
        }
    }

    /* =========================================
   Mobile Responsiveness (Max-Width: 768px)
   ========================================= */
    @media (max-width: 768px) {

        /* 1. Header & Navigation */
        header {
            padding: 15px 20px;
            background: rgba(255, 255, 255, 0.95);
            /* Always opaque on mobile */
        }

        nav {
            flex-direction: column;
            gap: 15px;
        }

        .nav-links {
            gap: 15px;
            width: 100%;
            justify-content: center;
            flex-wrap: wrap;
            font-size: 0.9rem;
            padding: 0;
        }

        .nav-links a {
            color: var(--deep-blue) !important;
            /* Force dark color on mobile white header */
        }

        /* 2. Typography Adjustment */
        html {
            font-size: 14px;
            /* Base scale down */
        }

        .hero-title {
            font-size: 2.2rem;
        }

        .hero-subtitle {
            font-size: 1rem;
            padding: 0 10px;
        }

        .section-title h2 {
            font-size: 2rem;
        }

        /* 3. Layout Adjustments */
        section {
            padding: 60px 5%;
        }

        /* About Section Stacking */
        .about {
            flex-direction: column;
            gap: 40px;
        }

        .about-image,
        .about-content {
            min-width: 100%;
            width: 100%;
        }

        /* Force full image visibility */
        .about-image img {
            width: 100%;
            height: auto;
            object-fit: contain;
        }

        .office-grid {
            grid-template-columns: 1fr;
            /* Single column */
            gap: 30px;
        }

        .team-member {
            height: 400px;
            /* Slightly shorter on mobile */
            max-width: 100%;
        }

        /* 5. Footer Adjustments */
        .footer-content {
            flex-direction: column;
            gap: 30px;
            text-align: center;
        }

        .footer-col {
            min-width: 100%;
        }

        /* 6. A-SEM Hero Fix */
        .asem-hero {
            flex-direction: column;
            padding-top: 100px;
        }

        .asem-title {
            font-size: 2rem;
        }

        .feature-row {
            flex-direction: column !important;
            gap: 30px;
            text-align: center;
        }

        .contact-grid {
            flex-direction: column;
        }

        .contact-info {
            padding-right: 0;
        }

        /* 7. Home & About Image Fixes */
        .team-member {
            height: 350px;
            /* Reduced height */
            max-width: 300px;
            /* Limit width */
            margin: 0 auto;
            /* Center */
        }

        .team-member img {
            object-position: top center;
            /* Focus on face */
        }

        .greeting-section {
            flex-direction: column !important;
            padding: 60px 5%;
            gap: 40px;
        }

        .greeting-img {
            width: 100% !important;
            flex: none !important;
            /* Disable flex grow/shrink from desktop */
            max-height: 500px;
            margin: 0 auto;
        }

        .greeting-text {
            width: 100%;
            flex: none !important;
            text-align: left !important;
            padding: 0;
        }

        .greeting-text h2 {
            font-size: 1.8rem;
            text-align: center;
            margin-bottom: 25px;
        }

        .greeting-text p {
            font-size: 1rem;
            text-align: justify;
            /* Justify text for clean edges */
            word-break: keep-all;
            /* Korean text readability */
        }
    }