:root {
    --primary-color: #AF52DE; /* Main app color */
    --primary-color-rgb: 175, 82, 222; /* RGB for use in rgba() */
    --primary-color-darker: #9845c4; /* For hover states */
    --text-color-light: #f8f8f8;
    --text-color-dark: #333;
    --background-color-page: #FFFFFF; /* Changed to white */
    --footer-background: #4A148C; /* Deep purple for footer */
    --header-border-color: #eee;
    --logo-color: var(--primary-color);
    --hero-image-opacity: 0.6; /* Adjust for image visibility vs text readability */
    --header-height: 62px; /* Estimated: (1rem * 2) for padding + ~1.8em for logo + 1px border */
}
.btn-primary {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px; /* capsule */
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary:hover {
    background: var(--primary-color-darker);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(var(--primary-color-rgb), 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.25);
}

/* General Styles */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color-dark);
    background-color: var(--background-color-page);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;

    accent-color: var(--primary-color) !important;
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
header.header-main {
    background: var(--background-color-page);
    padding: 1rem 5%;
    border-bottom: 1px solid var(--header-border-color);
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure header is above hero image */
    width: 90%;
}

header nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    /* max-width: 1100px; */
    margin: auto;
}

header .logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--logo-color);
    text-decoration: none;
}

a {
    color: var(--primary-color);
}

/* Main Hero Section */
.hero-main {
    position: relative; /* For absolute positioning of the background image */
    display: flex;
    align-items: center; /* Vertically center content */
    justify-content: flex-start; /* Align content to the left */
    padding: 80px 5%; /* Increased padding for more space */
    height: calc(100vh - var(--header-height));
    box-sizing: border-box; /* Ensures padding is included in the height calculation */
    text-align: left;
    overflow: hidden; /* Ensures nothing spills out */
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Behind hero-content */
}

.hero-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the entire area */
    opacity: var(--hero-image-opacity);
}

.hero-content {
    position: relative; /* To sit above the image container */
    z-index: 2;
    max-width: 55%; /* Adjust as needed for your text block */
    background-color: transparent;
    border-radius: 0;
    padding: 20px; /* Add some padding around the text block */
    /* Optional: Add a very subtle background to the text block for readability */
    /* background-color: rgba(255, 255, 255, 0.05); */ 
    /* Optional: Text shadow for readability if image is complex */
    /* text-shadow: 1px 1px 3px rgba(0,0,0,0.2); */
}

/* Removed .logo-main as logo is in header */

.hero-content h1 {
    font-size: 3.4em;
    color: var(--text-color-dark);
    margin-bottom: 0.6em;
    line-height: 1.2;
}

#changingWord {
    display: inline-block; /* Allows transforms and better layout control */
    color: var(--primary-color);
    position: relative; /* For potential pseudo-elements or complex animations */
    transition: opacity 0.3s ease-in-out; /* Smooth transition for word changes */
    /* Add a fixed width if words have very different lengths to prevent layout shifts */
    /* min-width: 200px; Adjust as needed, or handle with JS */ 
}

/* Animation for regular word cycling */
@keyframes cycleWord {
    0%, 100% { opacity: 0; transform: translateY(10px); }
    20%, 80% { opacity: 1; transform: translateY(0); }
}

/* Emphasis animation for "Dillr?" */
@keyframes emphasizeDillr {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05) rotate(-2deg); }
    50% { transform: scale(1.15) rotate(2deg); color: var(--primary-color-darker);}
    75% { transform: scale(1.05) rotate(0deg); }
}

#changingWord.cycling {
    animation: cycleWord 2s ease-in-out; /* Duration should match JS timeout for word */
}

#changingWord.emphasize {
    animation: emphasizeDillr 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

.hero-content p {
    font-size: 1.3em;
    color: #444; /* Slightly darker for better contrast on varied backgrounds */
    margin-bottom: 2em;
}

.app-store-button-main img {
    height: 50px;
    transition: transform 0.2s ease;
}

.app-store-button-main:hover img {
    transform: scale(1.05);
}

/* Features Section */
.features {
    padding: 70px 5%;
    text-align: center;
    background-color: var(--background-color-page); /* Or a slightly different shade if desired */
}

.features h2 {
    font-size: 2.6em;
    color: var(--text-color-dark);
    margin-bottom: 70px; /* More space for staggered cards */
    font-weight: 600;
}

.feature-cards {
    display: flex;
    justify-content: center; /* Center the group of cards */
    align-items: flex-start; 
    gap: 30px;
    flex-wrap: wrap;
    padding-top: 40px; /* Add padding to accommodate the raised middle card */
}

.card {
    background: #ffffff;
    padding: 35px 30px;
    border-radius: 25px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
    width: calc(33.333% - 40px);
    min-width: 280px;
    max-width: 320px; /* Slightly reduced max-width for a tighter group */
    text-align: center;
    /* Initial state for scroll animation */
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    /* Transition for hover effects - not for the entry animation itself */
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Removed animation property from here */
}

