/* 리셋 및 기본 설정 */
:root {
    /* 노트북/도화지 질감 컬러 */
    --bg-paper: #FDFBF7;
    /* 약간 누런 도화지 톤 */
    --text-main: #2C2C2C;
    /* 진회색 (연필/잉크 느낌) */
    --text-muted: #6B6B6B;

    /* 강조색 (형광펜이나 사인펜 느낌) */
    --accent-primary: #FF5A5F;
    /* 생동감 있는 코랄 레드 */
    --accent-secondary: #00A699;
    /* 민트 그린 */
    --accent-highlight: #FFD166;
    /* 노란색 하이라이터 */

    /* 노트북 선 및 보더색 */
    --border-color: #E2DBD3;
    /* 종이 텍스처와 어울리는 연한 테두리 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Pretendard', 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-paper);
    color: var(--text-main);
    line-height: 1.6;
    position: relative;
    /* 은은한 노이즈/도화지 텍스처 (SVG 데이터 URI) */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

/* 제목/강조용 폰트는 손글씨나 귀여운 고딕체 느낌을 주기 위해 두껍게 처리 */
h1,
h2,
h3,
.logo-text {
    font-family: 'Pretendard', sans-serif;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

/* 텍스트 강조(하이라이터) 효과 */
.highlight-text {
    background: linear-gradient(transparent 60%, var(--accent-highlight) 40%);
    display: inline;
    padding: 0 4px;
}

/* 부드러운 버튼 스타일 (스케치북 + 3D 효과) */
button,
.btn-primary,
.btn-secondary {
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    /* 둥근 노트북 스티커 느낌 */
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

/* 메인 버튼: 사용자 요청 3D 이중 그림자 적용 */
.btn-primary {
    background: var(--text-main);
    /* 어두운 색 배경 */
    color: #FDFBF7;
    border: 2px solid var(--text-main);
    /* 그림자 1: X:0 Y:2 Blur:1 White 100% / 그림자 2: X:0 Y:-2 Blur:1 Black 10% */
    /* 버튼 윗부분은 어두운 그림자, 아랫부분은 밝은 그림자로 입체감 */
    box-shadow: 0 2px 1px rgba(255, 255, 255, 1), 0 -2px 1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(1px);
    /* 눌리는 효과 */
    box-shadow: 0 1px 1px rgba(255, 255, 255, 1), 0 -1px 1px rgba(0, 0, 0, 0.1);
    background: #1A1A1A;
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 2px dashed var(--text-main);
    /* 점선 보더로 스케치 느낌 */
    box-shadow: 0 2px 1px rgba(255, 255, 255, 1), 0 -2px 1px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.03);
    transform: translateY(1px);
    box-shadow: 0 1px 1px rgba(255, 255, 255, 1), 0 -1px 1px rgba(0, 0, 0, 0.1);
}

/* 네비게이션 */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;

    /* 스켗북 상단 띠 느낌 */
    background: rgba(253, 251, 247, 0.95);
    /* 기본 배경색 (거의 불투명) */
    border: 2px solid var(--text-main);
    border-radius: 12px;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    /* 스크롤 트랜지션용 */
}

/* 스크롤 시 상단바 전체 투명화 (내부 콘텐츠 포함 25% 투명도 적용, 블러 제거) */
.navbar.scrolled {
    background: rgba(253, 251, 247, 0.95);
    opacity: 0.25;
    /* 유저 요청대로 네비게이션바 콘텐츠까지 전부 투명하게 작동 */
    box-shadow: none;
    /* 투명도를 가리기 않도록 그림자 제거 */
    border-color: rgba(44, 44, 44, 0.3);
    padding: 0.8rem 2rem;
    backdrop-filter: none;
    /* 명확한 블러 비활성화 */
}

.navbar.scrolled:hover {
    opacity: 1;
    /* 마우스 오버 시 다시 보이도록 편의성 추가 */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* 로고 이미지 컨테이너 */
.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 55px;
    /* 로고 이미지 높이 대폭 상향 */
    width: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 3px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-primary);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.nav-links a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* 버튼은 밑줄 제거 및 텍스트 강제 화이트 */
.nav-links a.btn-primary {
    color: #FDFBF7;
}

.nav-links a.btn-primary::after {
    display: none;
}

/* 공통 섹션 패딩 */
section,
header {
    padding: 120px 20px;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 히어로 섹션 */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-content {
    z-index: 10;
    max-width: 900px;
    opacity: 0;
    transform: translateY(30px);
}

.hero-title {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    line-height: 1.25;
    margin-bottom: 2rem;
    font-weight: 800;
    word-break: keep-all;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-weight: 500;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* 노트북 줄 공책 모티프 장식 */
.notebook-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(transparent, transparent 39px, rgba(0, 166, 153, 0.1) 40px);
    z-index: 0;
    pointer-events: none;
}

/* 포스트잇 장식 */
.post-it {
    position: absolute;
    background: #FFD166;
    padding: 15px;
    box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.1);
    transform: rotate(3deg);
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 5;
}

.pt-1 {
    top: 20%;
    left: 10%;
    transform: rotate(-5deg);
}

.pt-2 {
    bottom: 30%;
    right: 15%;
    transform: rotate(4deg);
    background: #FF5A5F;
    color: white;
}

/* 솔루션 섹션 (What We Do) */
.services {
    background-color: #f7f4ed;
    /* 도화지보다 조금 더 짙은 오프화이트로 구분감 */
    border-top: 2px solid var(--text-main);
    border-bottom: 2px solid var(--text-main);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

/* 제목 밑에 손글씨 밑줄 스러운 장식 */
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: -10%;
    width: 120%;
    height: 12px;
    background: var(--accent-highlight);
    z-index: -1;
    transform: skewX(-15deg);
    opacity: 0.7;
}

.cards-grid {
    display: grid;
    /* auto-fit 대신 auto-fill 사용, minmax 크기 축소하여 카드 하나만 있어도 늘어나지 않게 처리 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* 노트북/스케치북의 쪽지, 카드 타일 (메인페이지 솔루션용 복구 원본) */
.service-card {
    background: #fff;
    padding: 2.5rem 2rem;
    border: 2px solid var(--text-main);
    border-radius: 16px;
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 카드 상단을 테이프로 붙인 듯한 느낌 */
.service-card::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05);
}

.service-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.15);
}

