:root {
    --primary-color: #3500D3;
    --secondary-color: #240090;
    --background-color: #050510;
    /* Deep Space Blue/Black */
    --text-color: #ffffff;
    --light-color: rgba(56, 56, 56, 0.4);
    /* Glassmorphism Base */
    --dark-color: rgba(17, 17, 17, 0.8);
    --header-color: rgba(25, 25, 25, 0.8);
    --glass-blur: 10px;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    background: radial-gradient(circle at center, #0a0a20 0%, #000000 100%);
    color: var(--text-color);
    overflow-x: hidden;
    /* Prevent horizontal scroll from 3D canvas if any */
}

/* --- 3D Background Canvas --- */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    /* Allow clicking through to content */
}

.container {
    max-width: 1100px;
    margin: auto;
    overflow: visible;
    /* Changed from hidden to allow proper stacking */
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    text-shadow: 0 0 10px rgba(53, 0, 211, 0.5);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

header {
    background: var(--header-color);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-bottom: var(--glass-border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: auto;
    padding: 1rem 2rem;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-color);
}

#hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-color);
    background: transparent;
    /* Removed image, showing 3D background */
}

#hero .profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 5px solid var(--primary-color);
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(53, 0, 211, 0.4);
}

#hero h1 {
    font-size: 4rem;
}

#hero p {
    font-size: 1.5rem;
}

section {
    /* transform: translateY(50px); */
    /* transition: opacity 0.6s ease-out, transform 0.6s ease-out; */
    /* GSAP takes over */
    position: relative;
    /* Ensure positioning context */
}

/* section.visible {
    opacity: 1;
    transform: translateY(0);
} */

.about-text-row {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* --- Scroll Down Indicator --- */
.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 10;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-color);
    border-radius: 20px;
    position: relative;
    margin-bottom: 5px;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 1.5s infinite;
}

@keyframes scrollWheel {
    0% {
        top: 10px;
        opacity: 1;
    }

    100% {
        top: 30px;
        opacity: 0;
    }
}


.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.timeline {
    position: relative;
    max-width: 1000px;
    /* Increased width for snake layout */
    margin: 0 auto 6rem auto;
    padding-top: 2rem;
}

/* SVG Winding Path Container */
.winding-path-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: visible;
    /* Important: allow curve to go slightly outside if needed */
}

#winding-path {
    stroke: var(--primary-color);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 10, 10;
}

/* Old line removed */

.timeline-item {
    padding: 25px;
    position: relative;
    background-color: var(--light-color);
    width: 40%;
    /* Each item takes less than half width */
    border-radius: 15px;
    /* Softer corners */
    border: var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 6rem;
    /* More spacing for the curve */
    z-index: 2;
    /* Ensure above SVG */
    display: flex;
    flex-direction: column;
}

/* Year Badge inside card */
.year-badge {
    display: inline-block;
    align-self: flex-start;
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Staggered Layout (Desktop) */
.timeline-item:nth-child(odd) {
    margin-left: 5%;
    /* Shift from left edge */
    text-align: left;
    /* Reset text align, keep it clean */
    align-items: flex-start;
}

.timeline-item:nth-child(even) {
    margin-left: 55%;
    /* Shift to right side */
    text-align: left;
    align-items: flex-start;
}


/* Remove the old dots */
.timeline-item::after {
    display: none;
}

.achievements-carousel-container {
    position: relative;
    max-width: 90%;
    margin: 0 auto;
    overflow: hidden;
    padding-bottom: 10px;
}

.achievements-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    line-height: 1;
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

.card {
    background: var(--light-color);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    min-width: 300px;
    margin: 0 1rem;
    opacity: 0.5;
    transform: scale(0.9);
}

.card.active {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.card img {
    width: 100%;
    cursor: pointer;
}

.card-content {
    padding: 1.5rem;
}

.skills-container {
    display: flex;
    gap: 4rem;
}

.skills-column {
    flex: 1;
}

.skill p {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.skill-bar {
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.skill-level {
    height: 20px;
    background: var(--primary-color);
    width: 0;
    transition: width 1.5s ease-in-out;
}

#contact p {
    text-align: center;
}

#contact ul {
    list-style: none;
    text-align: center;
}

#contact ul li {
    font-size: 1.2rem;
    margin: 1rem 0;
}

#contact a {
    color: var(--primary-color);
    text-decoration: none;
}

footer {
    text-align: center;
    padding: 2rem;
    background: var(--dark-color);
    backdrop-filter: blur(var(--glass-blur));
    color: var(--light-color);
    border-top: var(--glass-border);
}

/* --- Contact Form Styles --- */
#contact-form {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--light-color);
    backdrop-filter: blur(var(--glass-blur));
    border-radius: 15px;
    border: var(--glass-border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    background-color: var(--light-color);
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

#contact-form textarea {
    resize: vertical;
}

.btn-submit {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-color);
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-submit:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-submit:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

#form-status {
    text-align: center;
    margin: 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

#form-status.success {
    color: green;
}

#form-status.error {
    color: red;
}

