/* =========================================
   DESIGN SYSTEM
   ========================================= */
:root {
    /* Color Palette — Material Dark */
    --bg-color: #131314;
    --bg-color-light: #1e1f20;
    --primary-color: #8ab4f8;
    --secondary-color: #669df6;
    --tertiary-color: #4285f4;
    --text-color: #e8eaed;
    --text-muted: #9aa0a6;

    /* RGB channels for rgba() usage */
    --primary-rgb: 138, 180, 248;
    --bg-rgb: 19, 19, 20;
    --glass-bg-rgb: 30, 31, 32;

    /* Gradient */
    --gradient-primary: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    --gradient-text: linear-gradient(90deg, var(--text-color) 0%, var(--primary-color) 100%);

    /* Glassmorphism */
    --glass-bg: rgba(var(--glass-bg-rgb), 0.75);
    --glass-border: rgba(var(--primary-rgb), 0.10);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

    /* Typography */
    --font-head: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Z-index layers */
    --z-background: -1;
    --z-base: 1;
    --z-nav: 100;
    --z-modal: 1000;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('/static/background.webp') center/cover no-repeat;
    z-index: -3;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: -2;
    pointer-events: none;
}

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

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

ul {
    list-style: none;
}

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

/* =========================================
   LAYOUT UTILITIES
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 3rem 0;
    scroll-margin-top: 5rem;
}

.section-title {
    font-family: var(--font-head);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 3px;
    bottom: -10px;
    left: 0;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Background Animated Shapes */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: var(--z-background);
    opacity: 0.07;
    animation: drift 25s infinite alternate linear;
    pointer-events: none;
}

.bg-shape-1 {
    width: 600px;
    height: 600px;
    background: var(--primary-color);
    top: -200px;
    left: -200px;
}

.bg-shape-2 {
    width: 700px;
    height: 700px;
    background: var(--tertiary-color);
    bottom: -200px;
    right: -200px;
    animation-delay: -5s;
    animation-direction: alternate-reverse;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 80px) scale(1.2);
    }
}

/* =========================================
   ANIMATIONS & EFFECTS
   ========================================= */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-nav);
    transition: background var(--transition-normal), box-shadow var(--transition-normal), padding var(--transition-normal);
    padding: 1.5rem 0;
}

.header.scrolled {
    background: rgba(var(--bg-rgb), 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding: 1rem 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.profile-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3);
}

.logo span {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.nav-link {
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

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

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.social-icons a:hover {
    background: var(--gradient-primary);
    color: var(--bg-color);
    border-color: transparent;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media screen and (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(var(--bg-rgb), 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 2rem 0;
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-20px);
        transition: all var(--transition-normal);
    }

    .nav-menu.show-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
    }
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.hero-content {
    max-width: 880px;
}

.hero-greeting {
    font-family: var(--font-head);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 1rem;
}

.hero-title {
    font-family: var(--font-head);
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    background: var(--gradient-text);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    margin-bottom: 2rem;
}

.hero-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 800px;
    text-align: justify;
}

.btn-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-color);
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.6);
    color: var(--bg-color);
    filter: brightness(1.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* =========================================
   ABOUT SECTION
   ========================================= */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.about-card {
    padding: 3rem;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: justify;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.highlight-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.highlight-info h4 {
    font-family: var(--font-head);
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.highlight-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =========================================
   STATS SECTION
   ========================================= */
.stats-carousel {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
    margin-top: -2rem;
    margin-bottom: -2rem;
    padding-left: max(2rem, calc((100% - 1200px) / 2 + 2rem));
    padding-right: max(2rem, calc((100% - 1200px) / 2 + 2rem));
    scroll-padding-inline: max(2rem, calc((100% - 1200px) / 2 + 2rem));
    /* scroll-snap-type: x mandatory; */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.stats-carousel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.stats-carousel.active {
    cursor: grabbing;
}

.stats-carousel.active .stat-card {
    cursor: grabbing;
    pointer-events: none;
}

.stat-card {
    flex: 0 0 280px;
    /* scroll-snap-align: start; */
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.stat-card-footer {
    margin-top: auto;
    padding-top: 1.2rem;
    display: flex;
    justify-content: center;
}

.stat-card-link {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    z-index: 10;
}

.stat-card-link:hover {
    color: var(--primary-color);
}


.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    height: 3rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 3rem;
    padding: 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span {
    color: var(--text-muted);
}

.stat-value {
    text-align: right;
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.stat-value small {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.2rem;
}


/* =========================================
   SKILLS SECTION
   ========================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    padding: 2rem;
    transition: transform var(--transition-normal);
}

.skill-category:hover {
    border-color: var(--primary-color);
}

.skill-category h3 {
    font-family: var(--font-head);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.skill-category h3 i {
    color: var(--primary-color);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.skill-tag:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* =========================================
   EXPERIENCE TIMELINE
   ========================================= */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background: var(--glass-border);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
}

.timeline-content {
    padding: 2rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.timeline-date {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 300;
    white-space: nowrap;
    flex-shrink: 0;
}

.timeline-title {
    font-family: var(--font-head);
    font-size: 1.5rem;
}

.timeline-company {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.timeline-bullets {
    list-style: none;
}

.timeline-bullets li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: justify;
}

.timeline-bullets li strong {
    color: var(--text-color);
}

.timeline-bullets li::before {
    content: '→';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-color);
}

/* =========================================
   PROJECTS & ACHIEVEMENTS SECTION
   ========================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.project-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.project-links a {
    color: var(--text-color);
    font-size: 1.2rem;
    transition: color var(--transition-fast);
}

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

.project-card h3 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.project-type {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background: rgba(var(--bg-rgb), 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    padding: 3rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.footer-logo span {
    color: var(--primary-color);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-socials {
    display: flex;
    gap: 1rem;
}

.footer-socials a {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color var(--transition-fast);
}

.footer-socials a:hover {
    color: var(--primary-color);
}

/* =========================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================= */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    .stats-carousel {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        scroll-padding-inline: 1.25rem;
    }

    .section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .hero {
        padding-top: 80px;
    }

    .hero-greeting {
        font-size: 1rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .about-card {
        padding: 1.5rem;
    }

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

    .skill-category {
        padding: 1.5rem;
    }

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

    .project-card {
        padding: 1.5rem;
    }

    .timeline {
        padding-left: 0;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-dot {
        left: 1px;
    }

    .timeline-item {
        padding-left: 35px;
        margin-bottom: 2rem;
    }

    .timeline-content {
        padding: 1.5rem;
    }

    .footer {
        padding: 2rem 0;
    }
}

@media screen and (max-width: 480px) {
    .timeline::before {
        display: none;
    }

    .timeline-dot {
        display: none;
    }

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