/* ==========================================================================
   Base Styles & Variables
   ========================================================================== */
:root {
    --bg-color: #050508;
    --text-primary: #f0f0f5;
    --text-secondary: #9aa0a6;
    --accent-gold: #d4af37;
    --accent-gold-dim: rgba(212, 175, 55, 0.4);
    --card-bg: rgba(15, 15, 20, 0.5);
    --card-border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --z-canvas: -2;
    --z-overlay: -1;
    --z-content: 10;
    --z-nav: 100;
    --z-preloader: 1000;
}

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

html {
    scroll-behavior: smooth;
    /* Hide scrollbar for cleaner look, but allow scrolling */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold-dim) var(--bg-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Train Canvas Background 
   ========================================================================== */
#trainCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: var(--z-canvas);
    pointer-events: none;
    /* Smooth scaling */
    image-rendering: high-quality;
    filter: saturate(1.3) contrast(1.1) brightness(1.1);
}

#canvasOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.7) 0%,
            /* Darker at top for white text/nav readability */
            rgba(0, 0, 0, 0.3) 15%,
            transparent 35%,
            /* Clear for the train */
            transparent 70%,
            rgba(0, 0, 0, 0.4) 100%);
    z-index: var(--z-overlay);
    pointer-events: none;
}

/* ==========================================================================
   Preloader
   ========================================================================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: var(--z-preloader);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease-out;
}

.loader-content {
    text-align: center;
    width: 250px;
}

.loader-train {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 1.5s infinite alternate ease-in-out;
}

.loader-text {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.loader-bar {
    width: 100%;
    height: 2px;
    background-color: var(--card-border);
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress {
    height: 100%;
    width: 0%;
    background-color: var(--accent-gold);
    box-shadow: 0 0 10px var(--accent-gold);
    transition: width 0.1s linear;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-10px);
    }
}

/* ==========================================================================
   Navigation
   ========================================================================== */
#mainNav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: var(--z-nav);
    transition: background-color 0.3s, backdrop-filter 0.3s, padding 0.3s;
}

#mainNav.scrolled {
    background-color: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 4rem;
    border-bottom: 1px solid var(--card-border);
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 2px;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-gold);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ==========================================================================
   Section & Scroll Container structure
   ========================================================================== */
#scrollContainer {
    position: relative;
    z-index: var(--z-content);
    overflow-x: hidden;
    /* Allow scrolling over the fixed canvas */
}

.section {
    min-height: 100vh;
    padding: 6rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    align-items: center;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-gold);
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(0, 0, 0, 0.5));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease 0.5s forwards;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: 6.5rem;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.7s forwards;
}

.hero-name-accent {
    background: linear-gradient(135deg, #FFDF73 0%, var(--accent-gold) 50%, #B8860B 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-style: italic;
    font-weight: 700;
    display: inline-block;
}

.hero-tagline {
    font-size: 1.35rem;
    color: #e0e0e0;
    max-width: 650px;
    margin: 0 auto 3rem auto;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease 0.9s forwards;
}

.hero-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease 1.1s forwards;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 1.8rem;
    background: rgba(15, 15, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hero-link:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 175, 55, 0.2);
    color: #fff;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeIn 1s ease 1.5s forwards;
}

