/* 기본 스타일 및 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif, 'Predendard Bold'; /* 가독성 좋은 웹폰트 */
    line-height: 1.6;
    color: #333;
    overflow-x: hidden; /* 가로 스크롤 방지 */
    scroll-behavior: smooth; /* 부드러운 스크롤 기본 적용 */
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 컨테이너 (중앙 정렬 및 최대 너비) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
#main-header {
    background-color: rgba(255, 255, 255, 0.95); /* 투명도 있는 배경 */
    padding: 15px 0;
    position: fixed; /* 화면 상단 고정 */
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000; /* 다른 요소들 위에 표시 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#main-header .container {
    display: flex;
    justify-content: space-between; /* 로고와 메뉴 양 끝 분리 */
    align-items: center;
}

.logo {
    font-weight: bold;
    color: #007bff; /* Whirlwind 대표 색상 */
    display: flex;
    align-items: center;
    height: 100%;
    font-size: 1.8em; /* 텍스트 로고 크기 조정 */
    letter-spacing: 2px; /* 로고 텍스트 자간 조정 */
}

.logo a {
    color: #007bff; /* 로고 텍스트 색상 */
    font-weight: 900; /* 로고 텍스트 굵기 */
}

#main-nav ul {
    list-style: none;
    display: flex;
}

#main-nav ul li {
    margin-left: 30px;
}

#main-nav ul li a {
    font-weight: 500;
    color: #555;
    padding-bottom: 5px; /* 밑줄 효과를 위한 패딩 */
    position: relative; /* 밑줄 효과를 위한 상대 위치 */
    transition: color 0.3s ease;
}

/* 내비게이션 활성화 및 호버 시 스타일 */
#main-nav ul li a::after { /* 호버 및 활성화 시 나타날 밑줄 */
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%; /* 초기 너비 0 */
    height: 2px;
    background-color: #007bff; /* 밑줄 색상 */
    transition: width 0.3s ease; /* 너비 변화 애니메이션 */
}

#main-nav ul li a:hover::after {
    width: 100%; /* 호버 시 밑줄 전체 표시 */
}

#main-nav ul li a.active { /* 현재 섹션에 해당하는 메뉴 항목 활성화 시 */
    color: #007bff; /* 글자 색상 변경 */
    font-weight: 700; /* 글자 굵기 변경 */
}
#main-nav ul li a.active::after {
    width: 100%; /* 활성화 시 밑줄 전체 표시 */
}

/* 모바일 메뉴 토글 */
.mobile-menu-toggle {
    display: none; /* 데스크탑에서는 숨김 */
}

/* 섹션 공통 스타일 */
.section-padding {
    padding: 100px 0;
    text-align: center;
}

.section-dark { /* 어두운 배경 섹션 */
    background-color: #f8f8f8;
}

.section-light { /* 밝은 배경 섹션 */
    background-color: #eef5ff;
}

h2 {
    font-size: 3em;
    margin-bottom: 60px;
    line-height: 1.3;
    font-weight: 700;
    color: #222;
}

h3 {
    font-size: 2.5em;
    margin-bottom: 10px;
    line-height: 1.2;
    font-weight: 550;
    color: #000;
}

/* 히어로 섹션 */
#hero {
    position: relative;
    width: 100%;
    height: 100vh; /* 뷰포트 전체 높이 */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    /* #hero 자체에는 더 이상 배경 이미지와 blur를 적용하지 않습니다. */
}

.hero-background {
    position: absolute; /* #hero를 기준으로 배치 */
    top: -10px; /* 약간 확장하여 블러 처리 시 테두리 잘림 방지 */
    left: -10px;
    width: calc(100% + 20px); /* 100% + 좌우 여백 */
    height: calc(100% + 20px); /* 100% + 상하 여백 */
    background-image: url('images/miguel-henriques-RfiBK6Y_upQ-unsplash.jpg'); /* 배경 이미지 적용 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(6px); /* 이미지에 흐림 효과 적용 (강도 조절 가능) */
    z-index: 1; /* hero-content보다 아래에, ::before 오버레이보다 위에 */
}

/* 히어로 섹션 이미지 위에 어둡게 만드는 오버레이 (텍스트 가독성 향상) */
#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* 텍스트 가독성을 위한 오버레이 */
    z-index: 2; /* hero-background와 hero-content 사이에 위치 */
}

