/* --- Theme Variables --- */
:root {
    /* Light Theme (Default) */
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.1);

    /* Accents (Slightly adjusted for light mode contrast) */
    --accent-1: #4f46e5;
    /* Deeper Indigo */
    --accent-2: #be185d;
    /* Deeper Pink */
    --gradient-primary: linear-gradient(135deg, var(--accent-1), var(--accent-2));

    /* Layout & Utilities */
    --nav-height: 80px;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-base: #09090b;
    --bg-surface: #18181b;
    --bg-card: rgba(24, 24, 27, 0.4);
    --bg-card-hover: rgba(39, 39, 42, 0.6);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.1);

    /* Accents */
    --accent-1: #6366f1;
    /* Indigo */
    --accent-2: #db2777;
    /* Pink */
    --gradient-primary: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    /* Subtle noise texture */
    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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
}

::selection {
    background-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* Background Blobs */
.blob-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(9, 9, 11, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(100px);
    animation: pulseBlob 20s infinite alternate;
}

.blob-bg-2 {
    position: absolute;
    top: 40%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(219, 39, 119, 0.1) 0%, rgba(9, 9, 11, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(100px);
    animation: pulseBlob 15s infinite alternate-reverse;
}

@keyframes pulseBlob {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.1) translate(5%, 5%);
    }
}

/* Typography & Utilities */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.mt-4 {
    margin-top: 1.5rem;
}

.opacity-50 {
    opacity: 0.5;
}

.small-text {
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 100px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-normal);
    cursor: pointer;
    font-size: 1rem;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-base);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(248, 250, 252, 0.15);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--text-secondary);
}

.disabled-link {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 100;
    transition: var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(var(--bg-base-rgb, 250, 250, 250), 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .navbar.scrolled {
    background: rgba(9, 9, 11, 0.8);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent-1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a:not(.btn) {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition-fast);
}

.nav-links a:not(.btn):hover {
    color: var(--text-primary);
}

.nav-links a:not(.btn):after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--gradient-primary);
    transition: var(--transition-fast);
    border-radius: 2px;
}

.nav-links a:not(.btn):hover:after {
    width: 100%;
}

/* Theme Toggle Button */
#theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

#theme-toggle:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

/* Hide sun in light mode, moon in dark mode */
[data-theme="light"] .sun-icon,
:root:not([data-theme="dark"]) .sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon,
:root:not([data-theme="dark"]) .moon-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
    position: relative;
}

.hero-content {
    max-width: 800px;
    z-index: 10;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    letter-spacing: -2px;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Sections General */
section {
    padding: 120px 0;
    position: relative;
    z-index: 10;
}

.section-header {
    margin-bottom: 80px;
    max-width: 600px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(220px, auto);
    gap: 24px;
}

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-normal);
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--border-color) 0%, transparent 100%);
    pointer-events: none;
}

.bento-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .bento-card {
    box-shadow: none;
}

[data-theme="dark"] .bento-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.bento-large {
    grid-column: span 8;
    grid-row: span 2;
}

.bento-wide {
    grid-column: span 8;
}

@media (max-width: 1024px) {
    .bento-card {
        grid-column: span 6;
    }

    .bento-large,
    .bento-wide {
        grid-column: span 12;
    }

    .bento-large {
        grid-row: span 1;
    }
}

@media (max-width: 640px) {
    .bento-card {
        grid-column: span 12;
    }
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent-1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.card-icon svg {
    width: 28px;
    height: 28px;
}

[data-theme="dark"] .card-icon {
    background: rgba(99, 102, 241, 0.15);
}

.bento-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.bento-card p {
    color: var(--text-secondary);
    flex-grow: 1;
}

/* Tools Section */
.glass-panel {
    background: linear-gradient(135deg, var(--bg-card), rgba(255, 255, 255, 0.1));
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 80px 40px;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .glass-panel {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

.glass-panel h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.glass-panel p:not(.small-text) {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 80px 0 30px;
    position: relative;
    z-index: 10;
    background: var(--bg-surface);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 1rem;
    max-width: 300px;
}

.footer-links h4 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.8rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

.footer-bottom {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

/* Animation Classes */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    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);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}