:root {
    --brand-cyan: #00f2ff;
    --brand-blue: #0ea5e9;
    --brand-dark: #030712;
    --brand-white: #ffffff;

    /* Light Mode Variables (Default) */
    --bg-main: #f1f5f9;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.8);
}

/* Dark Mode Overrides */
html.dark {
    --bg-main: #030712;
    --bg-secondary: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 41, 59, 0.5);
    --nav-bg: rgba(3, 7, 18, 0.8);
}

body {
    font-family: 'Inter', sans-serif;
    font-optical-sizing: auto;
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html.dark body {
    background-color: var(--bg-main);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    /* Mimicking the 450-500 Flex weight */
    color: var(--text-primary);
    letter-spacing: -0.025em;
    /* Tighter tracking for premium feel */
    line-height: 1.2;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease, border 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.text-gradient {
    background: linear-gradient(to right, #00f2ff, #0ea5e9, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-brand {
    background: linear-gradient(135deg, #00f2ff 0%, #0ea5e9 100%);
}

.glow {
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.2);
}

.dark .glow {
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.4);
}

.nav-link {
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--brand-cyan);
}

.tech-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-cyan);
}

/* Theme Toggle Button Styles */
#theme-toggle {
    cursor: pointer;
}

.dark #sun-icon {
    display: block;
}

.dark #moon-icon {
    display: none;
}

#sun-icon {
    display: none;
}

#moon-icon {
    display: block;
}

/* Overriding some Tailwind hardcoded dark classes for theme support */
html:not(.dark) .text-gray-400 {
    color: #475569;
}

html:not(.dark) .text-gray-300 {
    color: #334155;
}

html:not(.dark) .text-gray-500 {
    color: #64748b;
}

html:not(.dark) .bg-white\/5 {
    background-color: rgba(0, 0, 0, 0.05);
}

html:not(.dark) .border-white\/10 {
    border-color: rgba(0, 0, 0, 0.1);
}

/* Timeline Custom Styles */
@media (min-width: 768px) {
    .timeline-line {
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 1px;
        background: linear-gradient(to bottom, #00f2ff, #0ea5e9, #8b5cf6);
    }
}

.bg-slate-900\/40 {
    background-color: rgba(255, 255, 255, 0.5);
}

.dark .bg-slate-900\/40 {
    background-color: rgba(15, 23, 42, 0.4);
}

html.dark .text-gray-400 {
    color: #94a3b8;
    /* text-slate-400 equivalent for better contrast */
}

html.dark .text-gray-500 {
    color: #64748b;
    /* text-slate-500 */
}

/* Typing Cursor Styles */
.typed-cursor {
    font-size: 1.2em;
    color: var(--brand-cyan);
}

.text-secondary {
    color: var(--brand-blue);
}

/* Mobile Menu Icons */
.sun-icon-mobile,
.moon-icon-mobile {
    display: none;
}

html.dark .sun-icon-mobile {
    display: block;
    color: #fde047;
}

html:not(.dark) .moon-icon-mobile {
    display: block;
    color: #475569;
}

/* Fix generic text-white in light mode but keep it for buttons */
html:not(.dark) .text-white:not(button, a.bg-gradient-brand, .whatsapp-float, .text-white i) {
    color: #0f172a;
}

/* Mobile Menu Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.mobile-nav-link {
    padding: 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    background: var(--brand-cyan);
    color: white;
}

/* WhatsApp Floating Button - Subtle Bounce */
.whatsapp-float {
    position: fixed;
    padding: 0;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    background: transparent;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 5px 15px rgba(37, 211, 102, 0.4));
    animation: whatsapp-subtle-bounce 3s ease-in-out infinite;
}

@keyframes whatsapp-subtle-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

html.dark .whatsapp-float {
    filter: drop-shadow(0 0 20px rgba(37, 211, 102, 0.4));
}

