/* ==================== CSS RESET & BASE STYLES ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Refined Dark Color Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #242430;
    --hero-transition-bg: rgba(10, 10, 15, 0.8);
    --accent-primary: #2563eb;
    --accent-secondary: #60a5fa;
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: #27272a;
    /* Typography */
    --font-primary: 'Open Sans', sans-serif;
    --font-heading: 'Jost', sans-serif;
    --font-display: 'Playfair Display', serif;
    --font-mono: 'Inconsolata', monospace;
    /* Spacing */
    --section-padding: 5rem 0;
    --container-padding: 0 2rem;
    /* Transitions */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
    border: 3px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-primary);
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    /* Base font size for better consistency */
}

main {
    width: 100%;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ==================== UTILITY CLASSES ==================== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-label {
    color: var(--accent-primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    position: relative;
    padding-bottom: 0.3rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    gap: 0.5rem;
}

.btn i {
    width: 18px;
    height: 18px;
}

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

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

.btn-large {
    padding: 1rem 2rem;
}

/* ==================== NAVIGATION ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-primary);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    /* Removed hard line */
    padding: 0.75rem 0;
    transition: var(--transition);
}

.scroll-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00f2fe 0%, #a155ff 100%);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
    transition: width 0.1s ease-out;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00f2fe;
    transition: var(--transition);
}

.nav-logo:hover .logo-img {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--accent-secondary);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-mono);
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.3));
    letter-spacing: -1px;
    transition: var(--transition);
}

.nav-logo:hover .logo-text {
    filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.6));
    transform: scale(1.05);
}

.logo-bracket {
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.mobile-cv {
    display: none;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 0;
    position: relative;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00f2fe 0%, #a155ff 100%);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
}

@media (hover: hover) {
    .nav-link:hover::after {
        width: 100%;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: block;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

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

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f0f0f2;
    --bg-tertiary: #e1e1e6;
    --bg-card: #ffffff;
    --hero-transition-bg: rgba(255, 255, 255, 0.8);
    --text-primary: #111114;
    --text-secondary: #4b4b55;
    --text-muted: #71717a;
    --border-color: #d1d1d6;
    /* Darker border for better visibility */
}

/* Hide ALL background effects in light mode for a clean look (except home canvas) */
[data-theme="light"] .wave-container,
[data-theme="light"] .stars-layer-1,
[data-theme="light"] .stars-layer-2,
[data-theme="light"] .stars-layer-3,
[data-theme="light"] .skills::before,
[data-theme="light"] .projects::before,
[data-theme="light"] .certifications::before,
[data-theme="light"] .contact::before,
[data-theme="light"] .gallery-section::before,
[data-theme="light"] .about .stars-layer-1,
[data-theme="light"] .about .stars-layer-2,
[data-theme="light"] .about .stars-layer-3,
[data-theme="light"] .resume-section .stars-layer-1,
[data-theme="light"] .resume-section .stars-layer-2,
[data-theme="light"] .resume-section .stars-layer-3,
[data-theme="light"] .hobbies .stars-layer-1,
[data-theme="light"] .hobbies .stars-layer-2,
[data-theme="light"] .hobbies .stars-layer-3 {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

[data-theme="light"] .navbar {
    border-bottom: 1px solid var(--border-color);
}

/* Light theme specific card improvements */
[data-theme="light"] .about-card,
[data-theme="light"] .skill-category,
[data-theme="light"] .project-card,
[data-theme="light"] .timeline-content,
[data-theme="light"] .hobby-card,
[data-theme="light"] .contact-card,
[data-theme="light"] .message-box {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* Subtle shadow for depth */
    border-color: var(--border-color);
}

/* Standard Section Padding and Backgrounds */
.section {
    padding: var(--section-padding);
    background: var(--bg-primary);
    position: relative;
    z-index: 5; /* Ensure sections scroll OVER the pinned hero */
}

[data-theme="light"] .section {
    background: var(--bg-primary);
}

/* Hero background naturally follows --bg-primary */
[data-theme="light"] .hero {
    background: var(--bg-primary);
}

[data-theme="light"] .navbar {
    background: var(--bg-primary);
}

/* ==================== HERO SECTION ==================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    z-index: 1; /* Pin at the bottom layer */
}

/* Layered transition helper */
.section.reveal {
    transition: transform 1.2s cubic-bezier(0.2, 1, 0.3, 1), opacity 1.2s ease;
    will-change: transform, opacity;
}

.hero-main-content {
    transition: opacity 0.6s ease, transform 0.6s ease;
    width: 100%;
}

#dotCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-greeting {
    color: var(--accent-primary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    display: block;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.hero-role {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.role-highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.hero-tagline {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 480px;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.hero-social {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-image-wrapper {
    position: relative;
}

.hero-image-placeholder {
    width: 280px;
    height: 280px;
    position: relative;
    z-index: 1;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    box-shadow: var(--shadow-lg);
}

.hero-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    opacity: 0.2;
    pointer-events: none;
}

.decoration-1 {
    width: min(320px, 90vw);
    height: min(320px, 90vw);
}

.decoration-2 {
    width: min(360px, 95vw);
    height: min(360px, 95vw);
    opacity: 0.1;
}

/* ==================== ABOUT SECTION ==================== */
.about {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-primary) 100%);
    /* Solid black to keep stars clean */
    position: relative;
    overflow: hidden;
    padding-bottom: 80px;
    /* Reduced from 250px */
    z-index: 5; /* Ensure it stays above hero when scrolling back up */
}

.stars-layer-1,
.stars-layer-2,
.stars-layer-3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    background: transparent;
    z-index: -1;
}

.stars-layer-1 {
    animation: animStar 50s linear infinite;
}

.stars-layer-1::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow: inherit;
}

.stars-layer-2 {
    animation: animStar 100s linear infinite;
}

.stars-layer-2::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow: inherit;
}