/* ========================================= */
/* 아카이브 전용 갤러리 뷰 카드 (정방형 1:1 비율) */
/* ========================================= */
.archive-card {
    background: #fff;
    padding: 0;
    border: 2px solid var(--text-main);
    border-radius: 16px;
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    /* 단일 카드 외형을 완전한 정사각형으로! */
}

.archive-card::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 2;
}

.archive-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.15);
}

/* 카드 크기 내에서 상단 공간(약 60%)을 차지하는 직사각형 비율 썸네일 컨테이너 */
.archive-thumbnail {
    width: 100%;
    height: 60%;
    background-color: var(--bg-paper);
    background-size: cover;
    background-position: center;
    border-bottom: 2px solid var(--text-main);
}

/* 썸네일이 없을 때 보여질 기본 영역 */
.archive-thumbnail-empty {
    width: 100%;
    height: 60%;
    background-color: #f7f4ed;
    background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.02) 0, rgba(0, 0, 0, 0.02) 2px, transparent 2px, transparent 8px);
    border-bottom: 2px solid var(--text-main);
}

/* 썸네일 하단 텍스트 컨텐츠 영역 */
.archive-content {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    /* 본문이 정사각형을 침범하지 않도록 */
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 50%;
    border: 2px solid var(--text-main);
}

/* 갤러리 뷰의 작은 타이틀 옆 아이콘 용 */
.card-icon-small {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border-color);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 50%;
    border: 2px solid var(--text-main);
}

.keyword-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-highlight);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: 20px;
    margin-bottom: 1rem;
    border: 1px solid var(--text-main);
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.service-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* 챌린지 홍보 밴드 (Marquee 느낌 또는 강조 배너) */
.challenge-banner {
    padding: 60px 20px;
    background: var(--text-main);
    color: #FDFBF7;
    text-align: center;
}

.challenge-banner h2 {
    color: #FDFBF7 !important;
    text-decoration: none;
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.challenge-banner p {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.challenge-banner .btn-primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 0px #c93b3f;
    /* 눌리는 입체 형태 */
}

.challenge-banner .btn-primary:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0px #c93b3f;
    background: #e54c50;
}

/* 페이지네이션 (1, 2, 3...) */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 4rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: 'Pretendard', sans-serif;
    font-size: 1rem;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--text-main);
    color: var(--text-main);
}

