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

:root {
    --baltic-blue: #22577aff;
    --tropical-teal: #38a3a5ff;
    --emerald: #57cc99ff;
    --light-green: #80ed99ff;
    --tea-green: #c7f9ccff;

    --primary-color: var(--tropical-teal);
    --secondary-color: var(--baltic-blue);
    --text-color: #333;
    --light-bg: var(--tea-green);
    --light-grey: #dadada;
    --dark-grey: #2d2d2d;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

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

/* Navigation */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: all 0.3s ease;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--baltic-blue) 0%, var(--tropical-teal) 100%);
    color: var(--white);
    height: 100vh;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#neural-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* About Section */
.about {
    padding: 80px 0;
    background: var(--white);
}

.about h2,
.projects h2,
.skills h2,
.contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    box-shadow: var(--shadow);
}

.about-text p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Projects Section */
.projects {
    padding: 80px 0;
    background: var(--white);
}

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

.project-card {
    background: var(--light-grey);
    border-radius: 0;
    overflow: visible;
    box-shadow: var(--shadow);
    position: relative;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card .btn {
    margin: 1rem auto 1.5rem;
    align-self: center;
}

.project-card::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 12px;
    background: var(--baltic-blue);
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-card h3 {
    padding: 1.5rem 1.5rem 0.5rem;
    color: var(--primary-color);
}

.project-card p {
    padding: 0.5rem 1.5rem;
    color: #666;
    flex: 1;
}


/* Skills Section */
.skills {
    padding: 80px 0;
    background: var(--light-bg);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-item {
    background: var(--light-grey);
    padding: 2rem;
    border-radius: 0;
    text-align: center;
    box-shadow: var(--shadow);

    position: relative;
}

.skill-item::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 12px;
    background: var(--baltic-blue);
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.skill-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.skill-item p {
    color: #666;
    line-height: 1.8;
}

.skill-bar-group {
    margin-top: 1rem;
    text-align: left;
}

.skill-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.skill-bar {
    background: #e0e0e0;
    height: 8px;
    width: 100%;
}

.soft-skills {
    margin-top: 3rem;
    background: var(--light-grey);
    padding: 2rem;
    padding-bottom: 3rem;
    box-shadow: var(--shadow);
    position: relative;
}

.soft-skills::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 12px;
    background: var(--baltic-blue);
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
}


.soft-skills h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.soft-skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.soft-skill-tag {
    background: var(--light-grey);
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    flex: 1 1 calc(33% - 0.75rem);
    text-align: center;
    box-shadow: var(--shadow);
}

.skill-bar-fill {
    height: 100%;
    background: var(--tropical-teal);
}

/* Lifeline Preview (home page) */
.lifeline-preview {
    padding: 80px 0 0 0;
    background: var(--tea-green);
    overflow: hidden;
}

.lifeline-preview-content {
    display: flex;
    align-items: flex-end;
    gap: 4rem;
}

.lifeline-preview-text {
    flex: 1;
    padding-bottom: 80px;
}

.lifeline-preview-text {
    flex: 1;
}

.lifeline-preview-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.lifeline-preview-text p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
}

.lifeline-preview-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.lifeline-route-img {
    max-width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
}

.lifeline-visual-track {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.lifeline-visual-track::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--baltic-blue);
}

.lifeline-visual-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
}

.lifeline-visual-dot {
    width: 14px;
    height: 14px;
    background: var(--tropical-teal);
    border: 3px solid var(--baltic-blue);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.lifeline-visual-box {
    background: var(--white);
    border-bottom: 3px solid var(--baltic-blue);
    padding: 0.3rem 0.8rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--baltic-blue);
    box-shadow: var(--shadow);
    flex: 1;
    text-align: center;
}

.lifeline-visual-spacer {
    flex: 1;
}

/* Lifeline Section */
.lifeline {
    padding: 80px 0;
    background: var(--light-grey);
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--baltic-blue);
}

.timeline-item {
    position: relative;
    display: flex;
    margin-bottom: 3rem;
}

.timeline-item:nth-child(odd) {
    justify-content: flex-start;
    padding-right: calc(50% + 2rem);
}

.timeline-item:nth-child(even) {
    justify-content: flex-end;
    padding-left: calc(50% + 2rem);
}

.timeline-year {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    z-index: 1;
    min-width: 64px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    background: var(--baltic-blue);
    padding: 0.4rem 0.5rem;
    text-align: center;
}

.timeline-content {
    background: var(--tea-green);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    flex: 1;
    position: relative;
}

.timeline-content::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 12px;
    background: var(--baltic-blue);
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.timeline-content h3 {
    color: var(--baltic-blue);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.timeline-content p {
    color: #444;
    line-height: 1.6;
}

.timeline-item--start {
    padding: 0 !important;
    min-height: 70px;
}

.timeline-item--start .timeline-year {
    line-height: 1.8;
}

/* Contact Section */
.contact {
    padding: 80px 0;
    text-align: center;
}

.contact p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #666;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    background: var(--baltic-blue);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Nav */
    .nav-toggle {
        display: flex;
    }

    .nav-content {
        flex-wrap: wrap;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0.5rem 0 1rem;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li a {
        display: block;
        padding: 0.6rem 0;
        border-bottom: 1px solid #eee;
    }

    /* Hero */
    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* About */
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-img {
        margin: 0 auto;
        width: 150px;
        height: 150px;
    }

    /* About page flex layout */
    .about [style*="display: flex"] {
        flex-direction: column;
    }

    .about [style*="width:25%"] {
        width: 150px !important;
        margin: 0 auto;
    }

    /* Grids */
    .projects-grid,
    .skills-grid {
        grid-template-columns: 1fr;
    }

    /* Soft skills */
    .soft-skill-tag {
        flex: 1 1 calc(50% - 0.75rem);
    }

    /* Lifeline preview */
    .lifeline-preview-content {
        flex-direction: column;
        align-items: center;
    }

    .lifeline-preview-text {
        padding-bottom: 2rem;
        text-align: center;
    }

    .lifeline-route-img {
        max-height: 220px;
        width: 100%;
    }

    /* Timeline */
    .timeline::before {
        left: 20px;
        transform: none;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        justify-content: flex-end;
        padding-left: 60px;
        padding-right: 0;
    }

    .timeline-year {
        left: 0;
        transform: none;
    }

    .timeline-item--start {
        padding-left: 0 !important;
        justify-content: flex-start;
    }

    /* Contact */
    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        display: block;
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        font-size: 0.8rem;
        gap: 0.4rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .about h2,
    .projects h2,
    .skills h2,
    .contact h2,
    .lifeline h2 {
        font-size: 1.8rem;
    }

    .soft-skill-tag {
        flex: 1 1 100%;
    }
}
