/* --- VARIABLES & RESET --- */
:root {
    /* Background & Text */
    --bg: #050505;
    --text: #ffffff;
    --text-muted: #a0a0a0;

    /* Primary Color - Softer Emerald Green */
    --primary: #10b981;
    --primary-soft: #6ee7b7;
    --primary-deep: #047857;
    --primary-rgb: 16, 185, 129;

    /* Secondary & Accent */
    --secondary: #ffffff;
    --accent: #065f46;
    --accent-rgb: 6, 95, 70;
    --accent-warm: #fbbf24;
    --accent-warm-rgb: 251, 191, 36;

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Typography */
    --font-main: 'Outfit', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;

    /* Animation */
    --easing: cubic-bezier(0.19, 1, 0.22, 1);

    /* Gradients */
    --gradient: linear-gradient(135deg, var(--primary), var(--primary-deep));
    --gradient-soft: linear-gradient(135deg, var(--primary-soft), var(--primary));
    --gradient-warm: linear-gradient(135deg, var(--accent-warm), #f59e0b);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Safari tap highlight fix */
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    /* iOS Safari viewport fix */
    height: -webkit-fill-available;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* fallback for older browsers */
    overflow-x: clip;
    overscroll-behavior-x: none;
}

body {
    background-color: var(--bg);
    color: var(--text);
    /* Safari text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* iOS viewport fix */
    min-height: 100vh;
    min-height: -webkit-fill-available;
    font-family: var(--font-main);
    width: 100%;
    max-width: 100%;
    position: relative;
    overflow-x: hidden; /* fallback for older browsers */
    overflow-x: clip;
    overscroll-behavior-x: none;
    line-height: 1.6;
}

img,
video,
iframe,
canvas {
    max-width: 100%;
}



.skip-link {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    z-index: 1000;
    transition: top 0.3s var(--easing);
}

.skip-link:focus {
    top: 20px;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
/* ========================================
   NAME REVEAL PRELOADER
   ======================================== */

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background:
        radial-gradient(circle at 30% 40%, rgba(var(--primary-rgb), 0.12), transparent 55%),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.04), transparent 50%),
        #050505;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.preloader.fade-out {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

.preloader-content {
    text-align: center;
    max-width: 900px;
    padding: 0 2rem;
}

.preloader-role {
    font-family: var(--font-main);
    font-size: clamp(0.75rem, 1.5vw, 0.95rem);
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--primary);
    margin-bottom: 1.2rem;
    opacity: 0;
    clip-path: inset(0 0 100% 0);
}

.preloader-name {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1.05;
    color: var(--text);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 0.35em;
}

.preloader-word {
    display: inline-flex;
    overflow: hidden;
}

.preloader-name .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
}

.preloader-line {
    width: 0;
    height: 2px;
    margin: 1.5rem auto;
    background: linear-gradient(90deg, var(--primary), var(--primary-soft));
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.4);
}

.preloader-tagline {
    font-family: var(--font-main);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
}

/* Reduced motion: skip animations, show content immediately */
@media (prefers-reduced-motion: reduce) {
    .preloader-role, .preloader-tagline {
        opacity: 1;
        clip-path: none;
    }
    .preloader-name .char {
        opacity: 1;
        transform: none;
    }
    .preloader-line {
        width: 80px;
    }
}

@media (max-width: 480px) {
    .preloader-name { gap: 0 0.25em; }
}

/* ========================================
   MAIN CONTENT STYLES
   ======================================== */

.lead {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
}

.section-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.loader-logo {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.loader-line {
    width: 0;
    height: 2px;
    background: var(--primary);
    margin: 0 auto;
    animation: loadLine 1.5s ease-in-out forwards 0.5s;
}

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

@keyframes loadLine {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

/* Removed global cursor: none for a, button, etc to prevent accessibility issues if JS fails */

/* --- CURSOR --- */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;

    z-index: 9999;
    pointer-events: none;
    mix-blend-mode: difference;
    /* Inverts colors for visibility */
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: white;
    /* White + Difference = Invert */
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s, transform 0.2s;
}

/* Cursor Hover State */
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent;
    backdrop-filter: blur(2px);
}

/* Cursor Click State */
body.cursor-clicking .cursor-outline {
    transform: translate(-50%, -50%) scale(0.8);
    background-color: rgba(255, 255, 255, 0.3);
}

/* --- BACKGROUND ANIMATION (AURA + ThreeUI Nebula) --- */
.aura-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    background: var(--bg);
}

#threeui-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    opacity: 0.95;
    will-change: opacity;
}

@media (prefers-reduced-motion: reduce) {
    #threeui-canvas {
        display: none;
    }
}

body.light-theme #threeui-canvas {
    opacity: 0.45;
}

/* When WebGL is active, reduce CSS orb cost */
.aura-background:has(#threeui-canvas) .aura-orb {
    animation: none;
    opacity: 0.14;
    will-change: auto;
}

.aura-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.28;
    animation: float 10s infinite ease-in-out alternate;
    /* keep as subtle fallback under WebGL, lower opacity so canvas shows */
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent), transparent 70%);
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--secondary), transparent 70%);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 40%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, var(--primary), transparent 70%);
    animation-duration: 15s;
}

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

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.05;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    display: none;
    /* Clean look */
}

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

