@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --font-primary: 'Outfit', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --accent-color: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.3);
}

html.dark {
    --bg-color: #0b1120;
    --text-color: #f8fafc;
    --accent-color: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
}

html {
    scroll-behavior: smooth;
    /* Custom Scrollbar for a premium feel */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-color);
    overflow-x: hidden;
}

/* Webkit Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.outfit-font {
    font-family: var(--font-primary);
}

/* Base custom classes to complement Tailwind */
.text-gradient {
    background: linear-gradient(135deg, var(--accent-color), #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

html.dark .text-gradient {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-left {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.zoom-reveal {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.zoom-reveal.visible {
    opacity: 1;
    transform: scale(1);
}

/* Delay modifiers */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

.delay-500 {
    transition-delay: 500ms;
}

/* Floating shapes */
.shape {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    border-radius: 50%;
    animation: float 10s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -40px) scale(1.1);
    }

    100% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}



/* Logo Styles - The Main Character */
.logo-container {
    background-color: #ffffff !important;
    padding: 10px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.8);
    position: relative;
    animation: portal-float 4s ease-in-out infinite;
}

@keyframes portal-float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-8px) rotate(2deg);
    }
}

.logo-glow {
    box-shadow: 0 0 35px rgba(79, 70, 229, 0.5), 0 0 60px rgba(79, 70, 229, 0.2);
}

html.dark .logo-glow {
    box-shadow: 0 0 45px rgba(56, 189, 248, 0.7), 0 0 80px rgba(56, 189, 248, 0.3);
}

.logo-container:hover {
    transform: scale(1.15) rotate(-3deg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation-play-state: paused;
}

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}


html.dark .glass {
    background: rgba(11, 17, 32, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    visibility: hidden;
    will-change: transform, opacity;
}

#mobile-menu.menu-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}


/* Active Nav Links */
.nav-link {
    position: relative;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--accent-color);
}

html.dark .nav-link.active {
    color: #38bdf8;
}

/* Base utilities */
.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    border-radius: inherit;
    box-shadow: 0 0 20px var(--accent-glow);
    transition: opacity 0.3s ease;
    z-index: -1;
}

.glow-effect:hover::before {
    opacity: 1;
}

/* Portfolio Overlay */
.portfolio-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.group:hover .portfolio-overlay {
    opacity: 1;
}

/* Grid overlay for hero */
.bg-grid {
    position: relative;
    background-size: 50px 50px;
    background-image:
        linear-gradient(to right, rgba(79, 70, 229, 0.07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(79, 70, 229, 0.07) 1px, transparent 1px);
    background-position: 0 0;
    animation: grid-move 20s linear infinite;
    background-attachment: fixed;
}

.bg-grid::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle at center, transparent 20%, var(--bg-color) 100%);
}

html.dark .bg-grid {
    background-image:
        linear-gradient(to right, rgba(56, 189, 248, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(56, 189, 248, 0.06) 1px, transparent 1px);
}

@keyframes grid-move {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 50px 50px;
    }
}

/* Extra Pop effects for White Theme cards */
.hover-card {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.hover-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 35px -5px rgba(79, 70, 229, 0.15), 0 15px 15px -5px rgba(79, 70, 229, 0.08);
    /* Poppy indigo shadow */
    border-color: rgba(79, 70, 229, 0.3);
}

html.dark .hover-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 35px -5px rgba(56, 189, 248, 0.15), 0 15px 15px -5px rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
}

/* Button extra interactions */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #6366f1);
    color: white;
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 18px 0 var(--accent-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.4);
}

