/* ============================================
   이동근 포트폴리오
   ============================================ */

:root {
    --primary: #0071e3;
    --primary-dark: #0058b0;
    --primary-soft: rgba(0, 113, 227, 0.08);
    --text: #1d1d1f;
    --text-muted: #6e6e73;
    --bg: #ffffff;
    --bg-alt: #f5f5f7;
    --border: #d2d2d7;
    --border-soft: #e8e8ed;
    --accent-port: #0a7b6c;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, .08);
    --speed: .35s;
    --max: 1160px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    word-break: keep-all;
    overflow-wrap: break-word;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
a { text-decoration: none; color: inherit; transition: color var(--speed); }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { width: 90%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 2000;
    background: var(--primary); color: #fff; padding: 12px 20px;
}
.skip-link:focus { left: 0; }

/* ---------- 버튼 ---------- */
.btn {
    display: inline-block; padding: 13px 28px; border-radius: 50px;
    font-weight: 500; font-size: 15px; text-align: center;
    transition: all var(--speed);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-secondary { color: var(--primary); border: 1px solid var(--primary); }
.btn-secondary:hover { background: var(--primary-soft); transform: translateY(-2px); }

/* ---------- 네비게이션 ---------- */
nav {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    padding: 16px 0; transition: all var(--speed);
}
nav.scrolled { padding: 10px 0; border-bottom-color: var(--border-soft); box-shadow: var(--shadow-sm); }
nav .container { display: flex; justify-content: space-between; align-items: center; }

.logo a {
    font-size: 20px; font-weight: 700; color: var(--primary);
    letter-spacing: -.3px;
}

.nav-menu { display: flex; gap: 28px; }
.nav-menu a {
    font-size: 15px; color: var(--text-muted); position: relative; padding: 4px 0;
}
.nav-menu a::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 0; height: 2px; background: var(--primary); transition: width var(--speed);
}
.nav-menu a:hover { color: var(--text); }
.nav-menu a:hover::after,
.nav-menu a.active::after { width: 100%; }
.nav-menu a.active { color: var(--primary); font-weight: 500; }

.menu-toggle { display: none; font-size: 20px; color: var(--text); padding: 6px; }

/* ---------- 섹션 공통 ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
    font-size: clamp(28px, 4vw, 38px); margin-bottom: 14px; letter-spacing: -.01em;
}
.section-title::after {
    content: ''; display: block; width: 44px; height: 3px;
    background: var(--primary); border-radius: 2px; margin-top: 14px;
}
.section-desc {
    color: var(--text-muted); font-size: 16px; margin-bottom: 48px; max-width: 680px;
}

/* ---------- 인트로 ---------- */
.intro {
    min-height: 100vh; display: flex; align-items: center;
    position: relative; padding: 120px 0 90px;
    background:
        radial-gradient(circle at 12% 18%, rgba(0, 113, 227, .07), transparent 42%),
        radial-gradient(circle at 88% 72%, rgba(10, 123, 108, .06), transparent 45%);
}
.intro-content { max-width: 760px; }
.intro-eyebrow {
    font-family: 'JetBrains Mono', monospace; font-size: 13px; letter-spacing: 2px;
    text-transform: uppercase; color: var(--primary); margin-bottom: 14px;
}
.intro h1 {
    font-size: clamp(42px, 7vw, 68px); letter-spacing: -.02em; margin-bottom: 18px;
}
.intro-lead {
    font-size: clamp(18px, 2.4vw, 23px); color: var(--text); line-height: 1.6; margin-bottom: 26px;
}
.intro-quote {
    border-left: 3px solid var(--primary); padding: 4px 0 4px 18px;
    color: var(--text-muted); font-size: 16px; margin-bottom: 40px;
}

.intro-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 12px; margin-bottom: 42px;
}
.intro-stats li {
    background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
    padding: 18px 16px; box-shadow: var(--shadow-sm);
}
.intro-stats strong { display: block; font-size: 21px; margin-bottom: 2px; }
.intro-stats span { font-size: 13px; color: var(--text-muted); }

.cta-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

.scroll-indicator {
    position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
    text-align: center; color: var(--text-muted); font-size: 12px;
    animation: bounce 2.4s infinite;
}
.scroll-indicator i { display: block; margin-top: 6px; }
@keyframes bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 8px); }
}

/* ---------- 일하는 방식 ---------- */
.principle-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;
}
.principle-card {
    background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
    padding: 30px 26px; transition: all var(--speed);
}
.principle-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.principle-num {
    font-family: 'JetBrains Mono', monospace; font-size: 13px;
    color: var(--primary); margin-bottom: 12px; letter-spacing: 1px;
}
.principle-card h3 { font-size: 18px; margin-bottom: 10px; }
.principle-card p { font-size: 15px; color: var(--text-muted); }

