@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

:root {
    --light-bg: #F9F7F7;
    --light-blue: #DBE2EF;
    --medium-blue: #3F72AF;
    --dark-navy: #112D4E;
    --text-primary: #112D4E;
    --text-secondary: rgba(17, 45, 78, 0.6);
    --border: #DBE2EF;
    --hover: rgba(219, 226, 239, 0.4);
    --subtle-shadow: 0 2px 8px rgba(17, 45, 78, 0.04);
}

/* Dark Mode */
[data-theme="dark"] {
    --light-bg: #0D1B2A;
    --light-blue: #1B263B;
    --medium-blue: #5B9FE3;
    --dark-navy: #E0E1DD;
    --text-primary: #E0E1DD;
    --text-secondary: rgba(224, 225, 221, 0.6);
    --border: #1B263B;
    --hover: rgba(91, 159, 227, 0.15);
    --subtle-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body {
    background-image: radial-gradient(circle at 10% 20%, rgba(91, 159, 227, 0.08) 0%, transparent 50%);
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light-bg);
    background-image: radial-gradient(circle at 10% 20%, rgba(219, 226, 239, 0.1) 0%, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--medium-blue);
    color: var(--light-bg);
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-to-main:focus {
    top: 20px;
    outline: 3px solid var(--dark-navy);
    outline-offset: 2px;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--medium-blue);
    z-index: 1000;
    transition: width 0.05s linear;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 56px;
    height: 56px;
    background: var(--dark-navy);
    color: var(--light-bg);
    border: 2px solid rgba(249, 247, 247, 0.2);
    border-radius: 16px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(17, 45, 78, 0.15), 0 2px 8px rgba(17, 45, 78, 0.1);
    z-index: 900;
    will-change: transform, opacity;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.back-to-top svg {
    display: block;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    background: var(--medium-blue);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(17, 45, 78, 0.25), 0 4px 12px rgba(17, 45, 78, 0.15);
    border-color: rgba(249, 247, 247, 0.3);
}

.back-to-top:active {
    transform: translateY(-2px) scale(1);
    box-shadow: 0 6px 16px rgba(17, 45, 78, 0.2);
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 64px 40px 80px;
}

/* Header */
.header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--medium-blue);
    position: relative;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: 2px solid var(--border);
    color: var(--medium-blue);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.theme-toggle:hover {
    background: var(--hover);
    border-color: var(--medium-blue);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(20deg);
}

[data-theme="dark"] .theme-toggle svg {
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle:hover svg {
    transform: rotate(200deg);
}

.header-meta {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
    color: var(--medium-blue);
    font-weight: 600;
}

.header-name {
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.header-role {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-weight: 400;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-item {
    font-weight: 500;
}

#expandedCount {
    color: var(--medium-blue);
    font-weight: 600;
}

.stat-divider {
    color: var(--border);
}

.stat-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--medium-blue);
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.stat-btn:hover {
    background: var(--medium-blue);
    color: var(--light-bg);
    border-color: var(--medium-blue);
}

.header-note {
    font-size: 13px;
    color: var(--text-secondary);
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--light-blue);
    color: var(--medium-blue);
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(17, 45, 78, 0.1);
}

/* Index List */
.index {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Index Item */
.index-item {
    border-bottom: 1px solid var(--border);
    position: relative;
}

.index-item:last-child {
    border-bottom: none;
}

.index-item::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 20px;
    bottom: 20px;
    width: 3px;
    background: var(--medium-blue);
    opacity: 0;
    transform: scaleY(0);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.index-item.expanded::before {
    opacity: 1;
    transform: scaleY(1);
}

/* Item Header */
.item-header {
    display: grid;
    grid-template-columns: 50px 1fr auto 40px;
    gap: 16px;
    align-items: center;
    padding: 24px 0;
    cursor: pointer;
    position: relative;
}

.item-header::after {
    content: '';
    position: absolute;
    left: -12px;
    right: -12px;
    top: 0;
    bottom: 0;
    background: var(--hover);
    opacity: 0;
    transition: opacity 0.12s ease;
    border-radius: 4px;
    z-index: -1;
}

.item-header:hover::after {
    opacity: 1;
}

.item-header:hover {
    transform: translateX(8px);
}

.item-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--medium-blue);
    letter-spacing: 0.05em;
    transition: transform 0.15s ease;
}

