:root {
    /* Color Palette */
    --bg-base: #050505;
    --bg-surface: rgba(20, 20, 22, 0.6);
    --bg-surface-hover: rgba(30, 30, 35, 0.8);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.2);
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Spacing & Layout */
    --max-width: 1200px;
    --nav-height: 80px;
    
    /* Effects */
    --glass-blur: blur(12px);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.blob-bg {
    position: fixed;
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0) 70%);
    filter: blur(80px); /* Increased blur */
    z-index: -2;
    pointer-events: none;
    transition: transform 0.1s ease-out; /* Parallax support */
}
.blob-bg {
    animation: float 25s ease-in-out infinite alternate;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.blob-bg::after {
    content: '';
    position: absolute;
    top: 60vh;
    left: 85vw;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0) 70%);
    filter: blur(80px);
}

/* Background Animated Rectangles */
.flying-rects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.rect {
    position: absolute;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    animation: floatRect var(--d) linear infinite;
    backdrop-filter: blur(1px);
}

@keyframes floatRect {
    from {
        transform: translate(0, 0) rotate(0deg);
    }
    to {
        transform: translate(var(--mx), var(--my)) rotate(360deg);
    }
}

/* Custom Cursor */
.custom-cursor {
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.1s ease-out;
    opacity: 0.6;
    display: none; /* Hidden by default, show on mousemove */
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.2s ease-out, opacity 0.3s ease;
    opacity: 0.2;
    display: none; /* Hidden by default */
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    z-index: -1;
    pointer-events: none;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 50px); }
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
}

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

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition-smooth);
}

.navbar.scrolled {
    background: rgba(5, 5, 5, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-gradient);
    z-index: 1001;
    transition: width 0.1s ease-out;
}

.nav-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    position: relative;
    z-index: 1001;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: var(--transition-smooth);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-smooth);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.95rem;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    transform: translateY(-4px) scale(1.02);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 4rem) 2rem 4rem;
    gap: 4rem;
}

.hero-content {
    flex: 1;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    margin-bottom: 2rem;
    letter-spacing: -1.5px;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 500px;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
    opacity: 0;
}

.badge {
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.api-graphic {
    width: 300px;
    height: 300px;
    position: relative;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, rgba(20, 20, 22, 0) 70%);
}

.floating-node {
    position: absolute;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: var(--glass-blur);
    font-family: monospace;
    font-weight: bold;
    color: var(--accent-primary);
    box-shadow: var(--shadow-soft);
    animation: float-node 6s ease-in-out infinite alternate;
}

.node-1 { top: 10%; left: 0; animation-delay: 0s; }
.node-2 { top: 40%; right: 0; color: #8b5cf6; animation-delay: -2s; }
.node-3 { bottom: 10%; left: 20%; color: #10b981; animation-delay: -4s; }

@keyframes float-node {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-20px) rotate(2deg); }
}

/* Tools Section */
.tools-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 6rem 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* Tool Cards - Glassmorphism & Hover Effects */
.tool-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: var(--transition-smooth), transform 0.2s ease-out;
    transform-style: preserve-3d;
}

.card-content {
    padding: 2.5rem 2rem;
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Dynamic Glow Effect applied via JS */
.card-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    transform: translate(-50%, -50%); /* Centered on mouse */
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-highlight);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.1);
}

.tool-card:hover .card-glow, .article-card:hover .card-glow {
    opacity: 1;
}

.article-card {
    transition: var(--transition-smooth), transform 0.2s ease-out !important;
    transform-style: preserve-3d;
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.tool-rank {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.05);
    line-height: 1;
}

.tool-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-category {
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tool-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tool-tags span {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-secondary);
}

.tool-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    margin-top: auto;
}

/* Makes the entire card clickable by stretching the link over it */
.tool-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
}

.tool-link:hover {
    color: var(--accent-primary);
    gap: 5px;
}

/* Newsletter Section */
.newsletter {
    max-width: 800px;
    margin: 4rem auto 8rem;
    padding: 0 2rem;
}

.newsletter-content {
    background: linear-gradient(to bottom right, rgba(30, 30, 35, 0.8), rgba(20, 20, 22, 0.9));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 4rem 2rem;
    text-align: center;
    backdrop-filter: var(--glass-blur);
    position: relative;
    overflow: hidden;
}

.newsletter-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent-gradient);
}

.newsletter h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsletter p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.subscribe-form {
    display: flex;
    max-width: 450px;
    margin: 0 auto;
    gap: 0.5rem;
}

.subscribe-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-highlight);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition-smooth);
}

.subscribe-form input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    background: rgba(5, 5, 5, 0.8);
    padding: 4rem 2rem 2rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Reveal Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Base style for any card that should tilt */
.tilt-card {
    transition: var(--transition-smooth), transform 0.2s ease-out;
    transform-style: preserve-3d;
}

.read-more-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
}

.reveal.active.stagger {
    animation-delay: calc(var(--stagger-index) * 0.1s);
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-links {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        padding: 2rem;
        border-bottom: 1px solid var(--border-color);
        text-align: center;
        gap: 1.5rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    
    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }
    
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .menu-btn {
        display: flex;
        z-index: 1002;
    }

    
    /* Hero adjustments */
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: calc(var(--nav-height) + 2rem);
    }
    
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-visual {
        margin-top: 2rem;
    }
    
    .subscribe-form {
        flex-direction: column;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-hero {
        padding-top: 1rem;
    }
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: -100px;
    left: 2rem;
    right: 2rem;
    max-width: 500px;
    background: rgba(20, 20, 22, 0.9);
    border: 1px solid var(--border-highlight);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.cookie-consent.show {
    bottom: 2rem;
    animation: cookie-slide-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cookie-slide-up {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cookie-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.cookie-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.cookie-content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
}

.cookie-actions .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .cookie-consent {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}