/* 히어로 텍스트가 오버레이 위에 올라오도록 z-index 설정 */
.hero-content {
    position: relative; /* z-index가 작동하려면 필요 */
    z-index: 10; /* 가장 위에 */
    color: #fff;
    text-align: center;
    padding: 0 20px; /* 좌우 여백 추가 */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7); /* 텍스트 그림자 추가하여 가독성 높임 */
}

/* 기존 Hero 텍스트 라인 스타일 (hero-line-1, hero-line-2, hero-line-3)은 필요 없으므로 삭제하거나 주석 처리합니다. */
/* 주석 처리 예시:
.hero-content .hero-line-1 { ... }
.hero-content .hero-line-2 { ... }
.hero-content .hero-line-3 { ... }
*/

/* 새로 추가된 CI 이미지 스타일 */
.hero-ci-image {
    max-width: 700px; /* 이미지의 최대 너비 (조절 가능) */
    width: 80%; /* 부모의 80% 너비 (반응형) */
    height: auto; /* 비율 유지 */
    margin-bottom: 40px; /* 이미지와 스크롤 버튼 사이 간격 */
    opacity: 0; /* 초기에는 숨김 */
    transform: translateY(20px); /* 초기 위치 */
    transition: opacity 1s ease-out, transform 1s ease-out; /* 애니메이션 효과 */
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5)); /* 이미지 그림자 추가 (선택 사항) */
}

/* overlay-text의 flex 속성을 조정하여 이미지 중앙 정렬 */
.overlay-text {
    display: flex;
    flex-direction: column; /* 수직 정렬 */
    justify-content: center;
    align-items: center; /* 가로 중앙 정렬 */
    width: 100%; /* 부모에 맞춰 너비 차지 */
}


/* 모바일 반응형 부분 (hero-line-X 관련 코드 삭제) */
@media (max-width: 768px) {
    /* ... (생략) ... */
    /* Hero 섹션 텍스트 모바일 크기 조정 부분 삭제 */
    /* .hero-content .hero-line-1 { ... } */
    /* .hero-content .hero-line-2 { ... } */
    /* .hero-content .hero-line-3 { ... } */
    /* ... (생략) ... */

    /* 모바일에서 CI 이미지 크기 조정 */
    .hero-ci-image {
        max-width: 80%; /* 모바일에서 CI 이미지 최대 너비 */
        margin-bottom: 30px; /* 모바일 간격 조정 */
    }
}

.scroll-down-btn { /* 스크롤 다운 아이콘 */
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    animation: bounce 2s infinite;
    z-index: 11; /* 텍스트 위로 오도록 */
}
.scroll-down-btn::before {
    content: '';
    width: 10px;
    height: 10px;
    border-bottom: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: rotate(45deg);
}
@keyframes bounce { /* 스크롤 다운 버튼 애니메이션 */
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -10px); }
    60% { transform: translate(-50%, -5px); }
}

/* Service 섹션 */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(300px, 1fr)); /* 2개의 컬럼 생성 */
    gap: 40px;
    margin-top: 50px;
}

.service-item {
    text-align: center;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease;
}
.service-item:hover {
    transform: translateY(-10px); /* 호버 시 살짝 위로 이동 */
}

.service-item img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    margin-bottom: 20px;
}

.service-item h3 {
    font-weight: bolder;
    font-size: 2.5em;
    color: #007bff;
    margin-bottom: 13px;
}

.service-item h4 {
    font-size: 1.4em;
    color: #000;
    line-height: 1.5;
    margin-bottom: 0px;
    padding: 0 20px 20px; /* 텍스트 아래쪽 패딩 */
}

.service-item p {
    font-size: 1.3em;
    color: #555;
    line-height: 0.1;
    margin-bottom: 13px;
    padding: 0 20px 10px; /* 텍스트 아래쪽 패딩 */
}

/* History 섹션 */
.image-gallery { /* 슬라이드 컨테이너 */
    width: 100%;
    max-width: 2000px;
    height: 600px; /* 이미지만큼 높이 조정 (gallery-item img의 width/height와 맞춰 조절) */
                     /* gallery-item img가 100% height를 사용하므로, gallery-item의 height에 맞춰야 합니다. */
                     /* 만약 이미지가 180px x 180px 비율로 보이길 원한다면 height: 180px; */
    margin: 0 auto;
    overflow: visible; /* 슬라이드 시 잘림 방지를 위해 유지 */
    border-radius: 10px;  /*필요 없으면 제거/*
    /* box-shadow: 0 5px 20px rgba(0,0,0,0.15);  제거 */
    position: sticky;
    background-color: transparent; /* 배경색 투명으로 설정 */
    /* background-color: #fff; 이 줄을 제거하거나 transparent로 변경 */
}