.item-header:hover .item-number {
    transform: translateX(2px);
}

.item-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.item-header:hover .item-title {
    color: var(--medium-blue);
}

.item-meta {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: right;
    transition: color 0.3s ease;
}

.item-header:hover .item-meta {
    color: var(--medium-blue);
}

.item-toggle {
    font-size: 24px;
    color: var(--medium-blue);
    font-weight: 300;
    line-height: 1;
    transition: transform 0.15s ease;
    will-change: transform;
}

.index-item.expanded .item-toggle {
    transform: rotate(45deg);
}

.item-header:hover .item-toggle {
    transform: scale(1.1);
}

.index-item.expanded .item-header:hover .item-toggle {
    transform: rotate(45deg) scale(1.1);
}

/* Item Content */
.item-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.index-item.expanded .item-content {
    max-height: 1500px;
    padding-bottom: 32px;
}

.content-body {
    padding-left: 64px;
    padding-right: 64px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s ease 0.03s, transform 0.18s ease 0.03s;
    will-change: opacity, transform;
}

.index-item.expanded .content-body {
    opacity: 1;
    transform: translateY(0);
}

/* Content Typography */
.content-paragraph {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.grid-item {
    padding: 16px;
    border: 1px solid var(--border);
    background: var(--hover);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.grid-item:hover {
    background: var(--hover);
    border-color: var(--medium-blue);
    transform: translateY(-1px);
    opacity: 0.8;
}

.grid-icon {
    color: var(--medium-blue);
    margin-bottom: 12px;
    transition: transform 0.2s ease;
}

.grid-item:hover .grid-icon {
    transform: scale(1.1);
}

.grid-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--medium-blue);
    margin-bottom: 6px;
    font-weight: 600;
}

.grid-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Content Details */
.content-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.detail-section {
    display: grid;
    grid-template-columns: 24px 140px 1fr;
    gap: 12px;
    padding: 16px 0;
    align-items: start;
    transition: transform 0.15s ease;
}

.detail-section:hover {
    transform: translateX(4px);
}

.detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--medium-blue);
    padding-top: 2px;
}

.detail-icon svg {
    transition: transform 0.2s ease;
}

.detail-section:hover .detail-icon svg {
    transform: scale(1.1);
}

.detail-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--medium-blue);
    font-weight: 600;
}

