@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&family=Caveat:wght@400;700&family=Quicksand:wght@300;400;500;600;700&display=swap');

/* CSS Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-blur: blur(20px);
    
    /* Animation durations */
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
    
    /* Easing functions */
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
}

[data-theme="dark"] {
    --bg-color: #09090B;
    --card-bg: #18181B;
    --card-border: rgba(255, 255, 255, 0.08);
    --divider: rgba(255, 255, 255, 0.1);
    --nav-hover: rgba(255, 255, 255, 0.05);
    --accent-color: #3B82F6;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --text-primary: #FAFAFA;
    --text-secondary: #A1A1AA;
    --nav-bg: rgba(24, 24, 27, 0.8);
    --spotlight-color: rgba(59, 130, 246, 0.05);
}

[data-theme="light"] {
    --bg-color: #FAFAFA;
    --card-bg: #FFFFFF;
    --card-border: rgba(0, 0, 0, 0.08);
    --divider: rgba(0, 0, 0, 0.05);
    --nav-hover: rgba(0, 0, 0, 0.03);
    --accent-color: #2563EB;
    --accent-glow: rgba(37, 99, 235, 0.08);
    --text-primary: #09090B;
    --text-secondary: #71717A;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --spotlight-color: rgba(37, 99, 235, 0.03);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Quicksand', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, .font-heading {
    font-family: 'Archivo', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* Bento Grid System */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: 24px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* Bento Card Logic */
.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur); /* Safari support */
    transition: transform var(--duration-normal) var(--ease-out),
                border-color var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
    display: flex;
    flex-direction: column;
    cursor: default;
    will-change: transform; /* Performance hint */
    transform: translateZ(0); /* Force GPU acceleration */
    -webkit-transform: translateZ(0); /* Safari */
}

.cursor-pointer {
    cursor: pointer !important;
}

@media (max-width: 640px) {
    .bento-card { padding: 24px; border-radius: 24px; }
    .bento-grid { padding: 24px 16px; gap: 16px; }
}

.bento-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-4px) translateZ(0);
    -webkit-transform: translateY(-4px) translateZ(0); /* Safari */
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .bento-card:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Grid Spans */
.col-span-12 { grid-column: span 12; }
.col-span-8 { grid-column: span 8; }
.col-span-7 { grid-column: span 7; }
.col-span-6 { grid-column: span 6; }
.col-span-5 { grid-column: span 5; }
.col-span-4 { grid-column: span 4; }
.col-span-3 { grid-column: span 3; }

@media (max-width: 992px) {
    .bento-grid { grid-template-columns: repeat(1, 1fr); padding: 40px 16px; }
    .col-span-12, .col-span-8, .col-span-7, .col-span-6, .col-span-5, .col-span-4, .col-span-3 { grid-column: 1 / -1; }
}

/* Navigation - Floating Pill */
nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    padding: 6px;
    border-radius: 100px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3);
    max-width: 95vw;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 100px;
    transition: all 0.3s ease;
    text-transform: capitalize;
    white-space: nowrap;
}

@media (max-width: 640px) {
    nav {
        top: auto;
        bottom: 24px;
        padding: 4px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        width: 90%;
        border-radius: 30px;
    }
    nav::-webkit-scrollbar { display: none; }
    nav a { padding: 8px 16px; font-size: 11px; }
}

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

.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--divider);
    margin: 0 4px;
}

nav a.active {
    background: var(--accent-color);
    color: white;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.theme-toggle i {
    width: 18px;
    height: 18px;
}

/* Hero Section */
.hero {
    padding: 180px 24px 80px;
    text-align: left;
    max-width: 1300px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .hero { padding: 120px 24px 60px; }
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; margin-bottom: 24px; }
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1;
    margin-bottom: 24px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 40px;
}

