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

:root {
    /* Light theme (default) */
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-secondary: #333;
    --text-tertiary: #555;
    --text-muted: #666;
    --text-light: #888;
    --link-color: #0066cc;
    --card-bg: #fafafa;
    --card-hover: #f5f5f5;
    --icon-bg: #e0e0e0;
    --control-bg: #f0f0f0;
    --control-hover: #e0e0e0;
    --base-font-size: 16px;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-secondary: #d0d0d0;
    --text-tertiary: #c0c0c0;
    --text-muted: #a0a0a0;
    --text-light: #888;
    --link-color: #4d9fff;
    --card-bg: #242424;
    --card-hover: #2a2a2a;
    --icon-bg: #333;
    --control-bg: #2a2a2a;
    --control-hover: #333;
}

html {
    font-size: var(--base-font-size);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* Header/Intro Section */
.intro {
    margin-bottom: 80px;
}

.intro h1 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 40px;
    color: var(--text-color);
}

.bio {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.bio p {
    margin-bottom: 24px;
}

.bio strong {
    font-weight: 600;
}

.bio a {
    color: var(--link-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.bio a:hover {
    opacity: 0.7;
}

.signature {
    margin-top: 40px;
    font-style: italic;
}

.me-overview {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 60px;
}

.overview-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.overview-tab {
    flex: 0 0 auto;
    border: 1px solid var(--icon-bg);
    background-color: var(--card-bg);
    color: var(--text-color);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.overview-tab:hover {
    background-color: var(--card-hover);
}

.overview-tab.is-active {
    border-color: var(--link-color);
    color: var(--link-color);
}

.overview-panel {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
}

.overview-panel ul {
    list-style: none;
}

.overview-panel li {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.overview-panel strong {
    color: var(--text-color);
}

.favorite-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.favorite-tech-item {
    background-color: var(--icon-bg);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Projects Section */
.projects {
    margin-top: 60px;
}

.projects-fun {
    margin-top: 48px;
}

.project-search {
    margin: 30px 0 10px;
}

.project-search label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.project-search input {
    width: 100%;
    border: 1px solid var(--icon-bg);
    background-color: var(--card-bg);
    color: var(--text-color);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.9375rem;
}

.project-search input:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 1px;
}

.section-label {
    font-size: 1.125rem;
    margin-bottom: 40px;
    color: var(--text-muted);
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
    --timeline-axis: 28px;
}

.project-list.has-timeline::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: var(--timeline-axis);
    width: 1px;
    background-color: var(--icon-bg);
    opacity: 0.5;
    pointer-events: none;
}

.timeline-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Project Card */
.project-card {
    display: flex;
    gap: 20px;
    align-items: center;
    flex: 1;
    padding: 24px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background-color: var(--card-bg);
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.project-card.is-clickable {
    cursor: pointer;
}

.project-card:hover {
    background-color: var(--card-hover);
    transform: translateY(-2px);
}

.project-card:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

.project-year {
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 56px;
    text-align: right;
    position: relative;
    z-index: 1;
    background-color: var(--bg-color);
    padding-right: 4px;
}

.project-content {
    flex: 1;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.project-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.project-company {
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 10px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tech-pill {
    background-color: var(--icon-bg);
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 4px 10px;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.project-links a {
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--link-color);
    overflow-wrap: anywhere;
}

.project-links a:hover {
    opacity: 0.75;
}

.project-links-disabled .disabled-link {
    display: inline-block;
    color: var(--text-muted);
    filter: blur(1.2px);
    user-select: none;
}

.construction-tape {
    position: absolute;
    top: 10px;
    right: -45px;
    transform: rotate(22deg);
    background: repeating-linear-gradient(
        45deg,
        #ffbf00 0,
        #ffbf00 12px,
        #151515 12px,
        #151515 24px
    );
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 6px 48px;
    z-index: 2;
}

.construction-note {
    margin-top: 8px;
    font-size: 0.8125rem;
    color: #cf7b00;
    font-weight: 600;
}

.no-results {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 6px 2px;
}

.project-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background-color: var(--icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    overflow: hidden;
    align-self: center;
}

.site-footer {
    margin-top: 80px;
    padding: 22px 24px 30px;
    border-top: 1px solid var(--icon-bg);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.site-footer-inner {
    max-width: 900px;
    margin: 0 auto;
    overflow-wrap: anywhere;
}

.site-footer a {
    color: var(--link-color);
    text-decoration: none;
}

.project-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 40px 20px;
    }

    .intro h1 {
        font-size: 1.25rem;
    }

    .bio {
        font-size: 1rem;
    }

    .timeline-row {
        gap: 10px;
    }

    .project-year {
        min-width: 42px;
    }

    .project-list {
        --timeline-axis: 21px;
    }

    .project-card {
        gap: 14px;
        padding: 16px;
    }

    .project-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 34px 14px;
    }

    .section-label {
        font-size: 1rem;
        margin-bottom: 24px;
    }

    .project-list {
        gap: 20px;
        --timeline-axis: 18px;
    }

    .timeline-row {
        gap: 8px;
    }

    .project-year {
        min-width: 34px;
        font-size: 0.75rem;
        padding-right: 2px;
    }

    .project-card {
        gap: 10px;
        padding: 12px;
    }

    .project-title {
        font-size: 1.05rem;
    }

    .project-description {
        font-size: 0.92rem;
    }

    .project-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .tech-pill {
        font-size: 0.6875rem;
        padding: 3px 8px;
    }

    .project-links {
        gap: 8px;
    }

    .project-links a {
        font-size: 0.8125rem;
    }

    .construction-tape {
        right: -58px;
        font-size: 0.625rem;
        padding: 5px 44px;
    }

    .overview-tab {
        font-size: 0.8125rem;
        padding: 9px 10px;
    }

    .overview-panel {
        padding: 16px;
    }

    .overview-panel li {
        font-size: 0.875rem;
    }
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-row {
    animation: fadeIn 0.5s ease forwards;
}

.timeline-row:nth-child(1) { animation-delay: 0.1s; }
.timeline-row:nth-child(2) { animation-delay: 0.2s; }
.timeline-row:nth-child(3) { animation-delay: 0.3s; }
.timeline-row:nth-child(4) { animation-delay: 0.4s; }
.timeline-row:nth-child(5) { animation-delay: 0.5s; }

/* Accessibility Controls */
.accessibility-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 1000;
}

.font-size-controls {
    display: flex;
    gap: 4px;
    background-color: var(--control-bg);
    padding: 4px;
    border-radius: 8px;
}

.control-btn {
    background-color: var(--control-bg);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.control-btn:hover {
    background-color: var(--control-hover);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.theme-icon {
    font-size: 1.125rem;
    display: block;
}

/* Responsive Accessibility Controls */
@media (max-width: 640px) {
    .accessibility-controls {
        top: 12px;
        right: 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .control-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}