.gallery-inner {
    display: flex;
    width: fit-content;
    height: 100%;
    transition: transform 0.5s ease-in-out;
    gap: 300px; /* 각 gallery-item 사이의 간격 유지 */
    padding: 0 10px; /* 양쪽 끝 패딩 제거 또는 0으로 설정. 이미지 끝까지 루프되게 하려면 제거. */
    padding: 0; /* 패딩 제거 */
    align-items: center;
}

.gallery-item {
    flex-shrink: 0;
    /* 이전 계산된 너비 유지 (gap 고려) */
    width: 200px; /* (800px - (20px * 3)) / 4 = 740 / 4 = 185px (패딩 제거로 인한 재계산) */
                 /* 정확한 계산: (max-width - (gap * (itemsInView - 1))) / itemsInView */
                 /* (800 - (20 * 3)) / 4 = (800 - 60) / 4 = 740 / 4 = 185px */
    width: 300px; /* 새로운 계산 값 */
    height: 100%; /* gallery-item의 높이는 image-gallery의 height에 맞춰집니다. */
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    /* background-color: #f0f0f0;  제거 */
    /* border-radius: 8px;  제거 */
    /* box-shadow: 0 2px 5px rgba(0,0,0,0.1);  제거 */
}

.gallery-item img {
    width: 500%;
    height: 500%;
    object-fit: scale-down;
    border-radius: 3x; /* 이미지 자체의 둥근 모서리 유지 */
}

/* 반응형 디자인 */
@media (max-width: 1000px) {
    .image-gallery {
        max-width: 1000%;
        height: 130px; /* 모바일 이미지 높이 조정 (예: 130px) */
    }
    .gallery-inner {
        gap: 15px;
        padding: 0; /* 모바일에서도 패딩 제거 */
    }
    .gallery-item {
        /* 모바일 2장 표시: (100% - (gap * 1)) / 2 */
        width: calc((100% - 15px) / 2);
        height: 100%;
    }
}

@media (max-width: 480px) {
    .image-gallery {
        height: 10px; /* 더 작은 화면 이미지 높이 조정 (예: 100px) */
    }
    .gallery-inner {
        gap: 100px;
        padding: 0; /* 패딩 제거 */
    }
    .gallery-item {
        /* 모바일 1장 표시: 100% - (gap * 0) */
        width: 100%; /* 1장 표시, 패딩 없으므로 100% */
    }
}

/* Client 섹션 */
.client-logos {
    display: flex;
    flex-wrap: wrap; /* 로고가 많을 경우 줄바꿈 */
    justify-content: center;
    align-items: center;
    gap: 40px; /* 로고 간격 */
    margin-top: 50px;
}

.client-logos img {
    max-width: 1450px; /* 로고 최대 너비 */
    height: auto;
    /* filter: grayscale(80%); /* 로고를 흑백으로 만들어 깔끔함 유지 - 요청에 따라 제거 또는 유지 가능 */
    opacity: 1; /* 단일 이미지이므로 투명도 조정 필요 없을 수 있음 */
    transition: none; /* 호버 효과도 필요 없을 수 있음 */
}

/* Contact 섹션 */
.contact-content {
    display: flex; /* Flexbox 레이아웃 적용 */
    flex-wrap: wrap; /* 화면이 작아지면 줄바꿈 허용 */
    justify-content: center; /* 자식 요소들을 가로 중앙에 정렬 (기본) */
    align-items: flex-start; /* 자식 요소들을 상단에 정렬 */
    gap: 10px; /* 지도와 텍스트 사이의 간격 */
    margin-top: 80px; /* 섹션 제목과의 상단 간격 */
    text-align: left; /* 내부 텍스트 기본 정렬을 왼쪽으로 변경 */
}

.contact-map {
    flex: 0 0 900px; /* 지도의 고정 너비를 400px로 설정 (줄어들지 않음) */
    max-width: 550px; /* 최대 너비도 400px로 제한 */
    text-align: center;
}

