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

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #1f2937;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
}

/* Header */
.header {
    width: 100%;
    padding: 1.5rem 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    white-space: nowrap;
}

.site-title {
    font-size: 1.125rem;
    font-weight: 500;
    display: none;
}

.nav-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-size: 1rem;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Container and Content */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0 2.5rem;
}

.content {
    width: 100%;
    max-width: 1280px;
}

.spacer-12 {
    height: 3rem;
}

.divider {
    height: 0.125rem;
    width: 100%;
    background-color: #6b7280;
    margin: 2.5rem 0;
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    gap: 0;
    margin: 0;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: auto;
    text-align: center;
}

.hero-text h1 {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.hero-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
}

.hero-icon {
    height: 3rem;
    transition: transform 0.2s ease-in-out;
}

.hero-icon:hover {
    transform: scale(1.05);
}

.hero-image {
    margin: 0 auto 3rem auto;
    width: 100%;
}

.profile-img {
    border-radius: 0.5rem;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Section Styles */
.section {
    margin-bottom: 0;
}

.section h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

/* Experience Section */
.experience-container {
    display: flex;
    flex-direction: row;
    margin: 0 auto;
    width: 100%;
    max-width: 80rem;
    height: 100%;
}

.timeline {
    display: none;
    position: sticky;
    top: calc(50vh - 30%);
    flex-direction: column;
    max-height: 60vh;
    width: 8rem;
    margin-right: 5rem;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.timeline-item, .timeline-item-full {
    display: flex;
    flex-direction: row;
    align-items: flex-end; /* Align all years and markers to the bottom of their segment */
    justify-content: flex-end;
    gap: 1rem;
    width: 100%;
}

.timeline-item {
    height: min-content;
}

.timeline-item-full {
    flex-grow: 1; /* Grow to fill the available timeline space */
    align-items: flex-end;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 1rem;
    align-self: stretch; /* Stretch to fill the height of the segment */
    flex-shrink: 0;
    position: relative;
}

.timeline-year {
    font-size: 1.125rem;
    color: #4b5563;
    margin: 0;
    white-space: nowrap;
    text-align: right;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 1rem; /* Match dot height for perfect centering */
}

.timeline-line {
    position: relative;
    flex-grow: 1;
    width: 2px;
    background-color: #d1d5db;
    margin-top: -0.4375rem; /* Pull up to join center of dot above */
    margin-bottom: -0.4375rem; /* Pull down to join center of own dot */
}

.timeline-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: transparent;
    transition: all 0.2s ease-in-out;
}

.timeline-dot {
    width: 0.875rem;
    height: 0.875rem;
    background-color: #6b7280;
    border-radius: 9999px;
    flex-shrink: 0;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    z-index: 1; /* Ensure dot is above line slightly if they overlap */
}

.experience-cards {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.experience-card {
    width: 100%;
    border: 1px solid;
    border-radius: 0.75rem;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
    transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.experience-card:hover {
    transform: scale(1.005);
}

.card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

.card-header-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    justify-content: center;
}

.company-logo {
    height: 4rem;
    width: 4rem;
    margin-right: 1.25rem;
    object-fit: contain;
    flex-shrink: 0;
}

.card-title-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.card-title-row h2 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.date {
    font-size: 0.875rem;
    color: #4b5563;
    white-space: nowrap;
    margin-left: 1rem;
}

.position {
    font-size: 1rem;
    color: #4b5563;
    margin-top: 0.125rem;
}

.caption {
    font-size: 0.875rem;
}

.caption-link {
    text-decoration: underline;
    font-weight: 500;
}

/* Projects Section */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.project-card:hover {
    border-color: #6b7280;
    transform: scale(1.005);
}

.project-image {
    object-fit: cover;
    width: 100%;
    height: 14rem;
}

.project-content {
    padding: 1rem;
    border-top: 1px solid #d1d5db;
}

.project-title {
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.technologies {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 1rem;
    gap: 0.5rem;
}

.tech-tag {
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
}

.project-description {
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

/* 404 Page */
.not-found {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.not-found h1 {
    font-size: 1.875rem;
    font-weight: 600;
    margin: 4rem 0;
}

.btn {
    font-weight: 600;
    font-size: 1.125rem;
    padding: 0.5rem 1rem;
    margin: 1rem auto;
    background-color: #bfdbfe;
    border: 1px solid #93c5fd;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease-in-out;
}

.btn:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
    margin-top: 6rem;
}

.footer-text {
    font-size: 0.875rem;
    margin-left: auto;
    margin-right: 2rem;
    width: min-content;
    white-space: nowrap;
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .header {
        padding: 1.5rem 4rem;
    }

    .header-content {
        flex-direction: row;
    }

    .site-title {
        display: block;
    }

    .container {
        padding: 0 4rem;
    }

    .spacer-12 {
        height: 6rem;
    }

    .divider {
        margin: 4rem 0;
    }

    .hero {
        flex-direction: row;
        align-items: center;
        gap: 4rem;
    }

    .hero-text {
        text-align: left;
        margin: 0;
    }

    .hero-links {
        justify-content: flex-start;
    }

    .hero-text h1 {
        font-size: 3rem;
    }

    .hero-image {
        width: 40%;
        margin: 0;
    }

    .section h1 {
        font-size: 3rem;
    }

    .timeline {
        display: flex;
    }

    .company-logo {
        height: 5rem;
        max-width: 24rem;
    }

    .card-title-row h2 {
        font-size: 1.25rem;
    }

    .date {
        font-size: 1rem;
    }

    .position {
        font-size: 1rem;
    }

    .caption {
        font-size: 1rem;
    }

    .projects-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .project-card:hover {
        border-color: #6b7280;
        transform: scale(1.005);
    }

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

    .tech-tag {
        font-size: 0.875rem;
    }

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

    .not-found h1 {
        font-size: 4.375rem;
    }

    .footer-text {
        font-size: 1rem;
        margin-right: 1rem;
    }
}
