/* --- Global Styles & Variables --- */
:root {
    --primary-bg: #111111;
    --secondary-bg: #1A1A1A;
    --box-bg: #222222;
    --primary-text: #EAEAEA;
    --secondary-text: #A0A0A0;
    --accent: #00BFFF; /* DeepSkyBlue */
    --accent-hover: #FFFFFF;
    --border-color: #333;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Montserrat', sans-serif;
}

/* --- Base & Typography --- */
body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
    font-family: var(--font-body);
    line-height: 1.7;
    margin: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--secondary-text);
    max-width: 600px;
    margin: 0 auto 4rem auto;
    font-size: 1.1rem;
}

/* --- Header & Navigation --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.main-header nav a {
    margin-left: 2rem;
    color: var(--primary-text);
    font-weight: 500;
}

.main-header nav a:hover, .main-header nav a.active {
    color: var(--accent);
}

.button {
    background-color: var(--accent);
    color: var(--primary-bg);
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    font-weight: 700;
}
.button:hover {
    background-color: var(--accent-hover);
    color: var(--primary-bg);
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 6rem 0;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero .subtitle {
    font-size: 1.5rem;
    color: var(--secondary-text);
    margin-bottom: 2rem;
}

.social-links a {
    margin: 0 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* --- General Section Styling --- */
section {
    padding: 2.5rem 0;
}

.cute-box {
    background: var(--box-bg);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

/* --- About Section --- */
.about-container {
    display: flex;
    align-items: center;
    gap: 3rem;
}
.about-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: url('images/your-photo.jpg') center 30% / cover no-repeat;
    background-color: var(--accent);
    flex-shrink: 0;
}
.about-text-content h3 {
    margin-bottom: 1rem;
}

/* --- Experience Timeline (FINAL GRID METHOD V3) --- */
.timeline {
    display: grid;
    /* Create 3 columns: left content | Line | right content */
    grid-template-columns: 1fr 2px 1fr;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

/* This is the line */
.timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 20px; /* Start after the first logo's center */
    bottom: 20px; /* End before the last logo's center */
    width: 2px;
    background-color: var(--border-color);
    z-index: 0; /* Place it behind the logos */
}

.timeline-item {
    position: relative;
    padding: 0 0 3rem 0;
}

.timeline-content {
    position: relative;
    margin: 0 2rem;
}

/* --- THIS IS THE CRITICAL FIX --- */
/* The line is child 1, so the first ITEM is child 2 */
.timeline-item:nth-child(2) { grid-row: 1; } /* Google */
.timeline-item:nth-child(3) { grid-row: 2; } /* Georgia Tech */
.timeline-item:nth-child(4) { grid-row: 3; } /* Travelers */
.timeline-item:nth-child(5) { grid-row: 4; } /* PSEO */
.timeline-item:last-child {
    padding-bottom: 0;
}