/* ---------- 기술 스택 ---------- */
.skill-category { margin-bottom: 46px; }
.skill-category h3 {
    font-size: 17px; margin-bottom: 18px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft); color: var(--text-muted);
    font-weight: 500; letter-spacing: .3px;
}
.skills-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}
.skill-item {
    display: flex; gap: 16px; align-items: flex-start;
    background: var(--bg-alt); border-radius: var(--radius); padding: 20px;
    transition: all var(--speed);
}
.section-alt .skill-item { background: #fff; }
.skill-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.skill-icon {
    flex: 0 0 46px; width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
}
.skill-icon img, .skill-icon svg { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.skill-info h4 { font-size: 16px; margin-bottom: 4px; }
.skill-info p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ---------- 경력 타임라인 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
    content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px;
    width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 34px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
    position: absolute; left: -26px; top: 7px;
    width: 12px; height: 12px; border-radius: 50%;
    background: #fff; border: 3px solid var(--border);
}
.timeline-item:first-child .timeline-marker { border-color: var(--primary); }
.timeline-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline-head h3 { font-size: 19px; }
.timeline-meta {
    font-size: 14px; color: var(--text-muted); margin: 4px 0 10px;
}
.timeline-desc { font-size: 15px; color: var(--text); max-width: 720px; }

/* ---------- 뱃지 ---------- */
.badge {
    display: inline-block; font-size: 12px; font-weight: 500;
    padding: 3px 10px; border-radius: 50px; line-height: 1.6; white-space: nowrap;
}
.badge-now { background: rgba(10, 123, 108, .12); color: var(--accent-port); }
.badge-pl { background: var(--primary-soft); color: var(--primary); }
.badge-solo { background: rgba(190, 100, 0, .12); color: #a35c00; }

/* ---------- 필터 ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 30px; }
.filter-btn {
    padding: 9px 18px; border-radius: 50px; font-size: 14px;
    background: var(--bg-alt); color: var(--text-muted); transition: all var(--speed);
}
.section-alt .filter-btn { background: #fff; }
.filter-btn span { font-size: 12px; opacity: .65; margin-left: 4px; }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--primary); color: #fff; }
.filter-btn.active span { opacity: .8; }

/* ---------- 프로젝트 ---------- */
.projects-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 22px;
}
.project-item {
    background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
    padding: 30px 28px; transition: transform var(--speed), box-shadow var(--speed), opacity .3s;
}
.section-alt .project-item { background: var(--bg-alt); }
.project-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.project-item.hidden { display: none; }

.project-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.project-head h3 { font-size: 18px; line-height: 1.45; flex: 1 1 auto; min-width: 200px; }
.project-meta {
    font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px;
}
.project-summary {
    font-size: 15px; color: var(--text); margin-bottom: 16px;
    padding-bottom: 16px; border-bottom: 1px dashed var(--border);
}
.project-tech { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tech-tag {
    font-size: 12.5px; padding: 4px 10px; border-radius: 6px;
    background: var(--primary-soft); color: var(--primary-dark);
    white-space: nowrap;
}
.project-details li {
    position: relative; padding-left: 15px; margin-bottom: 7px;
    font-size: 14.5px; color: var(--text-muted); line-height: 1.65;
}
.project-details li::before {
    content: ''; position: absolute; left: 0; top: 11px;
    width: 5px; height: 5px; border-radius: 50%; background: var(--primary); opacity: .5;
}

/* ---------- 연락처 ---------- */
.contact-items { display: flex; flex-wrap: wrap; gap: 14px; }
.contact-item {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
    padding: 18px 26px; font-size: 15px; transition: all var(--speed);
}
.contact-item i { color: var(--primary); font-size: 17px; }
.contact-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--primary); }

/* ---------- 푸터 ---------- */
footer {
    padding: 34px 0; text-align: center;
    font-size: 13px; color: var(--text-muted);
    border-top: 1px solid var(--border-soft);
}

/* ---------- 스크롤 애니메이션 ---------- */
.reveal-text, .reveal-item {
    opacity: 0; transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}
.reveal-text.visible, .reveal-item.visible { opacity: 1; transform: none; }
.principle-card.reveal-item:nth-child(2) { transition-delay: .07s; }
.principle-card.reveal-item:nth-child(3) { transition-delay: .14s; }
.principle-card.reveal-item:nth-child(4) { transition-delay: .21s; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition-duration: .01ms !important; }
    .reveal-text, .reveal-item { opacity: 1; transform: none; }
}

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
    .projects-grid { grid-template-columns: 1fr; }
    .intro-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .section { padding: 72px 0; }
    .menu-toggle { display: block; }
    .nav-menu {
        position: fixed; top: 60px; left: 0; width: 100%;
        flex-direction: column; gap: 0;
        background: rgba(255, 255, 255, .97);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--border-soft);
        max-height: 0; overflow: hidden; transition: max-height var(--speed);
    }
    .nav-menu.active { max-height: 420px; }
    .nav-menu li { border-top: 1px solid var(--border-soft); }
    .nav-menu a { display: block; padding: 15px 24px; }
    .nav-menu a::after { display: none; }
    .intro { min-height: auto; padding: 130px 0 80px; }
    .skills-grid { grid-template-columns: 1fr; }
    .project-item { padding: 24px 20px; }
    .contact-items { flex-direction: column; }
    .contact-item { justify-content: flex-start; }
}

@media (max-width: 420px) {
    .intro-stats { grid-template-columns: 1fr 1fr; }
    .intro-stats strong { font-size: 18px; }
}