.section {
    padding: 8rem 0;
}

@supports (content-visibility: auto) {
    .section {
        content-visibility: auto;
        contain-intrinsic-size: 900px;
    }
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.outline-text {
    -webkit-text-stroke: 2px var(--text);
    color: transparent;
    opacity: 0.3;
    font-weight: 700;
}

.center {
    text-align: center;
}

.highlight {
    color: var(--primary);
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
}

.link-arrow i {
    font-size: 0.85rem;
    transition: transform 0.3s var(--easing);
}

.link-arrow:hover i {
    transform: translateY(-2px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

/* Focus states for accessibility */
.btn:focus-visible,
.tab-btn:focus-visible,
.link-arrow:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 100;
    padding: 1.25rem 0;
    transition: all 0.4s var(--easing);
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.75rem 0;
    width: 92%;
    max-width: 1100px;
    top: 0.75rem;
    border-radius: 60px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.nav-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-logo .highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-soft) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
    transition: opacity 0.3s var(--easing);
}

.nav-badge {
    display: none;
    /* Hidden on desktop, shown only in mobile menu */
}

.nav-close {
    display: none;
    /* Hidden on desktop, shown only in mobile menu */
}

.nav-toggle {
    display: none;
    /* Hidden on desktop, shown only in mobile menu */
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 5, 0.75);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--easing);
    z-index: 90;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.nav-link {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.25rem 0;
}

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

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

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

.btn-contact {
    padding: 0.6rem 1.4rem;
    border: 1px solid rgba(var(--primary-rgb), 0.4);
    border-radius: 50px;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-contact::after {
    display: none;
}

.btn-contact:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.3);
}

/* --- HERO --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    background: linear-gradient(var(--bg), var(--bg)) padding-box,
        linear-gradient(90deg, var(--primary), var(--primary-soft), var(--primary)) border-box;
    border: 1px solid transparent;
    animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(var(--primary-rgb), 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.5);
    }
}

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

.title-3d {
    display: inline-block;
    position: relative;
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.25),
        0 2px 0 rgba(0, 0, 0, 0.22),
        0 4px 10px rgba(0, 0, 0, 0.35),
        0 10px 24px rgba(0, 0, 0, 0.25);
    transform-style: preserve-3d;
}

.hero-content.gsap-ready {
    animation: none;
}

.hero-desc {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: min(600px, 100%);
    margin: 0 auto 2.5rem;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: break-word;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-btns .btn {
    min-width: 180px;
    justify-content: center;
}

.hero-marquee {
    margin: 2.4rem 0 2rem;
    overflow: hidden;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.9rem 0;
    background: rgba(255, 255, 255, 0.01);
}

.hero-marquee::before,
.hero-marquee::after {
    content: '';
    position: absolute;
    top: 0;
    width: 60px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.hero-marquee::before {
    left: 0;
    background: linear-gradient(90deg, rgba(5, 5, 5, 0.95), transparent);
}

.hero-marquee::after {
    right: 0;
    background: linear-gradient(270deg, rgba(5, 5, 5, 0.95), transparent);
}

.hero-marquee-track {
    display: flex;
    align-items: center;
    gap: 0;
    width: max-content;
    animation: heroMarquee 22s linear infinite;
    will-change: transform;
}

.hero-marquee-group {
    display: flex;
    align-items: center;
    gap: 0;
}

.tech-tile {
    width: 86px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 8, 8, 0.4);
}

.tech-icon {
    width: 28px;
    height: 28px;
    filter: none;
    opacity: 1;
}

body.light-theme .hero-marquee::before {
    background: linear-gradient(90deg, rgba(250, 249, 247, 0.95), transparent);
}

body.light-theme .hero-marquee::after {
    background: linear-gradient(270deg, rgba(250, 249, 247, 0.95), transparent);
}

body.light-theme .tech-icon {
    filter: none;
    opacity: 1;
}

.hero-marquee:hover .hero-marquee-track {
    animation-play-state: paused;
}

@keyframes heroMarquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}



/* Buttons */
.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s var(--easing);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-ghost {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text);
    backdrop-filter: blur(4px);
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
}

.btn-primary:hover {
    box-shadow: 0 10px 35px rgba(255, 255, 255, 0.25),
        0 0 50px rgba(var(--primary-rgb), 0.2);
}

.btn-ghost:hover {
    box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.15);
}

