/* ==========================================================================
   Design Tokens & Variables
   ========================================================================== */
:root {
    /* Fonts */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    
    /* Animation Timing */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme (Default) */
.dark-theme {
    --bg-main: #0B0F17;
    --bg-header: rgba(11, 15, 23, 0.7);
    --bg-card: rgba(22, 27, 34, 0.6);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(16, 185, 129, 0.3);
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --accent-emerald: #10B981;
    --accent-blue: #3B82F6;
    --accent-gradient: linear-gradient(135deg, #10B981 0%, #3B82F6 100%);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);
    
    --glass-blur: blur(12px) saturate(180%);
    --scrollbar-track: #0B0F17;
    --scrollbar-thumb: #1E293B;
    --scrollbar-thumb-hover: #334155;

    --code-bg: #090D14;
    --code-keyword: #F43F5E;
    --code-class: #38BDF8;
    --code-str: #F59E0B;
    --code-comment: #475569;
    
    /* Button Styles */
    --btn-secondary-bg: rgba(255, 255, 255, 0.03);
    --btn-secondary-bg-hover: rgba(255, 255, 255, 0.08);
    --btn-secondary-border: rgba(255, 255, 255, 0.15);
    --btn-secondary-border-hover: rgba(255, 255, 255, 0.3);
}

/* Light Theme */
.light-theme {
    --bg-main: #F8FAFC;
    --bg-header: rgba(248, 250, 252, 0.7);
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(5, 150, 105, 0.3);
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    
    --accent-emerald: #059669;
    --accent-blue: #2563EB;
    --accent-gradient: linear-gradient(135deg, #059669 0%, #2563EB 100%);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(5, 150, 105, 0.15);
    
    --glass-blur: blur(12px) saturate(140%);
    --scrollbar-track: #F8FAFC;
    --scrollbar-thumb: #CBD5E1;
    --scrollbar-thumb-hover: #94A3B8;

    --code-bg: #F1F5F9;
    --code-keyword: #D97706;
    --code-class: #2563EB;
    --code-str: #059669;
    --code-comment: #64748B;
    
    /* Button Styles */
    --btn-secondary-bg: rgba(15, 23, 42, 0.03);
    --btn-secondary-bg-hover: rgba(15, 23, 42, 0.08);
    --btn-secondary-border: rgba(15, 23, 42, 0.15);
    --btn-secondary-border-hover: rgba(15, 23, 42, 0.3);
}

/* Achromatic theme — shared black, gray, and white palette */
.dark-theme {
    --bg-main: #171717;
    --bg-header: #1f1f1f;
    --bg-card: rgba(255, 255, 255, 0.055);
    --bg-card-hover: rgba(255, 255, 255, 0.085);
    --border-color: rgba(255, 255, 255, 0.10);
    --border-hover: rgba(255, 255, 255, 0.24);
    --text-primary: #f2f2f2;
    --text-secondary: #b4b4b4;
    --text-muted: #808080;
    --accent-emerald: #f2f2f2;
    --accent-blue: #d8d8d8;
    --accent-gradient: linear-gradient(135deg, #f2f2f2, #b8b8b8);
    --shadow-glow: none;
    --scrollbar-track: #171717;
    --scrollbar-thumb: #3a3a3a;
    --scrollbar-thumb-hover: #555555;
    --code-bg: #111111;
    --btn-secondary-border-hover: rgba(255, 255, 255, 0.34);
}

.light-theme {
    --bg-main: #f7f7f8;
    --bg-header: #f0f0f1;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-hover: #ffffff;
    --border-color: rgba(0, 0, 0, 0.09);
    --border-hover: rgba(0, 0, 0, 0.30);
    --text-primary: #202123;
    --text-secondary: #565869;
    --text-muted: #8e8e95;
    --accent-emerald: #202123;
    --accent-blue: #565869;
    --accent-gradient: linear-gradient(135deg, #202123, #565869);
    --shadow-glow: none;
    --scrollbar-track: #f7f7f8;
    --scrollbar-thumb: #d1d1d4;
    --scrollbar-thumb-hover: #aaaab0;
    --code-bg: #ececee;
    --btn-secondary-border-hover: rgba(0, 0, 0, 0.32);
}

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

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ==========================================================================
   Utility Classes & Layout
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.tech-accent {
    color: var(--accent-emerald);
    font-weight: 800;
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-normal), background-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
}

.glass:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-weight: 600;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    font-size: 1rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #FFFFFF;
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--btn-secondary-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.btn-secondary:hover {
    background: var(--btn-secondary-bg-hover);
    border-color: var(--btn-secondary-border-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* Section Common Layout */
section {
    padding: 8rem 0;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3.5rem;
    text-align: center;
    position: relative;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: var(--accent-gradient);
    margin: 0.8rem auto 0;
    border-radius: 2px;
}

/* Scroll indicator */
#scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--accent-gradient);
    width: 0%;
    z-index: 1000;
    transition: width 0.1s ease-out;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-normal), border-bottom var(--transition-normal);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
}

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

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

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

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Theme Toggle Button */
#theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

#theme-toggle:hover {
    background-color: var(--border-color);
    border-color: var(--text-secondary);
}

/* Theme icon toggling visibility */
.dark-theme .theme-icon-light { display: none; }
.dark-theme .theme-icon-dark { display: block; color: var(--text-primary); }
.light-theme .theme-icon-dark { display: none; }
.light-theme .theme-icon-light { display: block; color: var(--text-primary); }

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
    overflow: hidden;
}

.hero-bg-gradients {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.hero-bg-gradients .gradient-1 {
    position: absolute;
    width: 500px;
    height: 500px;
    top: -150px;
    left: -150px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
}

.hero-bg-gradients .gradient-2 {
    position: absolute;
    width: 600px;
    height: 600px;
    bottom: -200px;
    right: -150px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-content .badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1.2rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    height: 2.2rem;
}

.cursor {
    animation: blink 0.7s infinite;
    font-weight: 300;
    color: var(--accent-emerald);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-description {
    font-size: 1.0rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.hero-socials {
    display: flex;
    gap: 1.8rem;
}

.hero-socials a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color var(--transition-fast);
}

.hero-socials a:hover {
    color: var(--text-primary);
}

/* Hero Image Profile Graphic */
.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1;
    margin: 0 auto;
}

.image-border-glow {
    position: absolute;
    inset: -10px;
    background: var(--accent-gradient);
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(25px);
    z-index: 1;
    animation: pulseGlow 8s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(1.0); opacity: 0.25; }
    100% { transform: scale(1.05); opacity: 0.4; }
}

.hero-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    background-color: var(--bg-card);
    overflow: hidden;
    z-index: 2;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-img {
    width: 105%;
    height: 105%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.hero-image-wrapper:hover .profile-img {
    transform: scale(1.06);
}

/* ==========================================================================
   About Me Section
   ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.about-card {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.card-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.about-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.about-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 2.5rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-right: none;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-emerald);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

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

/* ==========================================================================
   Skills Section
   ========================================================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

.skills-category {
    padding: 2.5rem;
}

.skills-category h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
}

.skills-category h3 i {
    color: var(--accent-emerald);
}

.skill-badges-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.8rem;
    width: 100%;
}

.badge-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.badge-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.03);
}

.badge-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.badge-item img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-gradient);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.project-card {
    overflow: hidden;
    display: flex;
    flex-direction: row;
    height: auto;
}

.project-thumbnail {
    position: relative;
    width: 320px;
    min-width: 320px;
    background: var(--code-bg);
    border-right: 1px solid var(--border-color);
    border-bottom: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.project-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.35rem 0.8rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-sm);
}

.project-tag.tag-team {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.project-tag.tag-personal {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.code-art {
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.code-art pre {
    margin: 0;
    text-align: left;
    width: 100%;
}

.code-art code {
    color: var(--text-primary);
}

.c-keyword { color: var(--code-keyword); font-weight: bold; }
.c-class { color: var(--code-class); }
.c-str { color: var(--code-str); }
.c-comment { color: var(--code-comment); font-style: italic; }

.project-info {
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.project-tagline {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-emerald);
    margin-bottom: 1rem;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 1.8rem;
    line-height: 1.55;
    flex-grow: 1;
}

.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.8rem;
}

.project-tech-stack span {
    background-color: var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.7rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.project-card:hover .project-tech-stack span {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--accent-emerald);
}

.btn-detail {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0;
    align-self: flex-start;
    font-size: 0.95rem;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.btn-detail i {
    transition: transform var(--transition-fast);
}

.btn-detail:hover {
    color: var(--accent-emerald);
}

.btn-detail:hover i {
    transform: translateX(5px);
}

/* ==========================================================================
   Education & Timeline
   ========================================================================== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    left: 32px;
}

.timeline-item {
    position: relative;
    margin-bottom: 3.5rem;
    display: flex;
}

.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    left: 25px;
    top: 24px;
    z-index: 2;
}

.timeline-date {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 140px;
    padding-left: 70px;
    padding-top: 1.2rem;
}

.timeline-content {
    flex-grow: 1;
    padding: 2rem;
}

.timeline-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.timeline-content .institution {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-emerald);
    margin-bottom: 1.2rem;
}

.timeline-content ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.timeline-content ul li {
    font-size: 0.92rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.2rem;
}

.timeline-content ul li::before {
    content: '▪';
    position: absolute;
    left: 0;
    color: var(--accent-emerald);
    font-size: 0.8rem;
    top: -1px;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3rem;
    align-items: stretch;
}

.contact-info {
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.contact-info h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-detail-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.contact-detail-item i {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.contact-detail-item div {
    display: flex;
    flex-direction: column;
}

.contact-detail-item span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.contact-detail-item strong {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.contact-form-container {
    padding: 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    font-family: var(--font-primary);
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.9rem 1.2rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    border-top: 1px solid var(--border-color);
    padding: 4rem 0;
    text-align: center;
    background: var(--bg-main);
}

footer p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Project Details Modal
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(7, 10, 15, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    width: 100%;
    max-width: 850px;
    border-radius: 16px;
    padding: 2.5rem 3rem;
    margin: auto;
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-card-hover);
    border: 1px solid var(--border-hover);
    animation: modalSlideUp 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes modalSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.38rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    line-height: 1.4;
    white-space: nowrap;
    min-height: 2rem;
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

.modal-github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-emerald);
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}

.modal-github-link:hover {
    background: rgba(16, 185, 129, 0.18);
    color: var(--accent-emerald);
    border-color: var(--accent-emerald);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

@media (max-width: 576px) {
    .close-modal,
    .modal-github-link {
        padding: 0.3rem 0.7rem;
        font-size: 0.75rem;
    }
}

/* Inside Modal Styling */
.modal-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0;
    letter-spacing: -0.02em;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#modal-header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.modal-tagline {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent-emerald);
    margin-bottom: 1.8rem;
}

.modal-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.2rem;
    background-color: var(--border-color);
    padding: 1.5rem;
    border-radius: 12px;
}

.modal-meta-item {
    display: flex;
    flex-direction: column;
}

.modal-meta-item span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.modal-meta-item strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.modal-section {
    margin-bottom: 2.2rem;
}

.modal-section h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-emerald);
    padding-left: 0.8rem;
}