/* EVEN children (Google, Travelers) are now the LEFT items */
.timeline-item:nth-child(even) {
    grid-column: 1;
}
/* ODD children (Georgia Tech, PSEO) are now the RIGHT items */
.timeline-item:nth-child(odd) {
    grid-column: 3;
}
/* Logo positioning must also be swapped */
.timeline-item:nth-child(even) .timeline-logo {
    right: 0;
    transform: translateX(50%);
}
.timeline-item:nth-child(odd) .timeline-logo {
    left: 0;
    transform: translateX(-50%);
}
/* --- END OF FIX --- */

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.timeline-header h3 {
    margin: 0;
    line-height: 1.3;
}
.timeline-date {
    color: var(--secondary-text);
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
    padding-left: 1rem;
    opacity: 0.8;
}
.timeline-content ul {
    list-style: none;
    padding: 0;
}
.timeline-content ul li {
    margin-bottom: 0.5rem;
    color: var(--secondary-text);
}
.timeline-logo {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: #FFFFFF;
    border: 3px solid var(--primary-bg);
    top: 0;
    border-radius: 50%;
    z-index: 1;
    object-fit: contain;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .timeline {
        /* Change to 2 columns: a small column for the line, and a fluid column for content */
        grid-template-columns: 20px 1fr;
        max-width: 100%; /* Allow it to take full width within container on mobile */
    }

    /* This is the line */
    .timeline-line {
        /* Position the line in the first column */
        grid-column: 1;
        left: initial; /* Remove previous left positioning */
        transform: none; /* Remove previous transform */
        justify-self: center; /* Keep it centered within its 20px column */
        top: 0; /* Adjust top and bottom to span the full height of the timeline */
        bottom: 0;
    }

    .timeline-item {
        /* All items go into the second column */
        grid-column: 2;
        padding: 0 0 2rem 1rem; /* Adjust padding: remove left padding from timeline-item, add to timeline-content */
        margin-left: 0; /* Ensure no extra margin from general timeline-item styles */
    }

    /* Remove specific column assignments for odd/even on mobile */
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        grid-column: 2; /* All items in the second column */
    }

    .timeline-content {
        margin: 0 0 0 1rem; /* Adjust margin to create space after the logo/line */
        /* You might want to remove the 'relative' if not needed, as it can sometimes interfere */
        position: static;
    }

    /* Position all logos to the left of their content, on the line */
    .timeline-logo,
    .timeline-item:nth-child(odd) .timeline-logo,
    .timeline-item:nth-child(even) .timeline-logo {
        left: -10px; /* Adjust this value to align with your line's center */
        transform: translateX(-50%); /* Keep this to center on the line */
        /* Make sure it's positioned relative to the .timeline-item, not a fixed position on the page */
        position: absolute;
    }

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

    .timeline-date {
        padding-left: 0;
        margin-top: 0.25rem;
    }

    /* Optional: Adjust font sizes or other elements for better mobile readability */
    h2 { font-size: 2rem; }
    .main-header { flex-direction: column; gap: 1rem; }
    .main-header nav a { margin: 0 0.5rem; }
    .skills-container, .project-grid { grid-template-columns: 1fr; }
}

/* --- Skills Section --- */
.skills-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}
.skill-category h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}
.skill-category p {
    color: var(--primary-text);
}


/* --- Projects Page --- */
.projects-main {
    padding: 2rem 0;
}
.projects-header {
    text-align: center;
    padding-bottom: 4rem;
}
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Flip Card */
.flip-card {
    background-color: transparent;
    aspect-ratio: 4 / 3;
    perspective: 1000px;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.flip-card-front {
    background-color: var(--box-bg);
}
.flip-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}
.flip-card-front h3 {
    position: absolute;
    font-size: 1.5rem;
    color: #061187;
}
.flip-card-back {
    background-color: var(--accent);
    color: var(--primary-bg);
    transform: rotateY(180deg);
    padding: 1.5rem;
    box-sizing: border-box;
}
.flip-card-back h3 {
    margin-bottom: 1rem;
}
.flip-card-back p {
    font-size: 0.9rem;
}
.tags {
    margin-top: 1rem;
}
.tags span {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.8rem;
    margin: 0.2rem;
}

/* --- Footer --- */
.main-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--secondary-text);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

@media (max-width: 768px) {
    h2 { font-size: 2rem; }
    .main-header { flex-direction: column; gap: 1rem; }
    .main-header nav a { margin: 0 0.5rem; }
    .skills-container, .project-grid { grid-template-columns: 1fr; }
}

/* --- Passions Page --- */

.passions-main {
    padding: 2rem 0;
}

.passions-header {
    text-align: center;
    padding-bottom: 4rem;
}

.passions-header h1 {
    font-size: 3.5rem;
}

.passion-content-box {
    max-width: 800px;
    margin: 2rem auto 3rem auto;
    text-align: center;
}

.passions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.passions-grid figure {
    margin: 0;
    background: var(--box-bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.passions-grid img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
}

.passions-grid figcaption {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--secondary-text);
    text-align: center;
}

.cat-grid img {
    height: 450px; /* A bit taller for the cats */
}

blockquote {
    max-width: 600px;
    margin: 3rem auto;
    padding-left: 2rem;
    border-left: 4px solid var(--accent);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--secondary-text);
}

blockquote footer {
    margin-top: 1rem;
    font-style: normal;
    font-weight: 600;
    color: var(--primary-text);
}

.audio-container {
    background: var(--box-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    max-width: 700px;
    margin: 1.5rem auto;
    text-align: center;
}

.audio-container p {
    margin-bottom: 1rem;
    font-weight: 600;
}

.audio-container audio {
    width: 100%;
}

.poem-container {
    background: var(--box-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 2rem;
    max-width: 800px;
    margin: 2rem auto;
}

.poem-container h3 {
    color: var(--accent);
    text-align: center;
}

.poem-container pre {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--secondary-text);
    margin-top: 1rem;
    text-align: center;
}