/* --- CARDS & GLASS PANELS --- */
.glass-panel {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.tilt-card {
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

/* --- ABOUT --- */
.grid-about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-visual .glass-panel {
    padding: 1rem;
    position: relative;
}

.profile-img {
    width: 100%;
    border-radius: 16px;
    display: block;
    filter: grayscale(20%);
}

.floating-badge {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-1 {
    top: 20px;
    right: -20px;
    color: var(--primary);
}

.badge-2 {
    bottom: 40px;
    left: -20px;
    color: var(--secondary);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.tech-stack span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

/* --- RESUME TABS --- */
.resume-container {
    margin-top: 4rem;
    padding: 2rem;
}

.tab-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 3rem;
    row-gap: 2.5rem;
}

.skill-item {
    margin-bottom: 0;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.8rem;
}

.skill-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.skill-level {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.skill-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient);
    border-radius: 10px;
    width: 0;
    transition: width 1s ease-out;
}

/* Metrics Grid (replaces skill bars) */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    text-align: center;
    padding: 2rem 1.5rem;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.metric-icon {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.metric-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.5rem;
}

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

.skills-list {
    margin-top: 2rem;
}

.skills-list h4 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

    .metric-value {
        font-size: 2rem;
    }
}

/* Timeline */
.timeline {
    position: relative;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 2rem;
    margin-left: 1rem;
}

.timeline-item {
    margin-bottom: 2.5rem;
    position: relative;
}

.timeline-marker {
    position: absolute;
    left: -2.6rem;
    top: 0.3rem;
    width: 16px;
    height: 16px;
    background: var(--bg);
    border: 2px solid var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}

.timeline-content h4 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.company {
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

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

.experience-details {
    list-style: disc;
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.experience-details li {
    margin-bottom: 0.5rem;
}

/* Education */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.education-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.education-icon {
    font-size: 2rem;
    color: var(--secondary);
}

.education-content h4 {
    margin-bottom: 0.3rem;
}

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

/* --- SERVICES --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(var(--primary-rgb), 0.1), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.service-card:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(var(--primary-rgb), 0.1);
}

.service-card .icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.service-card:hover .icon {
    transform: scale(1.1);
}

/* --- PORTFOLIO --- */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.link-arrow.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.link-arrow.btn:hover {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
}

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

.portfolio-grid {
    display: grid;
    gap: 4rem;
}

.project-card {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 2.5rem;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 50%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.project-card:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(30, 30, 30, 0.8);
    transform: translateY(-5px);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(var(--primary-rgb), 0.15);
}

.project-image {
    border-radius: 12px;
    overflow: hidden;
    height: 320px;
    position: relative;
    background: #1a1a1a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Browser Frame Styles removed */

.image-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.image-container img,
.image-container iframe {
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 5s ease-in-out;
    border: none !important;
}

.figma-embed {
    background: #000;
}

.project-card:hover .figma-embed iframe {
    transform: none;
}

/* Scroll on Hover removed */

.project-content {
    position: relative;
    z-index: 2;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.project-tags span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 50px;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.project-card h3 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    background: linear-gradient(90deg, #fff, #ddd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-impact {
    margin: 0.2rem 0 1.15rem;
    color: var(--text-muted);
    font-size: 0.96rem;
    line-height: 1.55;
}

/* Project Actions */
.project-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.project-link,
.btn-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    border: none;
}

.project-link {
    background: var(--text);
    color: var(--bg);
}

.project-link:hover {
    background: var(--primary);
    color: var(--bg);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(var(--primary-rgb), 0.4);
}

.btn-preview {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-preview:hover {
    border-color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    transform: translateY(-2px);
}

/* Preview Container */
.preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: #000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    /* Match project-image radius */
    overflow: hidden;
}

.project-card.preview-active .preview-container {
    opacity: 1;
    pointer-events: auto;
}

.preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Disable existing hover effects when preview is active */
.project-card.preview-active:hover .image-container img {
    transform: none !important;
}

/* --- CONTACT --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-text h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.contact-email {
    text-align: center;
    margin-top: 1rem;
}

.contact-email a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.contact-email a:hover {
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(var(--primary-rgb), 0.05);
}

.contact-email i {
    font-size: 1rem;
}

.socials-big a {
    display: block;
    font-size: 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: 0.3s;
}

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

.socials-big .icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1.3rem;
    margin-top: 2rem;
}

.socials-big .icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.socials-big .icons a:hover {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.2);
}

.minimal-form .form-group {
    margin-bottom: 1.5rem;
}

.minimal-form input,
.minimal-form textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    color: var(--text);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: 0.3s;
}

.minimal-form input:focus,
.minimal-form textarea:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

.full-width {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
}

/* --- BOOKING OPTIONS --- */
.booking-options {
    margin: 2.5rem 0;
    padding: 2rem;
    background: rgba(var(--primary-rgb), 0.03);
    border-radius: 20px;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
}

.booking-options h4 {
    font-size: 0.85rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.booking-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.booking-btn {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--primary-rgb), 0.02) 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-main);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.booking-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.booking-btn:hover {
    border-color: rgba(var(--primary-rgb), 0.4);
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(var(--primary-rgb), 0.15),
        0 5px 15px rgba(0, 0, 0, 0.2);
}

.booking-btn:hover::before {
    opacity: 1;
}

.booking-btn i {
    font-size: 1.75rem;
    color: var(--primary);
    position: relative;
    z-index: 1;
}

.booking-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    z-index: 1;
}

.booking-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.booking-duration {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.booking-duration::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.6;
}

@media (max-width: 480px) {
    .booking-buttons {
        flex-direction: column;
    }

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

/* --- TESTIMONIALS --- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.testimonial-card {
    padding: 2.5rem;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.testimonial-quote {
    margin-bottom: 1.5rem;
}

.testimonial-quote i {
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.6;
}

.testimonial-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 2rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.author-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.author-info span {
    font-size: 0.9rem;
    color: var(--primary);
}

/* --- FOOTER --- */
.simple-footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--glass-border);
    background: radial-gradient(circle at top, rgba(var(--primary-rgb), 0.08), transparent 55%),
        rgba(255, 255, 255, 0.02);
}

.footer-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.16), rgba(var(--primary-rgb), 0.06));
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.12);
}

