/* CSS Variables for Theming */
:root {
    /* Light Mode */
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --primary: 262.1 83.3% 57.8%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 18% 38%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 262.1 83.3% 57.8%;
    --radius: 0.75rem;

    /* Fluid typography scale */
    --fs-hero: clamp(2.5rem, 6vw, 4.5rem);
    --fs-section: clamp(1.875rem, 4vw, 3rem);
    --fs-h3: clamp(1.25rem, 2.2vw, 1.5rem);
    --fs-lead: clamp(1.0625rem, 1.6vw, 1.25rem);
    --lh-tight: 1.12;
    --lh-snug: 1.4;
    --lh-relaxed: 1.7;

    /* Vertical rhythm */
    --section-py: clamp(4rem, 8vw, 7rem);

    /* Glassmorphism tokens */
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.65);
    --glass-shadow: 0 8px 32px rgba(2, 6, 23, 0.10);
    --glass-blur: 16px;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.06);
    --shadow-md: 0 12px 30px -14px rgba(2, 6, 23, 0.20);
    --shadow-lg: 0 30px 60px -22px rgba(2, 6, 23, 0.30);
    --shadow-primary: 0 22px 48px -16px hsl(var(--primary) / 0.45);

    /* Easing */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}


.dark {
    /* Dark Mode */
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 8%;
    --card-foreground: 0 0% 98%;
    --primary: 263.4 70% 50.4%;
    --primary-foreground: 210 40% 98%;
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 263.4 70% 50.4%;
    --accent-foreground: 0 0% 98%;
    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 15.9%;
    --ring: 263.4 70% 60%;

    /* Glassmorphism tokens (dark) */
    --glass-bg: rgba(24, 18, 38, 0.55);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.40);

    /* Elevation (dark) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 30px -14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 60px -22px rgba(0, 0, 0, 0.7);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Radio Canada', sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1), color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Accessibility: visible focus ring for keyboard users only */
:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 3px;
    border-radius: 4px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 3px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 200;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-weight: 600;
    text-decoration: none;
    transition: top 0.25s var(--ease-out);
}

.skip-link:focus {
    top: 1rem;
}

::selection {
    background: hsl(var(--primary) / 0.25);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }

    .marquee-text,
    .hero-img,
    .bullet,
    .chatbot-pulse,
    .whatsapp-ripple {
        animation: none !important;
    }
}

