/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --text-primary: #e8e8ed;
    --text-secondary: #8888a0;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --border: #2a2a3a;
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.accent {
    color: var(--accent-light);
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    border-bottom-color: var(--border);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo-img {
    height: 36px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 36px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 120px 24px 80px;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
}

.hero-greeting {
    font-size: 1rem;
    color: var(--accent-light);
    font-weight: 500;
    margin-bottom: 8px;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 480px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-light);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    text-align: center;
}

/* Hero Code Block */
.hero-visual {
    flex: 0.8;
}

.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.code-header {
    display: flex;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-block pre {
    padding: 24px;
    font-size: 0.9rem;
    line-height: 1.8;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.code-keyword { color: #c792ea; }
.code-var { color: #82aaff; }
.code-prop { color: #f07178; }
.code-string { color: #c3e88d; }

/* ===== Section Common ===== */
.section {
    padding: 100px 0;
}

.section-alt {
    background: var(--bg-secondary);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: -0.5px;
}

/* ===== About ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 1.02rem;
}

.about-stats {
    display: flex;
    gap: 40px;
    margin-top: 32px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-light);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.about-image {
    display: flex;
    justify-content: center;
}

.image-placeholder {
    width: 280px;
    height: 320px;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.about-logo {
    width: 300px;
    height: auto;
    border-radius: var(--radius);
    filter: drop-shadow(0 10px 30px rgba(108, 92, 231, 0.2));
    animation: colorShift 2s linear infinite;
}

.nav-logo-img {
    animation: colorShift 2s linear infinite;
}

@keyframes colorShift {
    0%   { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    transition: var(--transition);
}

.skill-category:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-4px);
}

.skill-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--accent-light);
}

.skill-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.skill-icon {
    width: 36px;
    height: 36px;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-light);
    flex-shrink: 0;
}

/* ===== Project Tabs ===== */
.project-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.tab-btn {
    padding: 8px 24px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ===== Projects Slider ===== */
.projects-slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.projects-slider {
    display: flex;
    gap: 30px;
    overflow: hidden;
    scroll-behavior: smooth;
    flex: 1;
}

.projects-slider .project-card {
    min-width: calc(50% - 15px);
    flex-shrink: 0;
}

.slider-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.6rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.slider-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.slider-dot.active {
    background: var(--accent-light);
    transform: scale(1.3);
}

@media (max-width: 640px) {
    .projects-slider .project-card {
        min-width: 100%;
    }
    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.project-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 500;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Slideshow ===== */
.slideshow {
    position: relative;
    width: 100%;
    height: 100%;
}

.slideshow .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
}

.slideshow .slide.active {
    opacity: 1;
}

.project-preview {
    position: relative;
    overflow: hidden;
}

.project-preview iframe {
    width: 300%;
    height: 600%;
    border: none;
    transform: scale(0.333);
    transform-origin: top left;
    pointer-events: none;
    animation: scrollPreview 20s ease-in-out infinite alternate;
    background: #fff;
}

@keyframes scrollPreview {
    0% { transform: scale(0.333) translateY(0); }
    100% { transform: scale(0.333) translateY(-50%); }
}

.heatmap-bg {
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460, #533483) !important;
}

.project-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-light);
    margin-bottom: 10px;
}

.badge-program {
    background: rgba(0, 206, 158, 0.15);
    color: #00ce9e;
}

.project-card.hidden {
    display: none;
}

.project-content {
    padding: 24px;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    padding: 4px 12px;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 20px;
    font-size: 0.78rem;
    color: var(--accent-light);
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 20px;
}

.project-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-light);
    transition: var(--transition);
}

.project-link:hover {
    color: white;
}

/* ===== Contact ===== */
.contact-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-top: -40px;
    margin-bottom: 50px;
    font-size: 1.05rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-light);
    flex-shrink: 0;
}

.contact-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.contact-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== Contact Buttons ===== */
.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.btn-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
}

.btn-contact:hover {
    transform: translateY(-2px);
}

.btn-sms {
    background: #4CAF50;
    color: white;
}

.btn-sms:hover {
    background: #66BB6A;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.btn-call {
    background: #2196F3;
    color: white;
}

.btn-call:hover {
    background: #42A5F5;
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.3);
}

.btn-kakao {
    background: #FEE500;
    color: #191919;
}

.btn-kakao:hover {
    background: #FFE94A;
    box-shadow: 0 0 20px rgba(254, 229, 0, 0.3);
}

/* ===== Footer ===== */
.footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== Scroll Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 40px;
        padding-top: 100px;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-visual {
        width: 100%;
        max-width: 400px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        order: -1;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 20px 0;
        border-bottom: 1px solid var(--border);
        transform: translateY(-120%);
        transition: var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: 14px 0;
        font-size: 1rem;
    }

    .nav-link::after {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .about-stats {
        justify-content: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 70px 0;
    }
}