.detail-value {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Skills Grid */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.skill-section {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.skill-section:hover {
    transform: translateX(4px);
    border-color: var(--medium-blue);
}

.skill-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.skill-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.skill-value {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Experience List */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.experience-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 4px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.experience-item:hover {
    background: var(--hover);
    transform: translateX(2px);
}

.exp-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.exp-role {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.exp-icon {
    color: var(--medium-blue);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.experience-item:hover .exp-icon {
    transform: scale(1.1);
}

.exp-period {
    font-size: 13px;
    color: var(--medium-blue);
    white-space: nowrap;
    font-weight: 500;
}

.exp-company {
    font-size: 14px;
    color: var(--text-secondary);
}

.exp-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Contact List */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.contact-item {
    display: grid;
    grid-template-columns: 24px 120px 1fr;
    gap: 12px;
    padding: 12px 0;
    align-items: center;
    transition: transform 0.15s ease;
}

.contact-item:hover {
    transform: translateX(4px);
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--medium-blue);
}

.contact-icon svg {
    transition: transform 0.2s ease;
}

.contact-item:hover .contact-icon svg {
    transform: scale(1.1);
}

.contact-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--medium-blue);
    font-weight: 600;
}

.contact-value {
    font-size: 15px;
    color: var(--text-primary);
}

/* Links */
.content-link {
    color: var(--medium-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease;
    font-weight: 500;
    position: relative;
}

.content-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--medium-blue);
    transition: width 0.15s ease;
}

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

.content-link:hover {
    color: var(--dark-navy);
}

/* Footer */
.footer {
    margin-top: 48px;
}

.footer-line {
    width: 100%;
    height: 2px;
    background: var(--medium-blue);
    margin-bottom: 16px;
}

.footer-text {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

/* Shortcuts Modal */
.shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 45, 78, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.shortcuts-modal.active {
    opacity: 1;
    visibility: visible;
}

.shortcuts-content {
    background: var(--light-bg);
    padding: 40px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(17, 45, 78, 0.4);
    transform: scale(0.95);
    transition: transform 0.15s ease;
}

.shortcuts-modal.active .shortcuts-content {
    transform: scale(1);
}

.shortcuts-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.shortcut-item kbd {
    min-width: 60px;
}

.shortcut-item span {
    color: var(--text-secondary);
    font-size: 15px;
}

.shortcuts-note {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}

/* Selection */
::selection {
    background: var(--medium-blue);
    color: var(--light-bg);
}

/* Animations */
.index-item {
    opacity: 0;
    animation: fadeInSlide 0.5s ease forwards;
}

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

/* Stagger animations */
.index-item:nth-child(1) { animation-delay: 0s; }
.index-item:nth-child(2) { animation-delay: 0.05s; }
.index-item:nth-child(3) { animation-delay: 0.1s; }
.index-item:nth-child(4) { animation-delay: 0.15s; }
.index-item:nth-child(5) { animation-delay: 0.2s; }
.index-item:nth-child(6) { animation-delay: 0.25s; }
.index-item:nth-child(7) { animation-delay: 0.3s; }

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 40px 24px 60px;
    }

    .header-name {
        font-size: 48px;
    }

    .header-stats {
        flex-wrap: wrap;
        font-size: 12px;
    }

    .item-header {
        grid-template-columns: 40px 1fr 30px;
        gap: 12px;
    }

    .item-meta {
        display: none;
    }

    .item-title {
        font-size: 18px;
    }

    .content-body {
        padding-left: 52px;
        padding-right: 42px;
    }

    .detail-section,
    .skill-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .detail-icon {
        display: none;
    }
    
    .contact-item {
        grid-template-columns: 24px 1fr;
        gap: 12px;
        padding: 16px 0;
    }
    
    .contact-label {
        display: none;
    }
    
    .contact-value {
        font-size: 14px;
        word-break: break-all;
    }
    
    .contact-value a {
        display: inline-block;
        padding: 8px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

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

    .exp-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .shortcuts-content {
        padding: 32px 24px;
    }

    .index-item::before {
        display: none;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        background-image: none;
    }

    .container {
        max-width: 100%;
        padding: 20px;
    }

    .index-item {
        animation: none;
        opacity: 1;
    }

    .item-toggle,
    .progress-bar,
    .back-to-top,
    .shortcuts-modal,
    .stat-btn {
        display: none;
    }

    .item-content {
        max-height: none !important;
        padding-bottom: 20px !important;
    }

    .content-body {
        opacity: 1 !important;
        transform: none !important;
    }

    .content-link {
        color: var(--text-primary);
        text-decoration: underline;
    }

    .header {
        border-bottom-color: var(--text-primary);
    }

    .footer-line {
        background: var(--text-primary);
    }

    .index-item::before {
        display: none;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
a:focus-visible,
.item-header:focus-visible,
button:focus-visible {
    outline: 3px solid var(--medium-blue);
    outline-offset: 4px;
    border-radius: 2px;
}

.item-header:focus-visible {
    background: var(--hover);
}

/* Remove default focus outline for mouse users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
.item-header:focus:not(:focus-visible) {
    outline: none;
}