.modal-section p {
    color: var(--text-secondary);
    font-size: 0.96rem;
    line-height: 1.65;
    margin-bottom: 1rem;
}

.modal-section ul.achievements-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.modal-section ul.achievements-list li {
    font-size: 0.94rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.modal-section ul.achievements-list li::before {
    content: '✔';
    position: absolute;
    left: 0;
    color: var(--accent-emerald);
}

/* Architecture Visualizer inside Modal */
.arch-diagram {
    width: 100%;
    margin-top: 1.5rem;
    padding: 2rem;
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
}

.arch-svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.arch-img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    object-fit: contain;
}

/* ==========================================================================
   Certifications
   ========================================================================== */
.certification-panel {
    padding: 2.25rem;
}

.certification-intro {
    padding-right: 2rem;
    border-right: 1px solid var(--border-color);
}

.certification-kicker {
    display: block;
    margin-bottom: .75rem;
    color: var(--accent-emerald);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.certification-intro h3 {
    margin-bottom: .75rem;
    font-size: 1.35rem;
}

.certification-intro p {
    color: var(--text-secondary);
    font-size: .92rem;
    line-height: 1.75;
}

.certifications-list {
    display: grid;
    gap: 0;
    width: 100%;
}

.cert-item {
    display: grid;
    gap: .45rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cert-item:first-child { padding-top: 0; }
.cert-item:last-child { padding-bottom: 0; border-bottom: 0; }

.cert-title-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.cert-icon-small {
    color: var(--accent-emerald);
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.cert-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cert-meta {
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding-left: 2.1rem; /* Aligns description text under the certification name, bypassing the icon width */
}

@media (max-width: 768px) {
    .certification-panel { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem; }
    .certification-intro { padding: 0 0 1.5rem; border-right: 0; border-bottom: 1px solid var(--border-color); }
}

/* ==========================================================================
   Scroll Reveal Animation Styles
   ========================================================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Responsive Design Media Queries
   ========================================================================== */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-content {
        align-items: center;
    }
    
    .hero-subtitle {
        height: auto;
    }
    
    .hero-description {
        margin: 0 auto 2.5rem;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .stat-item {
        border-right: none;
    }
    
    .stat-item:nth-child(2n) {
        border-left: 1px solid var(--border-color);
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    section {
        padding: 5rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .project-card {
        flex-direction: column;
    }
    
    .project-thumbnail {
        width: 100%;
        min-width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu {
        display: none; /* Mobile menu hidden by default */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-main);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: var(--shadow-md);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-link {
        padding: 1rem 2rem;
        width: 100%;
        display: block;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .timeline::after {
        left: 16px;
    }
    
    .timeline-dot {
        left: 9px;
    }
    
    .timeline-date {
        padding-left: 40px;
        min-width: auto;
        font-size: 0.9rem;
    }
    
    .timeline-item {
        flex-direction: column;
    }
    
    .timeline-content {
        margin-top: 0.5rem;
        margin-left: 24px;
        padding: 1.5rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stat-item:nth-child(2n) {
        border-left: none;
    }
    
    .stat-item {
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1.5rem;
    }
    
    .stat-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
    }
}

/* ==========================================================================
   PDF Download Button & Print Styles
   ========================================================================== */
.download-toggle-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 2px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 170px;
    height: 38px;
    overflow: hidden;
    user-select: none;
}

.toggle-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 48%;
    height: 100%;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 20px;
}

.toggle-divider {
    color: var(--border-color);
    font-size: 0.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    user-select: none;
}

/* 1. 이력서 버튼 호버 시 */
.download-toggle-container:has(#resume-download:hover) {
    border-color: #3B82F6;
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.download-toggle-container:has(#resume-download:hover) #resume-download {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    color: #3B82F6;
    z-index: 3;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.download-toggle-container:has(#resume-download:hover) #portfolio-download,
.download-toggle-container:has(#resume-download:hover) .toggle-divider {
    opacity: 0;
    pointer-events: none;
}

/* 2. 포트폴리오 버튼 호버 시 */
.download-toggle-container:has(#portfolio-download:hover) {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.download-toggle-container:has(#portfolio-download:hover) #portfolio-download {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    color: #10B981;
    z-index: 3;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.download-toggle-container:has(#portfolio-download:hover) #resume-download,
.download-toggle-container:has(#portfolio-download:hover) .toggle-divider {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 576px) {
    .download-toggle-container {
        width: 150px;
        height: 34px;
    }
    .toggle-btn {
        font-size: 0.8rem;
    }
}

/* Screen styling for print resume (hidden off-screen but rendered for html2pdf.js) */
#print-resume {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 210mm; /* A4 width */
    min-height: 297mm; /* A4 height */
    padding: 20mm;
    background: #ffffff !important;
    color: #0F172A !important;
    font-family: var(--font-primary);
    box-sizing: border-box;
    z-index: -1000;
    box-shadow: none;
}

/* Document Resume Styling */
#print-resume .print-header {
    border-bottom: 2px solid #0F172A;
    padding-bottom: 1.2rem;
    margin-bottom: 1.8rem;
}

#print-resume .print-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0F172A !important;
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.02em;
}

#print-resume .print-subtitle {
    font-size: 1.15rem;
    font-weight: 600;
    color: #059669 !important; /* Emerald Green */
    margin: 0 0 0.8rem 0;
}

#print-resume .print-contacts {
    display: flex;
    gap: 1.5rem;
    font-size: 0.88rem;
    color: #475569 !important;
}

#print-resume .print-section {
    margin-bottom: 1.8rem;
}

#print-resume .print-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0F172A !important;
    border-bottom: 1px solid #CBD5E1;
    padding-bottom: 0.4rem;
    margin: 0 0 0.8rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#print-resume .print-section-content {
    padding-left: 0.2rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #334155 !important;
}

#print-resume .print-skills-group {
    margin-bottom: 0.5rem;
    color: #334155 !important;
}

#print-resume .print-skills-group strong {
    color: #0F172A !important;
    font-weight: 700;
}

#print-resume .print-project-item {
    margin-bottom: 1.5rem;
}

