/* Base styles will be added here */

:root {
    /* Palette */
    --primary: #6957db;
    --primary-rgb: 105, 87, 219;
    --secondary: #e5e3fa;
    --surface: #fbfaff;
    --text: #1e1e1e;
    --text-muted: #6b7280;
    --border: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    --focus-ring: 0.125rem solid var(--primary);

    /* Typography */
    --font-headline: 'Alef', sans-serif;
    --font-body: 'Inter', sans-serif;
    --h1-size: clamp(2.5rem, 5vw, 3.5rem);
    --h2-size: clamp(2rem, 4vw, 2.5rem);
    --h3-size: 1.5rem;
    --body-size: 1rem;
    --caption-size: 0.875rem;
    --font-regular: 400;
    --font-semibold: 600;
    --font-bold: 700;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 4rem;

    /* Radius */
    --radius-sm: 0.375rem; /* 6px */
    --radius-md: 0.625rem; /* 10px */
    --radius-lg: 0.75rem; /* 12px */
    --radius-pill: 9999px;

    /* Motion */
    --transition-duration: 150ms;
}

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

html {
    scroll-behavior: smooth;
    font-size: clamp(14px, 1vw, 50px); /* Fluidly scales the base font for the entire site */
}

body {
    font-family: var(--font-body);
    background-color: var(--surface);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 5rem; /* 80px */
    overflow-x: hidden;
}

body.mobile-menu-active {
    overflow: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headline);
    font-weight: var(--font-bold);
    line-height: 1.2;
    text-wrap: balance;
}

h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); }

p {
    margin-bottom: var(--space-md);
    max-width: 65ch;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 90rem; /* Changed from px to rem for scaling */
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(1.5rem, 5vw, 3rem); /* Fluid padding */
    padding-right: clamp(1.5rem, 5vw, 3rem);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

main > section {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

#logo-cloud {
    background-color: white;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
}

.logo-cloud-title {
    text-align: center;
    color: var(--text-muted);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-lg);
    font-size: var(--body-size);
}

.logo-marquee {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    padding: 0.5rem 0; /* Add vertical padding */
}

.logo-marquee::before, .logo-marquee::after {
    content: '';
    position: absolute;
    top: 0;
    width: 10rem;
    height: 100%;
    z-index: 2;
}

.logo-marquee::before {
    left: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 0), white);
}

.logo-marquee::after {
    right: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), white);
}

@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

.logo-slide {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-shrink: 0;
    min-width: 100%;
    animation: scroll 40s linear infinite;
}

.logo-slide img {
    height: 60px;
    width: 60px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all var(--transition-duration) ease;
    margin: 0 var(--space-lg);
}

.logo-slide img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: var(--font-semibold);
    text-decoration: none;
    transition: all var(--transition-duration) ease;
    border: 1px solid transparent;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: #5845c7;
    text-decoration: none;
}

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

.btn-secondary:hover {
    background-color: #f4f2ff;
    text-decoration: none;
}


/* Header */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-sm) 0;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo img {
    height: 5.3125rem; /* 85px */
}

.navbar-controls {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--text-muted);
    font-weight: var(--font-semibold);
    padding: var(--space-xs) 0;
    border-bottom: 0.125rem solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary);
    text-decoration: none;
    border-bottom-color: var(--primary);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.navbar-toggle-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.navbar-toggle-btn .hamburger-icon {
    width: 1.5rem; /* 24px */
    height: 1.5rem; /* 24px */
    color: var(--text);
    transition: transform 0.3s ease;
}

body.mobile-menu-active .navbar-toggle-btn .hamburger-icon {
    transform: rotate(90deg);
}

/* Hero Section */
#hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1rem, 5vw, 4rem);
    align-items: center;
}

#hero .hero-content {
    padding-bottom: 2rem;
}

#hero .hero-content h1 {
    margin-bottom: var(--space-md);
}

#hero .hero-content p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 50ch;
}

#hero .hero-content .btn {
    margin-top: var(--space-sm);
}

#hero .trust-bar {
    margin-top: var(--space-xl);
    color: var(--text-muted);
}

#hero .trust-bar p {
    font-size: var(--caption-size);
    margin-bottom: var(--space-sm);
}

#hero .trust-bar .logos {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    filter: grayscale(100%);
    opacity: 0.7;
}

#hero .hero-media {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px; /* Ensures space for the animation */
}

#hero .hero-media .media-placeholder {
    width: 100%;
    height: 500px;
    background-color: var(--secondary);
    border-radius: var(--radius-lg);
}

/* Common Section Styles */
.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

/* Stats Section */
#stats {
    background-color: white;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.stat-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--card-shadow);
    text-align: center;
}

.stat-card .icon-container {
    width: 48px;
    height: 48px;
    background-color: var(--secondary);
    border-radius: 12px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.stat-card .icon-container svg {
    width: 28px;
    height: 28px;
}

.stat-card .stat-number {
    font-family: var(--font-headline);
    font-size: 2.5rem;
    font-weight: var(--font-bold);
    color: var(--primary);
}

.stat-card .stat-description {
    color: var(--text-muted);
    font-size: var(--body-size);
}

/* Problem Section */
#problem {
    background-color: var(--surface);
}

