:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background-color: #f8f9fa;
    --text-color: #333;
    --light-gray: #e0e0e0;
    --dark-gray: #555;
    --white: #fff;
    --black: #000;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --nav-bg-light: rgba(255, 255, 255, 0.85);
    --nav-bg-dark: rgba(30, 30, 30, 0.85);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #3498db;
        --secondary-color: #9b59b6;
        /*--secondary-color: #e67e22;*/
        --background-color: #121212;
        --text-color: #e0e0e0;
        --light-gray: #333;
        --dark-gray: #aaa;
        --white: #1e1e1e;
        --black: #f0f0f0;
        --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ====================== */
/* Enhanced Navigation Bar */
/* ====================== */
.nav {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    width: auto;
    min-width: 300px;
    background-color: var(--nav-bg-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 50px;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    background-color 0.3s ease;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

@media (prefers-color-scheme: dark) {
    .nav {
        background-color: var(--nav-bg-dark);
        border: 1px solid rgba(0, 0, 0, 0.18);
    }
}

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

.nav__list {
    display: flex;
    flex-direction: row;
    list-style: none;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav__list li {
    margin: 0;
}

.nav__list a {
    color: var(--primary-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    display: block;
    border-radius: 50px;
    transition: var(--transition);
}

.nav__list a:hover {
    background-color: rgba(var(--primary-color), 0.1);
    color: var(--primary-color);
}

/* Enhanced Burger Menu */
.burger__container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1100;
    cursor: pointer;
    background-color: var(--nav-bg-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: background-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .burger__container {
        background-color: var(--nav-bg-dark);
    }
}

.burger {
    width: 24px;
    height: 18px;
    position: relative;
}

.burger__meat {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.burger__meat--1 {
    top: 0;
}

.burger__meat--2 {
    top: 50%;
    transform: translateY(-50%);
}

.burger__meat--3 {
    bottom: 0;
}

.burger.active .burger__meat--1 {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger.active .burger__meat--2 {
    opacity: 0;
}

.burger.active .burger__meat--3 {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============== */
/* Enhanced Hero Section */
/* ============== */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.9) 0%, rgba(52, 152, 219, 0.8) 100%);
}

/* Parallax effect for hero section */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/clean_cosmology.jpg') center/cover no-repeat;
    opacity: 0.1;
    z-index: 1;
    animation: parallax 20s linear infinite;
}

@keyframes parallax {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 2000px;
    margin: 0 auto;
    z-index: 2;
}

@media (min-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: left;
    }
}

.hero-text {
    flex: 1;
    padding: 2rem;
    animation: fadeInUp 1s ease-out;
}

.hero-section h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 400;
    max-width: 800px;
    margin-bottom: 2rem;
    color: rgba(255,255,255,0.9);
}

.hero-subtitle a {
    color: white;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.hero-subtitle a:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/*.float-container {*/
/*    flex: 1;*/
/*    position: relative;*/
/*    min-height: 300px;*/
/*    width: 100%;*/
/*    max-width: 500px;*/
/*    margin: 2rem auto;*/
/*    height: 100%;*/
/*    top: 0;*/
/*    left: 0;*/
/*}*/

/*.floating-element {*/
/*    position: absolute;*/
/*    font-size: 1.5rem;*/
/*    opacity: 0.7;*/
/*    animation: float 8s ease-in-out infinite;*/
/*}*/

/*.element-1 {*/
/*    top: 20%;*/
/*    left: 5%;*/
/*    animation-delay: 0s;*/
/*}*/

/*.element-2 {*/
/*    top: 60%;*/
/*    left: 80%;*/
/*    animation-delay: 2s;*/
/*}*/

/*.element-3 {*/
/*    top: 30%;*/
/*    left: 70%;*/
/*    animation-delay: 4s;*/
/*}*/

/*@keyframes float {*/
/*    0%, 100% {*/
/*        transform: translateY(0) rotate(0deg);*/
/*    }*/
/*    50% {*/
/*        transform: translateY(-20px) rotate(5deg);*/
/*    }*/
/*}*/

@media (prefers-color-scheme: dark) {
    .hero-section {
        background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(52, 152, 219, 0.8) 100%);
    }
}

/* ============== */
/* Content Sections */
/* ============== */
section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

section.in-view {
    opacity: 1;
    transform: translateY(0);
}

section.in-view h2,
section.in-view h3,
section.in-view p,
section.in-view .card {
    animation: fadeInUp 0.6s ease-out forwards;
}

section.in-view h2 { animation-delay: 0.1s; }
section.in-view h3 { animation-delay: 0.2s; }
section.in-view p { animation-delay: 0.3s; }
section.in-view .card { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============== */
/* About Section */
/* ============== */
.about-section {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1000px;
    width: 90%;
}

.about-section p {
    font-size: 1.2rem;
    line-height: 1.8;

}


/* Highlights Section */
.highlights-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.highlights-container {
    position: relative;
    margin: 0 auto;
    max-width: 100%;
    overflow: hidden;
}

.highlights-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(270deg, var(--background-color) 20%, transparent);
}

.highlights-scroller {
    display: flex;
    gap: 2rem;
    padding: 1rem 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.highlights-scroller::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.highlights-scroller .card {
    flex: 0 0 calc(33.333% - 1.33rem); /* 3 cards per view with gap */
    scroll-snap-align: start;
    min-width: 300px; /* Minimum card width */
    animation: none; /* Remove the initial animation */
    opacity: 1; /* Make sure cards are visible */
    transform: none; /* Reset any transforms */
}

/* Scroll buttons */
/* Hide left scroll button by default */
.scroll-button.scroll-left {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Show left button when scrolled */
.highlights-container.scrolled .scroll-button.scroll-left {
    opacity: 0.8;
    pointer-events: auto;
}

/* Scroll button styling */
.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--primary-color);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.scroll-button:hover {
    opacity: 1;
    background-color: var(--secondary-color);
    color: var(--white);
}

.scroll-left {
    left: 10px;
}

.scroll-right {
    right: 10px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .highlights-scroller .card {
        flex: 0 0 calc(50% - 1rem); /* 2 cards per view on medium screens */
    }
}

@media (max-width: 768px) {
    .highlights-scroller .card {
        flex: 0 0 calc(100% - 1rem); /* 1 card per view on small screens */
    }

    .scroll-button {
        display: none; /* Hide buttons on mobile */
    }

    .highlights-scroller {
        overflow-x: auto; /* Always show scrollbar on mobile */
    }
}

/* ============== */
/* Project Cards */
/* ============== */
.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

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

.card h3 {
    padding: 0 1rem;
    margin-top: 1rem;
}

.card p {
    padding: 0 1rem 1rem;
    color: var(--dark-gray);
}

/* ============== */
/* CV Section */
/* ============== */
.cv-section {
    text-align: center;
    margin: 4rem auto;
}

.cv-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.cv-button {
    margin: 0 0.5rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--secondary-color);
    color: var(--white);
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
}

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

.cv-image img {
    max-width: 70%;
    height: auto;
    border-radius: 5px;
    box-shadow: var(--shadow);
    margin-top: 1rem;
}

/* ============== */
/* Footer */
/* ============== */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.social-icons__link {
    margin: 0 0.5rem;
}

.social-icons__icon {
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: invert(1);
    opacity: 0.8;
    transition: var(--transition);
}

.social-icons__link:hover .social-icons__icon {
    opacity: 1;
}

/* ============== */
/* Back to Top Button */
/* ============== */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: none;
    z-index: 999;
    transition: var(--transition);
}