#print-resume .print-project-item:last-child {
    margin-bottom: 0;
}

#print-resume .print-project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.2rem;
}

#print-resume .print-project-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0F172A !important;
    margin: 0;
}

#print-resume .print-project-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563EB !important;
    background: #EFF6FF !important;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

#print-resume .print-project-period {
    font-size: 0.82rem;
    color: #64748B !important;
    font-weight: 500;
}

#print-resume .print-project-tagline {
    font-size: 0.88rem;
    font-weight: 600;
    color: #059669 !important;
    margin: 0 0 0.4rem 0;
}

#print-resume .print-project-desc {
    font-size: 0.88rem;
    color: #475569 !important;
    margin: 0 0 0.5rem 0;
}

#print-resume .print-project-bullets {
    list-style-type: disc;
    padding-left: 1.1rem;
    margin: 0;
}

#print-resume .print-project-bullets li {
    font-size: 0.88rem;
    margin-bottom: 0.3rem;
    color: #334155 !important;
}

#print-resume .print-project-bullets li strong {
    color: #0F172A !important;
}

#print-resume .print-cert-item {
    font-size: 0.92rem;
    color: #334155 !important;
}

#print-resume .print-cert-item strong {
    color: #0F172A !important;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }

    html, body {
        height: auto !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        background: #FFFFFF !important;
    }

    body > *:not(#print-resume) {
        display: none !important;
    }

    #print-resume {
        display: block !important;
        position: static !important;
        width: auto !important;
        min-height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 1 !important;
    }
}

/* ==========================================================================
   2026 Portfolio Redesign — Left rail, restrained surfaces, clear hierarchy
   ========================================================================== */
:root {
    --sidebar-width: 280px;
    --content-width: 1120px;
}

.dark-theme {
    --bg-main: #171717;
    --bg-header: #1f1f1f;
    --bg-card: #242424;
    --bg-card-hover: #2c2c2c;
    --border-color: rgba(255, 255, 255, .10);
    --border-hover: rgba(255, 255, 255, .24);
    --text-primary: #f2f2f2;
    --text-secondary: #b4b4b4;
    --text-muted: #808080;
    --accent-emerald: #f2f2f2;
    --accent-blue: #d8d8d8;
    --accent-gradient: linear-gradient(135deg, #f2f2f2, #b8b8b8);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .16);
    --shadow-md: 0 14px 36px rgba(0, 0, 0, .2), 0 1px 2px rgba(0, 0, 0, .2);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .26);
    --btn-secondary-bg: transparent;
}

