/* ===== CSS Variables ===== */
:root {
    --bg-primary: #fafaf8;
    --bg-secondary: #f4f3f0;
    --bg-tertiary: #eeedea;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-tertiary: #999999;
    --accent-primary: #c45d3e;
    --accent-hover: #a84a2f;
    --accent-secondary: #3d7c6b;
    --border-color: #e0dfdc;
    --highlight-color: #c45d3e;
}

[data-theme="dark"] {
    --bg-primary: #121210;
    --bg-secondary: #1a1917;
    --bg-tertiary: #222120;
    --text-primary: #e8e6e1;
    --text-secondary: #a09d95;
    --text-tertiary: #6b6860;
    --accent-primary: #e07a5a;
    --accent-hover: #f09070;
    --accent-secondary: #5daa96;
    --border-color: #2a2926;
    --highlight-color: #e07a5a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 15px;
    letter-spacing: -0.01em;
    word-break: keep-all;
}

a, button {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

/* ===== Layout ===== */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 32px;
}

.section {
    padding: 56px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 28px;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 24px;
}

.section-header .section-title {
    margin-bottom: 0;
    flex: 1;
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.2s ease;
    color: var(--text-tertiary);
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* ===== Scroll Navigation ===== */
.scroll-nav {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 999;
}

.scroll-nav-dot {
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--border-color);
    transition: all 0.25s ease;
    text-decoration: none;
    display: block;
}

.scroll-nav-dot:hover {
    background-color: var(--text-tertiary);
    transform: scale(1.4);
}

.scroll-nav-dot.active {
    background-color: var(--accent-primary);
    transform: scale(1.6);
}

.scroll-nav-label {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    z-index: 1;
}

.scroll-nav-dot:hover .scroll-nav-label {
    opacity: 1;
    z-index: 10;
}

.scroll-nav-dot.active .scroll-nav-label {
    opacity: 1;
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    z-index: 5;
}

/* ===== Hero Section ===== */
.hero {
    padding: 80px 0 16px 0;
}

.hero-name {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.hero-role {
    font-size: 15px;
    color: var(--accent-primary);
    margin-bottom: 20px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.hero-intro {
    max-width: 520px;
}

.hero-intro p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== Introduce Section ===== */
.introduce-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.introduce-item {
    padding-left: 16px;
    border-left: 2px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.introduce-item:hover {
    border-left-color: var(--accent-primary);
}

.introduce-item h3 {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.introduce-list {
    list-style: none;
    padding-left: 0;
}

.introduce-list li {
    margin-bottom: 6px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 15px;
}

.introduce-list li:last-child {
    margin-bottom: 0;
}

/* ===== ETC / Footnote ===== */
.etc.section {
    padding: 20px 0;
    border-bottom: none;
}

.footnote {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.7;
}

.footnote sup {
    color: var(--accent-primary);
    margin-right: 3px;
}

/* ===== Experience Section (Timeline) ===== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.timeline-item {
    position: relative;
    padding-left: 16px;
    border-left: 2px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.timeline-item:hover {
    border-left-color: var(--accent-primary);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 6px;
}

.timeline-header h3 {
    font-size: 20px;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.timeline-date {
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}

.timeline-role {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 15px;
}

.timeline-description {
    color: var(--text-tertiary);
    font-weight: 400;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 2px;
    margin-bottom: 20px;
}

.timeline-list {
    list-style: none;
    padding-left: 0;
}

.timeline-list li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 15px;
}

.timeline-list li + li {
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.timeline-list li:last-child {
    margin-bottom: 0;
}

.timeline-list li strong {
    color: var(--highlight-color);
    font-weight: 600;
}

/* Details/Summary for detailed work experience */
.timeline-details {
    margin-top: 8px;
}

.timeline-details summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
}

.timeline-details summary::-webkit-details-marker,
.timeline-details summary::marker {
    display: none;
}

.timeline-details summary:hover {
    color: var(--accent-primary);
}

.timeline-details[open] summary {
    margin-bottom: 10px;
}

/* ===== Open Source Contributions Section ===== */
.opensource-inline {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    line-height: 1.8;
}

.opensource-inline li {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.opensource-inline li span {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 3px;
}

.opensource-inline li a {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-primary);
    text-decoration: none;
    margin-left: 1px;
}

.opensource-inline li a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ===== Contact Section ===== */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-item {
    display: flex;
    gap: 24px;
    align-items: baseline;
}

.contact-label {
    color: var(--text-tertiary);
    font-size: 13px;
    min-width: 80px;
    font-weight: 500;
}

.contact-item a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
}

.contact-item a:hover {
    color: var(--accent-primary);
}

/* ===== Footer ===== */
.footer {
    padding: 28px 0;
    margin-top: 0;
}

.footer p {
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
}

/* ===== Fade-in Animation ===== */
.section {
    animation: fadeUp 0.5s ease both;
}

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

.hero {
    animation: fadeUp 0.6s ease both;
}

/* ===== Responsive Design (Tablet) ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }

    .section {
        padding: 40px 0;
    }

    .section-header {
        align-items: flex-start;
        margin-bottom: 20px;
        gap: 16px;
    }

    .hero {
        padding: 64px 0 36px 0;
    }

    .hero-name {
        font-size: 32px;
    }

    .hero-role {
        font-size: 14px;
    }

    .timeline {
        gap: 28px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .contact-item {
        flex-direction: column;
        gap: 2px;
        align-items: flex-start;
    }

    .contact-label {
        min-width: auto;
        font-size: 12px;
    }

    .theme-toggle {
        top: 16px;
        right: 16px;
    }

    .scroll-nav {
        right: 16px;
        gap: 12px;
    }

    .scroll-nav-dot {
        width: 5px;
        height: 5px;
    }

    .scroll-nav-label {
        display: none;
    }
}

/* ===== Responsive Design (Mobile) ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .section {
        padding: 32px 0;
    }

    .section-header {
        margin-bottom: 16px;
    }

    .hero {
        padding: 48px 0 28px 0;
    }

    .hero-name {
        font-size: 28px;
    }

    .hero-role {
        margin-bottom: 16px;
    }

    .timeline-header h3 {
        font-size: 18px;
    }

    .introduce-item h3 {
        font-size: 15px;
    }

    .footer {
        margin-top: 0;
    }

    .scroll-nav {
        display: none;
    }
}

/* ===== Print Styles ===== */
@media print {
    body {
        background-color: white;
        color: black;
    }

    .theme-toggle,
    .scroll-nav {
        display: none;
    }

    .section {
        padding: 24px 0;
        border-bottom-color: #ddd;
        animation: none;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}