.whatsapp-icon-circle {
    width: 100%;
    height: 100%;
    color: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-float:hover {
    animation-play-state: paused;
    transform: scale(1.15);
    filter: drop-shadow(0 8px 25px rgba(37, 211, 102, 0.6));
}

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 25px;
        right: 25px;
        border-radius: 16px;
    }

    .whatsapp-icon-circle {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
}

@keyframes loading-bar {
    0% {
        transform: scaleX(0);
    }

    50% {
        transform: scaleX(0.7);
    }

    100% {
        transform: scaleX(1);
    }
}

.animate-loading-bar {
    animation: loading-bar 1.5s ease-in-out infinite;
}

@keyframes bounce-slow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.animate-bounce-slow {
    animation: bounce-slow 4s ease-in-out infinite;
}

#preloader.loaded {
    opacity: 0;
    pointer-events: none;
}

/* --- Tech Marquee & Wave Animations --- */

.marquee-container {
    padding: 4rem 0;
    overflow: hidden;
    user-select: none;
    display: flex;
    white-space: nowrap;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.marquee-content {
    display: flex;
    flex-shrink: 0;
    gap: 4rem;
    padding-right: 4rem;
    /* Match gap for seamless flow */
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

.tech-item-wavy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: snake-wave 3s ease-in-out infinite;
}

@keyframes snake-wave {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Precise delays for "snake" synchronization */
.tech-item-wavy:nth-child(1) {
    animation-delay: 0s;
}

.tech-item-wavy:nth-child(2) {
    animation-delay: 0.2s;
}

.tech-item-wavy:nth-child(3) {
    animation-delay: 0.4s;
}

.tech-item-wavy:nth-child(4) {
    animation-delay: 0.6s;
}

.tech-item-wavy:nth-child(5) {
    animation-delay: 0.8s;
}

.tech-item-wavy:nth-child(6) {
    animation-delay: 1.0s;
}

.tech-item-wavy:nth-child(7) {
    animation-delay: 1.2s;
}

.tech-item-wavy:nth-child(8) {
    animation-delay: 1.4s;
}

.tech-item-wavy:nth-child(9) {
    animation-delay: 1.6s;
}

.tech-item-wavy:nth-child(10) {
    animation-delay: 1.8s;
}

.tech-item-wavy:nth-child(11) {
    animation-delay: 2.0s;
}

.tech-item-wavy:nth-child(12) {
    animation-delay: 2.2s;
}

.tech-item-wavy:nth-child(13) {
    animation-delay: 2.4s;
}

.tech-item-wavy:nth-child(14) {
    animation-delay: 2.6s;
}

.tech-item-wavy:nth-child(15) {
    animation-delay: 2.8s;
}

.tech-item-wavy:nth-child(16) {
    animation-delay: 3.0s;
}

.tech-item-wavy:nth-child(17) {
    animation-delay: 3.2s;
}

.tech-item-wavy:nth-child(18) {
    animation-delay: 3.4s;
}

.tech-item-wavy:nth-child(19) {
    animation-delay: 3.6s;
}

.tech-item-wavy:nth-child(20) {
    animation-delay: 3.8s;
}

.tech-item-wavy:nth-child(21) {
    animation-delay: 4.0s;
}

.tech-item-wavy:nth-child(22) {
    animation-delay: 4.2s;
}


.tech-bubble {
    width: 90px;
    height: 90px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
}

.tech-item-wavy:hover .tech-bubble {
    transform: scale(1.1);
    border-color: var(--brand-cyan);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.3);
    color: var(--brand-cyan);
}

.tech-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Contact Section Enhancements --- */
.contact-field {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-field:focus {
    border-color: var(--brand-cyan);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.15);
    transform: scale(1.01);
}

/* Rounded border trace effect simulated with shadow and scale */
.contact-field:focus-within {
    border-color: var(--brand-cyan);
}

.animate-float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 12s linear infinite;
}

.animate-spin-slow-reverse {
    animation: spin-slow 15s linear infinite reverse;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fade-up 0.6s ease-out forwards;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.2);
    border-color: var(--brand-cyan);
    transform: translateY(-2px);
}