#back-to-top:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

/* ============== */
/* Typed.js cursor */
/* ============== */
.typed-cursor {
    opacity: 1;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

/* ============== */
/* Responsive Design */
/* ============== */
@media (min-width: 768px) {
    .nav {
        transform: translateX(-50%) translateY(0);
        width: auto;
        max-width: 90%;
    }

    .nav__list {
        flex-wrap: nowrap;
        gap: 0;
    }

    .burger__container {
        display: none;
    }

    .hero-section h1 {
        font-size: 4rem;
    }

    .hero-section h2 {
        font-size: 2rem;
    }
}

@media (min-width: 992px) {
    .nav {
        padding: 0.5rem 1.5rem;
    }

    .nav__list a {
        padding: 0.5rem 1.25rem;
    }

    .project-cards {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* ====================== */
/* Enhanced Typography and Links */
/* ====================== */
a {
    color: var(--secondary-color);
    text-decoration: none;
    position: relative;
    transition: var(--transition);
}

a:not(.nav__list a):not(.btn):not(.cta):not(.social-icons__link):hover {
    color: var(--primary-color);
}

/* Underline animation for regular links */
a:not(.nav__list a):not(.btn):not(.cta):not(.social-icons__link)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

a:not(.nav__list a):not(.btn):not(.cta):not(.social-icons__link):hover::after {
    width: 100%;
}

/* ====================== */
/* Enhanced Lists */
/* ====================== */
ul:not(.nav__list) {
    list-style: none;
    padding-left: 1.5rem;
    margin: 1rem 0;
}

ul:not(.nav__list) li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

ul:not(.nav__list) li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

ol {
    padding-left: 1.8rem;
    margin: 1rem 0;
}

ol li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

/* Delay animations for list items */
ul:not(.nav__list) li:nth-child(1),
ol li:nth-child(1) { animation-delay: 0.1s; }
ul:not(.nav__list) li:nth-child(2),
ol li:nth-child(2) { animation-delay: 0.2s; }
ul:not(.nav__list) li:nth-child(3),
ol li:nth-child(3) { animation-delay: 0.3s; }
ul:not(.nav__list) li:nth-child(4),
ol li:nth-child(4) { animation-delay: 0.4s; }
ul:not(.nav__list) li:nth-child(5),
ol li:nth-child(5) { animation-delay: 0.5s; }

/* ====================== */
/* Enhanced Navigation Bar Buttons */
/* ====================== */
.nav__list a {
    position: relative;
    overflow: hidden;
    color: var(--primary-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    display: block;
    border-radius: 50px;
    transition: var(--transition);
    z-index: 1;
}

.nav__list a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    z-index: -1;
    border-radius: 50px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.5, 1.6, 0.4, 0.7);
}

.nav__list a:hover {
    color: var(--white);
}

.nav__list a:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* ====================== */
/* Enhanced Buttons (CTA, CV buttons) */
/* ====================== */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--secondary-color);
    color: var(--white);
    font-weight: 600;
    transition: var(--transition);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.btn:hover::before {
    opacity: 0.9;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn:hover::after {
    animation: ripple 1s ease-out;
}

.cta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    /*margin: 0 0.5rem;*/
}

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

/* ====================== */
/* Card Animations */
/* ====================== */
.card {
    transform: perspective(1000px) rotateX(0) rotateY(0);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    animation: floatIn 0.6s ease forwards;
    opacity: 0;
}

/* Stagger card animations */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }
.card:nth-child(9) { animation-delay: 0.9s; }
.card:nth-child(10) { animation-delay: 1s; }

.card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg) translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* ====================== */
/* Section Entrance Animations */
/* ====================== */
section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

section.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ====================== */
/* Hero Section Animations */
/* ====================== */
.hero-section h1 {
    animation: fadeInDown 0.8s ease forwards;
}

.hero-section h2 {
    animation: fadeInUp 0.8s ease 0.3s forwards;
    opacity: 0;
}

.cta {
    animation: fadeInUp 0.8s ease 0.6s forwards;
    opacity: 0;
}

/* ====================== */
/* Keyframe Animations */
/* ====================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 1;
    }
    20% {
        transform: scale(25, 25);
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-7px);
    }
}

/* ====================== */
/* Interactive Elements */
/* ====================== */
.card img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.card:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* ====================== */
/* Scroll Animations */
/* ====================== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ====================== */
/* Responsive Adjustments */
/* ====================== */
@media (max-width: 768px) {
    .nav__list {
        flex-direction: column;
        padding: 1rem;
    }

    .nav__list a {
        width: 100%;
        text-align: center;
        margin: 0.25rem 0;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-section h2 {
        font-size: 1.25rem;
    }

    .project-cards {
        grid-template-columns: 1fr;
    }
}