.card.is-visible {
    /* Apply animation when card becomes visible */
    animation: fadeInCard 0.7s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.card:nth-child(1) {
    transform: translateY(40px) scale(0.95) rotate(-3deg); /* Default slight rotation */
}
.card:nth-child(1).is-visible {
    animation-delay: 0.1s; /* Staggered delay */
}

.card:nth-child(2) {
    position: relative; 
    top: -40px; /* Makes the middle card sit noticeably higher */
    /* Initial transform for animation needs to include this top offset if not handled carefully in JS */
    /* For simplicity, we let the JS add is-visible, and this card's animation will run */
}
.card:nth-child(2).is-visible {
    animation-delay: 0.25s; /* Staggered delay */
}


.card:nth-child(3) {
    transform: translateY(40px) scale(0.95) rotate(3deg); /* Default slight rotation */
}
.card:nth-child(3).is-visible {
    animation-delay: 0.4s; /* Staggered delay */
}

.card:hover {
    /* Hover state overrides initial/animated transform for rotation but keeps lift */
    transform: translateY(-12px) rotate(0deg); /* Neutralize rotation on hover for a clean lift */
    box-shadow: 0 15px 35px rgba(var(--primary-color-rgb), 0.25); /* Slightly stronger shadow */
}

.card img {
    width: 70px; /* Adjust as needed for your SVG/icon size */
    height: 70px;
    margin-bottom: 25px;
    color: var(--primary-color); /* If using SVGs that can inherit color */
}

.card h3 {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-weight: 600;
}

.card p {
    font-size: 1em;
    color: #666;
    line-height: 1.6;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        /* Transform is now the default state of .card */
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg); /* Ensure final state is neutral rotation */
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 25px 5%;
    background: var(--footer-background);
    color: var(--text-color-light);
    width: 90%;
    margin: 0 auto;
    position: relative; /* Ensure footer is above any absolute elements if they were to overlap */
    z-index: 100; 
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.footer-nav ul li a {
    text-decoration: none;
    color: #d1c4e9;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-nav ul li a:hover {
    color: var(--primary-color);
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .hero-content {
        max-width: 70%; /* Allow text to take more width */
        padding: 15px;
    }
    .hero-content h1 {
        font-size: 2.8em;
    }
    .hero-content p {
        font-size: 1.2em;
    }
    .features h2 {
        font-size: 2.3em;
        margin-bottom: 50px;
    }
    .feature-cards {
        justify-content: center; 
        padding-top: 0; /* Reset padding for tablet */
    }
    .card {
        width: calc(50% - 30px); /* Two cards per row on medium screens */
        margin-bottom: 30px; /* Add margin for stacked items */
    }
    .card:nth-child(1),
    .card:nth-child(3) {
        transform: translateY(40px) scale(0.95); /* Reset rotation for stacked layout */
    }
    .card:nth-child(2) {
        top: 0; /* Reset vertical adjustment */
    }
    .card:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.8rem 5%;
        z-index: 1001; /* Ensure header is above hero image even on small screens */
    }
    header .logo {
        font-size: 1.6em;
    }
    .hero-main {
        padding: 60px 5%;
        justify-content: center; /* Center content block on smaller screens */
        text-align: center; /* Center text within content block */
    }
    .hero-content {
        max-width: 90%; /* More width for content */
        text-align: center; /* Center text for the block */
        background-color: rgba(255, 255, 255, 0.15); /* Slightly more pronounced bg for readability */
        border-radius: 10px;
    }
    .hero-content h1 {
        font-size: 2.4em;
    }
    .hero-content p {
        font-size: 1.1em;
        color: #333;
    }
    .app-store-button-main img {
        height: 45px;
    }
    .card:nth-child(1),
    .card:nth-child(3) {
        transform: translateY(40px) scale(0.95); /* Reset rotation here too */
    }
    .card:nth-child(2) {
        top: 0; 
    }
    .features h2 {
        font-size: 2.1em;
    }
    .footer-nav ul {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero-main {
        padding: 40px 5%;
        min-height: calc(100vh - 70px); /* Adjust for header */
    }
    .hero-content {
        max-width: 95%;
        padding: 10px;
    }
    .hero-content h1 {
        font-size: 2em;
    }
    .hero-content p {
        font-size: 1em;
    }
    .app-store-button-main img {
        height: 40px;
    }
    .features {
        padding: 50px 5%;
    }
    .card:nth-child(1),
    .card:nth-child(3) {
        transform: translateY(40px) scale(0.95); /* Reset rotation */
    }
    .card {
        width: 95%;
        padding: 30px 25px;
    }
    .features h2 {
        font-size: 1.9em;
        margin-bottom: 40px;
    }
} 


 /* Iubenda docs  */
 #iub-legalDoc {
    border-top-color: var(--primary-color) !important;
 }