.contact-links {
    list-style: none;
    text-align: center;
    padding-left: 0;
    margin-top: 3rem;
}

.contact-links li {
    font-size: 1.2rem;
    margin: 1rem 0;
}

.contact-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.project-carousel-container {
    position: relative;
    max-width: 90%;
    margin: 0 auto;
    overflow: hidden;
    padding-bottom: 10px;
}

.project-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.project-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    line-height: 1;
}

.project-button.prev {
    left: 10px;
}

.project-button.next {
    right: 10px;
}

.project-card {
    background: var(--light-color);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    min-width: 700px;
    margin: 0 1rem;
    opacity: 0.5;
    transform: scale(0.9);
}

.project-card.active {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 8px 20px rgba(56, 56, 56, 0.2);
}

.project-card img {
    width: 100%;
    cursor: pointer;
}

.project-card-content {
    padding: 1.5rem;
}

.project-card-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.project-pitch {
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 1rem;
    flex-grow: 1;
    /* Drückt den Rest nach unten */
}

.project-card-content h4 {
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.project-more {
    background: none;
    border: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem 0;
    align-self: flex-start;
    /* Button linksbündig */
    text-align: left;
}

.project-more:hover {
    text-decoration: underline;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.tech-tags span {
    background-color: #0075b6;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-links {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.project-link-btn {
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.project-link-btn.github {
    background-color: var(--dark-color);
    color: var(--text-color);
}

.project-link-btn.github:hover {
    background-color: #495057;
}

.project-link-btn.live {
    background-color: var(--primary-color);
    color: var(--text-color);
}

.project-link-btn.live:hover {
    background-color: #2378d3;
}

/* --- Mobile Navigation & Responsive Design --- */
.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .line {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px;
    transition: all 0.3s ease;
}

@media screen and (max-width: 1024px) {

    /* Navigation */
    body {
        overflow-x: hidden;
    }

    .nav-links {
        position: fixed;
        right: 0px;
        height: 100vh;
        top: 0;
        background-color: var(--secondary-color);
        background: rgba(17, 17, 17, 0.98);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        transform: translateX(100%);
        transition: transform 0.4s ease-in;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        z-index: 999;
    }

    .hamburger {
        display: block;
        z-index: 1001;
        position: relative;
        padding: 15px;
    }

    .nav-links li {
        opacity: 0;
        margin: 1.5rem 0;
    }

    .nav-links li a {
        font-size: 1.5rem;
    }

    nav {
        justify-content: space-between;
        padding: 1rem 2rem;
    }

    /* Hero */
    #hero h1 {
        font-size: 2.5rem;
    }

    #hero p {
        font-size: 1.2rem;
    }

    /* Layout Adjustments */
    .container {
        padding: 4rem 1.5rem;
    }

    /* Timeline - Mobile/Tablet (Left-aligned line) */
    /* Timeline - Mobile/Tablet (Stacked) */
    .timeline {
        margin: 0 auto 3rem auto;
        padding-top: 0;
    }

    /* Hide complex winding path on mobile */
    .winding-path-svg {
        display: none;
    }

    /* Restore a simple vertical line for mobile */
    .timeline::before {
        content: '';
        position: absolute;
        left: 50%;
        /* Center the line */
        transform: translateX(-50%);
        top: 0;
        bottom: 0;
        width: 4px;
        background: var(--primary-color);
        z-index: 1;
    }

    .timeline-item {
        width: 100%;
        margin-left: 0 !important;
        /* Reset margins */
        margin-right: 0 !important;
        margin-bottom: 2rem;
        padding-left: 20px;
        padding-right: 20px;
        text-align: center;
        /* Center text for mobile */
        align-items: center;
        /* Center content */
        z-index: 2;
        /* Sit on top of the line */

        /* Reset Card Style if needed, but keeping the card look is good */
        backdrop-filter: blur(var(--glass-blur));
        border: var(--glass-border);
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        text-align: left;
        margin-left: 0;
    }

    .timeline-item::after {
        right: auto !important;
        left: -10px !important;
        /* Center on the line (20px left) -> 20 - 30 = -10 */
        top: 10px !important;
    }

    /* Ensure odd items also have dot on left */
    .timeline-item:nth-child(odd)::after {
        right: auto;
        left: -10px !important;
    }

    .timeline-item:nth-child(even)::after {
        left: -10px !important;
    }

    /* Skills */
    .skills-container {
        flex-direction: column;
        gap: 2rem;
    }

    /* Projects */
    .project-card {
        min-width: 85vw;
        margin: 0 0.5rem;
    }

    .project-card-content h3 {
        font-size: 1.5rem;
    }

    .project-pitch {
        font-size: 0.95rem;
    }

    /* Contact */
    #contact-form {
        padding: 1.5rem;
    }

    /* Ensure no overflow */
    html,
    body {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

.nav-active {
    transform: translateX(0%);
}

@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0px);
    }
}

/* Burger Animation Classes */
.toggle .line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line:nth-child(2) {
    opacity: 0;
}

.toggle .line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}