.contact-map img {
    width: 200%; /* 부모 div의 너비에 맞춤 */
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.contact-info-text {
    flex: 1; /* 남은 공간을 모두 차지하도록 설정 */
    min-width: 500px; /* 텍스트 내용이 줄바꿈되지 않도록 최소 너비 조정 */
    padding-top: 100px;
}

.contact-info-text p {
    font-size: 1.4em; /* 폰트 크기 약간 증가 */
    margin-bottom: 15px; /* 간격 약간 증가 */
    line-height: 1.6;
    text-align: left;
}

.contact-info-text p:last-child {
    margin-bottom: 0; /* 마지막 줄 아래 간격 제거 */
}

/* 푸터 */
#main-footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
    font-size: 0.9em;
}

#main-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.social-links a {
    margin-left: 15px;
}

.social-links img {
    width: 24px;
    height: 24px;
    filter: invert(1);
}

/* 스크롤 섹션 진입 애니메이션 */
.animated-section { /* JS로 'fade-in' 클래스가 추가되기 전 초기 상태 */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animated-section.fade-in { /* JS로 'fade-in' 클래스가 추가되면 적용될 스타일 */
    opacity: 1;
    transform: translateY(0);
}


/* 반응형 디자인 */
@media (max-width: 768px) {
    h2 {
        font-size: 2.2em;
        margin-bottom: 40px;
    }

    #main-nav {
        display: none; /* 모바일에서 메뉴 숨김 */
        flex-direction: column;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        position: absolute;
        top: 60px;
        left: 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        padding-bottom: 10px; /* 모바일 메뉴 패딩 */
    }

    #main-nav.active {
        display: flex; /* 활성화 시 보임 */
    }

    #main-nav ul {
        flex-direction: column;
        width: 100%;
        padding: 0;
    }

    #main-nav ul li {
        margin: 0;
        text-align: center;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }

    #main-nav ul li:last-child {
        border-bottom: none;
    }

    .mobile-menu-toggle {
        display: block; /* 모바일에서 햄버거 버튼 보임 */
        background: none;
        border: none;
        font-size: 1.8em;
        cursor: pointer;
        color: #333;
    }

    /* 모바일 로고 크기 조정 */
    .logo {
        font-size: 1.5em; /* 모바일에서 로고 텍스트 크기 조정 */
    }

    /* Hero 섹션 텍스트 모바일 크기 조정 */
    .hero-content .hero-line-1 {
        font-size: 3em; /* 모바일에서 첫째 줄 폰트 크기 */
        margin-bottom: 10px;
    }
    .hero-content .hero-line-2 {
        font-size: 1.8em; /* 모바일에서 둘째 줄 폰트 크기 */
        margin-bottom: 10px;
    }
    .hero-content .hero-line-3 {
        font-size: 1.1em; /* 모바일에서 셋째 줄 폰트 크기 */
    }


    .service-grid {
        grid-template-columns: 1fr; /* 모바일에서 한 줄에 하나씩 */
    }
    .history-categories {
        flex-wrap: wrap; /* 버튼이 많으면 줄바꿈 */
        gap: 10px;
    }
    .history-categories .category-btn {
        padding: 8px 15px;
        font-size: 1em;
    }
    .image-gallery {
        max-width: 100%; /* 모바일에서 갤러리 너비 100% */
        height: 450px; /* 모바일에서 갤러리 높이 조정 */
        padding-bottom: 70px;
    }
    .gallery-item img {
        height: 300px; /* 모바일에서 이미지 높이 조정 */
    }
    .gallery-item .image-description {
        font-size: 0.95em;
        bottom: 15px;
    }

    /* Contact 섹션 모바일 반응형 */
    .contact-content {
        flex-direction: column; /* 세로 방향으로 정렬 */
        align-items: center; /* 가운데 정렬 */
        gap: 30px; /* 간격 조정 */
    }
    .contact-map,
    .contact-info-text {
        max-width: 90%; /* 모바일에서 너비 조정 */
        min-width: unset; /* 최소 너비 제한 해제 */
    }
    .contact-info-text {
        padding-top: 0;
    }
    .contact-info-text p {
        text-align: center; /* 모바일에서 텍스트 중앙 정렬 */
    }
}

@media (min-width: 769px) { /* 데스크탑에서 지도와 텍스트를 나란히 정렬 */
    .contact-content {
        justify-content: center; /* 중앙 정렬로 변경하여 텍스트가 너무 멀리 가지 않도록 */
        gap: 80px; /* 지도와 텍스트 사이 간격 증가 */
        align-items: flex-start; /* 상단 정렬 (필요 시 center로 변경) */
    }
}

@media (max-width: 480px) {
    .section-padding {
        padding: 60px 0;
    }
}