.status-dot {
    width: 9px;
    height: 9px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.footer-cta {
    margin-bottom: 1.5rem;
}

.footer-cta a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.8rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
        var(--gradient);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 30px rgba(var(--primary-rgb), 0.25);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.footer-cta a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
    transform: translateX(-120%);
    transition: transform 0.5s ease;
}

.footer-cta a:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(var(--primary-rgb), 0.32);
}

.footer-cta a:hover::before {
    transform: translateX(120%);
}

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

/* --- RESPONSIVE --- */

/* Tablets and below */
@media (max-width: 992px) {
    .hero-title {
        font-size: clamp(3rem, 6vw, 5rem);
    }

    .grid-about,
    .project-card,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .project-image {
        height: 250px;
    }
}

/* Mobile devices - Medium to Large (up to 900px) */
@media (max-width: 900px) {
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        background: #000000;
        border: none;
        gap: 0;
        transform: translate3d(100%, 0, 0);
        opacity: 1;
        visibility: visible;
        will-change: transform;
        transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 120;
    }

    .nav-menu.active {
        transform: translate3d(0, 0, 0);
    }

    .nav-menu a {
        font-size: clamp(1.5rem, 5vw, 2rem);
        font-weight: 700;
        font-family: var(--font-display);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--text);
        text-decoration: none;
        padding: 1rem 0;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease, color 0.2s ease;
    }

    /* Close button - hidden, hamburger transforms to X instead */

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

    .nav-menu.active a {
        opacity: 1;
        transform: translateY(0);
    }

    /* Using nth-of-type to skip the close button */
    .nav-menu.active a:nth-of-type(1) {
        transition-delay: 0.1s;
    }

    .nav-menu.active a:nth-of-type(2) {
        transition-delay: 0.15s;
    }

    .nav-menu.active a:nth-of-type(3) {
        transition-delay: 0.2s;
    }

    .nav-menu.active a:nth-of-type(4) {
        transition-delay: 0.25s;
    }

    .nav-menu.active a:nth-of-type(5) {
        transition-delay: 0.3s;
    }

    /* CTA Button in mobile menu */
    .nav-menu .btn-contact {
        margin-top: 2.5rem;
        padding: 1.1rem 3rem;
        background: var(--text);
        color: var(--bg);
        border: none;
        border-radius: 999px;
        font-size: 1rem;
        font-weight: 600;
        font-family: var(--font-main);
        text-transform: none;
        letter-spacing: 0;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
        box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
    }

    .nav-menu .btn-contact:hover {
        background: var(--primary);
        color: var(--bg);
    }

    .nav-menu.active .btn-contact {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.35s;
    }

    /* Hide nav-close button - hamburger transforms to X instead */
    .nav-close {
        display: none !important;
    }

    .nav-badge {
        display: none;
    }

    .nav-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        width: 24px;
        height: 24px;
    }

    .hamburger::before,
    .hamburger::after {
        content: '';
        display: block;
        height: 2px;
        background: var(--text);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .hamburger::before {
        width: 100%;
    }

    .hamburger::after {
        width: 60%;
        margin-left: auto;
    }

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

    /* Active state: transforms to X */
    .nav-toggle.active .hamburger {
        gap: 0;
    }

    .nav-toggle.active .hamburger::before {
        transform: translateY(1px) rotate(45deg);
    }

    .nav-toggle.active .hamburger::after {
        width: 100%;
        transform: translateY(-1px) rotate(-45deg);
    }

    .minimal-form input,
    .minimal-form textarea {
        width: 100%;
        background: transparent;
    }

    /* Container and Spacing */
    .container {
        padding: 0 1.5rem;
    }

    .section {
        padding: 5rem 0;
    }

    /* Navbar Fixes */

    .navbar {
        top: 0;
        bottom: auto;
        padding: 1rem 0;
        border-bottom: 1px solid var(--glass-border);
        border-top: none;
    }

    .nav-container {
        justify-content: space-between;
        padding: 0 1.5rem;
    }

    .nav-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        z-index: 121;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        background: rgba(8, 8, 8, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-left: none;
        gap: 0;
        transform: translate3d(100%, 0, 0);
        will-change: transform;
        transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 120;
        box-shadow: none;
        overflow: hidden;
    }

    .nav-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 2px;
        height: 100%;
        background: linear-gradient(180deg,
                transparent 0%,
                var(--primary) 20%,
                var(--primary) 80%,
                transparent 100%);
        opacity: 0;
        transition: opacity 0.4s ease 0.2s;
    }

    .nav-menu.active::before {
        opacity: 1;
    }

    .nav-menu.active {
        transform: translate3d(0, 0, 0);
    }

    /* Hide floating bar when mobile menu is open */
    .nav-overlay.active~.floating-bar,
    body:has(.nav-menu.active) .floating-bar {
        opacity: 0 !important;
        pointer-events: none;
        transform: translateX(-50%) translateY(100px) !important;
    }

    /* Nav Links Container */
    .nav-menu .nav-links-wrapper {
        display: flex;
        flex-direction: column;
        padding: 7rem 2.5rem 2rem;
        flex: 1;
    }

    .nav-menu a {
        font-size: 1.75rem;
        font-weight: 700;
        font-family: var(--font-display);
        color: var(--text);
        text-decoration: none;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 1rem 0;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        text-align: center;
        border-bottom: none;
    }

    .nav-menu a:last-of-type {
        border-bottom: none;
    }

    .nav-menu a::before {
        content: none;
    }

    .nav-menu {
        counter-reset: nav-counter;
    }

    .nav-menu a:hover {
        color: var(--primary);
        /* padding-left removed to keep centering */
        transform: scale(1.05);
    }

    .nav-menu a:hover::before {
        opacity: 1;
    }

    .nav-menu.active a {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered Animation Delays */
    .nav-menu.active a:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-menu.active a:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-menu.active a:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-menu.active a:nth-child(4) {
        transition-delay: 0.25s;
    }

    .nav-menu.active a:nth-child(5) {
        transition-delay: 0.3s;
    }

    /* Badge at bottom */
    .nav-badge {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 1.5rem;
        padding: 0.5rem 1.2rem;
        background: rgba(var(--primary-rgb), 0.08);
        border: 1px solid rgba(var(--primary-rgb), 0.2);
        border-radius: 50px;
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--primary);
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
    }

    .nav-badge::before {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
        display: inline-block;
        background: var(--primary);
        color: var(--primary);
    }

    .nav-menu.active .nav-badge {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.4s;
    }

    /* Hero Section */
    .hero {
        padding-top: 100px;
    }

    .about-visual .glass-panel {
        overflow: hidden;
    }

    .badge-1 {
        right: 0.75rem;
    }

    .badge-2 {
        left: 0.75rem;
        bottom: 0.75rem;
    }



    .hero-btns {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 320px;
    }

    .hero-marquee {
        margin: 1.7rem 0 1.5rem;
        padding: 0.7rem 0;
    }

    .hero-marquee-track {
        animation-duration: 18s;
    }

    .tech-icon {
        width: 24px;
        height: 24px;
    }

    .tech-tile {
        width: 70px;
        height: 56px;
    }

    /* Tech Stack */
    .tech-stack {
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .tech-stack span {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    /* Cursor (hide on mobile) */
    .cursor-dot,
    .cursor-outline {
        display: none;
    }

    /* Typography */
    .section-title {
        font-size: 2.5rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    .hero-title {
        font-size: clamp(2.2rem, 7.2vw, 3.2rem);
        line-height: 1.1;
        text-wrap: balance;
        max-width: 22ch;
        margin-inline: auto;
        overflow-wrap: break-word;
    }

    /* Resume Container */
    .resume-container {
        padding: 1.5rem;
        margin-top: 2rem;
    }

    /* Hide Scrollbar on Tabs */
    .tab-buttons {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tab-buttons::-webkit-scrollbar {
        display: none;
    }

    /* Stack Grids */
    .skills-grid,
    .education-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        gap: 2rem;
    }

    /* Timeline Adjustments */
    .timeline {
        padding-left: 1.5rem;
        margin-left: 0.5rem;
    }

    .timeline-marker {
        left: -1.4rem;
    }

    /* Floating Badges - keep inside viewport */
    .about-visual .glass-panel {
        overflow: hidden;
    }

    .badge-1 {
        right: 12px;
    }

    .badge-2 {
        left: 12px;
    }

    /* Portfolio */
    .header-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header-row .section-title {
        margin-bottom: 1rem;
    }

    .project-card h3 {
        font-size: 1.8rem;
    }

    /* Contact */
    .contact-text h2 {
        font-size: 2.5rem;
    }

    .socials-big a {
        font-size: 1.2rem;
    }
}

/* Small Mobile devices (up to 640px) */
@media (max-width: 640px) {
    .nav-overlay {
        display: none;
    }

    .navbar {
        padding-top: calc(1rem + env(safe-area-inset-top));
    }

    /* Container */
    .container {
        padding: 0 1.25rem;
    }

    .section {
        padding: 4rem 0;
    }

    /* Hero */
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
    }

    .hero-desc {
        font-size: 0.95rem;
        max-width: 42ch;
        margin-inline: auto;
        text-wrap: balance;
    }

    .hero-btns .btn {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }

    /* About */
    .section-title {
        font-size: 2.2rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-card {
        padding: 2rem 1.5rem;
    }

    .service-card h3 {
        font-size: 1.3rem;
    }

    /* Portfolio */
    .project-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .project-card h3 {
        font-size: 1.6rem;
    }

    .project-image {
        height: 200px;
    }

    /* Contact */
    .contact-text h2 {
        font-size: 2rem;
    }

    .minimal-form input,
    .minimal-form textarea {
        font-size: 0.95rem;
    }

    /* Preloader */
    .shadow-fighter {
        transform: scale(0.75);
    }

    .preloader-title {
        font-size: 2.5rem;
    }

    .preloader-subtitle {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }
}

/* Extra Small Mobile (up to 480px) */
@media (max-width: 480px) {

    /* Container */
    .container {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0 1rem;
        /* Matches .container padding */
    }

    .section {
        padding: 3.5rem 0;
    }

    /* Hero */
    .hero {
        min-height: 90vh;
        padding-top: 80px;
    }

    .hero-title {
        font-size: 2.1rem;
        max-width: 20ch;
    }

    .hero-desc {
        font-size: 0.9rem;
        margin-bottom: 2rem;
        max-width: 34ch;
        margin-inline: auto;
        text-wrap: balance;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
        margin-bottom: 1.2rem;
    }

    .hero-btns .btn {
        padding: 0.85rem 1.3rem;
        font-size: 0.9rem;
    }

    /* About */
    .section-title {
        font-size: 2rem;
    }

    .lead {
        font-size: 0.95rem;
    }

    .about-info p {
        font-size: 0.9rem;
    }

    /* Floating Badges */
    .floating-badge {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    /* Tech Stack */
    .tech-stack span {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }

    /* Resume Tabs */
    .tab-btn {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .resume-container {
        padding: 1.25rem;
    }

    /* Timeline */
    .timeline-content h4 {
        font-size: 1rem;
    }

    .company {
        font-size: 0.85rem;
    }

    .experience-details {
        font-size: 0.85rem;
    }

    /* Education */
    .education-item {
        padding: 1.25rem;
    }

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

    .education-content h4 {
        font-size: 1rem;
    }

    /* Services */
    .service-card {
        padding: 1.75rem 1.25rem;
    }

    .service-card .icon {
        font-size: 1.75rem;
    }

    .service-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }

    .service-card p {
        font-size: 0.9rem;
    }

    /* Portfolio */
    .project-card {
        padding: 1.25rem;
    }

    .project-card h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .project-tags span {
        font-size: 0.75rem;
    }

    .project-image {
        height: 180px;
    }

    /* Contact */
    .contact-wrapper {
        padding: 1.5rem;
    }

    .contact-text h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .contact-text p {
        font-size: 0.9rem;
    }

    .socials-big a {
        font-size: 1rem;
    }

    .socials-big .icons {
        font-size: 1.1rem;
        gap: 1.25rem;
    }

    .minimal-form input,
    .minimal-form textarea {
        font-size: 0.9rem;
        padding: 0.85rem 0;
    }

    .btn.full-width {
        font-size: 0.9rem;
        padding: 0.85rem;
    }

    /* Footer */
    .simple-footer {
        font-size: 0.85rem;
        padding: 1.5rem;
    }

    /* Preloader */
    .shadow-fighter {
        transform: scale(0.65);
        margin-bottom: 100px;
    }

    .preloader-title {
        font-size: 2rem;
    }

    .preloader-subtitle {
        font-size: 0.85rem;
        letter-spacing: 1.5px;
    }

    .percentage-counter {
        font-size: 1.25rem;
    }

    .percentage-number {
        font-size: 1.75rem;
    }

    .loading-bar {
        width: 200px;
    }
}

/* Very Small Mobile (up to 375px - iPhone SE, etc.) */
@media (max-width: 375px) {
    .container {
        padding: 0 0.85rem;
    }

    .nav-container {
        padding: 0 0.85rem;
        /* Matches .container padding */
    }

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

    .section-title {
        font-size: 1.85rem;
    }

    .project-card h3 {
        font-size: 1.4rem;
    }

    .contact-text h2 {
        font-size: 1.6rem;
    }

    .preloader-title {
        font-size: 1.75rem;
    }

    .shadow-fighter {
        transform: scale(0.6);
    }
}

/* Extra Small Mobile (up to 320px - Very old devices) */
@media (max-width: 320px) {
    .container {
        padding: 0 0.75rem;
    }

    .nav-container {
        padding: 0 0.75rem;
        /* Matches .container padding */
    }

    .hero-title {
        font-size: 1.85rem;
    }

    .hero-desc {
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 1.7rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }

    .preloader-title {
        font-size: 1.6rem;
    }

    .shadow-fighter {
        transform: scale(0.55);
    }

    .loading-bar {
        width: 180px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .particles,
    .footstep-ripple,
    .spotlight-effect,
    .spotlight-beam,
    .aura-background,
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }

    .tilt-card {
        transform: none !important;
    }

    .magnetic {
        transform: none !important;
    }

    .hero-marquee-track {
        animation: none !important;
        transform: none !important;
    }
}

/* Form Status */
.form-status {
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 1.5em;
}

.form-status.success {
    color: var(--primary);
}

.form-status.error {
    color: var(--secondary);
}

/* --- SCROLL ANIMATIONS --- */
.animate-ready {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Staggered animation for grid items */
.service-card.animate-ready,
.project-card.animate-ready,
.timeline-item.animate-ready,
.education-item.animate-ready {
    transition-delay: var(--stagger-delay, 0s);
}

/* Hero content fade on load */
.hero-content {
    animation: heroFadeIn 0.9s ease-out 1.8s both;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Nav link animated underline */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-soft));
    transition: width 0.3s ease;
}

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

/* ========================================
   FLOATING FOOTER BAR
   ======================================== */

.floating-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(var(--primary-rgb), 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-bar.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

body.chat-open .floating-bar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(100px);
}

body.chat-open .ai-chat-launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(0.98);
}

body.chat-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(6, 6, 6, 0.35);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    z-index: 1098;
}