.stars-layer-3 {
    animation: animStar 150s linear infinite;
}

.stars-layer-3::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow: inherit;
}

/* Hide stars in light mode for professional look */
[data-theme="light"] .stars-layer-1,
[data-theme="light"] .stars-layer-2,
[data-theme="light"] .stars-layer-3 {
    display: none;
}

@keyframes animStar {
    from {
        transform: translateY(0px);
    }

    to {
        transform: translateY(-2000px);
    }
}

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

.about-image-placeholder {
    width: min(400px, 100%);
    height: auto;
    aspect-ratio: 1/1;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: visible;
    perspective: 1000px;
}

.about-image-placeholder:hover model-viewer {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

.about-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.about-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.about-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
}

.about-card-icon {
    font-size: 1.75rem;
    display: block;
    margin-bottom: 0.5rem;
}

.about-card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.about-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.about-description {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

/* ==================== SKILLS SECTION ==================== */
.wave-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.skills,
.projects,
.certifications,
.contact {
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
    padding-top: 60px;
    /* Reduced from 150px */
    margin-top: -80px;
    /* Reduced from -120px */
    z-index: 1;
}

.skills::before,
.projects::before,
.certifications::before,
.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 400px;
    background: linear-gradient(to bottom,
            rgba(10, 10, 15, 1) 0%,
            rgba(10, 10, 15, 0.8) 20%,
            transparent 100%);
    z-index: 4;
    pointer-events: none;
}