.scroll-text {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.scroll-arrow {
    font-size: 1.5rem;
    color: var(--accent-gold);
    animation: bounceArrow 2s infinite ease-in-out;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes bounceArrow {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* ==========================================================================
   Timeline / Journey Section
   ========================================================================== */
.timeline-container {
    /* Tall scroll runway to drive the timeline parallax */
    height: 600vh;
    position: relative;
    max-width: 100vw;
    margin: 0;
    padding: 0;
}

.timeline-year-marker,
.timeline-card {
    position: fixed;
    top: 15vh;
    /* Floating high in the sky above the train */
    left: 50%;
    width: 90%;
    max-width: 650px;
    margin: 0;
    z-index: var(--z-content);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Year Markers */
.timeline-year-marker {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 6rem 0 3rem 0;
    opacity: 0.9;
}

.timeline-year-marker:first-child {
    margin-top: 0;
}

.year-badge {
    background: linear-gradient(135deg, var(--accent-gold), #B8860B);
    color: #000;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    text-transform: uppercase;
}

.year-line {
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-gold) 0%, transparent 100%);
    opacity: 0.6;
}

/* Timeline Cards */
.timeline-card {
    background: rgba(15, 15, 20, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.card-category {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
}

/* Category Colors */
.card-category.experience {
    color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
    border: 1px solid rgba(79, 172, 254, 0.2);
}

.card-category.project {
    color: #43e97b;
    background: rgba(67, 233, 123, 0.1);
    border: 1px solid rgba(67, 233, 123, 0.2);
}

.card-category.activity {
    color: #fa709a;
    background: rgba(250, 112, 154, 0.1);
    border: 1px solid rgba(250, 112, 154, 0.2);
}

.card-category.education {
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.card-category.award {
    color: #f6d365;
    background: rgba(246, 211, 101, 0.1);
    border: 1px solid rgba(246, 211, 101, 0.2);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-title a {
    color: var(--text-primary);
    text-decoration: none;
    background-image: linear-gradient(transparent 80%, var(--accent-gold-dim) 80%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    transition: background-size 0.3s ease;
}

.card-title a:hover {
    background-size: 100% 100%;
    background-image: linear-gradient(transparent 0%, rgba(212, 175, 55, 0.3) 0%);
    color: var(--accent-gold);
}

.card-date {
    font-size: 0.9rem;
    color: var(--accent-gold);
    margin-bottom: 1.2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-date::before {
    content: '🕒';
    font-size: 0.8rem;
    opacity: 0.8;
}

.card-desc {
    color: #d0d0d5;
    font-size: 1.05rem;
    line-height: 1.7;
    font-weight: 300;
}

.card-clubs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.club-tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    color: var(--text-secondary);
}

.timeline-end {
    display: none;
}

.end-line {
    width: 1px;
    height: 100px;
    background: linear-gradient(to bottom, var(--accent-gold) 0%, transparent 100%);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.end-badge {
    font-size: 0.9rem;
    color: var(--accent-gold);
    font-weight: 500;
    letter-spacing: 1px;
    font-style: italic;
}

/* ==========================================================================
   Skills Section
   ========================================================================== */
.skills-section {
    /* Keep train video visible through skills section */
    background: transparent;
    position: relative;
    z-index: var(--z-content);
}

/* Inner backdrop for readability over the video */
.skills-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    background: rgba(5, 5, 8, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 4rem;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
}

.skills-container .section-title {
    text-align: center;
    margin-bottom: 4rem;
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFDF73 0%, var(--accent-gold) 50%, #B8860B 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

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

.skill-group {
    background: rgba(15, 15, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    opacity: 1;
    transform: translateY(0);
    animation: fadeUp 0.8s ease forwards;
}

.skill-group:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(212, 175, 55, 0.05);
}

.skill-group-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    text-align: center;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e5;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent-gold);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.skill-tag.highlight {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
    color: #fff;
    font-weight: 600;
}

.skill-tag.highlight:hover {
    background: var(--accent-gold);
    color: #000;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-section {
    min-height: auto;
    padding-top: 8rem;
    padding-bottom: 4rem;
    background: linear-gradient(to top, #000 0%, transparent 100%);
    position: relative;
    z-index: var(--z-content);
}

.contact-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.contact-container .section-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.contact-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 4rem;
    font-weight: 300;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 5rem;
    flex-wrap: wrap;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2.5rem 3rem;
    background: rgba(15, 15, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    color: var(--text-primary);
    text-decoration: none;
    min-width: 250px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.contact-card:hover {
    transform: translateY(-10px);
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 175, 55, 0.1);
}

.contact-icon {
    font-size: 2.5rem;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 50%;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.contact-card:hover .contact-icon {
    transform: scale(1.1);
    background: var(--accent-gold);
    color: #000;
}

.contact-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-weight: 600;
}

.contact-value {
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-card:hover .contact-value {
    color: var(--accent-gold);
}

.footer-text {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 3rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* ==========================================================================
   Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
    .section {
        padding: 4rem 2rem;
    }

    #mainNav {
        padding: 1.5rem 2rem;
    }

    #mainNav.scrolled {
        padding: 1rem 2rem;
    }
}

@media (max-width: 768px) {
    .hero-name {
        font-size: 3.5rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
    }

    .hero-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-link {
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
        padding: 0.9rem 1.2rem;
    }

    #mainNav {
        display: none;
    }

    .skills-container {
        padding: 2rem 1.2rem;
        border-radius: 16px;
        overflow: hidden;
    }

    .skills-container .section-title {
        font-size: 2.2rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .timeline-card {
        margin-left: 0;
        padding: 1.5rem;
        max-width: 95vw;
        left: 50%;
        width: 95%;
    }

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

    .contact-card {
        width: 100%;
        max-width: 340px;
        padding: 1.8rem;
    }
}