html.dark .btn-primary:hover {
    box-shadow: 0 12px 25px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(79, 70, 229, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

html.dark .btn-secondary {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
    background: rgba(79, 70, 229, 0.05);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
    border-color: rgba(79, 70, 229, 0.5);
}

html.dark .btn-secondary:hover {
    background: rgba(56, 189, 248, 0.1);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.6);
}

/* Staggered pulse effect */
.icon-pulse {
    animation: pulse-soft 2s infinite;
}

@keyframes pulse-soft {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

html.dark .icon-pulse {
    animation: pulse-soft-dark 2s infinite;
}

@keyframes pulse-soft-dark {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.3);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(56, 189, 248, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
    }
}

/* ------------------------
   Preloader Styles
------------------------ */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    /* Dynamic Tech Background for Loader */
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at center, rgba(79, 70, 229, 0.05) 0%, transparent 60%),
        linear-gradient(to right, rgba(79, 70, 229, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(79, 70, 229, 0.08) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

html.dark #preloader {
    background-image:
        radial-gradient(circle at center, rgba(56, 189, 248, 0.05) 0%, transparent 60%),
        linear-gradient(to right, rgba(56, 189, 248, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(56, 189, 248, 0.08) 1px, transparent 1px);
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* ------------------------
   Floating Bubbles
------------------------ */
.bubble-container {
    position: relative;
    width: 200px;
    height: 200px;
}

.bubble {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.25);
    animation: animate_4010 8s ease-in-out infinite;
}

.bubble:nth-child(2) {
    position: relative;
    zoom: 0.45;
    left: -10px;
    top: -100px;
    animation-delay: -4s;
}

.bubble:nth-child(3) {
    position: relative;
    zoom: 0.45;
    right: -80px;
    top: -300px;
    animation-delay: -6s;
}

.bubble:nth-child(4) {
    position: relative;
    zoom: 0.35;
    left: -120px;
    bottom: -200px;
    animation-delay: -3s;
}

.bubble:nth-child(5) {
    position: relative;
    zoom: 0.5;
    left: 0px;
    top: 200px;
    animation-delay: -5s;
}

@keyframes animate_4010 {

    0%,
    100% {
        transform: translateY(-20px);
    }

    50% {
        transform: translateY(20px);
    }
}

.bubble::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 45px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    z-index: 10;
    filter: blur(2px);
}

.bubble::after {
    content: '';
    position: absolute;
    top: 80px;
    left: 80px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    z-index: 10;
    filter: blur(2px);
}

.bubble span {
    position: absolute;
    border-radius: 50%;
}

.bubble span:nth-child(1) {
    inset: 10px;
    border-left: 15px solid #0fb4ff;
    filter: blur(8px);
}

.bubble span:nth-child(2) {
    inset: 10px;
    border-right: 15px solid #ff4484;
    filter: blur(8px);
}

.bubble span:nth-child(3) {
    inset: 10px;
    border-top: 15px solid #ffeb3b;
    filter: blur(8px);
}

.bubble span:nth-child(4) {
    inset: 30px;
    border-left: 15px solid #ff4484;
    filter: blur(12px);
}

.bubble span:nth-child(5) {
    inset: 10px;
    border-bottom: 10px solid #fff;
    filter: blur(8px);
    transform: rotate(330deg);
}

/* Base layout provided */
.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 600px;
}

.loader {
    width: 100%;
}

.trace-bg {
    stroke: #333;
    stroke-width: 1.8;
    fill: none;
}

html.dark .trace-bg {
    stroke: #1e293b;
}

.trace-flow {
    stroke-width: 1.8;
    fill: none;
    stroke-dasharray: 40 400;
    stroke-dashoffset: 438;
    filter: drop-shadow(0 0 6px currentColor);
    animation: flow 3s cubic-bezier(0.5, 0, 0.9, 1) infinite;
}

.yellow {
    stroke: #ffea00;
    color: #ffea00;
}

.blue {
    stroke: #00ccff;
    color: #00ccff;
}

.green {
    stroke: #00ff15;
    color: #00ff15;
}

.purple {
    stroke: #9900ff;
    color: #9900ff;
}

.red {
    stroke: #ff3300;
    color: #ff3300;
}

@keyframes flow {
    to {
        stroke-dashoffset: 0;
    }
}

/* Chip */
.chip-body {
    rx: 20;
    ry: 20;
}

/* Text */
.chip-text {
    font-weight: bold;
    letter-spacing: 1px;
}

/* Pins */
.chip-pin {
    stroke: #444;
    stroke-width: 0.5;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
}