.light-theme {
    --bg-main: #f7f7f8;
    --bg-header: #f0f0f1;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --border-color: rgba(0, 0, 0, .09);
    --border-hover: rgba(0, 0, 0, .30);
    --text-primary: #202123;
    --text-secondary: #565869;
    --text-muted: #8e8e95;
    --accent-emerald: #202123;
    --accent-blue: #565869;
    --accent-gradient: linear-gradient(135deg, #202123, #565869);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-md: 0 14px 36px rgba(0, 0, 0, .07), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .10);
}

html { scroll-padding-top: 2rem; }
body { padding-left: var(--sidebar-width); letter-spacing: -0.008em; }

.container { max-width: var(--content-width); padding-inline: 3.5rem; }
section { padding: 6.5rem 0; }
section + section { border-top: 1px solid var(--border-color); }

header {
    width: var(--sidebar-width);
    height: 100vh;
    border-right: 1px solid var(--border-color);
    border-bottom: 0;
    background: var(--bg-header);
    backdrop-filter: none;
}

.header-container {
    height: 100%;
    padding: 28px 20px 22px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.logo { padding: 0 10px 25px; font-family: 'Outfit', sans-serif; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.tech-accent { color: var(--accent-emerald); }

.sidebar-profile {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    margin: 14px 0 0;
    padding: 18px 10px 0;
    border-top: 1px solid var(--border-color);
}
.sidebar-profile img { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.sidebar-profile div { min-width: 0; display: flex; flex-direction: column; }
.sidebar-profile strong { font-size: 13px; line-height: 1.3; font-weight: 700; }
.sidebar-profile span { color: var(--text-secondary); font-size: 11px; line-height: 1.45; font-weight: 400; }

.nav-menu { display: flex; flex-direction: column; gap: .25rem; }
.nav-group-label {
    display: block;
    padding: 14px 10px 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}
.nav-group-label:first-child { padding: 0 10px 8px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px;
    border-radius: 9px;
    font-size: 14px;
    color: var(--text-secondary);
}
.nav-link i { width: 17px; text-align: center; font-size: 13px; }
.nav-link::after { display: none; }
.nav-link:hover { color: var(--text-primary); background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.nav-link.active { color: var(--accent-emerald); background: color-mix(in srgb, var(--accent-emerald) 10%, transparent); }

.header-actions { margin-top: auto; gap: .6rem; flex-wrap: wrap; }
.download-toggle-container { order: 2; width: 100%; height: 40px; border-radius: 8px; backdrop-filter: none; }
#theme-toggle { order: 1; width: 40px; height: 40px; border-radius: 8px; }

#scroll-indicator { left: var(--sidebar-width); height: 2px; background: var(--accent-emerald); }

.hero-section { min-height: 100vh; padding-top: 4rem; }
.hero-bg-gradients { opacity: .32; }
.hero-bg-gradients .gradient-1 { left: 30%; top: -260px; background: radial-gradient(circle, rgba(128,128,128,.12), transparent 68%); }
.hero-bg-gradients .gradient-2 { display: none; }
.hero-container { grid-template-columns: minmax(0, 1.45fr) minmax(220px, .55fr); gap: 5rem; }
.hero-content .badge {
    margin-bottom: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: .78rem;
    letter-spacing: .12em;
}
.hero-content h1 { max-width: 720px; font-size: clamp(2.55rem, 4.4vw, 4.5rem); line-height: 1.11; margin-bottom: 1.5rem; }
.text-gradient { background: none; -webkit-text-fill-color: var(--accent-emerald); color: var(--accent-emerald); }
.hero-subtitle { font-size: 1.05rem; margin-bottom: 1rem; }
.hero-description { max-width: 680px; font-size: 1rem; line-height: 1.85; }
.hero-cta { gap: .65rem; margin-bottom: 2rem; }
.btn { min-height: 44px; padding: .72rem 1.15rem; border-radius: 7px; font-size: .9rem; }
.hero-cta .btn-secondary:nth-child(1), .hero-cta .btn-secondary:nth-child(2) { display: none; }
.hero-socials { gap: 1.2rem; font-size: .9rem; }
.hero-image-wrapper { max-width: 270px; aspect-ratio: 4 / 5; }
.image-border-glow { display: none; }
.hero-image-container { border-radius: 14px; border-width: 1px; box-shadow: var(--shadow-lg); }

.section-title { margin-bottom: 3rem; text-align: left; font-size: clamp(2rem, 3vw, 3rem); }
.section-title::after { width: 28px; height: 2px; margin: .9rem 0 0; background: var(--accent-emerald); }
.glass { border-radius: 10px; backdrop-filter: none; box-shadow: var(--shadow-sm); }
.glass:hover { transform: none; box-shadow: var(--shadow-md); }

.about-grid { gap: 1rem; margin-bottom: 1rem; }
.about-card { padding: 2rem; }
.card-icon { width: 38px; height: 38px; border-radius: 8px; font-size: 1rem; margin-bottom: 1.25rem; }
.about-card p { line-height: 1.8; }
.stats-container { padding: 1.75rem 2rem; }
.stat-number { background: none; -webkit-text-fill-color: var(--text-primary); font-size: 2rem; font-variant-numeric: tabular-nums; }

.skills-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.skills-category { padding: 1.75rem; }
.skills-category h3 { margin-bottom: 1.4rem; font-size: 1.1rem; }
.badge-item { border-radius: 6px; background: transparent; }

.project-filters { justify-content: flex-start; margin-bottom: 1.5rem; }
.filter-btn { border-radius: 6px; }
.projects-grid { gap: 1rem; }
.project-card { border-radius: 10px; overflow: hidden; }
.project-thumbnail { min-width: 300px; }
.project-info { padding: 2rem; }
.project-tech-stack span { border-radius: 5px; }

.contact-grid { gap: 1rem; }
.contact-info, .contact-form-container { padding: 2rem; }
input, textarea { border-radius: 6px; }
footer { border-top: 1px solid var(--border-color); }

.scroll-reveal { transform: translateY(18px); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 1080px) {
    :root { --sidebar-width: 280px; }
    .container { padding-inline: 2.25rem; }
    .hero-container { gap: 2.5rem; }
    .hero-content h1 { font-size: clamp(2.4rem, 5vw, 3.5rem); }
}

@media (max-width: 820px) {
    body { padding-left: 0; padding-top: 68px; }
    html { scroll-padding-top: 84px; }
    header { width: 100%; height: 68px; border-right: 0; border-bottom: 1px solid var(--border-color); }
    .header-container { padding: 0 1.25rem; flex-direction: row; align-items: center; justify-content: space-between; }
    .logo { position: static; padding: 0; transform: none; white-space: nowrap; }
    .sidebar-profile { display: none; }
    .header-actions { margin-top: 0; margin-left: auto; flex-wrap: nowrap; }
    .download-toggle-container { display: none; }
    .mobile-menu-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border-color); border-radius: 8px; background: transparent; color: var(--text-primary); }
    .nav-menu {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        width: 100%;
        padding: .75rem;
        gap: .25rem;
        background: var(--bg-header);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        flex-direction: column;
    }
    .nav-menu.active { display: flex; }
    .nav-group-label { padding: .6rem .75rem .15rem; }
    .nav-link { display: flex; width: 100%; padding: .75rem; }
    #scroll-indicator { left: 0; }
    section { padding: 5rem 0; }
    .container { padding-inline: 1.5rem; }
    .hero-section { padding-top: 3rem; }
    .hero-container { grid-template-columns: 1fr; text-align: left; }
    .hero-content { align-items: flex-start; }
    .hero-description { margin: 0 0 2rem; }
    .hero-image-wrapper { max-width: none; width: 100%; height: 320px; aspect-ratio: auto; }
    .hero-socials { justify-content: flex-start; }
    .skills-grid { grid-template-columns: 1fr; }
}

/* Context rail and collapsible workspace sidebar */
.sidebar-collapse-control,.sidebar-reopen-control{display:grid;place-items:center;width:28px;height:28px;border:0;border-radius:7px;background:transparent;color:var(--text-secondary);cursor:pointer}
.sidebar-collapse-control{position:absolute;top:14px;right:12px;z-index:45}.sidebar-collapse-control:hover,.sidebar-collapse-control:focus-visible,.sidebar-reopen-control:hover,.sidebar-reopen-control:focus-visible{background:color-mix(in srgb,var(--text-primary) 7%,transparent);color:var(--text-primary);outline:none}
.sidebar-reopen-control{position:fixed;top:11px;left:10px;z-index:70;border:1px solid var(--border-color);background:var(--bg-header);opacity:0;pointer-events:none}
.context-rail{position:fixed;top:50%;right:12px;z-index:35;width:18px;transform:translateY(-50%)}.context-rail-ticks{display:grid;gap:12px;padding:8px 4px}.context-rail-ticks span{display:block;width:10px;height:2px;margin-left:auto;border-radius:2px;background:var(--text-muted);opacity:.42;transition:width .14s ease,opacity .14s ease,background-color .14s ease}.context-rail:hover .context-rail-ticks span,.context-rail:focus-within .context-rail-ticks span{width:15px;opacity:.75}
.context-rail-popover{position:absolute;top:50%;right:27px;width:270px;max-height:min(70vh,560px);padding:16px;border:1px solid var(--border-color);border-radius:14px;background:color-mix(in srgb,var(--bg-card) 96%,transparent);box-shadow:0 16px 44px rgba(0,0,0,.13);opacity:0;overflow:auto;pointer-events:none;transform:translate(8px,-50%);transition:opacity .15s ease,transform .15s ease;backdrop-filter:blur(16px)}.context-rail:hover .context-rail-popover,.context-rail:focus-within .context-rail-popover{opacity:1;pointer-events:auto;transform:translate(0,-50%)}.context-rail-popover>strong{display:block;margin:0 8px 4px;font-size:13px}.context-rail-popover>p{margin:0 8px 12px;color:var(--text-muted);font-size:10px;line-height:1.5}
.portfolio-context-rail{opacity:0;pointer-events:none;transition:opacity .15s ease}.portfolio-section-active .portfolio-context-rail,.project-chat-open .portfolio-context-rail{opacity:1;pointer-events:auto}.context-rail .sidebar-project-nav{display:grid;gap:2px;margin:0;padding:0;border:0}.context-rail .sidebar-project-item{min-height:36px;padding:7px 9px;font-size:12px}.context-rail .sidebar-project-item i{display:none}
@media(min-width:821px){body.sidebar-collapsed{padding-left:0}body.sidebar-collapsed header{transform:translateX(-100%)}body.sidebar-collapsed .workspace-topbar{left:0}body.sidebar-collapsed .sidebar-reopen-control{opacity:1;pointer-events:auto}body.sidebar-collapsed #scroll-indicator{left:0}header{transition:transform .2s ease}.workspace-topbar{transition:left .2s ease}}
@media(min-width:821px){body.sidebar-collapsed .workspace-topbar{padding-left:48px}}
.sidebar-collapse-control[hidden],.sidebar-reopen-control[hidden]{display:none!important}
@media(max-width:820px){.context-rail,.sidebar-collapse-control,.sidebar-reopen-control{display:none}}
@media(prefers-reduced-motion:reduce){.context-rail-popover,.portfolio-context-rail,header,.workspace-topbar{transition:none}}
.context-rail-popover{right:18px;padding:12px;border-radius:12px;font-weight:400}.context-rail-popover>strong{font-weight:500}.context-rail .sidebar-project-item{font-weight:400}.context-rail .sidebar-project-item.active{font-weight:500}


/* Certification list rhythm */
.certification-panel .cert-item,
.certification-panel .cert-item:first-child,
.certification-panel .cert-item:last-child {
    min-height: 0;
    gap: 11px;
    padding: 24px 8px;
}
.certification-panel .cert-item:last-child { border-bottom: 0; }
.certification-panel .cert-title-group { gap: 12px; }
.certification-panel .cert-meta { padding-left: 36px; line-height: 1.65; }

@media (max-width: 560px) {
    .certification-panel .cert-item,
    .certification-panel .cert-item:first-child,
    .certification-panel .cert-item:last-child { padding: 20px 4px; }
}

@media (max-width: 380px) {
    .logo { font-size: 14px; }
}

@media (max-width: 560px) {
    .container { padding-inline: 1.1rem; }
    .hero-content h1 { font-size: 2.35rem; }
    .hero-subtitle { min-height: 3.2rem; }
    .hero-cta { width: 100%; }
    .hero-cta .btn { flex: 1; }
    .hero-image-wrapper { height: 260px; }
    .about-grid { grid-template-columns: 1fr; }
    .about-card, .skills-category, .project-info, .contact-info, .contact-form-container { padding: 1.35rem; }
    .skill-badges-container { grid-template-columns: 1fr 1fr; }
    .stats-container { padding: 1.4rem; }
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
    box-shadow: var(--shadow-md);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

#back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

#back-to-top:active {
    transform: translateY(-1px) scale(0.95);
}

@media (max-width: 768px) {
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }
}

@media print {
    #back-to-top {
        display: none !important;
    }
}

/* GPT-inspired portfolio refinement */
.light-theme {
    --bg-main: #f7f7f8;
    --bg-header: #f0f0f1;
    --bg-card: #ffffff;
    --bg-card-hover: #fbfcfd;
    --border-color: #dedee2;
    --border-hover: rgba(0, 0, 0, .30);
    --text-primary: #202123;
    --text-secondary: #565869;
    --text-muted: #8e8e95;
    --accent-emerald: #202123;
    --accent-blue: #565869;
    --accent-gradient: linear-gradient(135deg, #202123, #565869);
    --shadow-sm: 0 1px 2px rgba(31, 38, 51, .035);
    --shadow-md: 0 12px 32px rgba(31, 38, 51, .07), 0 1px 2px rgba(31, 38, 51, .04);
    color-scheme: light;
}

.light-theme header { background: var(--bg-header); }
.light-theme .header-container { padding: 28px 20px 22px; }
.light-theme .logo { font-weight: 600; }
.light-theme .sidebar-profile { margin-top: 14px; }
.light-theme .nav-link { border-radius: 9px; font-weight: 400; }
.light-theme .nav-link.active { color: var(--text-primary); background: #e6e8ed; }
.light-theme #theme-toggle,
.light-theme .download-toggle-container { background: rgba(255,255,255,.48); }

.light-theme .hero-section { min-height: 92vh; }
.light-theme .hero-bg-gradients { display: none; }
.light-theme .hero-content .badge { color: var(--text-muted); }
.light-theme .hero-content h1 { color: var(--text-primary); font-weight: 700; }
.light-theme .text-gradient { -webkit-text-fill-color: var(--text-primary); color: var(--text-primary); }
.light-theme .hero-image-container { border-radius: 18px; box-shadow: 0 22px 60px rgba(31,38,51,.10); }
.light-theme .section-title { font-weight: 700; }
.light-theme .section-title::after { display: none; }
.light-theme .glass { border-color: var(--border-color); box-shadow: var(--shadow-sm); }
.light-theme .glass:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.light-theme .card-icon { background: #ececee; border-color: #dedee2; }
.light-theme .skills-category h3 i { color: var(--text-muted); }
.light-theme .badge-item:hover { transform: none; background: #f7f8fa; border-color: #d6dae1; }
.light-theme .filter-btn { border: 0; background: transparent; }
.light-theme .filter-btn.active { background: #e6e8ed; color: var(--text-primary); box-shadow: none; }
.light-theme .project-card { position: relative; min-height: 300px; }
.light-theme .project-thumbnail { width: 38%; min-width: 340px; background: #edf0f3; }
.light-theme .project-info { padding: 2.5rem; }
.light-theme .project-info h3 { font-size: 1.65rem; }
.light-theme .project-tagline { color: var(--text-secondary); }
.light-theme .project-tech-stack span { background: #f1f3f5; border: 1px solid #e6e8ec; }
.light-theme .project-card:hover .project-tech-stack span { background: #f1f3f5; color: var(--text-secondary); }
.light-theme .btn-detail { color: var(--text-primary); text-decoration: none; }
.light-theme .btn-detail::after { content: ''; position: absolute; inset: 0; }
.light-theme .certification-kicker { color: var(--text-muted); }
.light-theme .cert-icon-small { color: var(--text-secondary); }
.light-theme footer { background: var(--bg-main); }

@media (max-width: 820px) {
    .light-theme .header-container { padding: 0 1.25rem; }
    .light-theme .project-thumbnail { width: 100%; min-width: 100%; }
    .light-theme .project-info { padding: 1.5rem; }
}

/* GPT-like type scale and dark palette */
.hero-content h1,
.light-theme .hero-content h1 {
    max-width: 680px;
    font-size: clamp(2.25rem, 3.4vw, 3.45rem);
    line-height: 1.16;
    letter-spacing: -.04em;
}
.hero-description { max-width: 650px; }

.dark-theme {
    --bg-main: #171717;
    --bg-header: #1f1f1f;
    --bg-card: #242424;
    --bg-card-hover: #2c2c2c;
    --border-color: #383838;
    --border-hover: #555555;
    --text-primary: #f2f2f2;
    --text-secondary: #b4b4b4;
    --text-muted: #808080;
    --accent-emerald: #f2f2f2;
    --accent-blue: #d8d8d8;
    --accent-gradient: linear-gradient(135deg, #f2f2f2, #b8b8b8);
    --btn-secondary-bg: transparent;
    --btn-secondary-bg-hover: #2c2c2c;
    --btn-secondary-border: #444444;
    --btn-secondary-border-hover: #666666;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.16);
    --shadow-md: 0 12px 32px rgba(0,0,0,.18);
    color-scheme: dark;
}
.dark-theme header { background: var(--bg-header); }
.dark-theme .nav-link.active { background: #303030; color: #f2f2f2; }
.dark-theme .sidebar-profile,
.dark-theme section + section,
.dark-theme footer { border-color: var(--border-color); }
.dark-theme .hero-bg-gradients { display: none; }
.dark-theme .text-gradient { background: none; -webkit-text-fill-color: var(--text-primary); color: var(--text-primary); }
.dark-theme .glass { background: var(--bg-card); border-color: var(--border-color); box-shadow: var(--shadow-sm); }
.dark-theme .glass:hover { background: var(--bg-card-hover); border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.dark-theme .badge-item,
.dark-theme .project-tech-stack span { background: #2c2c2c; border-color: #404040; }
.dark-theme .filter-btn.active { background: #303030; color: var(--text-primary); box-shadow: none; }
.dark-theme .project-thumbnail { background: #111111; }
.dark-theme .card-icon { background: #2c2c2c; border-color: #444444; }
.dark-theme .certification-kicker,
.dark-theme .project-tagline { color: var(--accent-emerald); }

@media (max-width: 560px) {
    .hero-content h1, .light-theme .hero-content h1 { font-size: 2.05rem; }
}

/* Career */
.section-draft {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.section-draft > span {
    display: block;
    margin-bottom: .65rem;
    color: var(--accent-primary);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.section-draft h3 { margin: 0 0 .45rem; font-size: 1.2rem; }
.section-draft p { margin: 0; color: var(--text-secondary); font-size: .9rem; }
.career-draft { margin-top: .5rem; }
.portfolio-draft { margin-top: 2.5rem; }
.career-layout {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
    gap: 4rem;
    align-items: start;
}
.career-intro { position: sticky; top: 4rem; }
.career-status {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 1.25rem;
    color: var(--accent-emerald);
    font-size: .8rem;
    font-weight: 600;
}
.career-status i { font-size: .48rem; }
.career-intro h3 {
    margin-bottom: 1rem;
    font-size: clamp(1.65rem, 2.4vw, 2.25rem);
    line-height: 1.35;
    letter-spacing: -.035em;
}
.career-intro p { color: var(--text-secondary); line-height: 1.8; }
.career-timeline { border-top: 1px solid var(--border-color); }
.career-item {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 1.5rem;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border-color);
}
.career-period { color: var(--text-muted); font-size: .78rem; font-weight: 600; }
.career-item h3 { margin: 0 0 .45rem; font-size: 1.05rem; }
.career-item p { margin: 0; color: var(--text-secondary); font-size: .9rem; line-height: 1.7; }

@media (max-width: 820px) {
    .career-layout { grid-template-columns: 1fr; gap: 2.5rem; }
    .career-intro { position: static; }
}

@media (max-width: 560px) {
    .career-item { grid-template-columns: 1fr; gap: .5rem; }
}

/* Stable section headings and theme-correct contact icons */
.section-title::after { display: none !important; }
.light-theme .contact-detail-item i {
    background: #ececee;
    border-color: #dedee2;
    color: #202123;
}
.dark-theme .contact-detail-item i {
    background: #2c2c2c;
    border-color: #444444;
    color: var(--accent-emerald);
}

/* High-contrast portfolio thumbnail labels */
.project-tag {
    z-index: 2;
    padding: .45rem .85rem;
    border-radius: 7px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 3px 10px rgba(20, 16, 34, .22);
    font-size: .76rem;
    line-height: 1.2;
}
.light-theme .project-tag.tag-team,
.light-theme .project-tag.tag-personal {
    background: #202123;
    color: #ffffff;
    border: 1px solid #202123;
}
.dark-theme .project-tag.tag-team,
.dark-theme .project-tag.tag-personal {
    background: #f2f2f2;
    color: #202123;
    border: 1px solid #f2f2f2;
}

/* Same-origin page transitions: portfolio ↔ blog */
@view-transition {
    navigation: auto;
}

@media (prefers-reduced-motion: no-preference) {
    ::view-transition-old(root) {
        animation: 140ms cubic-bezier(.4, 0, 1, 1) both page-transition-out;
    }

    ::view-transition-new(root) {
        animation: 220ms cubic-bezier(0, 0, .2, 1) both page-transition-in;
    }
}

@keyframes page-transition-out {
    to { opacity: 0; transform: translateY(-3px); }
}

@keyframes page-transition-in {
    from { opacity: 0; transform: translateY(5px); }
}

/* ==========================================================================
   GPT workspace layout — reversible rebuild on codex/gpt-layout-redesign
   ========================================================================== */
:root {
    --sidebar-width: var(--app-sidebar-width, 244px);
    --workspace-bar-height: 58px;
    --reading-width: 900px;
}

html { scroll-padding-top: calc(var(--workspace-bar-height) + 24px); }
body { padding-left: var(--sidebar-width); }
header { width: var(--sidebar-width); }
.sidebar-resizer { position: absolute; inset: 0 0 0 auto; z-index: 40; width: 7px; cursor: col-resize; touch-action: none; outline: none; }
.sidebar-resizer::after { content: ''; position: absolute; inset: 0 auto 0 3px; width: 1px; background: transparent; transition: background-color .15s ease; }
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, .sidebar-resizing .sidebar-resizer::after { background: var(--text-secondary); }
.sidebar-resizing { cursor: col-resize; user-select: none; }
.header-container { padding: 16px 12px 14px; }
.logo { padding: 5px 8px 18px; font-size: 16px; }
.nav-menu { flex: 1; min-height: 0; gap: 2px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-muted) 35%, transparent) transparent; }
.nav-menu { scrollbar-width: none; }
.nav-menu::-webkit-scrollbar { display: none; }
.nav-group-label { padding: 14px 9px 4px; font-size: 11px; }
.nav-group-label:first-child { padding: 0 9px 5px; }
.nav-link { min-height: 35px; gap: 10px; padding: 6px 9px; border-radius: 8px; font-size: 13px; }
.nav-link i { width: 15px; font-size: 12px; }
.nav-link.active { background: color-mix(in srgb, var(--text-primary) 7%, transparent); color: var(--text-primary); }
.header-actions { display: grid; grid-template-columns: 36px 1fr; margin-top: 10px; }
#theme-toggle { grid-column: 1; }
#theme-toggle { width: 36px; height: 36px; border-radius: 8px; }
.sidebar-profile { min-height: 46px; margin-top: 10px; padding: 13px 8px 0; }
.sidebar-profile img { flex-basis: 30px; width: 30px; height: 30px; }
.sidebar-profile strong { font-size: 12px; }
.sidebar-profile span { font-size: 10px; }

.workspace-topbar {
    position: fixed;
    inset: 0 0 auto var(--sidebar-width);
    z-index: 30;
    height: var(--workspace-bar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--bg-main) 88%, transparent);
    color: var(--text-secondary);
    font-size: 13px;
    backdrop-filter: blur(16px);
}
.workspace-topbar span { display: inline-flex; align-items: center; gap: 8px; }
.workspace-context { color: var(--text-muted); font-size: 12px; }

.container { width: min(100%, var(--reading-width)); max-width: var(--reading-width); padding-inline: 40px; }
section { padding: 88px 0; scroll-margin-top: calc(var(--workspace-bar-height) + 24px); }
section + section { border-top: 1px solid var(--border-color); }

.hero-section {
    min-height: min(780px, 100vh);
    padding: calc(var(--workspace-bar-height) + 90px) 0 80px;
    display: flex;
    align-items: center;
}
.hero-container { display: block; }
.hero-content { max-width: 760px; }
.hero-image-wrapper, .hero-bg-gradients { display: none; }
.hero-content .badge {
    display: inline-flex;
    margin: 0 0 26px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.hero-content h1,
.light-theme .hero-content h1 {
    max-width: 750px;
    margin-bottom: 24px;
    font-size: clamp(2.45rem, 4.1vw, 4.25rem);
    line-height: 1.12;
    letter-spacing: -.045em;
    text-wrap: balance;
}
.hero-subtitle { margin-bottom: 12px; font-size: 17px; font-weight: 600; }
.hero-description { max-width: 700px; font-size: 15px; line-height: 1.85; }
.hero-cta {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    width: min(100%, 700px);
    min-height: 62px;
    margin: 34px 0 20px;
    padding: 9px 9px 9px 168px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-card);
    box-shadow: 0 10px 30px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}
.hero-cta::before {
    content: '빠르게 살펴보기';
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 13px;
}
.hero-cta .btn { min-height: 42px; margin-left: auto; padding: 0 14px; border: 0; border-radius: 9px; box-shadow: none; }
.hero-cta .btn + .btn { margin-left: 0; }
.hero-cta .btn:hover { background: color-mix(in srgb, var(--text-primary) 7%, transparent); transform: none; }
.hero-cta .btn-primary { background: var(--text-primary); color: var(--bg-main); }
.hero-socials { gap: 18px; padding-left: 4px; color: var(--text-muted); font-size: 13px; }

.section-title {
    margin: 0 0 36px;
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    line-height: 1.2;
    letter-spacing: -.035em;
}
.about-grid { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; border-top: 1px solid var(--border-color); }
.about-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 18px;
    padding: 26px 0;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.about-card .card-icon { grid-row: 1 / span 2; margin: 0; }
.about-card h3 { margin: 1px 0 8px; font-size: 17px; }
.about-card p { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.85; }
.glass:hover { transform: none; }
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 28px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: none;
}
.stat-item { padding: 22px 24px; text-align: left; }
.stat-item + .stat-item { border-left: 1px solid var(--border-color); }
.stat-number { font-size: 26px; }
.stat-label { margin-top: 4px; font-size: 11px; }

.skills-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: auto; align-items: start; gap: 0 32px; }
.skills-category {
    min-height: 0;
    height: auto;
    align-self: start;
    padding: 24px 0;
    border: 0;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.skills-category h3 { margin-bottom: 16px; font-size: 14px; }
.skill-badges-container { align-content: start; gap: 7px; }
.badge-item {
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
}
.badge-item img { width: 20px; height: 20px; filter: grayscale(1); }
.badge-title { font-size: 12px; }

.certification-panel { padding: 0; border: 0; border-top: 1px solid var(--border-color); border-radius: 0; background: transparent; box-shadow: none; }
.cert-item { min-height: 62px; padding: 18px 4px; border-bottom: 1px solid var(--border-color); }
.career-layout { grid-template-columns: minmax(240px, .85fr) minmax(0, 1.15fr); gap: 56px; }
.career-intro { top: calc(var(--workspace-bar-height) + 28px); }
.career-status { color: var(--text-secondary); }

.project-filters {
    width: fit-content;
    margin: 0 0 24px;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
}
.filter-btn { min-height: 34px; padding: 6px 12px; border-radius: 7px; font-size: 12px; }
.projects-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.project-card {
    min-height: 230px;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    border-radius: 14px;
    box-shadow: none;
}
.project-thumbnail, .light-theme .project-thumbnail { width: 100%; min-width: 0; height: 100%; }
.project-info, .light-theme .project-info { padding: 28px 30px; }
.project-info h3, .light-theme .project-info h3 { font-size: 22px; }
.project-description { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.project-tech-stack { gap: 5px; }
.project-tech-stack span { padding: 4px 7px; font-size: 10px; }

.contact-grid { grid-template-columns: minmax(0, .85fr) minmax(360px, 1.15fr); gap: 48px; }
.contact-info, .contact-form-container { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.contact-details { margin-top: 28px; border-top: 1px solid var(--border-color); }
.contact-detail-item { padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.contact-detail-item i { border: 0; background: transparent !important; }
.contact-form-container form {
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 10px 30px rgba(0,0,0,.05);
}
.form-group input, .form-group textarea { border-radius: 8px; background: var(--bg-main); }
.btn-block { min-height: 44px; border-radius: 9px; }
footer { padding: 28px 0 38px; border-top: 1px solid var(--border-color); }

@media (max-width: 980px) {
    :root { --sidebar-width: var(--app-sidebar-width, 244px); }
    .container { padding-inline: 32px; }
    .project-card { grid-template-columns: 230px minmax(0, 1fr); }
    .contact-grid { gap: 34px; }
}

@media (max-width: 820px) {
    :root { --sidebar-width: 0px; --workspace-bar-height: 54px; }
    .sidebar-resizer { display: none; }
    body { padding-left: 0; padding-top: 68px; }
    header { width: 100%; height: 68px; }
    .workspace-topbar { top: 68px; left: 0; padding-inline: 18px; }
    html { scroll-padding-top: calc(68px + var(--workspace-bar-height) + 18px); }
    section { scroll-margin-top: calc(68px + var(--workspace-bar-height) + 18px); }
    .workspace-context { display: none !important; }
    .hero-section { min-height: auto; padding-top: calc(var(--workspace-bar-height) + 72px); }
    .skills-grid { grid-template-columns: 1fr; }
    .project-card { grid-template-columns: 1fr; }
    .project-thumbnail, .light-theme .project-thumbnail { height: 220px; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .container { padding-inline: 20px; }
    section { padding: 68px 0; }
    .hero-content h1, .light-theme .hero-content h1 { font-size: 2.25rem; }
    .hero-cta { flex-wrap: wrap; padding: 46px 8px 8px; }
    .hero-cta::before { top: 16px; }
    .hero-cta .btn { flex: 1; margin-left: 0; padding-inline: 10px; }
    .stats-container { grid-template-columns: 1fr; }
    .stat-item + .stat-item { border-left: 0; border-top: 1px solid var(--border-color); }
    .career-layout { grid-template-columns: 1fr; gap: 36px; }
    .project-info, .light-theme .project-info { padding: 24px 22px; }
}

@media print { .workspace-topbar { display: none !important; } }

/* Project conversations */
.sidebar-project-nav { display: grid; gap: 1px; margin: 2px 0 3px 17px; padding-left: 8px; border-left: 1px solid var(--border-color); }
.sidebar-project-nav[hidden] { display: none; }
.portfolio-nav-toggle .portfolio-toggle-icon {
    width: auto;
    margin-left: auto;
    font-size: 9px;
    transition: transform .16s ease;
}
.portfolio-nav-toggle[aria-expanded="true"] .portfolio-toggle-icon { transform: rotate(90deg); }
.sidebar-project-item {
    width: 100%;
    min-height: 31px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
}
.sidebar-project-item i { width: 14px; color: var(--text-muted); font-size: 11px; text-align: center; }
.sidebar-project-item:hover { background: color-mix(in srgb, var(--text-primary) 5%, transparent); color: var(--text-primary); }
.sidebar-project-item.active { background: color-mix(in srgb, var(--text-primary) 8%, transparent); color: var(--text-primary); font-weight: 600; }
.sidebar-project-item:focus-visible { outline: 2px solid var(--text-primary); outline-offset: -2px; }

body.project-chat-open { overflow: hidden; }
body.project-chat-open #scroll-indicator { display: none; }
body.project-chat-open > section:not(#project-chat),
body.project-chat-open > footer,
body.project-chat-open > #back-to-top { display: none !important; }
.project-chat-section {
    height: 100vh;
    padding: var(--workspace-bar-height) 0 0;
    border: 0;
    overflow: hidden;
    background: var(--bg-main);
}
.project-chat-section[hidden] { display: none !important; }
.project-chat-shell { position: relative; height: 100%; display: grid; grid-template-rows: 58px minmax(0, 1fr) auto; }
.project-chat-header {
    position: static;
    width: auto;
    height: 58px;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
    align-items: center;
    gap: 18px;
    padding: 0 24px;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-main);
}
.project-chat-back, .project-chat-external {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.project-chat-back:hover, .project-chat-external:hover { background: color-mix(in srgb, var(--text-primary) 6%, transparent); color: var(--text-primary); }
.project-chat-title { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.project-chat-title strong { font-size: 14px; }
.project-chat-title span { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.project-chat-external { justify-self: end; }

.project-chat-thread {
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 42px max(32px, calc((100% - 850px) / 2)) 150px;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--text-muted) 45%, transparent) transparent;
}
.chat-turn {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 14px;
    max-width: 850px;
    margin: 0 auto 34px;
}
.chat-avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 11px;
}
.chat-avatar-assistant { background: var(--text-primary); color: var(--bg-main); border-color: var(--text-primary); }
.chat-speaker { display: block; margin: 4px 0 8px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.chat-turn p { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.8; }
.chat-turn-user > div:last-child { width: fit-content; max-width: 680px; padding: 0 16px 14px; border-bottom: 1px solid var(--border-color); }
.chat-turn-user p { color: var(--text-primary); }
.chat-turn-compact { margin-top: 62px; }
.chat-answer h1 { margin: 0 0 7px; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.1; letter-spacing: -.045em; }
.chat-answer h2 { margin: 0 0 18px; font-size: 22px; letter-spacing: -.025em; }
.chat-answer .chat-lead { margin-bottom: 14px; color: var(--text-primary); font-size: 16px; font-weight: 600; }
.chat-project-preview {
    height: 330px;
    margin: 26px 0 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
}
.chat-project-preview > * { display: block; width: 100%; height: 100%; object-fit: cover; }
.chat-role { display: grid; grid-template-columns: 90px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.chat-role span { color: var(--text-muted); font-size: 12px; }
.chat-role strong { font-size: 13px; line-height: 1.7; }
.chat-tech { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.chat-tech span { padding: 5px 8px; border: 1px solid var(--border-color); border-radius: 7px; background: var(--bg-card); color: var(--text-secondary); font-size: 11px; }
.chat-achievements { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border-color); }
.chat-achievements li { position: relative; padding: 17px 8px 17px 28px; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); font-size: 13px; line-height: 1.75; }
.chat-achievements li::before { content: '✓'; position: absolute; left: 5px; color: var(--text-primary); font-weight: 700; }
.chat-troubles { display: grid; gap: 9px; }
.chat-trouble { border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-card); }
.chat-trouble summary { padding: 15px 17px; color: var(--text-primary); font-size: 13px; font-weight: 600; cursor: pointer; }
.chat-trouble dl { margin: 0; padding: 0 17px 16px; }
.chat-trouble dl > div { display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border-color); }
.chat-trouble dt { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.chat-trouble dd { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.75; }

.project-chat-composer {
    position: absolute;
    left: 50%;
    bottom: 20px;
    z-index: 5;
    width: min(760px, calc(100% - 48px));
    min-height: 76px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 11px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg-card) 94%, transparent);
    box-shadow: 0 12px 38px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.06);
    transform: translateX(-50%);
    backdrop-filter: blur(18px);
}
.project-chat-composer > span { color: var(--text-secondary); font-size: 13px; }
.project-chat-composer > span i { margin-right: 10px; color: var(--text-muted); }
.project-chat-composer > div { display: flex; justify-content: flex-end; gap: 5px; }
.project-chat-composer button { padding: 5px 9px; border: 1px solid var(--border-color); border-radius: 7px; background: transparent; color: var(--text-muted); font: inherit; font-size: 10px; cursor: pointer; }
.project-chat-composer button:hover { background: color-mix(in srgb, var(--text-primary) 7%, transparent); color: var(--text-primary); }

@media (max-width: 820px) {
    .sidebar-project-nav { margin-left: 16px; }
    body.project-chat-open { padding-top: 68px; }
    .project-chat-section { height: calc(100vh - 68px); padding-top: var(--workspace-bar-height); }
    .project-chat-header { grid-template-columns: auto 1fr auto; padding-inline: 14px; }
    .project-chat-back span, .project-chat-title span, .project-chat-external { display: none; }
    .project-chat-thread { padding: 30px 20px 140px; }
    .chat-project-preview { height: 260px; }
}

@media (max-width: 560px) {
    .project-chat-header { grid-template-columns: 36px 1fr; }
    .project-chat-back { width: 36px; padding: 8px; }
    .project-chat-title { justify-content: center; }
    .chat-turn { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
    .chat-avatar { width: 27px; height: 27px; border-radius: 7px; }
    .chat-turn-user > div:last-child { padding-inline: 10px; }
    .chat-answer h1 { font-size: 2rem; }
    .chat-project-preview { height: 210px; }
    .chat-role { grid-template-columns: 1fr; gap: 5px; }
    .chat-trouble dl > div { grid-template-columns: 1fr; gap: 4px; }
    .project-chat-composer { width: calc(100% - 24px); bottom: 10px; }
}

@media print { #project-chat, .sidebar-project-nav { display: none !important; } }

/* Quiet hover language: no jumping, glowing, or structural-card recoloring. */
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.badge-item:hover,
#back-to-top:hover,
.close-modal:hover,
.modal-github-link:hover {
    transform: none;
    box-shadow: none;
}

.about-card:hover,
.skills-category:hover,
.certification-panel:hover,
.contact-info:hover,
.contact-form-container:hover {
    border-color: var(--border-color);
    background: transparent;
    box-shadow: none;
}

.light-theme :is(.about-card, .skills-category, .certification-panel, .contact-info, .contact-form-container),
.dark-theme :is(.about-card, .skills-category, .certification-panel, .contact-info, .contact-form-container),
.light-theme :is(.about-card, .skills-category, .certification-panel, .contact-info, .contact-form-container):hover,
.dark-theme :is(.about-card, .skills-category, .certification-panel, .contact-info, .contact-form-container):hover {
    background: transparent;
    box-shadow: none;
}

.badge-item:hover {
    border-color: var(--border-hover);
    background: color-mix(in srgb, var(--text-primary) 4%, var(--bg-card));
}

.project-card:hover { transform: none; }
.project-card:hover .project-tech-stack span {
    background: var(--bg-badge);
    color: var(--text-secondary);
}

/* Codex workspace fidelity pass */
:root {
    --workspace-bar-height: 48px;
    --reading-width: 820px;
}

.light-theme {
    --bg-main: #ffffff;
    --bg-header: #f7f7f8;
    --bg-card: #f7f7f8;
    --bg-card-hover: #f0f0f1;
    --border-color: #e5e5e7;
    --text-primary: #202123;
    --text-secondary: #5f6273;
    --text-muted: #9296a3;
}

header { background: var(--bg-header); }
.logo {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 650;
}
.logo i { font-size: 10px; color: var(--text-muted); }
.nav-link i,
.sidebar-project-item i { color: var(--text-secondary); font-weight: 400; }
.nav-link i.fas { font-weight: 900; }
.nav-link.active i { color: var(--text-primary); }
.nav-link:hover,
.sidebar-project-item:hover { background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.nav-link.active,
.sidebar-project-item.active { background: color-mix(in srgb, var(--text-primary) 7%, transparent); }

.workspace-topbar {
    padding-inline: 20px;
    background: color-mix(in srgb, var(--bg-main) 96%, transparent);
    font-size: 12px;
}

.hero-section {
    min-height: 100vh;
    padding: calc(var(--workspace-bar-height) + 72px) 0 54px;
    text-align: center;
}
.hero-content {
    width: 100%;
    max-width: 720px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 18px;
}
.hero-content h1,
.light-theme .hero-content h1 {
    max-width: 650px;
    margin-bottom: 20px;
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    line-height: 1.25;
    letter-spacing: -.04em;
}
.hero-subtitle { margin-bottom: 10px; color: var(--text-primary); font-size: 15px; font-weight: 600; }
.hero-description { max-width: 620px; font-size: 14px; line-height: 1.8; }
.hero-cta {
    width: min(100%, 680px);
    min-height: 104px;
    margin: 42px auto 18px;
    padding: 48px 12px 10px;
    border-radius: 17px;
    text-align: left;
}
.hero-cta::before { top: 17px; left: 18px; content: '포트폴리오에서 무엇을 찾아볼까요?'; }
.hero-cta .btn { min-height: 34px; padding-inline: 11px; border-radius: 8px; font-size: 11px; }
.hero-socials { justify-content: center; padding: 0; font-size: 12px; }

.container { padding-inline: 30px; }
section:not(.hero-section):not(.project-chat-section) { padding-block: 76px; }
.section-title { margin-bottom: 28px; font-size: 28px; }
.about-card { grid-template-columns: 34px minmax(0, 1fr); column-gap: 13px; padding: 22px 0; }
.card-icon { width: 30px; height: 30px; border: 0; background: transparent !important; font-size: 13px; }
.stats-container { border-radius: 10px; }
.stat-item { padding: 18px 20px; }
.stat-number { font-size: 22px; }
.project-card { min-height: 210px; border-radius: 10px; }
.project-info, .light-theme .project-info { padding: 24px 26px; }
.contact-form-container form { border-radius: 12px; box-shadow: none; }

@media (max-width: 820px) {
    :root { --workspace-bar-height: 48px; }
    .hero-section { min-height: calc(100vh - 68px); padding-top: calc(var(--workspace-bar-height) + 54px); }
    .hero-content h1, .light-theme .hero-content h1 { font-size: 2rem; }
}
