html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

:root {
    --primary-blue: #1A5276;
    --accent-blue: #2E86C1;
    --deep-navy: #1B2631;
    --soft-gray: #F8F9FA;
    --border-color: #E9ECEF;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Style */
body { font-family: 'Pretendard', -apple-system, sans-serif; }

.navbar {
    padding: 0.8rem 0 !important;;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

/* Logo */
.nav-logo {
    height: 35px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.navbar-brand:hover .nav-logo { transform: scale(1.05); }

/* Desktop Menu */
@media (min-width: 992px) {
    .nav-link {
        position: relative;
        padding: 0.5rem 15px !important;
        margin: 0 4px;
    }
    /* 하단 언더라인 애니메이션 */
    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0; left: 50%;
        width: 0; height: 2px;
        background: var(--accent-blue);
        transition: var(--transition);
        transform: translateX(-50%);
    }
    .nav-link:hover::after { width: 70%; }

    /* 드롭다운 호버 시 바로 열기 (선택사항) */
    .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .dropdown-menu {
        display: block; /* 애니메이션을 위해 유지 */
        opacity: 0;
        pointer-events: none;
        transform: translateY(10px);
        transition: var(--transition);
        border: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
        border-radius: 12px;
        padding: 10px;
    }
}

/* --- Mobile Menu (햄버거 메뉴 대응) --- */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #fff;
        margin-top: 15px;
        padding: 20px;
        border-radius: 15px;
        box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        max-height: 80vh; /* 화면 넘어감 방지 */
        overflow-y: auto;
    }

    .nav-link {
        padding: 12px 15px !important;
        border-radius: 8px;
    }

    .nav-link:active, .nav-link:focus {
        background-color: var(--soft-gray);
    }

    /* 드롭다운 메뉴 모바일 스타일 */
    .dropdown-menu {
        background-color: var(--soft-gray);
        border-radius: 8px;
        padding-left: 15px;
        margin-bottom: 10px;
    }

    /* 햄버거 버튼 커스텀 (애니메이션 넣고 싶을 때) */
    .navbar-toggler {
        border: none;
        padding: 0;
    }
    .navbar-toggler:focus {
        box-shadow: none;
    }
}

/* 스크롤 시 축소 효과 */
.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.navbar.scrolled .nav-logo { height: 28px; }

/* --- Main Visual Slider --- */
.main-slider { margin-top: 70px; }
.carousel-item {
    height: 75vh; min-height: 600px;
    background-size: cover; background-position: center; position: relative;
}
.carousel-item::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(27, 38, 49, 0.9), rgba(27, 38, 49, 0.3));
}
.carousel-caption {
    z-index: 10; top: 50%; transform: translateY(-50%); bottom: auto;
    text-align: left; max-width: 800px; left: 10%;
}
.slider-title { font-size: clamp(2.2rem, 4vw, 3.8rem); font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 20px; }
.slider-desc { font-size: 1.2rem; color: rgba(255,255,255,0.8); margin-bottom: 35px; word-break: keep-all; }

/* --- Common Section Style --- */
section { padding: 120px 0; }
.section-header { margin-bottom: 80px; text-align: center; }
.section-header .sub-title { color: var(--accent-blue); font-weight: 700; letter-spacing: 2px; font-size: 0.9rem; margin-bottom: 15px; display: block; }
.section-header h2 { font-weight: 800; font-size: 2.6rem; color: var(--deep-navy); position: relative; }

/* --- Service Cards --- */
.service-card {
    background: #fff; padding: 50px 40px; border-radius: 20px; border: 1px solid var(--border-color);
    transition: var(--transition); height: 100%;
}
.service-card:hover {
    transform: translateY(-15px); box-shadow: 0 30px 60px rgba(0,0,0,0.1); border-color: var(--accent-blue);
}
.icon-wrap {
    width: 70px; height: 70px; background: var(--soft-gray); color: var(--accent-blue);
    display: flex; align-items: center; justify-content: center; border-radius: 15px;
    font-size: 1.8rem; margin-bottom: 30px; transition: var(--transition);
}
.service-card:hover .icon-wrap { background: var(--accent-blue); color: #fff; }
.service-card h4 { font-weight: 700; margin-bottom: 20px; }
.service-list { list-style: none; padding: 0; font-size: 0.95rem; color: #666; }
.service-list li { margin-bottom: 8px; }
.service-list li i { color: var(--accent-blue); margin-right: 8px; font-size: 0.8rem; }

/* --- Portfolio (Project Grid) --- */
.project-item {
    position: relative; overflow: hidden; border-radius: 15px; cursor: pointer; height: 350px;
}
.project-img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.project-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 82, 118, 0.9); display: flex; flex-direction: column;
    justify-content: center; align-items: center; opacity: 0; transition: var(--transition);
    color: #fff; padding: 20px; text-align: center;
}
.project-item:hover .project-overlay { opacity: 1; }
.project-item:hover .project-img { transform: scale(1.1); }

/* --- Technical Strength --- */
.tech-box { background: var(--deep-navy); color: #fff; border-radius: 30px; padding: 60px; }
.tech-tag {
    display: inline-block; padding: 10px 22px; background: rgba(255,255,255,0.1);
    border-radius: 50px; margin: 6px; font-size: 0.95rem; transition: 0.3s;
}

.tech-tag {
    display: inline-block;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    margin: 4px;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.tech-tag:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
    transform: translateY(-3px);
}
.tech-groups h6 {
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- Footer --- */
footer { background: #111; color: #999; padding: 100px 0 30px; }
.footer-logo { font-size: 2rem; font-weight: 800; color: #fff; margin-bottom: 30px; }
.footer-info p { margin-bottom: 10px; font-size: 0.95rem; }
.footer-title { color: #fff; font-weight: 700; margin-bottom: 25px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #999; text-decoration: none; transition: 0.3s; }
.footer-links a:hover { color: #fff; padding-left: 5px; }

@media (max-width: 991.98px) {
    .carousel-item { height: 60vh; }
    section { padding: 80px 0; }
    .section-header h2 { font-size: 2rem; }
    .carousel-caption { left: 5%; right: 5%; text-align: center; }
}

.project-container {
    cursor: pointer;
    transition: transform 0.5s ease;
}
.project-container::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
    transition: opacity 0.4s ease;
}
.project-container:hover {
    transform: translateY(-10px);
}
.project-container:hover::after {
    background: linear-gradient(to top, rgba(26, 82, 118, 0.95) 0%, rgba(26, 82, 118, 0.4) 100%);
}
.project-content-overlay {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    z-index: 2;
    transition: transform 0.4s ease;
}
.project-container:hover .project-content-overlay {
    transform: translateY(-10px);
}
.btn-warning {
    background-color: #FEE500; /* 카카오 노란색 */
    border: none;
}
.btn-warning:hover {
    background-color: #E6CF00;
    transform: scale(1.05);
}