.dark body {
    background: radial-gradient(circle at 50% 10%, #2e0235 0%, #09090b 100%);
}

/* Utility Classes */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

.text-gradient {
    background: linear-gradient(to right, #9333ea, #ec4899, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark .text-gradient {
    background: linear-gradient(to right, #a855f7, #f472b6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass {
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.dark .glass {
    border-color: var(--glass-border);
}

.neon-glow {
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2), 0 0 20px rgba(168, 85, 247, 0.1);
}

.dark .neon-glow {
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5), 0 0 20px rgba(168, 85, 247, 0.3);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem 1.5rem;
    animation: slideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled {
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    background: hsl(var(--background) / 0.72);
    border-bottom: 1px solid hsl(var(--border) / 0.6);
    box-shadow: 0 8px 32px rgba(2, 6, 23, 0.10);
    padding: 0.75rem 1.5rem;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dark .header.scrolled {
    background: hsl(var(--background) / 0.55);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: -0.02em;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.header-nav {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .header-nav {
        display: flex;
    }
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    padding: 0.25rem 0;
    will-change: transform, color;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: hsl(var(--primary));
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover {
    color: hsl(var(--primary));
    font-weight: 700;
    transform: translateY(-2px);
}

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

.nav-link.active {
    color: hsl(var(--primary));
    font-weight: 700;
}

.theme-toggle {
    background: hsl(var(--secondary));
    border: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: hsl(var(--primary) / 0.1);
    transform: scale(0);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(180deg);
}

.theme-toggle:hover::before {
    transform: scale(1);
}

.theme-toggle:active {
    transform: scale(0.95) rotate(180deg);
}

.theme-icon {
    font-size: 1.25rem;
    display: block;
}

.theme-icon-sun {
    display: none;
}

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

.dark .theme-icon-sun {
    display: block;
}

.mobile-nav-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .mobile-nav-toggle {
        display: none;
    }
}

.menu-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: hsl(var(--foreground));
    padding: 0.5rem;
}

.menu-icon {
    display: block;
}

.menu-close {
    display: none;
}

.menu-toggle.active .menu-open {
    display: none;
}

.menu-toggle.active .menu-close {
    display: block;
}

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: hsl(var(--background));
    backdrop-filter: blur(24px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

.mobile-nav-link {
    font-size: 1.5rem;
    font-weight: bold;
    color: hsl(var(--foreground));
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.5rem 1rem;
    transform: translateX(20px);
    opacity: 0;
}

.mobile-menu.active .mobile-nav-link {
    animation: slideInRightMenu 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.mobile-menu.active .mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu.active .mobile-nav-link:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu.active .mobile-nav-link:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu.active .mobile-nav-link:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu.active .mobile-nav-link:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu.active .mobile-nav-link:nth-child(6) { animation-delay: 0.35s; }
.mobile-menu.active .mobile-nav-link:nth-child(7) { animation-delay: 0.4s; }
.mobile-menu.active .mobile-nav-link:nth-child(8) { animation-delay: 0.45s; }

@keyframes slideInRightMenu {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mobile-nav-link:hover {
    color: hsl(var(--primary));
    transform: translateX(5px) scale(1.05);
}

/* Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: hsl(var(--background));
    overflow: hidden;
    padding-top: 80px;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hero-background {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: rotate(-15deg) scale(1.5);
    pointer-events: none;
    z-index: 0;
}

.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    opacity: 0.1;
    user-select: none;
    width: 100%;
}

.marquee-text {
    display: inline-block;
    font-size: clamp(4rem, 14vw, 8rem);
    font-weight: 900;
    text-transform: uppercase;
    color: hsl(var(--foreground) / 0.25);
    margin: 0 1rem;
    animation: marquee 20s linear infinite;
}

.marquee-2 .marquee-text {
    animation-direction: reverse;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-1000px);
    }
}

.hero-gradients {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.gradient-1 {
    position: absolute;
    top: 0;
    right: 0;
    width: 500px;
    height: 500px;
    background: rgba(147, 51, 234, 0.3);
    border-radius: 50%;
    filter: blur(150px);
}

.gradient-2 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 500px;
    height: 500px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    filter: blur(150px);
}

.hero-container {
    position: relative;
    z-index: 10;
    padding: 2rem 1rem;
}

.hero-content {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 3rem;
}

@media (min-width: 1024px) {
    .hero-content {
        flex-direction: row;
        gap: 5rem;
    }
}

.hero-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
    animation: slideInLeftHero 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    .hero-text {
        text-align: left;
    }
}

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

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: var(--fs-hero);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: var(--lh-tight);
    margin-bottom: 1rem;
}

/* Subtle, slow gradient drift on the hero name only (kept elegant, not flashy) */
.hero-title .text-gradient {
    background-size: 220% auto;
    animation: gradientDrift 9s ease-in-out infinite;
}

@keyframes gradientDrift {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

.animated-roles {
    height: 2rem;
    overflow: hidden;
    position: relative;
}

@media (min-width: 768px) {
    .animated-roles {
        height: 2.5rem;
    }
}

.role-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--primary));
    animation: roleSlide 0.5s ease-in-out;
}

@media (min-width: 768px) {
    .role-text {
        font-size: 1.5rem;
    }
}

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

.about-me-section {
    margin-top: 1rem;
}

.about-me-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: hsl(var(--foreground));
    border-left: 4px solid hsl(var(--primary));
    padding-left: 1rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin-bottom: 1rem;
}

.about-me-list {
    list-style: none;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.about-me-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: hsl(var(--muted-foreground));
    font-size: 1.125rem;
    opacity: 0;
    transform: translateX(-15px);
    animation: slideInLeftList 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: transform, opacity;
}

.about-me-item:nth-child(1) {
    animation-delay: 0.1s;
}

.about-me-item:nth-child(2) {
    animation-delay: 0.2s;
}

.about-me-item:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes slideInLeftList {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.bullet {
    margin-top: 0.375rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: hsl(var(--primary));
    flex-shrink: 0;
    animation: pulse 3s ease-in-out infinite;
    box-shadow: 0 0 8px hsl(var(--primary) / 0.4);
    will-change: transform;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.9;
    }
}

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

@media (min-width: 640px) {
    .hero-buttons {
        flex-direction: row;
    }
}

@media (min-width: 1024px) {
    .hero-buttons {
        justify-content: flex-start;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.75rem;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3);
}

.btn:hover::before {
    width: 350px;
    height: 350px;
}

.btn:active {
    transform: translateY(0) scale(1);
    transition: all 0.1s;
}

/* Light theme: solid brand primary so the CTA is visible on light backgrounds */
.btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    width: 100%;
}

/* Dark theme keeps the signature white pill */
.dark .btn-primary {
    background: white;
    color: #0a0a0a;
}

@media (min-width: 640px) {
    .btn-primary {
        width: auto;
    }
}

.btn-primary:hover {
    box-shadow: var(--shadow-primary);
}

.dark .btn-primary:hover {
    background: #f1f1f3;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.btn-outline {
    background: transparent;
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    width: 100%;
}

@media (min-width: 640px) {
    .btn-outline {
        width: auto;
    }
}

.btn-outline:hover {
    background: hsl(var(--primary) / 0.10);
    border-color: hsl(var(--primary) / 0.5);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.18);
}

.hero-social {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    padding-top: 1rem;
}

@media (min-width: 1024px) {
    .hero-social {
        justify-content: flex-start;
    }
}

.social-link {
    padding: 0.5rem;
    border-radius: 50%;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: transform 0.3s var(--ease-smooth), color 0.3s var(--ease-smooth), background 0.3s var(--ease-smooth), border-color 0.3s var(--ease-smooth);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    position: relative;
}

.social-link i {
    font-size: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.social-link::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(45deg, hsl(var(--primary)), hsl(var(--primary) / 0.5));
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: -1;
}

.social-link:hover {
    background: hsl(var(--primary) / 0.12);
    color: hsl(var(--primary));
    transform: translateY(-4px) scale(1.08);
    border-color: hsl(var(--primary));
}

.social-link:hover i {
    transform: scale(1.1);
}

.social-link:hover::before {
    opacity: 0.3;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.hero-image {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    animation: slideInRightHero 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

@media (min-width: 1024px) {
    .hero-image {
        justify-content: flex-end;
    }
}

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

.hero-image-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
}

@media (min-width: 768px) {
    .hero-image-wrapper {
        width: 500px;
        height: 600px;
    }
}

@media (min-width: 1024px) {
    .hero-image-wrapper {
        width: 600px;
        height: 700px;
    }
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    position: relative;
    z-index: 10;
    animation: float 8s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(168, 85, 247, 0.3));
    transition: filter 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, filter;
}

.hero-img:hover {
    filter: drop-shadow(0 25px 50px rgba(168, 85, 247, 0.4));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Stats Section */
.stats-section {
    padding: 2.5rem 0;
    background: hsl(var(--primary) / 0.05);
    border-top: 1px solid hsl(var(--border));
    border-bottom: 1px solid hsl(var(--border));
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    text-align: center;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.stat-item.animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes statFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-value {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.stat-item:hover .stat-value {
    transform: scale(1.1);
    text-shadow: 0 0 25px hsl(var(--primary) / 0.6);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: hsl(var(--primary));
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .stat-value {
        font-size: 3rem;
    }
}

.stat-label {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 768px) {
    .stat-label {
        font-size: 1rem;
    }
}

/* About Section */
.about-section {
    padding: var(--section-py) 0;
    position: relative;
    overflow: hidden;
    background: hsl(var(--secondary) / 0.05);
}

.section-header {
    max-width: 56rem;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid;
}

.badge-outline {
    border-color: hsl(var(--primary) / 0.5);
    color: hsl(var(--primary));
    background: transparent;
}

.badge-primary {
    background: hsl(var(--secondary) / 0.3);
    backdrop-filter: blur(4px);
    border-color: hsl(var(--primary) / 0.2);
    color: hsl(var(--primary));
}

.badge-secondary {
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    border: none;
}

.badge-yellow {
    background: #fef3c7;
    color: #92400e;
    border: none;
}

.dark .badge-yellow {
    background: rgba(234, 179, 8, 0.3);
    color: #fbbf24;
}

.section-title {
    font-size: var(--fs-section);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: var(--lh-tight);
}

.section-description {
    font-size: var(--fs-lead);
    line-height: var(--lh-snug);
    color: hsl(var(--muted-foreground));
    max-width: 65ch;
    margin: 0 auto;
}

.about-content {
    padding: clamp(1.75rem, 4vw, 3rem);
    border-radius: 1.5rem;
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    font-size: var(--fs-lead);
    line-height: var(--lh-relaxed);
    color: hsl(var(--muted-foreground));
    transition: transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth), border-color 0.4s var(--ease-smooth);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.about-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, hsl(var(--primary) / 0.05), transparent);
    transform: rotate(45deg);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.about-content:hover {
    box-shadow: 0 24px 50px -18px rgba(168, 85, 247, 0.28);
    border-color: hsl(var(--primary) / 0.35);
}

@media (min-width: 768px) {
    .about-content {
        padding: 3rem;
    }
}

.about-text {
    margin: 0;
    max-width: 62ch;
    margin-inline: auto;
}

/* Experience Section */
.experience-section {
    padding: var(--section-py) 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, hsl(var(--background)), hsl(var(--secondary) / 0.05), hsl(var(--background)));
}

.experience-toggle {
    margin-top: 2rem;
}

.toggle-icon {
    margin-left: 0.5rem;
    transition: transform 0.3s;
}

.experience-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.experience-tree {
    position: relative;
    max-width: 80rem;
    margin: 0 auto;
}

.timeline-line {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, hsl(var(--primary) / 0.2), hsl(var(--primary) / 0.2), hsl(var(--primary) / 0.2));
    border-radius: 9999px;
}

@media (min-width: 768px) {
    .timeline-line {
        left: 50%;
        transform: translateX(-50%);
    }
}

.experience-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

@media (min-width: 768px) {
    .experience-items {
        gap: 1.5rem;
    }
}

.experience-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    padding-left: 3rem;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@media (min-width: 768px) {
    .experience-item {
        flex-direction: row;
        align-items: center;
        padding-left: 0;
    }
    
    .experience-item.even {
        flex-direction: row;
    }
    
    .experience-item.odd {
        flex-direction: row-reverse;
    }
}

.experience-marker {
    position: absolute;
    left: 20px;
    width: 2rem;
    height: 2rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

@media (min-width: 768px) {
    .experience-marker {
        left: 50%;
    }
}

.marker-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 4px solid;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.marker-dot.highlight {
    background: hsl(var(--primary));
    border-color: white;
    transform: scale(1.25);
}

.dark .marker-dot.highlight {
    border-color: #18181b;
}

.marker-dot:not(.highlight) {
    background: hsl(var(--background));
    border-color: hsl(var(--primary));
}

.experience-branch {
    position: absolute;
    top: 2rem;
    left: 20px;
    width: 2rem;
    height: 2px;
    background: hsl(var(--primary) / 0.2);
    z-index: -1;
    transform-origin: left;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (min-width: 768px) {
    .experience-branch {
        top: 50%;
        left: 50%;
        width: calc(50% - 40px);
    }
    
    .experience-item.even .experience-branch {
        margin-left: 0;
        transform-origin: left;
    }
    
    .experience-item.odd .experience-branch {
        margin-left: calc(-50% + 40px);
        transform-origin: right;
    }
}

.experience-content {
    width: 100%;
    padding-left: 0;
}

@media (min-width: 768px) {
    .experience-content {
        width: calc(50% - 40px);
        padding-left: 0;
    }
    
    .experience-item.even .experience-content {
        padding-right: 3rem;
        text-align: right;
    }
    
    .experience-item.odd .experience-content {
        padding-left: 3rem;
        text-align: left;
    }
}

.experience-card {
    position: relative;
    border-radius: 1rem;
    border: 1px solid;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    padding: 1rem;
    overflow: hidden;
}

.experience-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, hsl(var(--primary) / 0.1), transparent);
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.experience-card:hover::before {
    left: 100%;
}

@media (min-width: 768px) {
    .experience-card {
        padding: 2rem;
    }
}

.experience-card.highlight {
    background: linear-gradient(to bottom right, hsl(var(--primary) / 0.1), hsl(var(--primary) / 0.1));
    border-color: hsl(var(--primary) / 0.5);
}

.experience-card:not(.highlight) {
    background: hsl(var(--card));
    border-color: hsl(var(--border));
}

.experience-card:hover {
    box-shadow: 0 15px 30px -5px rgba(168, 85, 247, 0.2);
    border-color: hsl(var(--primary) / 0.5);
    transform: translateY(-2px);
}

.experience-year {
    font-size: 0.875rem;
    font-family: monospace;
    color: hsl(var(--primary));
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.experience-title {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    background: linear-gradient(to right, hsl(var(--foreground)), hsl(var(--foreground) / 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s;
}

.experience-details-expanded .experience-title {
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .experience-details-expanded .experience-title {
        font-size: 1.875rem;
    }
}

.experience-institute {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
}

.experience-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
}

.experience-details.expanded {
    max-height: 500px;
    opacity: 1;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid hsl(var(--border) / 0.5);
}

.experience-details-text {
    color: hsl(var(--muted-foreground));
    line-height: 1.75;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .experience-details-text {
        font-size: 1rem;
    }
}

/* Projects Section */
.projects-section {
    padding: var(--section-py) 0;
    background: hsl(var(--secondary) / 0.05);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 4rem;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-card {
    border-radius: 1.5rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    will-change: transform, opacity;
}

.project-card.animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes projectFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.project-card:hover {
    box-shadow: 0 25px 50px -12px rgba(168, 85, 247, 0.3), 0 0 30px rgba(168, 85, 247, 0.15);
    transform: translateY(-8px) scale(1.01);
    border-color: hsl(var(--primary) / 0.4);
}

.project-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: hsl(var(--muted));
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s;
    filter: brightness(0.95);
    will-change: transform;
}

.project-card:hover .project-image {
    transform: scale(1.08);
    filter: brightness(1.05);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 6, 20, 0.72), rgba(10, 6, 20, 0.30) 60%, rgba(10, 6, 20, 0.15));
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

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

.project-overlay-button {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    color: black;
    font-weight: bold;
    border-radius: 9999px;
    transform: translateY(1rem) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.project-card:hover .project-overlay-button {
    transform: translateY(0) scale(1);
}

.project-card-footer {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.project-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: hsl(var(--primary));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.project-card-title {
    font-size: 1.25rem;
    font-weight: bold;
    transition: color 0.3s;
}

.project-card:hover .project-card-title {
    color: hsl(var(--primary));
}

.project-description {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-stack {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-stack-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: hsl(var(--primary) / 0.08);
    border: 1px solid hsl(var(--primary) / 0.18);
    color: hsl(var(--foreground));
    transition: background 0.3s var(--ease-smooth), border-color 0.3s var(--ease-smooth);
}

.project-card:hover .project-stack-badge {
    background: hsl(var(--primary) / 0.14);
    border-color: hsl(var(--primary) / 0.32);
}

.projects-load-more {
    margin-top: 3rem;
    text-align: center;
}

.hidden-md {
    display: block;
}

@media (min-width: 768px) {
    .hidden-md {
        display: none;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: modalFadeIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    max-width: 56rem;
    width: 100%;
    background: hsl(var(--card));
    border-radius: 1rem;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10;
    animation: modalSlideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
    will-change: transform, opacity;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: hsl(var(--background));
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: hsl(var(--foreground));
}

.modal-body {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
    }
}

.modal-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

@media (min-width: 768px) {
    .modal-image {
        width: 50%;
        aspect-ratio: auto;
    }
}

.modal-content-section {
    width: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-content-section {
        width: 50%;
        padding: 2rem;
    }
}

.modal-badge {
    margin-bottom: 0.75rem;
}

.modal-title {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.modal-description {
    color: hsl(var(--muted-foreground));
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.modal-stack-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.modal-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.modal-stack-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    border: 1px solid hsl(var(--primary) / 0.2);
    background: hsl(var(--primary) / 0.05);
    color: hsl(var(--foreground));
}

.modal-button {
    margin-top: auto;
    padding-top: 2rem;
}

/* Achievements Section */
.achievements-section {
    padding: var(--section-py) 0;
    background: hsl(var(--background));
    position: relative;
    overflow: hidden;
}

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

@media (min-width: 1024px) {
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.achievements-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.achievements-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

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

.achievements-icon i {
    font-size: 2rem;
}

.achievements-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.achievement-item {
    padding: 1.5rem;
    border-radius: 1rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    opacity: 0;
    transform: translateX(-15px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.achievement-item.animate {
    opacity: 1;
    transform: translateX(0);
}

@keyframes achievementFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-15px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.achievement-item:hover {
    transform: translateX(3px);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.12);
    border-color: hsl(var(--primary) / 0.3);
}

.achievement-bullet {
    margin-top: 0.25rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #eab308;
    flex-shrink: 0;
}

.achievement-item h4 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.achievement-item .text-primary {
    color: hsl(var(--primary));
    font-weight: 500;
}

.achievement-item .text-muted {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

.certifications-list {
    display: grid;
    gap: 1rem;
}

.certification-item {
    padding: 1rem;
    border-radius: 0.75rem;
    background: hsl(var(--secondary) / 0.05);
    border: 1px solid hsl(var(--border));
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(10px);
    will-change: transform, opacity;
}

.certification-item.animate {
    opacity: 1;
    transform: translateY(0);
}

@keyframes certFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.certification-item:hover {
    background: hsl(var(--secondary) / 0.12);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(168, 85, 247, 0.15);
    border-color: hsl(var(--primary) / 0.3);
}

.cert-number {
    height: 2rem;
    width: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid hsl(var(--primary) / 0.2);
    color: hsl(var(--primary));
    font-weight: 500;
    flex-shrink: 0;
}

.certification-item span:last-child {
    font-weight: 500;
    color: hsl(var(--foreground));
}

.learning-box {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 1.5rem;
    background: linear-gradient(to bottom right, #9333ea, #3b82f6);
    color: white;
    position: relative;
    overflow: hidden;
}

.learning-box h4 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.learning-box p {
    color: rgba(255, 255, 255, 0.8);
}

.learning-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8rem;
    height: 8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(64px);
    margin-right: -2.5rem;
    margin-top: -2.5rem;
}

.learning-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 8rem;
    height: 8rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    filter: blur(64px);
    margin-left: -2.5rem;
    margin-bottom: -2.5rem;
}

/* Timeline Section */
.timeline-section {
    padding: var(--section-py) 0;
    background: hsl(var(--background));
    position: relative;
}

.timeline-scroll {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2rem;
    scrollbar-width: none;
}

.timeline-scroll::-webkit-scrollbar {
    display: none;
}

.timeline-items {
    display: flex;
    gap: 2rem;
    padding: 0 1rem;
    width: max-content;
}

@media (min-width: 768px) {
    .timeline-items {
        padding: 0 1.5rem;
    }
}

.timeline-item {
    position: relative;
    width: 300px;
    height: 500px;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(30px) scale(0.96);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.timeline-item.animate {
    opacity: 1;
    transform: translateX(0) scale(1);
}

@keyframes timelineFadeIn {
    0% {
        opacity: 0;
        transform: translateX(30px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@media (min-width: 768px) {
    .timeline-item {
        width: 400px;
    }
}

.timeline-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.timeline-item:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 12px 30px rgba(168, 85, 247, 0.2);
    border-color: hsl(var(--primary) / 0.4);
}

.timeline-item:hover .timeline-image {
    transform: scale(1.08);
}

.timeline-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5), transparent);
}

.timeline-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-year {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--primary));
    font-family: monospace;
    font-size: 0.875rem;
}

.timeline-year i {
    font-size: 0.875rem;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    line-height: 1.2;
}

.timeline-description {
    color: #d1d5db;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.timeline-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    margin-top: 0.5rem;
    transition: color 0.3s;
}

.timeline-link:hover {
    color: hsl(var(--primary));
}

/* Testimonials Section */
.testimonials-section {
    padding: 6rem 0;
    background: hsl(var(--secondary) / 0.05);
    position: relative;
    overflow: hidden;
}

.testimonials-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.testimonials-scroll {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    padding: 1rem;
    cursor: grab;
}

.testimonials-scroll:active {
    cursor: grabbing;
}

.testimonial-card {
    width: 350px;
    padding: 2rem;
    border-radius: 1.5rem;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    user-select: none;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--primary) / 0.5));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.testimonial-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 15px 35px -12px rgba(168, 85, 247, 0.2);
    border-color: hsl(var(--primary) / 0.3);
}

.testimonial-card:hover::before {
    transform: scaleX(1);
}

.testimonial-quote {
    width: 2.5rem;
    height: 2.5rem;
    color: hsl(var(--primary) / 0.2);
    transform: rotate(180deg);
}

.testimonial-text {
    font-size: 1.125rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.75;
    font-style: italic;
}

.testimonial-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid hsl(var(--primary) / 0.2);
    position: relative;
}

.testimonial-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonial-info h4 {
    font-weight: bold;
    color: hsl(var(--foreground));
}

.testimonial-info p {
    font-size: 0.75rem;
    color: hsl(var(--primary));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.testimonial-stars {
    margin-left: auto;
    display: flex;
    gap: 0.125rem;
}

.testimonial-star {
    width: 0.875rem;
    height: 0.875rem;
    fill: #eab308;
    color: #eab308;
}

/* Services Section */
.services-section {
    padding: var(--section-py) 0;
    background: hsl(var(--background));
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 4rem;
}

@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.service-card {
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(25px) scale(0.97);
    position: relative;
    overflow: hidden;
    will-change: transform, opacity;
}

.service-card.animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes serviceFadeIn {
    0% {
        opacity: 0;
        transform: translateY(25px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, hsl(var(--primary) / 0.05), transparent);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.service-card:hover {
    background: hsl(var(--accent) / 0.05);
    transform: translateY(-10px) scale(1.03) rotateZ(1deg);
    box-shadow: 0 30px 60px -12px rgba(168, 85, 247, 0.3), 0 0 30px rgba(168, 85, 247, 0.15);
    border-color: hsl(var(--primary) / 0.5);
}

.service-card:hover::after {
    opacity: 1;
}

.service-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: hsl(var(--primary) / 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: hsl(var(--primary));
    font-size: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.service-icon i {
    font-size: 2rem;
}

.service-icon::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 1rem;
    background: hsl(var(--primary) / 0.2);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.service-card:hover .service-icon {
    background: hsl(var(--primary));
    color: white;
    transform: rotate(10deg) scale(1.15);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}

.service-card:hover .service-icon::before {
    opacity: 1;
    transform: scale(1.2);
}

.service-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
}

.service-description {
    color: hsl(var(--muted-foreground));
    line-height: 1.75;
}

/* AllOfTech Section */
.alloftech-content {
    max-width: 56rem;
    margin: 3rem auto 0;
    padding: clamp(1.75rem, 4vw, 3rem);
    border-radius: 1.5rem;
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth), border-color 0.4s var(--ease-smooth);
}

.alloftech-content:hover {
    box-shadow: 0 24px 50px -18px rgba(168, 85, 247, 0.28);
    border-color: hsl(var(--primary) / 0.35);
}

.alloftech-mission {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 1rem;
    background: hsl(var(--primary) / 0.1);
    border-left: 4px solid hsl(var(--primary));
}

.alloftech-mission h4 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    color: hsl(var(--primary));
}

.alloftech-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.alloftech-link {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    background: hsl(var(--primary) / 0.1);
    border: 1px solid hsl(var(--primary) / 0.3);
    color: hsl(var(--foreground));
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.alloftech-link:hover {
    background: hsl(var(--primary) / 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.alloftech-link i {
    font-size: 1rem;
}

/* Expertise Section */
.expertise-section {
    padding: var(--section-py) 0;
    background: hsl(var(--secondary) / 0.06);
    text-align: center;
}

.dark .expertise-section {
    background: rgba(0, 0, 0, 0.2);
}

.title-underline {
    width: 5rem;
    height: 4px;
    background: hsl(var(--primary));
    border-radius: 9999px;
    margin: 1rem auto;
}

.expertise-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .expertise-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .expertise-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.expertise-card {
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.18), 0 0 20px rgba(168, 85, 247, 0.08);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s;
    opacity: 0;
    position: relative;
    overflow: hidden;
    min-height: fit-content;
}

.expertise-card.compact {
    padding: 1.25rem;
}

.expertise-card.animate {
    animation: glassFadeIn 0.6s var(--ease-out) forwards;
}

/* Opacity-only entrance keeps the frosted blur from flickering */
@keyframes glassFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dark .expertise-card {
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5), 0 0 20px rgba(168, 85, 247, 0.3);
}

.expertise-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, hsl(var(--primary) / 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s, transform 0.6s;
    transform: scale(0);
}

.expertise-card:hover {
    background: hsl(var(--primary) / 0.06);
    border-color: hsl(var(--primary) / 0.4);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.4), 0 0 50px rgba(168, 85, 247, 0.22);
}

.expertise-card:hover::before {
    opacity: 1;
    transform: scale(1);
}

.expertise-title {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: hsl(var(--foreground));
}

.expertise-card.compact .expertise-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.expertise-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.expertise-card.compact .expertise-tags {
    gap: 0.4rem;
}

.expertise-tag {
    padding: 0.4rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid;
    font-size: 0.8125rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
    display: inline-block;
    will-change: transform;
}

.expertise-card.compact .expertise-tag {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.expertise-tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.expertise-tag.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.2);
}

.expertise-tag.purple {
    background: rgba(147, 51, 234, 0.1);
    color: #a855f7;
    border-color: rgba(147, 51, 234, 0.2);
}

.expertise-tag.pink {
    background: rgba(236, 72, 153, 0.1);
    color: #f472b6;
    border-color: rgba(236, 72, 153, 0.2);
}

/* WhatsApp Button */
.whatsapp-button {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    background: #25D366;
    color: white;
    padding: 1rem;
    border-radius: 50%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    text-decoration: none;
}

.whatsapp-button:hover {
    transform: scale(1.08) rotate(5deg);
}

.whatsapp-ripple {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #25D366;
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
    opacity: 0.2;
}

.whatsapp-button:hover .whatsapp-ripple {
    opacity: 0.4;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.whatsapp-icon {
    font-size: 2rem;
    position: relative;
    z-index: 10;
    color: white;
}

.whatsapp-icon i {
    font-size: 2rem;
}

/* Footer */
.footer {
    background: hsl(var(--secondary) / 0.05);
    border-top: 1px solid hsl(var(--border));
    padding-top: 5rem;
    padding-bottom: 2.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .footer-brand {
        grid-column: span 2;
    }
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: hsl(var(--foreground));
}

.footer-description {
    color: hsl(var(--muted-foreground));
    font-size: 1.125rem;
    max-width: 24rem;
}

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

.footer-social-link {
    padding: 0.75rem;
    border-radius: 50%;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    text-decoration: none;
    color: hsl(var(--foreground));
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    will-change: transform;
}

.footer-social-link i {
    font-size: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.footer-social-link:hover {
    border-color: hsl(var(--primary) / 0.5);
    transform: translateY(-3px) scale(1.1);
}

.footer-social-link:hover i {
    transform: scale(1.15);
}

.footer-links,
.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-title {
    font-weight: bold;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.footer-link {
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: hsl(var(--primary));
}

.footer-text {
    color: hsl(var(--muted-foreground));
}

.footer-bottom {
    border-top: 1px solid hsl(var(--border) / 0.5);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

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

/* Contact Form (Footer) */
.footer-form-section {
    margin-bottom: 3rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 1.5rem;
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.footer-form-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field.full {
    grid-column: 1 / -1;
}

.form-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.form-input {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 0.9rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.form-input::placeholder {
    color: hsl(var(--muted-foreground));
}

.form-input:focus {
    border-color: hsl(var(--primary) / 0.7);
    box-shadow: 0 0 0 4px hsl(var(--primary) / 0.15);
}

textarea.form-input {
    resize: vertical;
    min-height: 140px;
}

.form-status {
    min-height: 1.25rem;
    font-size: 0.95rem;
    color: hsl(var(--muted-foreground));
}

.form-status.success {
    color: #16a34a;
}

.form-status.error {
    color: #ef4444;
}

.contact-form .btn-primary {
    width: 100%;
}

.service-cta {
    margin-top: 1.25rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    width: fit-content;
    border-radius: 9999px;
    position: relative;
    z-index: 2;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Scroll reveal framework (JS-driven; degrades gracefully) ===== */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}

/*
 * Variant for frosted-glass (backdrop-filter) surfaces. Moving a blurred
 * element forces the compositor to re-rasterize every frame, which causes
 * visible flicker. These surfaces therefore fade in with opacity ONLY.
 */
.reveal.reveal-soft {
    transform: none;
}

.reveal.in-view {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.reveal-soft {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Offset anchor jumps so targets aren't hidden under the fixed header */
section[id],
#contact {
    scroll-margin-top: 90px;
}

#home {
    scroll-margin-top: 0;
}

/* Text Colors */
.text-primary {
    color: hsl(var(--primary));
}

.text-muted {
    color: hsl(var(--muted-foreground));
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* ═══════════════════════════════════════════════════════════════════
   PAGE LOADER & ENTRY ANIMATION SYSTEM
   All new rules live here — nothing above is modified.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Full-screen loader overlay ──────────────────────────────────── */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Fixed dark bg so loader looks right before theme class is applied */
    background: radial-gradient(circle at 50% 0%, #2e0235 0%, #09090b 100%);
    /* Exit transition — JS adds .loader-exit */
    transition: opacity 0.55s cubic-bezier(0.4, 0, 1, 1),
                transform 0.55s cubic-bezier(0.4, 0, 1, 1);
    will-change: opacity, transform;
}

#page-loader.loader-exit {
    opacity: 0;
    transform: translateY(-18px) scale(1.015);
    pointer-events: none;
}

/* ── Loader inner layout ─────────────────────────────────────────── */
.loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    animation: loader-inner-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes loader-inner-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Glyph (rings + monogram) ────────────────────────────────────── */
.loader-glyph {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4rem;
}

/* Pulsing glow orb behind the monogram */
.loader-glow {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.45) 0%, transparent 70%);
    animation: loader-glow-breathe 2.4s ease-in-out infinite;
}

@keyframes loader-glow-breathe {
    0%, 100% { transform: scale(0.85); opacity: 0.6; }
    50%       { transform: scale(1.15); opacity: 1;   }
}

/* Outer spinning ring (slow, counter-clockwise) */
.loader-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid transparent;
}

.loader-ring-1 {
    inset: -4px;
    border-top-color:    rgba(168, 85, 247, 0.8);
    border-right-color:  rgba(236, 72, 153, 0.5);
    border-bottom-color: rgba(168, 85, 247, 0.15);
    border-left-color:   rgba(236, 72, 153, 0.15);
    animation: loader-spin 2.4s linear infinite;
}

.loader-ring-2 {
    inset: 8px;
    border-top-color:    transparent;
    border-right-color:  transparent;
    border-bottom-color: rgba(59, 130, 246, 0.7);
    border-left-color:   rgba(59, 130, 246, 0.35);
    animation: loader-spin 1.8s linear infinite reverse;
}

@keyframes loader-spin {
    to { transform: rotate(360deg); }
}

/* "IH" gradient monogram */
.loader-monogram {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.4rem, 8vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #c084fc, #f472b6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: loader-monogram-in   0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both,
               loader-gradient-flow 4s   linear                           infinite;
    position: relative;
    z-index: 1;
}

@keyframes loader-monogram-in {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1);   }
}

@keyframes loader-gradient-flow {
    0%   { background-position: 0%   center; }
    50%  { background-position: 200% center; }
    100% { background-position: 0%   center; }
}

/* ── Loader text ─────────────────────────────────────────────────── */
.loader-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1rem, 2.8vw, 1.2rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    animation: loader-text-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

/* Single static role line */
.loader-role-single {
    font-family: 'Radio Canada', sans-serif;
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    color: rgba(192, 132, 252, 0.85);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    animation: loader-text-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

@keyframes loader-text-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* ── Pulsing data dots ───────────────────────────────────────────── */
.loader-dots {
    display: flex;
    gap: 7px;
    margin-top: 0.25rem;
    animation: loader-text-rise 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.loader-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.7);
    animation: loader-dot-bounce 1.1s ease-in-out infinite;
}
.loader-dots span:nth-child(1) { animation-delay: 0s;     background: rgba(192, 132, 252, 0.8); }
.loader-dots span:nth-child(2) { animation-delay: 0.18s;  background: rgba(244, 114, 182, 0.7); }
.loader-dots span:nth-child(3) { animation-delay: 0.36s;  background: rgba(96,  165, 250, 0.7); }

@keyframes loader-dot-bounce {
    0%, 60%, 100% { transform: translateY(0)    scale(1);    opacity: 0.55; }
    30%            { transform: translateY(-7px) scale(1.25); opacity: 1;    }
}

/* ── Progress bar (CSS-driven; no JS needed for fill) ────────────── */
.loader-track {
    width: clamp(130px, 28vw, 200px);
    height: 2px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 1.1rem;
    animation: loader-text-rise 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.loader-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #a855f7, #ec4899, #3b82f6);
    transform: scaleX(0);
    transform-origin: left;
    /* Fills in 0.7 s — JS exits loader at 0.85 s */
    animation: loader-progress 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}

@keyframes loader-progress {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* ── Hero elements: suppressed while loader is on screen ────────── */
/*    Prevents slideInLeftHero / slideInRightHero / fadeIn / slideDown
      from firing while the loader covers the page.                  */
html.is-entering .header {
    animation:  none !important;
    opacity:    0    !important;
    transform:  translateY(-10px) !important;
    transition: none !important;
}
html.is-entering .hero-section { animation: none !important; }
html.is-entering .hero-text    { animation: none !important; }
html.is-entering .hero-image   {
    animation:  none !important;
    opacity:    0    !important;
    transform:  translateX(28px) !important;
}
html.is-entering .hero-subtitle,
html.is-entering .hero-title,
html.is-entering .animated-roles,
html.is-entering .about-me-section,
html.is-entering .hero-buttons,
html.is-entering .hero-social {
    opacity:    0 !important;
    transition: none !important;
}

/* ── Enhanced button press: scale 0.97 ──────────────────────────── */
.btn:active {
    transform:  scale(0.97) !important;
    transition: transform  0.1s cubic-bezier(0.4, 0, 1, 1),
                box-shadow 0.1s cubic-bezier(0.4, 0, 1, 1) !important;
}

/* Click ripple — JS injects <span class="ripple"> at click origin */
.btn .ripple {
    position:      absolute;
    border-radius: 50%;
    background:    rgba(255, 255, 255, 0.28);
    transform:     scale(0);
    pointer-events: none;
    animation:     btn-ripple 0.65s linear forwards;
}

@keyframes btn-ripple {
    to { transform: scale(4); opacity: 0; }
}

/* ── Project/service card active state (touch devices) ───────────── */
@media (hover: none) and (pointer: coarse) {
    .project-card:active {
        transform:    scale(0.98) !important;
        border-color: hsl(var(--primary) / 0.4) !important;
        box-shadow:   0 4px 20px rgba(168, 85, 247, 0.2) !important;
        transition:   all 0.12s cubic-bezier(0.4, 0, 1, 1) !important;
    }
    .service-card:active,
    .achievement-item:active,
    .certification-item:active {
        opacity:    0.82 !important;
        transform:  scale(0.985) !important;
        transition: all 0.12s cubic-bezier(0.4, 0, 1, 1) !important;
    }
}

/* ── Shorter transition durations on mobile ─────────────────────── */
@media (max-width: 768px) {
    .stat-item,
    .service-card,
    .expertise-card,
    .achievement-item,
    .certification-item,
    .timeline-item    { transition-duration: 0.4s !important; }
    .project-card     { transition-duration: 0.4s !important; }
    .reveal           { transition-duration: 0.45s !important; }
}

/* ── Mobile menu: visibility-based transitions (smooth open/close) ─ */
/*    On desktop .mobile-menu stays display:none — no z-index conflict */
@media (max-width: 767px) {
    .mobile-menu {
        display:        flex !important;
        visibility:     hidden;
        pointer-events: none;
        transition: opacity   0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0s 0.35s; /* hide after transition ends */
    }
    .mobile-menu.active {
        visibility:     visible;
        pointer-events: auto;
        transition: opacity   0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0s 0s;   /* show immediately on open */
    }
}

/* ── Expertise tags: stagger-pop when parent card animates ──────── */
.expertise-card.animate .expertise-tag {
    animation: tag-pop 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.expertise-card.animate .expertise-tag:nth-child(1)   { animation-delay: 0.06s; }
.expertise-card.animate .expertise-tag:nth-child(2)   { animation-delay: 0.11s; }
.expertise-card.animate .expertise-tag:nth-child(3)   { animation-delay: 0.16s; }
.expertise-card.animate .expertise-tag:nth-child(4)   { animation-delay: 0.21s; }
.expertise-card.animate .expertise-tag:nth-child(5)   { animation-delay: 0.26s; }
.expertise-card.animate .expertise-tag:nth-child(n+6) { animation-delay: 0.30s; }

@keyframes tag-pop {
    from { opacity: 0; transform: scale(0.78) translateY(6px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

/* ── Achievements icon hover ─────────────────────────────────────── */
.achievements-header .achievements-icon {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s;
}
.achievements-header:hover .achievements-icon {
    transform: scale(1.2) rotate(-6deg);
    color: hsl(var(--primary));
}

/* ── Modal content: support JS close scale-down ─────────────────── */
.modal-content { will-change: transform, opacity; }

/* ── Reduced-motion: instant final state for ALL new animations ─── */
@media (prefers-reduced-motion: reduce) {
    #page-loader,
    #page-loader.loader-exit,
    .loader-inner,
    .loader-monogram,
    .loader-ring-1,
    .loader-ring-2,
    .loader-glow,
    .loader-name,
    .loader-role-single,
    .loader-dots,
    .loader-dots span,
    .loader-fill,
    .btn .ripple,
    .expertise-card.animate .expertise-tag {
        animation:  none !important;
        transition: none !important;
    }
    /* Loader still shows/hides but instantly */
    #page-loader.loader-exit { display: none !important; }

    /* Hero elements immediately visible */
    html.is-entering .header,
    html.is-entering .hero-image,
    html.is-entering .hero-subtitle,
    html.is-entering .hero-title,
    html.is-entering .animated-roles,
    html.is-entering .about-me-section,
    html.is-entering .hero-buttons,
    html.is-entering .hero-social {
        opacity:   1    !important;
        transform: none !important;
    }
}