.ai-chatbot {
    z-index: 1102;
}

.ai-chat-launcher {
    z-index: 1102;
}
@keyframes floatingBarEnter {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.floating-bar-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 1.1rem;
}

.floating-bar-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.floating-bar-item:active {
    transform: translateY(0) scale(0.95);
}

/* Tooltip */
.floating-bar-item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.95);
    color: #0a0a0a;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.floating-bar-item::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.floating-bar-item:hover::before,
.floating-bar-item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.floating-bar-item:hover::after {
    transform: translateX(-50%);
}

/* Divider */
.floating-bar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 0.25rem;
}

/* Theme toggle special styling */
.theme-toggle {
    font-family: var(--font-main);
}

.theme-toggle i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle:hover i {
    transform: rotate(25deg);
}

/* Light theme styles */
body.light-theme {
    --bg: #faf9f7;
    --text: #1a1a1a;
    --text-muted: #525252;
    --primary: #059669;
    --primary-soft: #34d399;
    --primary-deep: #047857;
    --primary-rgb: 5, 150, 105;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
}

body.light-theme .floating-bar {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.1),
        0 0 40px rgba(var(--primary-rgb), 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-theme .floating-bar-item {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .floating-bar-item:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.08);
}

body.light-theme .floating-bar-divider {
    background: rgba(0, 0, 0, 0.12);
}

