:root {
    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;

    /* Theme Variables (Default Dark) */
    --bg-color: #050505;
    --text-white: #ffffff;
    --text-gray: #888888;
    --text-dark: #333333;
    --point-red: #FF4800;
    --border-color: rgba(255, 255, 255, 0.2);

    /* Spacing */
    --spacing-section: 180px;
    --spacing-item: 10px;
}

/* Light Theme Override */
body.light-theme {
    --bg-color: #ffffff;
    --text-white: #111111;
    /* Inverted */
    --text-gray: #666666;
    --text-dark: #eeeeee;
    --border-color: rgba(0, 0, 0, 0.1);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 1000;
    background: none;
    border: 1px solid var(--text-gray);
    color: var(--text-gray);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    mix-blend-mode: difference;
    /* Ensure visibility */
}

.theme-toggle:hover {
    border-color: var(--text-white);
    color: var(--text-white);
}

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

::selection {
    background: var(--point-red);
    color: #fff;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-gray);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

a:hover {
    color: var(--text-white);
}

ul {
    list-style: none;
}

/* 0. Ambient Light Background (Canvas) */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}



/* 1. Language Toggle */
.lang-switch {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    mix-blend-mode: difference;
}

.globe-icon {
    width: 18px;
    height: 18px;
    fill: #fff;
    opacity: 0.8;
}

.lang-btn {
    background: none;
    border: none;
    color: #999;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
}

.lang-btn.active {
    color: #fff;
    font-weight: 700;
}

.divider {
    color: #333;
    font-size: 10px;
}

/* 2. Social Links */
.social-links {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 1000;
    display: flex;
    align-items: center;
    mix-blend-mode: difference;
}

.social-icon {
    width: 24px;
    height: 24px;
    fill: #999;
    transition: all 0.3s ease;
    display: block;
}

.social-icon:hover {
    fill: #fff;
    transform: scale(1.1);
}

/* Visibility Logic */
[data-lang="ko"] .en,
[data-lang="ko"] .cn {
    display: none !important;
}

[data-lang="en"] .ko,
[data-lang="en"] .cn {
    display: none !important;
}

[data-lang="cn"] .ko,
[data-lang="cn"] .en {
    display: none !important;
}

/* Container - Shared Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Red Rounded Badge */
.red-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--point-red);
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    padding: 2px 10px;
    height: 24px;
    vertical-align: middle;
    margin-left: 12px;
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(255, 72, 0, 0.4);
    /* Glow effect */
}

.red-badge.large {
    height: 36px;
    border-radius: 18px;
    font-size: 20px;
    padding: 0 16px;
    margin-left: 20px;
    transform: translateY(-4px);
}

/* 3. Header */
header {
    padding-top: 220px;
    padding-bottom: 100px;
}

h1.main-title {
    font-size: 9vw;
    font-weight: 800;
    color: var(--text-white);
    line-height: 0.85;
    letter-spacing: -0.04em;
    margin-bottom: 60px;
    text-transform: uppercase;
    min-height: 1.7em;
    opacity: 1;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    /* Subtle glow */
}

.role-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-top: 1px solid #222;
    padding-top: 30px;
}

.role {
    font-size: 22px;
    font-weight: 400;
    color: var(--text-white);
    line-height: 1.4;
}

.exp-years {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--text-white);
    margin-top: 16px;
    font-size: 16px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 20px 60px;
    font-size: 14px;
    text-align: right;
}

.contact-label {
    display: block;
    font-size: 11px;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

/* 4. Changing Skill Section */
.skill-section {
    padding: 80px 0;
    border-top: 1px solid #111;
    border-bottom: 1px solid #111;
    margin-bottom: 140px;
    display: block;
    position: relative;
    overflow: hidden;
}

/* High-tech scanline effect for skill section */
.skill-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(255, 255, 255, 0.02) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
}

.display-text {
    font-size: 11vw;
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    word-break: break-all;
    margin-bottom: 40px;

    /* 3D Perspective */
    will-change: transform;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    cursor: default;
}

.skill-text {
    font-size: 4vw;
    font-weight: 700;
    color: var(--text-white);
    text-transform: lowercase;
    letter-spacing: -0.05em;
    line-height: 1;
    font-family: var(--font-main);
    display: block;
    text-align: left;
}

/* 5. Section Layout */
section {
    margin-bottom: var(--spacing-section);
}

.section-header {
    margin-bottom: 50px;
    display: flex;
    align-items: center;
}

h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
}

.timeline-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    margin-bottom: 24px;
    align-items: baseline;
    border-bottom: 1px solid #111;
    padding-bottom: 24px;
    transition: border-color 0.3s;
}

.timeline-row:hover {
    border-color: #333;
}

.timeline-row:last-child {
    border-bottom: none;
}

.year-col {
    font-size: 16px;
    font-weight: 600;
    color: #666;
}

.content-col h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 6px;
}

.content-col ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.content-col li {
    position: relative;
    color: #888;
    font-weight: 300;
    font-size: 15px;
    transition: all 0.2s;
    padding-left: 0;
}

.content-col li::before {
    content: "-";
    margin-right: 8px;
    color: #444;
}

.content-col li:hover {
    color: var(--text-white);
    transform: translateX(5px);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.sub-date {
    display: inline-block;
    width: 50px;
    font-variant-numeric: tabular-nums;
    color: #555;
    font-size: 0.9em;
    font-weight: 500;
}

/* 6. Scramble & Reveal Animations */
.scramble-scroll {
    opacity: 0;
}

.scramble-scroll.scrambled-done {
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(12px);
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-white);
    font-family: var(--font-main);
    overflow-x: hidden;
    /* Smooth Theme Transition */
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Add transitions to elements that change color */
h1,
h2,
h3,
.role,
.skill-text,
.footer-logo,
.contact-value,
.content-col li,
.timeline-row,
.lang-btn,
.social-icon path {
    transition: color 0.5s ease, border-color 0.5s ease, fill 0.5s ease;
}

/* ... existing styles ... */

/* Footer */
footer {
    padding: 60px 40px;
    border-top: 1px solid var(--border-color);
    /* Use variable */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 100px;
    transition: border-color 0.5s ease;
}

.footer-logo {
    font-weight: 800;
    color: var(--text-white);
    /* Fix: Use variable */
    letter-spacing: -0.02em;
}

.copyright {
    font-size: 12px;
    color: var(--text-gray);
    /* Use variable */
}

/* Scramble Helper Class */
.dud {
    color: #444;
    opacity: 0.7;
}

/* Mobile */
@media (max-width: 768px) {
    h1.main-title {
        font-size: 15vw;
    }

    .role-wrapper {
        flex-direction: column;
        gap: 40px;
    }

    .contact-grid {
        text-align: left;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .timeline-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-bottom: 30px;
    }

    .container {
        padding: 0 24px;
    }

    header {
        padding-top: 140px;
    }

    .lang-switch {
        top: 25px;
        left: 24px;
    }

    .social-links {
        top: 25px;
        right: 24px;
    }

    .skill-section {
        padding: 40px 0;
    }

    .skill-text {
        font-size: 8vw;
    }
}