.problem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.problem-card {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
}

.problem-card h3 {
    margin-bottom: var(--space-md);
    color: var(--primary);
}

/* Features Section */
.mobile-layout {
    display: none;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: flex-start;
}

.feature-item {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border);
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item h3 {
    margin-bottom: var(--space-sm);
}

.feature-item p {
    color: var(--text-muted);
}

.features-sticky-media {
    position: sticky;
    top: 7.5rem; /* 120px */
    height: 60vh;
}

.media-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(40px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, visibility 0.4s;
}

.media-content .media-placeholder {
    aspect-ratio: 16 / 9;
    height: 100%;
    background-color: var(--secondary);
    border-radius: var(--radius-lg);
}

.media-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* Center the images with transparent backgrounds */
#feature-media-1,
#feature-media-2,
#feature-media-3 {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Styles for feature images */
#feature-media-1 img,
#feature-media-2 img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    box-shadow: none;
    border-radius: 0;
}

#feature-media-3 img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    box-shadow: none;
    border-radius: 0;
}

.media-content.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Testimonials Section */
#testimonials {
    background-color: var(--surface);
}

.testimonial-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 90%; /* On mobile, one card takes up most of the width */
    gap: var(--space-lg);

    overflow-x: auto;
    scroll-snap-type: x mandatory;

    padding: var(--space-md);

    /* Hide scrollbar */
    scrollbar-width: none;
}

.testimonial-carousel::-webkit-scrollbar {
    display: none;
}

.testimonial-card {
    scroll-snap-align: center;
    height: 100%;
}

.testimonial-card blockquote {
    font-size: 1rem;
    font-weight: var(--font-regular);
    margin: 0;
    color: var(--text-muted);
    font-style: normal;
    line-height: 1.6;
}

.testimonial-card .author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: auto;
    padding-top: var(--space-lg);
    border-top: none;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-weight: var(--font-bold);
    color: var(--primary);
}

.author-title {
    font-size: var(--caption-size);
    color: var(--text-muted);
}

/* CTA Section */
#cta {
    background-color: var(--primary);
    color: white;
    text-align: center;
}

#cta h2 {
    color: white;
}

#cta p {
    color: rgba(255, 255, 255, 0.9);
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
}

#cta .btn-cta {
    background-color: white;
    color: var(--primary);
    font-weight: var(--font-bold);
    margin-top: var(--space-md);
}

#cta .btn-cta:hover {
    background-color: #f0f0f0;
    transform: scale(1.05);
}

/* Footer */
#main-footer-content {
    padding: var(--space-lg) 0;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--caption-size);
}

/* Responsive Styles */
@media (min-width: 640px) {
    .testimonial-carousel {
        grid-auto-columns: 45%; /* Two cards on tablet */
    }
}

@media (min-width: 1024px) {
    .testimonial-carousel {
        grid-auto-columns: 31%; /* Three cards on desktop */
    }
}

@media (max-width: 1024px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .problem-grid {
        grid-template-columns: 1fr;
    }
    #hero .container {
        gap: var(--space-lg);
    }
}

@media (max-width: 768px) {
    .desktop-layout {
        display: none;
    }

    .mobile-layout {
        display: block;
    }

    .feature-mobile-item {
        margin-bottom: var(--space-xl);
    }

    .feature-mobile-item h3 {
        margin-bottom: var(--space-md);
    }

    .feature-mobile-img {
        width: 100%;
        margin-top: var(--space-lg);
        border-radius: var(--radius-lg);
    }

    .navbar-controls {
        gap: 0; /* Remove gap to align toggle button to the far right */
        justify-content: flex-end;
    }

    .navbar-nav-wrapper {
        display: none; /* Hidden by default */
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(251, 250, 255, 0.75); /* Glass effect */
        backdrop-filter: blur(12px);
        z-index: 1000;
    }

    .navbar-nav-wrapper.is-active {
        display: flex; /* Show the overlay */
        justify-content: center;
        align-items: center;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: center;
        gap: var(--space-xl);
    }

    .nav-link {
        color: var(--text);
        font-size: var(--h3-size);
        font-weight: var(--font-bold);
        border-bottom: none; /* remove desktop style */
        transition: color 0.2s ease;
    }

    .nav-link:hover {
        color: var(--primary);
        border-bottom: none;
    }

    .navbar-toggle-btn {
        display: block;
        z-index: 1001; /* On top of overlay */
    }

    .navbar-actions .btn {
        display: none; /* Hide desktop CTA button */
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .features-sticky-media {
        order: -1;
        position: relative;
        top: auto;
        height: auto;
        margin-bottom: var(--space-lg);
    }

    .media-content {
        position: relative;
        height: auto;
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .media-content:not(:first-child) {
        display: none;
    }
}

@media (max-width: 640px) {
    #hero .container {
        grid-template-columns: 1fr;
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }

    #hero .hero-content {
        text-align: center;
        order: 1; /* Appears before media */
    }

    #hero .hero-media {
        order: 2; /* Appears after content */
        margin-top: var(--space-lg);
    }

    #hero .trust-bar {
        justify-content: center;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .media-content {
        display: none;
    }

    .media-content.is-active {
        display: block;
    }
}