.about .container,
.skills .container,
.projects .container,
.certifications .container,
.hobbies .container,
.contact .container,
.experience .container,
.education .container {
    position: relative;
    z-index: 10;
    /* Elevated above all background mist and waves */
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.skill-category {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.skill-category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.category-icon {
    font-size: 1.25rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.skill-tag:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.projects,
.certifications,
.contact {
    background: var(--bg-primary);
}

.projects-marquee {
    overflow: hidden;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 1rem 0; /* Reduced padding */
    position: relative;
    z-index: 10;
}

.projects-track {
    display: flex;
    gap: 2rem;
    width: max-content;
    align-items: stretch;
    padding: 0 5vw; /* Balanced padding */
    will-change: transform;
}


.project-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: auto;
    /* Allow flex stretch from track */
    width: 380px;
    min-height: 580px;
    flex-shrink: 0;
    box-shadow: var(--shadow-lg);
}

.project-card:hover {
    transform: translateY(-20px) scale(1.02);
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.3);
    border-color: var(--accent-primary);
}

.project-image {
    position: relative;
    height: 220px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

.project-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-link {
    background: white;
    color: var(--accent-primary);
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.project-link:hover {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    margin-top: auto;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.6s ease;
}

.project-card:hover .project-img {
    transform: scale(1.1);
}

.project-btn {
    display: inline-flex;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    width: fit-content;
}

.project-tech span {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Read More Styles */
.read-more-text {
    display: none;
}

.read-more-text.active {
    display: inline;
}

.read-more-btn {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0;
    margin: 0 0 0.5rem 0;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.read-more-btn:hover {
    color: var(--accent-secondary);
}

/* ==================== TIMELINE (Education & Experience) ==================== */
.education {
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.experience {
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    padding-top: 60px; /* Offset for pinned transition */
    padding-bottom: 60px;
    z-index: 1;
}

.resume-section {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* ==================== RESUME SECTION (GRID) ==================== */
.resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    will-change: transform;
}

.resume-col {
    transition: opacity 0.3s ease;
    will-change: transform, opacity;
    padding-bottom: 1rem; /* Safety space for last card radius */
}

@media (max-width: 992px) {
    .resume-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

.resume-col .section-header {
    text-align: left;
    margin-bottom: 2rem;
}

.resume-col .section-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.resume-col .section-title::after {
    left: 0;
    transform: none;
}

.timeline {
    max-width: 700px;
    margin: 0 auto;
    padding-left: 1.5rem;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-primary);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0.5rem; /* Allow space for rounded corners */
}

.timeline-marker {
    position: absolute;
    left: -1.5rem;
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    transform: translateX(-50%);
}

.timeline-content {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-left: 1rem;
}

.education .timeline-content {
    background: var(--bg-secondary);
}

.experience .timeline-content {
    background: var(--bg-card);
}

.timeline-content:hover {
    border-color: var(--accent-primary);
}

.timeline-date {
    display: inline-block;
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.timeline-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.timeline-content h4 {
    font-size: 0.95rem;
    color: var(--accent-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.timeline-content ul {
    color: var(--text-secondary);
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.timeline-content ul li {
    margin-bottom: 0.4rem;
    list-style: disc;
}

.timeline-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.timeline-highlights span {
    background: var(--bg-primary);
    color: var(--accent-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* ==================== CERTIFICATIONS SECTION ==================== */
.certifications {
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.certification-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 16px;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.certification-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.certification-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.04);
}

.certification-card:hover::before {
    opacity: 1;
}

.certification-icon {
    width: 48px;
    height: 48px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-secondary);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.certification-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.certification-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.certification-card p::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
}

/* ==================== HOBBIES SECTION ==================== */
.hobbies {
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    padding-bottom: 80px;
    z-index: 1;
}

.hobbies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.hobby-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.hobby-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
}

.hobby-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.hobby-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.hobby-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.hobby-skill {
    display: block;
    margin-top: 0.5rem;
    color: var(--accent-secondary);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==================== CONTACT SECTION ==================== */
.contact-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.contact-intro {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.contact-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: left;
}

.contact-card:hover {
    border-color: var(--accent-primary);
    transform: translateX(5px);
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.message-box {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.message-box h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.message-box p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* ==================== ANIMATIONS ==================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
    transition-property: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.scale-up {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.scale-up.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

.delay-500 {
    transition-delay: 500ms;
}

.delay-600 {
    transition-delay: 600ms;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--bg-secondary);
    padding: 1.5rem 0;
}

.footer-bottom {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-content {
        order: 2;
    }

    .hero-visual {
        order: 1;
    }

    .hero-tagline {
        margin: 0 auto 2rem;
    }

    .hero-cta,
    .hero-social {
        justify-content: center;
    }

    .project-card {
        width: 320px;
    }

    .hobbies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 3.5rem 0;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-150%);
        width: 95%;
        background: var(--bg-secondary);
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1.25rem 0.75rem;
        gap: 0.4rem;
        transition: var(--transition);
        border: 1px solid var(--border-color);
        border-radius: 20px;
        text-align: center;
        box-shadow: var(--shadow-lg);
        justify-content: center;
    }

    .nav-menu li {
        width: calc(50% - 0.5rem);
        min-width: 130px;
        flex-grow: 1;
    }

    .nav-link {
        justify-content: center;
        padding: 0.75rem 0.25rem;
        font-size: 0.75rem;
        background: var(--bg-primary);
        border-radius: 12px;
        border: 1px solid var(--border-color);
    }

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

    .mobile-cv {
        display: block;
    }

    .mobile-cv .nav-link {
        background: var(--accent-primary);
        color: white;
        border: none;
    }

    .mobile-cv i {
        width: 18px;
        height: 18px;
    }

    .hamburger {
        display: flex;
    }

    .nav-actions .btn {
        display: none;
    }

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

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .hero-image-placeholder {
        width: min(200px, 80vw);
        height: min(200px, 80vw);
        font-size: 4rem;
    }

    .hobbies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {

    .hero-name {
        font-size: 2rem;
    }

    .hobbies-grid {
        grid-template-columns: 1fr;
    }

    .about-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .about-card {
        padding: 0.75rem 0.25rem;
    }

    .about-card h3 {
        font-size: 0.8rem;
    }

    .about-card p {
        font-size: 0.7rem;
    }

    .certifications-grid {
        grid-template-columns: 1fr;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .container {
        padding: 0 1rem;
    }
}

/* ==================== GALLERY PAGES ==================== */
.gallery-section {
    padding: 120px 0 60px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.gallery-section.waves-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background: linear-gradient(to bottom,
            rgba(10, 10, 15, 1) 0%,
            rgba(10, 10, 15, 0.8) 20%,
            transparent 100%);
    z-index: 4;
    pointer-events: none;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: auto;
    cursor: pointer;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-info {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-info {
    opacity: 1;
}

.gallery-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.gallery-tag {
    color: var(--accent-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.back-btn:hover {
    color: var(--accent-primary);
    transform: translateX(-5px);
}

.gallery-header {
    margin-bottom: 1.5rem;
}

.gallery-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
}

.instagram-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    font-style: italic;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.instagram-link:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-section {
        padding: 140px 0 60px;
    }
}

@media (max-width: 480px) {
    .project-card {
        width: 270px;
        min-height: 520px;
        /* Increased to accommodate content without overlap */
        height: auto;
    }

    .project-image {
        height: 160px;
        padding: 1.5rem;
    }

    .project-content {
        padding: 1.25rem;
    }

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

    .project-content p {
        font-size: 0.85rem;
    }
}

/* ==================== CERTS & HOBBIES HORIZONTAL TRANSITION ==================== */
.certs-hobbies-wrapper {
    overflow: hidden;
    width: 100%;
}

.certs-hobbies-track {
    display: flex;
    width: 200%;
    will-change: transform;
}

.certs-hobbies-track > .section {
    width: 50%; /* Each section is 100% of the viewport width */
    flex-shrink: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 100px 0 20px 0; /* Add top padding to clear the 80px fixed navbar */
}