/* 1. 웹 폰트 및 변수 설정 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css');

:root {
    --primary: #2E75B6;       /* 로고의 메인 블루 */
    --primary-light: #60a5fa;
    --accent: #f97316;        /* 로고의 오렌지 포인트 */
    --success: #22c55e;       /* 로고의 그린 포인트 */
    --bg-dark: #0f172a;       /* 네이비 배경 */
    --bg-deep: #020617;
    --bg-light: #f8fafc;      /* 밝은 섹션용 배경 추가 */
    --text-white: #ffffff;
    --text-gray: #cbd5e1;
    --transition: all 0.3s ease;
}

/* 2. 기본 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-dark);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 0 25px;
}

/* 3. 헤더 (고정 및 유리 효과) */
.header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 48px;
    display: block;
    transition: var(--transition);
}

.logo img:hover {
    transform: scale(1.05);
}

nav a {
    margin-left: 25px;
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

nav a:hover {
    color: var(--primary-light);
}

nav a[href^="mailto"] {
    background: var(--primary);
    color: white;
    padding: 8px 18px;
    border-radius: 8px;
}

nav a[href^="mailto"]:hover {
    background: #1e5a8f;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* 4. 히어로 섹션 */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

#network {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(32px, 6vw, 60px);
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: clamp(18px, 2vw, 24px);
    color: var(--text-gray);
    margin-bottom: 40px;
}

/* 5. 버튼 공통 */
.btn {
    padding: 14px 32px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: var(--transition);
}

.btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 117, 182, 0.3);
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 117, 182, 0.5);
}

.btn.outline {
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    margin-left: 15px;
}

.btn.outline:hover {
    border-color: white;
    background: rgba(255,255,255,0.1);
}

/* 6. 섹션 공통 */
.section {
    padding: 120px 0;
}

.center { text-align: center; }

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.section-text {
    font-size: 1.15rem;
    color: var(--text-gray);
    max-width: 700px;
    margin: 20px auto 0;
}

/* 7. 서비스 카드 섹션 */
.services {
    background: var(--bg-light);
    color: #0f172a;
}

.section-title {
    text-align: center;
    margin-bottom: 70px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    padding: 50px 35px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

.card-icon {
    font-size: 50px;
    margin-bottom: 25px;
    display: inline-block;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--bg-dark);
}

/* 8. 찾아오는 길 (Contact) - 요청사항 반영 */
.section.contact {
    background: #fbfbfc;
    color: #0f172a;
    padding-top: 40px !important;
    padding-bottom: 80px;
}

.section.contact .section-title {
    margin-bottom: 30px !important;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: start;
}

.map-container {
    width: 100%;
    height: 500px; /* 세로 크기 확대 반영 */
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.info-item h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.info-item p {
    color: #475569;
    line-height: 1.6;
}

/* 9. 푸터 (Footer) - 정렬 보정 */
.footer {
    background: var(--bg-deep);
    padding: 60px 0 30px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-content p {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.8;
}

.copyright {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: #64748b !important;
    font-size: 0.8rem !important;
}

/* 10. 맨 위로 가기 버튼 */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 54px;
    height: 54px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 11. 반응형 레이아웃 */
@media (max-width: 768px) {
    .menu-toggle { display: block; color: white; }
    
    nav {
        display: none;
        flex-direction: column;
        background: #1e293b;
        position: absolute;
        top: 80px; right: 20px;
        width: 220px;
        padding: 25px;
        border-radius: 20px;
        box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    }

    nav.active { display: flex; }
    nav a { margin: 12px 0; margin-left: 0; }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .map-container {
        height: 350px; /* 모바일 대응 높이 */
    }

    .section.contact {
        padding-top: 30px !important;
    }
}

/* 비디오 페이지 전용 스타일 - 최적화 완료 */
.video-page {
    padding-top: 100px;
    background: var(--bg-deep);
}

.video-hero {
    padding: 60px 0;
    background: linear-gradient(to bottom, var(--bg-dark), var(--bg-deep));
}

.video-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-white);
}

.video-card {
    background: #1e293b;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

.video-frame {
    width: 100%;
    /* 고정 비율(aspect-ratio) 대신 유연한 높이 설정을 위해 수정 */
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* iframe 관련 불필요한 설정 제거 및 video 태그 최적화 */
.video-frame video {
    width: 50%;
    height: auto;       /* 영상 비율에 맞춰 높이 자동 조절 (잘림 방지) */
    max-height: 80vh;   /* 너무 길어지지 않도록 화면 높이의 80%로 제한 */
    display: block;
    outline: none;
}

.video-content {
    padding: 40px;
}

.video-content .category {
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.video-content h2 {
    margin: 15px 0;
    font-size: 1.8rem;
    color: var(--text-white);
}

.video-content p {
    color: var(--text-gray);
    margin-bottom: 25px;
}

.tech-tags span {
    display: inline-block;
    background: rgba(46, 117, 182, 0.1);
    color: var(--primary-light);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-right: 8px;
    border: 1px solid rgba(46, 117, 182, 0.2);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .video-content {
        padding: 25px;
    }
    .video-hero h1 {
        font-size: 2.2rem;
    }
}

/* 네이버 지도 스타일링 */
.map-container {
    width: 100%;
    height: 600px;
    background: #f1f5f9;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.naver-map-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.map-static-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.map-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.3s;
}

.map-btn {
    background: #03C75A; /* 네이버 녹색 */
    color: white;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.naver-map-link:hover .map-static-img {
    transform: scale(1.05);
}

.naver-map-link:hover .map-overlay {
    background: rgba(15, 23, 42, 0.1);
}

.naver-map-link:hover .map-btn {
    transform: translateY(-5px);
    background: #02b350;
}