:root {
    --primary: #1a1a1a;
    --primary-accent: #2563eb;
    --primary-accent-bg: #eff6ff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Custom Scrollbar - High Visibility */
html {
    scrollbar-color: #64748b #f1f5f9;
    scrollbar-width: auto;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-left: 1px solid #e2e8f0;
}

::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e293b;
}

::-webkit-scrollbar-thumb:active {
    background: #0f172a;
}

/* Fixed Glassmorphism Header */
.profile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
    transition: background-color 0.3s, border-color 0.3s;
}

.header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.profile-subname {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.profile-contact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #4b5563;
    text-decoration: none;
    font-size: 13px;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.profile-link:hover {
    color: var(--primary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.profile-link svg {
    color: #64748b;
}

/* Container */
.container {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 110px 20px 80px 20px;
}

/* Personal Info & Tech Stack Card */
.profile-summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    margin-top: 10px;
    margin-bottom: 36px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.profile-main-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.profile-name-box h2 {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 14px 0;
    letter-spacing: -0.5px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.profile-name-box .subname {
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
}

.profile-info-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
    width: 100%;
}

.info-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #334155;
    white-space: nowrap;
}

.info-item svg {
    color: #64748b;
    flex-shrink: 0;
}

.info-item .info-label {
    font-weight: 600;
    color: #64748b;
    font-size: 13px;
}

.info-item .info-val {
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}

.info-item a.info-val {
    color: #2563eb;
    text-decoration: none;
}

.info-item a.info-val:hover {
    text-decoration: underline;
}

/* Tech Stack Section */
.tech-stack-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tech-stack-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tech-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tech-group-label {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    min-width: 110px;
    padding-top: 4px;
    flex-shrink: 0;
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.tech-badge {
    font-size: 12.5px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    transition: all 0.2s;
}

.tech-badge:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.tech-badge.dev { background: #eff6ff; border-color: #dbeafe; color: #1e40af; }
.tech-badge.ai { background: #faf5ff; border-color: #f3e8ff; color: #6b21a8; }
.tech-badge.agent { background: #fff7ed; border-color: #ffedd5; color: #9a3412; }
.tech-badge.media { background: #ecfdf5; border-color: #d1fae5; color: #065f46; }
.tech-badge.biz { background: #fef3c7; border-color: #fde68a; color: #92400e; }

@media (max-width: 768px) {
    .profile-summary-card {
        padding: 20px;
        border-radius: 16px;
        gap: 18px;
        margin-bottom: 24px;
    }
    .profile-info-grid {
        gap: 10px 20px;
    }
    .info-item {
        font-size: 13.5px;
    }
    .tech-group {
        flex-direction: column;
        gap: 6px;
    }
    .tech-group-label {
        min-width: unset;
        padding-top: 0;
    }
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 50px 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    letter-spacing: -0.4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* Works Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.portfolio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Portfolio Action Buttons */
.portfolio-btn-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.portfolio-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #1e293b;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    flex: 1;
    min-width: 260px;
}

.portfolio-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.06);
    border-color: #94a3b8;
    color: var(--primary-accent);
}

.portfolio-action-btn svg {
    color: var(--primary-accent);
    flex-shrink: 0;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.portfolio-card:hover .card-icon {
    background: #0f172a;
    color: #ffffff;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.card-meta-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.card-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-accent);
    transition: gap 0.2s ease;
}

.portfolio-card:hover .card-action {
    gap: 10px;
}

/* 2-Tier Matrix Filter Component */
.matrix-filter-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.matrix-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.matrix-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    background: #e2e8f0;
    padding: 6px 10px;
    border-radius: 6px;
    min-width: 95px;
    text-align: center;
    letter-spacing: -0.3px;
    flex-shrink: 0;
}

.matrix-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.matrix-filter-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.matrix-filter-btn:hover {
    border-color: #94a3b8;
    color: #0f172a;
    background: #f1f5f9;
}

.matrix-filter-btn.active {
    background: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(30, 41, 59, 0.2);
}

.matrix-filter-btn:active {
    transform: scale(0.96);
}

@media (max-width: 640px) {
    .matrix-filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .matrix-filter-label {
        min-width: auto;
    }
}

/* Vertical Timeline Component */
.timeline {
    position: relative;
    padding-left: 36px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 11px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 36px;
    transition: opacity 0.3s ease;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    left: -36px;
    top: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #3b82f6;
    box-shadow: 0 0 0 3px #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.timeline-item[data-categories~="career"] .timeline-dot {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px #eff6ff;
}

.timeline-item[data-categories~="ai"] .timeline-dot {
    border-color: #9333ea;
    box-shadow: 0 0 0 3px #faf5ff;
}

.timeline-item[data-categories~="biz"] .timeline-dot {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px #fffbeb;
}

.timeline-item[data-categories~="education"] .timeline-dot {
    border-color: #10b981;
    box-shadow: 0 0 0 3px #ecfdf5;
}

.timeline-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 26px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.timeline-content:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.05);
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.timeline-date-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-date {
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: -0.2px;
}

.timeline-category-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.tag-career { background: #dbeafe; color: #1e40af; }
.tag-ai { background: #f3e8ff; color: #6b21a8; }
.tag-biz { background: #fef3c7; color: #92400e; }
.tag-education { background: #d1fae5; color: #065f46; }

.timeline-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.timeline-body {
    font-size: 14px;
    color: #4b5563;
    margin: 0;
    line-height: 1.6;
}

.timeline-details {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}

.timeline-list {
    margin: 8px 0 0 0;
    padding-left: 18px;
    font-size: 13px;
    color: #4b5563;
}

.timeline-list li {
    margin-bottom: 5px;
}

/* Detail Accordion for Deep Curriculum */
details.curriculum-accordion {
    margin-top: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
}

details.curriculum-accordion summary {
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    outline: none;
    user-select: none;
}

details.curriculum-accordion summary:hover {
    color: #2563eb;
}

.curriculum-content {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.curriculum-step {
    margin-bottom: 12px;
}

.curriculum-step-title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

/* Footer */
.footer {
    margin-top: 80px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 14px;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .container {
        padding-top: 100px;
    }

    .header-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px;
    }

    .header-nav {
        width: auto;
        justify-content: flex-end;
        gap: 16px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-quote {
        font-size: 15px;
    }

    .timeline {
        padding-left: 28px;
    }

    .timeline::before {
        left: 7px;
    }

    .timeline-dot {
        left: -28px;
        width: 18px;
        height: 18px;
        top: 6px;
    }

    .timeline-content {
        padding: 18px;
    }
}
