:root {
    --primary-color: #4f46e5;
    --secondary-color: #6366f1;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --text-color: #334155;
    --border-radius: 8px;

    /* Light mode colors (default) */
    --bg-color: #ffffff;
    --bg-secondary: #f1f5f9;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --footer-bg: #1e293b;
    --footer-text: #ffffff;
    --text-primary: #334155;
    --text-secondary: #64748b;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --nav-hover: #4f46e5;
}

/* Dark mode colors */
[data-theme="dark"] {
    --bg-color: #121212;
    --bg-secondary: #1e1e1e;
    --header-bg: #1e1e1e;
    --card-bg: #252525;
    --footer-bg: #0f172a;
    --footer-text: #e2e8f0;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --nav-hover: #818cf8;
}

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

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* General anchor link styles */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary-color);
}

[data-theme="dark"] a {
    color: #818cf8;
    /* Light purple/blue for better contrast in dark mode */
}

[data-theme="dark"] a:hover {
    color: #a5b4fc;
    /* Slightly lighter on hover */
}

/* Override for specific navigation and footer links to maintain their existing styles */
.nav-link,
.footer-links a,
.social-icon,
.logo a,
.btn {
    color: var(--text-primary);
    /* Use theme-specific colors */
}

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

/* Ensure buttons maintain their proper colors */
.btn-primary {
    color: white !important;
}

.btn-secondary {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .btn-secondary {
    color: var(--nav-hover) !important;
}

/* Header and Navigation */
header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition:
        background-color 0.3s ease,
        box-shadow 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--nav-hover);
}

/* Theme toggle switch */
.theme-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-left: 1rem;
}

.theme-toggle-icon {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    transition:
        transform 0.3s ease,
        color 0.3s ease;
}

[data-theme="dark"] .theme-toggle-icon {
    background-color: var(--dark-color);
    color: var(--light-color);
}

/* Hero Section */
.hero {
    padding: 5rem 0;
    background-color: var(--bg-color);
    transition: background-color 0.3s ease;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-text {
    flex: 0.8;
    max-width: 550px;
}

.hero-text h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.hero-text p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.hero-image {
    flex: 1.2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.hero-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px var(--shadow-color);
    background-color: var(--bg-secondary);
    transition:
        box-shadow 0.3s ease,
        background-color 0.3s ease;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

[data-theme="dark"] .btn-secondary {
    color: var(--nav-hover);
    border: 2px solid var(--nav-hover);
}

.btn-secondary:hover {
    background-color: rgba(79, 70, 229, 0.1);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-secondary:hover {
    background-color: rgba(129, 140, 248, 0.1);
}

/* Features Section */
.features {
    padding: 5rem 0;
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 4rem;
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-item.reversed {
    flex-direction: row-reverse;
}

.feature-image {
    flex: 1;
}

.feature-content {
    flex: 1;
}

.feature-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.feature-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    margin-bottom: 1rem;
}

.feature-content p:last-child {
    margin-bottom: 0;
}

code {
    background-color: #e2e8f0;
    color: var(--text-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family:
        "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
        "Courier New", monospace;
    font-size: 0.9em;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

[data-theme="dark"] code {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* Used By Section */
.used-by {
    padding: 4rem 0;
    background-color: var(--bg-color);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .used-by {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.used-by h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    font-weight: 600;
    transition: color 0.3s ease;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 120px;
    background-color: var(--bg-color);
}

.carousel-container::before,
.carousel-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.carousel-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-color), transparent);
}

.carousel-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-color), transparent);
}

.carousel-track {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: 100%;
    width: calc(42 * (160px + 0.25rem));
    animation: scrollLeft 60s linear infinite;
}

.carousel-track:hover {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        animation-duration: 120s;
    }
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-14 * (160px + 0.25rem)));
    }
}

.carousel-track:hover {
    animation-play-state: paused;
}

.logo-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background-color: transparent;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    width: 160px;
    height: 80px;
    flex-shrink: 0;
    white-space: nowrap;
}

.logo-item:hover {
    transform: translateY(-2px);
}

.logo-placeholder {
    max-width: 120px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: block;
    border-radius: 6px;
    background-color: white;
    padding: 4px;
}

.logo-item:hover .logo-placeholder {
    transform: scale(1.05);
    opacity: 1;
}

[data-theme="dark"] .logo-placeholder {
    opacity: 0.9;
    background-color: white;
}

/* Carousel disclaimer */
.carousel-disclaimer {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    font-style: italic;
    opacity: 0.8;
}

/* Footer */
/* Main content wrapper to push footer down */
main {
    flex: 1 0 auto;
    /* This makes the main content take up all available space */
}

footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
    margin-top: auto;
    /* Pushes the footer to the bottom */
}

footer .container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.footer-links a {
    color: var(--footer-text);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition:
        opacity 0.2s,
        color 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

.social-links {
    display: flex;
    gap: 1.2rem;
    justify-content: flex-end;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--footer-text);
    opacity: 0.8;
    transition:
        all 0.2s ease,
        color 0.3s ease;
}

.social-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.social-icon:hover {
    opacity: 1;
    transform: translateY(-3px);
}

/* Responsive Design */
@media (max-width: 900px) {
    .hero-content,
    .feature-item,
    .feature-item.reversed {
        flex-direction: column;
    }

    .hero-text,
    .hero-image,
    .feature-image,
    .feature-content {
        flex: none;
        width: 100%;
        max-width: 100%;
    }

    .cta-buttons {
        justify-content: center;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .hero-image {
        order: -1;
        margin-bottom: 2rem;
        padding: 0;
    }

    .hero-image img {
        max-height: 300px;
        object-fit: contain;
    }

    .footer-main,
    .footer-right {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .social-links {
        justify-content: center;
    }

    .used-by {
        padding: 3rem 0;
    }

    .used-by h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .carousel-container {
        height: 100px;
    }

    .carousel-track {
        gap: 0.25rem;
    }

    .logo-item {
        width: 140px;
        height: 70px;
        padding: 0.5rem;
    }

    .logo-placeholder {
        max-width: 100px;
        max-height: 50px;
    }
}
