/* --- CSS Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- CSS Variables for Theming --- */
:root {
    --font-sans: 'Inter', sans-serif;
    --background-light: #F9F9F9;
    --text-primary-light: #111827;
    --text-secondary-light: #6B7280;
    --accent-light: #4F46E5;
    --border-light: #E5E7EB;
    --card-bg-light: #FFFFFF;
    --background-dark: #121212;
    --text-primary-dark: #E5E7EB;
    --text-secondary-dark: #9CA3AF;
    --accent-dark: #818CF8;
    --border-dark: #374151;
    --card-bg-dark: #1E1E1E;
}

.dark-theme {
    --background: var(--background-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --accent: var(--accent-dark);
    --border: var(--border-dark);
    --card-bg: var(--card-bg-dark);
}

body {
    --background: var(--background-light);
    --text-primary: var(--text-primary-light);
    --text-secondary: var(--text-secondary-light);
    --accent: var(--accent-light);
    --border: var(--border-light);
    --card-bg: var(--card-bg-light);

    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header & Navigation --- */
header {
    padding: 40px 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.theme-toggle-button {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.theme-toggle-button:hover {
    background-color: var(--card-bg);
}

.theme-toggle-button .moon-icon { display: none; }
.theme-toggle-button .sun-icon { display: block; }
.dark-theme .theme-toggle-button .moon-icon { display: block; }
.dark-theme .theme-toggle-button .sun-icon { display: none; }

/* --- Sticky Scrolling Effect --- */
.scroll-container > .sticky-section {
    position: -webkit-sticky; /* For Safari */
    position: sticky;
    top: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--background); /* Match body background */
}

/* --- General Section Styling --- */
section {
    padding: 60px 0;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

/* --- Hero Section --- */
.hero-section {
    min-height: 80vh; /* Adjust height for the first section */
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
}

.status {
    display: inline-flex;
    align-items: center;
    margin-top: 2rem;
    padding: 8px 16px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: #10B981;
    border-radius: 50%;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --- Heartbeat Line Animation --- */
.heartbeat-line {
    margin-top: 3rem;
    width: 100%;
    max-width: 400px;
}

.heartbeat-line svg path {
    stroke-dasharray: 150; /* Total length of the path */
    stroke-dashoffset: 150; /* Start with the path hidden */
    animation: draw-line 2s ease-out forwards 0.5s; /* Animation effect */
}

@keyframes draw-line {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- Journey Timeline Section (Horizontal) --- */
.journey-intro {
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 3rem;
}

.timeline-horizontal {
    display: flex;
    gap: 20px;
    padding: 20px 10px;
    /* Enable horizontal scrolling */
    overflow-x: auto;
    /* Adds a nice scroll snapping effect */
    scroll-snap-type: x mandatory;
    /* Hides the scrollbar but keeps it functional */
    scrollbar-width: none; /* For Firefox */
}

/* Hide scrollbar for Chrome, Safari, and Opera */
.timeline-horizontal::-webkit-scrollbar {
    display: none;
}

.timeline-item-h {
    /* Each item will be a flex column */
    display: flex;
    flex-direction: column;
    /* Set a minimum width for each card */
    flex: 0 0 300px;
    scroll-snap-align: center;
    position: relative;
    padding-top: 40px; /* Space for the date above */
}

/* The horizontal connecting line */
.timeline-item-h::before {
    content: '';
    position: absolute;
    left: -20px; /* Start from the previous item's gap */
    right: -20px; /* Extend to the next item's gap */
    top: 10px;
    height: 2px;
    background-color: var(--border);
}

/* Remove the line for the very first item */
.timeline-item-h:first-child::before {
    left: 0;
}
/* Remove the line for the very last item */
.timeline-item-h:last-child::before {
    right: 0;
}

/* The circle on the timeline */
.timeline-item-h::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 4px; /* Position circle on the line */
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 3px solid var(--background);
    z-index: 1;
}

.timeline-date-h {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Make the container span the full width of the card */
    transform: none; /* Remove the horizontal transform */
    text-align: center; /* Center the text inside the new full-width container */
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.timeline-content-h {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    height: 100%;
}

.timeline-content-h h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.timeline-company-h {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.timeline-description-h {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Skills Section --- */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-tag:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--accent);
    color: var(--accent);
}

.dark-theme .skill-tag:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Add a transition for a smooth animation */
.timeline-content-h {
    /* ...keep all existing styles... */
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

/* Define the hover effect */
.timeline-item-h:hover .timeline-content-h {
    transform: translateY(-8px); /* Lifts the card up */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Add a specific shadow for dark mode */
.dark-theme .timeline-item-h:hover .timeline-content-h {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* --- Work Section --- */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.work-card {
    background-color: transparent; /* Make background transparent for effect */
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.work-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(400px circle at var(--mouse-x, 0px) var(--mouse-y, 0px), var(--accent), transparent 40%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease-out;
    z-index: 0;
}

.work-card::after {
    content: "";
    position: absolute;
    left: 1px;
    top: 1px;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    background: var(--card-bg);
    border-radius: inherit;
    z-index: 1;
}

.work-card:hover::before {
    opacity: 1;
}

.work-card > * {
    position: relative;
    z-index: 2;
}

.work-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.work-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.work-tags {
    display: flex;
    gap: 8px;
}

.work-tags span {
    background-color: var(--border);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- Footer Section --- */
.footer-section {
    text-align: center;
    padding: 60px 0;
    background-color: var(--background);
}

.footer-section p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 1.5rem auto;
}

.email-link {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.email-link:hover {
    opacity: 0.8;
}

.socials {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.socials a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.socials a:hover {
    color: var(--accent);
}

.copyright {
    margin-top: 3rem;
    font-size: 0.9rem;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.75rem; }

    .nav-links { display: none; } /* Simple hide for mobile, can be replaced with a menu icon */

    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .timeline-date {
        padding-top: 0;
    }
}

/* --- Interests Page Specific --- */
.interests-content ul {
    list-style-position: inside;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* --- Animate on Scroll --- */
/* Elements start as invisible and slightly moved down */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* When the 'visible' class is added by JS, they fade in to place */
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Interests Page Specific Styles --- */
.interests-page {
    text-align: center;
    padding-bottom: 100px; /* More space at the bottom */
}

.interests-intro {
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem auto;
    font-size: 1.1rem;
}

.interests-grid-chaos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center items initially */
    align-items: center;
    gap: 15px; /* Spacing between buttons */
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.interest-tag-chaos {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 30px; /* More rounded, pill-like shape */
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: default; /* Not clickable */
    user-select: none; /* Prevent text selection */
    /* Add subtle initial rotation for chaos */
    transform: rotate(calc(var(--random-rotate) * 1deg));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dark-theme .interest-tag-chaos {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.interest-tag-chaos:hover {
    transform: translateY(-5px) scale(1.05) rotate(calc(var(--random-rotate) * 1deg)); /* Lift and slightly enlarge */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background-color: var(--accent); /* Highlight on hover */
    color: white; /* Text white on accent background */
    border-color: var(--accent);
}

.dark-theme .interest-tag-chaos:hover {
     box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* --- About Page Specific Styles --- */
.about-page-content {
    padding-top: 80px;
    padding-bottom: 80px;
}

#about-bio p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

#about-bio p:first-child {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.about-image-placeholder {
    width: 200px;
    height: 200px;
    background-color: var(--border);
    border-radius: 50%;
    margin: 4rem auto 2rem auto;
}