body.light-theme .floating-bar-item::before {
    background: rgba(10, 10, 10, 0.9);
    color: #ffffff;
}

body.light-theme .floating-bar-item::after {
    border-top-color: rgba(10, 10, 10, 0.9);
}

body.light-theme .aura-background {
    background: var(--bg);
}

body.light-theme .glass-panel {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .nav-link {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .nav-link:hover {
    color: var(--text);
}

/* Light theme mobile menu */
body.light-theme .nav-menu {
    background: rgba(250, 250, 250, 0.98);
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .nav-menu a {
    color: var(--text);
}

body.light-theme .nav-badge {
    background: rgba(var(--primary-rgb), 0.05);
    border-color: rgba(var(--primary-rgb), 0.15);
}

/* Ensure button text is visible in light mode (overriding generic link color) */
body.light-theme .nav-menu .btn-contact {
    color: var(--bg);
    background: var(--text);
}

body.light-theme .nav-menu .btn-contact:hover {
    background: var(--primary);
    color: var(--bg);
}

/* Mobile adjustments for floating bar */
@media (max-width: 768px) {
    .floating-bar {
        bottom: 1.25rem;
        padding: 0.4rem 0.6rem;
        gap: 0.15rem;
    }

    .floating-bar-item {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .floating-bar-divider {
        height: 20px;
        margin: 0 0.15rem;
    }

    /* Hide tooltips on mobile */
    .floating-bar-item::before,
    .floating-bar-item::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .floating-bar {
        gap: 0.1rem;
        padding: 0.35rem 0.5rem;
    }

    .floating-bar-item {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .floating-bar-divider {
        height: 18px;
    }
}

/* ========================================
   AI CHAT ASSISTANT
   ======================================== */

.ai-chat-launcher {
    position: fixed;
    right: clamp(1rem, 3vw, 1.5rem);
    bottom: clamp(1rem, 3vw, 1.5rem);
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid rgba(var(--primary-rgb), 0.45);
    border-radius: 999px;
    padding: 0.8rem 1rem;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(10, 10, 10, 0.92));
    color: var(--text);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35), 0 0 24px rgba(var(--primary-rgb), 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
}

.ai-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-image: url("Images/Eugene in cartoon.jpg");
    background-size: 185%;
    background-position: center 18%;
    background-repeat: no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    flex: 0 0 auto;
}

.ai-chat-launcher:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb), 0.7);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.4), 0 0 28px rgba(var(--primary-rgb), 0.25);
}