.page-btn.active {
    background: var(--text-main);
    color: #FDFBF7;
    border-color: var(--text-main);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 푸터 */
.site-footer {
    background-color: transparent;
    border-top: 2px solid var(--border-color);
    padding: 30px 20px 20px;
    /* 기존 60px에서 축소 */
    font-size: 0.95rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    /* 양쪽 열의 높이를 최대한 조화롭게 중앙 정렬 결합 */
    gap: 2rem;
    margin-bottom: 30px;
}

.footer-col-left {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}

.footer-col-left {
    flex: 1;
    min-width: 250px;
}

.footer-col-left img {
    height: 55px;
    /* 로고 사이즈 아담하게 수정 (기존 보다 살짝 축소) */
    width: auto;
    margin-bottom: 12px;
}

.footer-col-left .footer-slogan {
    color: var(--text-muted);
    font-size: 0.85rem;
    /* 로고 아래 내용 텍스트 사이즈 조화롭게 축소 */
    line-height: 1.6;
    margin: 0;
}

.footer-col-right {
    flex: 2;
    min-width: 300px;
    color: var(--text-muted);
}

.footer-col-right .footer-info {
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-col-right .footer-info p {
    margin: 0.25rem 0;
}

.footer-bottom {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    /* 원래 디자인처럼 명확한 중앙 정렬 */
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    /* 구분선 명확하게 추가 */
    color: var(--text-muted);
    font-size: 0.85rem;
}

#core-values-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* ==========================================================================
   네비게이션 드롭다운 및 모바일 서브메뉴
   ========================================================================== */
.nav-links li {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #FDFBF7;
    border: 1px solid var(--text-main);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 160px;
    z-index: 1000;
}

.nav-links li:hover .dropdown-menu {
    display: block;
    animation: fadeInDropdown 0.2s ease-out forwards;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.dropdown-item {
    display: block;
    padding: 0.6rem 1.5rem;
    color: var(--text-main) !important;
    font-weight: 500 !important;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 90, 95, 0.05);
    color: var(--accent-primary) !important;
}

/* 모바일 사이드 서랍 서브메뉴 */
.drawer-submenu {
    list-style: none;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    border-left: 2px solid rgba(44, 44, 44, 0.1);
}

.drawer-submenu a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
}

.drawer-submenu a:hover {
    color: var(--accent-primary);
}

/* 사이드 서랍 및 햄버거 메뉴 디자인 */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
    /* 네비게이션 상단바 내에서 클릭가능하도록 */
}

.hamburger-btn span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-main);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    max-width: 80vw;
    height: 100vh;
    background: #FDFBF7;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

.side-drawer.open {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--text-main);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    box-shadow: none;
}

.close-btn:hover {
    box-shadow: none;
    transform: scale(1.1);
    background: none;
}

.drawer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.drawer-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
    transition: color 0.3s ease;
}

.drawer-links a:hover {
    color: var(--accent-primary);
}

.drawer-links a.btn-primary {
    display: inline-block;
    color: #FDFBF7;
    text-align: center;
    margin-top: 10px;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   미디어 쿼리 (반응형 웹 - 모바일 기기 최적화)
   ========================================================================== */
@media screen and (max-width: 768px) {

    /* 네비게이션 모바일 최적화 */
    .nav-links {
        display: none;
    }

    .hamburger-btn {
        display: flex;
    }

    .navbar {
        width: 100%;
        top: 0;
        left: 0;
        transform: none;
        /* 중앙정렬 풀기 */
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid var(--text-main);
        box-shadow: none;
        padding: 0.6rem 1rem;
    }

    .navbar.scrolled {
        padding: 0.6rem 1rem;
        border-bottom: 1px solid rgba(44, 44, 44, 0.3);
    }

    .logo img {
        height: 35px;
        /* 모바일 전용 로고 크기 축소 */
    }

    #core-values-grid {
        grid-template-columns: 1fr;
    }

    /* 공통 패딩 축소 */
    section,
    header {
        padding: 80px 15px;
    }

    .scrap-box {
        padding: 1.5rem;
        margin: 1rem auto;
    }

    /* 히어로 섹션 글꼴 및 여백 축소 */
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.4;
        word-break: break-word;
        /* 텍스트 넘침 방지 */
    }

    .hero-subtitle {
        font-size: 1rem;
        word-break: break-word;
        padding: 0 10px;
    }

    /* 포스트잇 겹침 방지 (크기 축소 및 위치 조정) */
    .post-it {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .pt-1 {
        top: 12%;
        left: 2%;
        transform: rotate(-5deg) scale(0.85);
    }

    .pt-2 {
        bottom: 12%;
        right: 2%;
        transform: rotate(4deg) scale(0.85);
    }

    /* 서비스/아카이브 카드 그리드 강제 1열 */
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* 푸터 요소 상하 배치 전환 */
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-col-left,
    .footer-col-right {
        margin: 0;
        min-width: 100%;
    }
}

/* 이 괄호가 미디어 쿼리를 닫습니다 */