/* Specialized Cards */
.card-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Spotlight */
.spotlight {
    position: fixed;
    width: 60vmax;
    height: 60vmax;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

/* Buttons */
.btn-main {
    padding: 16px 32px;
    background: var(--accent-color);
    color: white;
    border-radius: 100px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-main:hover {
    transform: scale(1.05);
    background: #2563EB;
}

/* Badges */
.badge {
    padding: 6px 14px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
    display: inline-block;
}

/* Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px) translateZ(0);
    -webkit-transform: translateY(30px) translateZ(0);
    transition: opacity 0.8s ease, 
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    -webkit-transition: opacity 0.8s ease, 
                        -webkit-transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) translateZ(0);
    -webkit-transform: translateY(0) translateZ(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        transition: none;
        -webkit-transition: none;
        opacity: 1;
        transform: none;
        -webkit-transform: none;
    }
    .bento-card:hover {
        transform: none;
        -webkit-transform: none;
    }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: #1F2937; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }

/* Utility Classes */
.hidden { display: none !important; }
.block { display: block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flex utilities */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }

/* Grid utilities */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:col-span-4 { grid-column: span 4; }
    .md\:col-span-8 { grid-column: span 8; }
}

/* Spacing utilities */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-6 { padding-bottom: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-auto { margin-top: auto; }
.mt-12 { margin-top: 3rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Width & Height */
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 2.75rem; }
.w-full { width: 100%; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 2.75rem; }
.h-full { height: 100%; }
.max-w-2xl { max-width: 42rem; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.bottom-8 { bottom: 2rem; }
.left-8 { left: 2rem; }

/* Text utilities */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-\[10px\] { font-size: 10px; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-mono { font-family: ui-monospace, monospace; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }
.tracking-widest { letter-spacing: 0.1em; }
.tracking-\[0\.2em\] { letter-spacing: 0.2em; }
.tracking-tighter { letter-spacing: -0.05em; }
.leading-relaxed { line-height: 1.625; }
.text-center { text-align: center; }
.line-clamp-2 { 
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Colors */
.text-white { color: #ffffff; }
.text-blue-400 { color: #60a5fa; }
.text-blue-500 { color: #3b82f6; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.border-white\/5 { border-color: rgba(255, 255, 255, 0.05); }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.border-none { border: none; }
.border-b { border-bottom-width: 1px; }
.border-x { border-left-width: 1px; border-right-width: 1px; }

/* Background gradients */
.bg-gradient-to-t { background-image: linear-gradient(to top, var(--tw-gradient-stops)); }
.from-black\/80 { --tw-gradient-from: rgba(0, 0, 0, 0.8); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(0, 0, 0, 0)); }
.via-transparent { --tw-gradient-stops: var(--tw-gradient-from), transparent, var(--tw-gradient-to, rgba(0, 0, 0, 0)); }
.to-transparent { --tw-gradient-to: transparent; }

/* Border radius */
.rounded-full { border-radius: 9999px; }
.rounded-2xl { border-radius: 1rem; }

/* Object fit */
.object-cover { object-fit: cover; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Transform */
.scale-110 { 
    transform: scale(1.1) translateZ(0); 
    -webkit-transform: scale(1.1) translateZ(0);
}
.hover\:scale-100:hover { 
    transform: scale(1) translateZ(0); 
    -webkit-transform: scale(1) translateZ(0);
}
.hover\:bg-blue-500:hover { background-color: #3b82f6; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:border-blue-500:hover { border-color: #3b82f6; }
.hover\:-translate-y-1:hover { 
    transform: translateY(-0.25rem) translateZ(0); 
    -webkit-transform: translateY(-0.25rem) translateZ(0);
}
.group-hover\:scale-100 { 
    transition: transform 1s ease; 
    -webkit-transition: -webkit-transform 1s ease;
}
.group:hover .group-hover\:scale-100 { 
    transform: scale(1) translateZ(0); 
    -webkit-transform: scale(1) translateZ(0);
}
.group-hover\:bg-blue-500 { 
    transition: background-color 0.3s ease; 
    -webkit-transition: background-color 0.3s ease;
}
.group:hover .group-hover\:bg-blue-500 { background-color: #3b82f6; }

/* Transitions */
.transition-colors { 
    transition-property: color, background-color, border-color; 
    -webkit-transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 
    -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms; 
    -webkit-transition-duration: 150ms;
}
.transition-transform { 
    transition-property: transform; 
    -webkit-transition-property: -webkit-transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 
    -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms; 
    -webkit-transition-duration: 150ms;
}
.transition-all { 
    transition-property: all; 
    -webkit-transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 
    -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms; 
    -webkit-transition-duration: 150ms;
}
.duration-300 { 
    transition-duration: 300ms; 
    -webkit-transition-duration: 300ms;
}
.duration-1000 { 
    transition-duration: 1000ms; 
    -webkit-transition-duration: 1000ms;
}

/* Spacing */
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Important overrides */
.\!p-0 { padding: 0 !important; }
.\!bg-white { background-color: #ffffff !important; }
.\!text-blue-600 { color: #2563eb !important; }
.\!mb-0 { margin-bottom: 0 !important; }
.\!bg-slate-900 { background-color: #0f172a !important; }
.\!text-slate-500 { color: #64748b !important; }
.\!text-\[9px\] { font-size: 9px !important; }

/* Keyframe Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Loading skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Smooth page transitions */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles */
@media print {
    nav, footer, .theme-toggle, .spotlight {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .bento-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