.ai-chatbot {
    position: fixed;
    right: clamp(1rem, 3vw, 1.5rem);
    bottom: 5.5rem;
    width: min(390px, calc(100vw - 2rem));
    height: min(540px, 72vh);
    z-index: 1101;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    contain: layout paint;
    will-change: transform, opacity;
    touch-action: pan-y;
}

.ai-chat-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(10, 10, 10, 0.93));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45), 0 0 35px rgba(var(--primary-rgb), 0.14);
    overflow: hidden;
}

.ai-chatbot.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

.ai-chat-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ai-chat-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ai-chat-brand .ai-avatar {
    width: 34px;
    height: 34px;
    background-size: 190%;
    background-position: center 16%;
}

.ai-chat-titles h3 {
    margin: 0 0 0.15rem;
}

.ai-chat-subtitle {
    margin: 0;
}

.ai-chat-title-wrap h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.ai-chat-title-wrap p {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.ai-chat-status {
    margin-top: 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ai-chat-status .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.ai-chat-status.online .dot {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.ai-chat-status.offline .dot {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.ai-chat-status.pending .dot {
    background: #f59e0b;
}

.ai-chat-status.ready .dot {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.ai-chat-close {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.9);
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-close:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--primary-rgb), 0.6);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}

.ai-chat-footer {
    margin-top: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border-top: none;
    z-index: 2;
}

.ai-chat-messages {
    flex: 1;
    padding: 1.1rem 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    touch-action: pan-y;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
}

.ai-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-msg {
    max-width: 82%;
    padding: 0.7rem 0.95rem;
    border-radius: 18px;
    font-size: 0.93rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.ai-msg-bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-bottom-left-radius: 6px;
}

.ai-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.95), rgba(var(--primary-rgb), 0.7));
    border: none;
    color: var(--bg);
    border-bottom-right-radius: 6px;
}

