:root {
    /* Color Palette */
    --purple-primary: #6A1B9A;
    /* Deep, elegant purple */
    --purple-light: #9c4dcc;
    /* Lighter purple for accents */
    --purple-dark: #38006b;
    /* Darker purple for hover/active */
    --purple-bg-light: #F3E5F5;
    /* Very light purple for backgrounds */

    --text-main: #333333;
    --text-muted: #666666;
    --text-light: #ffffff;

    --bg-white: #ffffff;
    --bg-off-white: #f9fafe;
    /* Subtle cool white */

    --border-color: #e0e0e0;

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --section-spacing: 6rem;

    /* Typography */
    --font-main: 'Outfit', sans-serif;
    /* Modern, geometric but friendly */

    /* Effects */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(106, 27, 154, 0.1);
    --shadow-lg: 0 8px 30px rgba(106, 27, 154, 0.15);
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-off-white);
    line-height: 1.6;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Fix emoji/icons breaking into new lines */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    /* fixed width for alignment */
    line-height: 1;
}

html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Utilities */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.text-purple {
    color: var(--purple-primary);
}

.grid {
    display: grid;
    gap: 2rem;
}

.flex {
    display: flex;
    gap: 1rem;
}

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

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--text-main);
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

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

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Components: Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--purple-primary);
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--purple-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background-color: var(--purple-bg-light);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
}

/* Header */
.header {
    min-height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--purple-primary);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-main);
}

.nav-link:hover,
.nav-link.active {
    color: var(--purple-primary);
}

/* Mobile Menu Handling */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
        /* Allow wrapping */
        justify-content: center;
        gap: 1rem;
    }

    /* Keep landing header unified on mobile */
    .landing-header .container {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }

    /* Simplify landing nav for mobile */
    .landing-header .nav {
        flex-direction: row;
        width: 100%;
        padding: 0;
        justify-content: space-between;
    }

    .nav-links {
        display: flex;
        /* Show links on mobile too, but stacked or wrapped */
        gap: 1rem;
        font-size: 0.9rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Landing Specific Header */
.landing-header {
    min-height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    position: sticky;
    /* Sticky as requested */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.landing-header .logo {
    font-size: 1.25rem;
    /* Slightly smaller to fit button */
}

.landing-header .btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    box-shadow: none;
    /* Cleaner look */
}

.landing-header .btn:hover {
    transform: translateY(0);
    /* Remove jump */
    background-color: var(--purple-dark);
}

/* Sections */
section {
    padding: var(--section-spacing) 0;
}

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

.bg-light {
    background-color: var(--bg-off-white);
}

.bg-purple-light {
    background-color: var(--purple-bg-light);
}

/* Hero Section */
.hero {
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: 6rem;
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    /* Standard property for compatibility */
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.hero-text .subheadline {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
}

.hero-img {
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: block;
    background-color: #f2f2f7;
    /* Placeholder while loading */
}

/* Image container for better overflow control */
.hero-img-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    overflow: hidden;
    /* Prevent image overflow */
    border-radius: var(--radius-lg);
}

/* Specific Page Styling: Cards */
.card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--purple-light);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--purple-primary);
}

.card-features {
    margin: 1.5rem 0;
    flex-grow: 1;
}

.card-features li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.card-features li::before {
    content: "✓";
    color: var(--purple-primary);
    margin-right: 0.5rem;
    font-weight: bold;
}

/* FAQ */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.faq-item h4 {
    margin-bottom: 0.5rem;
    color: var(--purple-primary);
}

/* Footer */
footer {
    background-color: var(--text-main);
    color: var(--bg-white);
    padding: 4rem 0 2rem;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    display: inline-block;
}

.socials {
    margin-bottom: 2rem;
}

.copyright {
    color: #999;
    font-size: 0.9rem;
    border-top: 1px solid #444;
    padding-top: 2rem;
}

/* Responsive */
@media (max-width: 968px) {
    h1 {
        font-size: clamp(2rem, 5vw, 3rem);
        /* Responsive typography */
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-content>.hero-text {
        order: 1;
        /* Ensure text is first */
    }

    .hero-content>.hero-img-wrapper {
        order: 2;
        /* Image below text */
        margin-top: 1rem;
    }

    .hero-img {
        max-width: 100%;
        /* Let it take full width of container */
        width: 80%;
        /* But not huge */
        margin: 0 auto;
        border-radius: var(--radius-md);
    }

    /* Ensure book covers don't get too wide on mobile */
    .hero-img[src*="capa"] {
        max-width: 280px;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        padding-inline: 16px;
        /* Ensure lateral padding */
    }

    h1 {
        font-size: clamp(28px, 6vw, 2.5rem);
        /* Minimum size constraint */
    }

    .hero {
        padding-top: calc(var(--header-height) + 6rem);
        /* Increased space for stacked header with new link */
    }

    .flex-center {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        /* Full width buttons on mobile */
        max-width: 400px;
        margin-bottom: 0px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
        align-items: center;
    }

    .grid {
        grid-template-columns: 1fr !important;
        /* Force single column */
    }
}

@media (max-width: 420px) {
    :root {
        --section-spacing: 3rem;
        /* Reduced spacing on small screens */
    }

    .container {
        padding-inline: 14px;
        /* Tighter padding on very small screens */
    }

    .nav-links {
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .hero-text h1 {
        font-size: 1.75rem;
    }

    .hero-text .subheadline {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .card {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}