:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --accent-color: #ffffff;
    --grid-color: rgba(255, 255, 255, 0.05);
    --line-color: rgba(255, 255, 255, 0.2);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Space Mono', monospace;
    min-height: 100vh;
    overflow-x: hidden;
    cursor: crosshair;
}

/* Grid Background */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -1;
    pointer-events: none;
}

/* Nav */
.back-nav {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    perspective: 1000px;
}

.back-nav a {
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 2px;
    opacity: 0.5;
    display: inline-block;
    will-change: transform;
    transform: translate(calc(var(--mouse-norm-x, 0) * 30px), calc(var(--mouse-norm-y, 0) * 30px)) rotateX(calc(var(--mouse-norm-y, 0) * -15deg)) rotateY(calc(var(--mouse-norm-x, 0) * 15deg));
    transition: opacity 0.3s ease, transform 0.1s ease-out;
}

.back-nav a:hover {
    opacity: 1;
}

/* Timeline Container */
.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px;
}

.timeline-header {
    text-align: center;
    margin-bottom: 80px;
    perspective: 1000px;
}

.header-title {
    font-family: 'Syncopate', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    display: inline-block;
    will-change: transform;
    transform: translate(calc(var(--mouse-norm-x, 0) * 40px), calc(var(--mouse-norm-y, 0) * 40px)) rotateX(calc(var(--mouse-norm-y, 0) * -10deg)) rotateY(calc(var(--mouse-norm-x, 0) * 10deg));
    transition: transform 0.1s ease-out;
}

.header-sub {
    font-size: 0.7rem;
    letter-spacing: 0.5em;
    opacity: 0.4;
    display: inline-block;
    will-change: transform;
    transform: translate(calc(var(--mouse-norm-x, 0) * 20px), calc(var(--mouse-norm-y, 0) * 20px)) rotateX(calc(var(--mouse-norm-y, 0) * -5deg)) rotateY(calc(var(--mouse-norm-x, 0) * 5deg));
    transition: transform 0.1s ease-out;
}

/* Timeline */
.timeline {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.timeline-line {
    position: absolute;
    width: 2px;
    background-color: var(--line-color);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item.left {
    left: 0;
    text-align: right;
}

.timeline-item.right {
    left: 50%;
    text-align: left;
}

.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    top: 40px;
    z-index: 10;
}

.left .timeline-dot {
    right: -8px;
}

.right .timeline-dot {
    left: -8px;
}

/* Project Card */
.project-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s ease, background 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.02);
}

.project-image {
    width: 100%;
    height: 200px;
    background: #111;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transform: translateZ(20px);
}

.project-info {
    transform: translateZ(40px);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    transition: filter 0.3s ease;
}

.project-card:hover .project-image img {
    filter: grayscale(0);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.project-title {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: var(--accent-color);
    margin-bottom: 0;
}

/* Progress Bar */
.project-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-label {
    font-size: 0.6rem;
    letter-spacing: 1px;
    opacity: 0.8;
}

.progress-bar {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--text-color);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    position: absolute;
    left: 0;
    top: 0;
}

.project-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.7;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.left .project-tags {
    justify-content: flex-end;
}

.project-tags span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    background: #222;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 1px;
}

.project-tags img {
    height: 14px;
    width: 14px;
    object-fit: contain;
}

/* Responsividad */

/* Tablets and Small Laptops */
@media screen and (max-width: 1200px) {
    .timeline-container {
        padding: 60px 20px;
    }

    .header-title {
        font-size: 2.5rem;
    }
}

/* Medium Tablets */
@media screen and (max-width: 1024px) {
    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 20px;
        text-align: left !important;
    }

    .timeline-item.right {
        left: 0;
    }

    .timeline-line {
        left: 20px;
    }

    .timeline-dot {
        left: 10px !important;
        right: auto !important;
    }

    .left .project-tags {
        justify-content: flex-start;
    }
}

/* Mobile Devices */
@media screen and (max-width: 768px) {
    .back-nav {
        top: 1rem;
        left: 1rem;
    }

    .header-title {
        font-size: 1.8rem;
    }

    .header-sub {
        font-size: 0.5rem;
        letter-spacing: 0.3em;
    }

    .project-card {
        padding: 20px;
    }

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

/* Small Mobile */
@media screen and (max-width: 480px) {
    .timeline-container {
        padding: 40px 10px;
    }

    .timeline-item {
        padding-left: 40px;
    }

    .timeline-line {
        left: 15px;
    }

    .timeline-dot {
        left: 5px !important;
    }
}