.ai-chat-actions {
    padding: 0 0.85rem 0.85rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ai-action-btn {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    font-family: var(--font-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.ai-action-btn:hover {
    border-color: rgba(var(--primary-rgb), 0.65);
    background: rgba(var(--primary-rgb), 0.12);
    transform: translateY(-1px);
}

.ai-chat-form {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.85rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.7rem;
    align-items: end;
    flex: 0 0 auto;
    background: linear-gradient(180deg, rgba(12, 12, 12, 0.94), rgba(6, 6, 6, 0.98));
}

.ai-chat-form textarea {
    resize: none;
    min-height: 46px;
    max-height: 120px;
    padding: 0.72rem 0.9rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-family: var(--font-main);
    font-size: 0.92rem;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.ai-chat-form textarea:focus {
    outline: none;
    border-color: rgba(var(--primary-rgb), 0.7);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
}

.ai-chat-form .btn {
    min-width: 96px;
    justify-content: center;
    padding: 0.75rem 1rem;
}

.ai-chat-form .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

body.light-theme .ai-chat-launcher {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 245, 0.92));
    color: var(--text);
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}

body.light-theme .ai-chat-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 245, 0.92));
    border-color: rgba(0, 0, 0, 0.09);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
}

body.light-theme .ai-chat-header,
body.light-theme .ai-chat-form {
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .ai-chat-messages {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0));
}

body.light-theme .ai-msg-bot {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text);
}

body.light-theme .ai-msg-user {
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    color: #ffffff;
}

body.light-theme .ai-chat-form textarea {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.14);
    color: var(--text);
}

body.light-theme .ai-chat-footer {
    border-color: rgba(0, 0, 0, 0.08);
    background: transparent;
}

body.light-theme .ai-chat-close {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body.light-theme .ai-msg-bot {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .ai-chat-form textarea {
    border-color: rgba(0, 0, 0, 0.16);
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme .title-3d {
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.15),
        0 2px 0 rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.18),
        0 10px 24px rgba(0, 0, 0, 0.15);
}

body.light-theme .ai-action-btn {
    border-color: rgba(0, 0, 0, 0.18);
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .ai-action-btn:hover {
    border-color: rgba(var(--primary-rgb), 0.75);
    background: rgba(var(--primary-rgb), 0.12);
}

@media (max-width: 768px) {
    .ai-chat-launcher {
        bottom: 4.5rem;
        right: 1rem;
        width: 52px;
        height: 52px;
        padding: 0;
        gap: 0;
        border-radius: 50%;
        justify-content: center;
        aspect-ratio: 1 / 1;
    }

    .ai-chat-launcher span:not(.ai-avatar) {
        display: none;
    }

    .ai-chat-launcher .ai-avatar {
        width: 32px;
        height: 32px;
    }

    .ai-chatbot {
        right: 1rem;
        left: 1rem;
        width: auto;
        top: calc(0.9rem + env(safe-area-inset-top));
        bottom: calc(5.2rem + env(safe-area-inset-bottom));
        height: auto;
        max-height: none;
    }

    .ai-chat-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .ai-chat-actions::-webkit-scrollbar {
        display: none;
    }

    .ai-chat-form {
        padding-bottom: calc(0.85rem + env(safe-area-inset-bottom));
    }

    .ai-chat-footer {
        margin-top: 0.5rem;
        padding-bottom: env(safe-area-inset-bottom);
    }
}

@media (max-width: 480px) {
    .ai-chat-launcher {
        right: 0.8rem;
        bottom: 4.2rem;
        width: 48px;
        height: 48px;
    }

    .ai-chat-launcher .ai-avatar {
        width: 30px;
        height: 30px;
    }

    .ai-chatbot {
        right: 0.7rem;
        left: 0.7rem;
        top: calc(0.7rem + env(safe-area-inset-top));
        bottom: calc(5.8rem + env(safe-area-inset-bottom));
        height: auto;
        max-height: none;
    }

    .ai-chat-actions {
        gap: 0.35rem;
        padding: 0 0.75rem 0.75rem;
    }

    .ai-action-btn {
        font-size: 0.72rem;
        padding: 0.42rem 0.6rem;
    }

    .ai-chat-form {
        grid-template-columns: 1fr;
    }

    .ai-chat-form .btn {
        width: 100%;
    }

    .ai-chat-footer {
        margin-top: 0.4rem;
        padding-bottom: env(safe-area-inset-bottom);
    }
}
