:root {
    --bg-primary: #161617; /* Apple's dark grey, almost black */
    --bg-secondary: #1d1d1f; /* Slightly lighter for depth */
    --bg-contrast: #2c2c2e; /* For cards or distinct sections */

    --text-primary: #f5f5f7; /* Apple's light text */
    --text-secondary: #a1a1a6; /* Apple's secondary/dimmed text */
    --text-tertiary: #6e6e73; /* Even dimmer text */

    --accent-primary: #ffffff; /* White for primary accents/links */
    --accent-secondary: #e0e0e0; /* Light grey for hover or secondary accents */
    
    --border-color: #3a3a3c; /* Subtle border color */
    --border-color-light: #525254;

    --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-strong: 0 12px 36px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 90%;
    max-width: 1100px; /* Slightly reduced for tighter Apple feel */
    margin: 0 auto;
    padding: 0 15px;
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Removes bottom space */
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

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

/* Header */
header {
    background-color: rgba(22, 22, 23, 0.85); /* Slightly more opaque */
    backdrop-filter: blur(16px) saturate(180%); /* Increased blur */
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    padding: 18px 0; /* Increased vertical padding */
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
    border-bottom: 1px solid transparent;
}

header.scrolled {
    background-color: rgba(22, 22, 23, 0.98); /* More opaque when scrolled */
    border-bottom-color: var(--border-color);
    padding: 12px 0; /* Slightly reduce padding on scroll for a subtle effect */
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 62px; /* Increased by ~30% from 48px */
    margin-right: 15px; /* Slightly increased margin */
    filter: none; 
    transition: transform 0.2s ease;
}

.logo img:hover {
    transform: scale(1.03);
}

.logo h1 {
    font-size: 2.2em; /* Reduced for better header fit */
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 15px; /* Reduced margin due to button padding */
}

nav ul li a {
    font-size: 0.85em; /* Slightly reduced font size */
    font-weight: 500;
    color: var(--text-secondary);
    padding: 7px 12px; /* Reduced padding */
    position: relative;
    letter-spacing: 0.4px; 
    border: 1px solid var(--border-color);
    border-radius: 18px; /* Slightly smaller radius */
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05); /* Subtle background on hover/active */
    border-color: var(--border-color-light);
}

/* No underline for nav items, active state by color */

/* Language Switcher Dropdown */
.language-switcher {
    display: flex;
    align-items: center;
    margin-left: 20px; /* Add some space to the left of the switcher */
}

.language-switcher label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-right: 8px;
    font-weight: 500;
}

.language-switcher select {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85em;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.language-switcher select:hover {
    border-color: var(--border-color-light);
    background-color: rgba(255, 255, 255, 0.1);
}

.language-switcher select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.3);
}

.language-switcher select option {
    background-color: var(--bg-contrast);
    color: var(--text-primary);
}

/* Hero Section */
#hero {
    padding-top: 250px; /* Increased to push content below enlarged header */
    padding-bottom: 80px;
    text-align: center;
    background-color: var(--bg-primary); /* Solid, clean background */
    color: var(--text-primary);
    min-height: auto; /* Let content define height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#hero h2 {
    font-size: 2.8em; /* Slightly reduced for balance */
    margin-bottom: 20px;
    font-weight: 600; /* Apple uses semi-bold often */
    letter-spacing: 0.2px;
    line-height: 1.2;
}

#hero p {
    font-size: 1.15em;
    margin-bottom: 35px;
    max-width: 680px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.cta-buttons {
    margin-bottom: 40px;
}

.cta-buttons .app-store-link img {
    height: 150px; /* Reverted: was 450px, back to 150px */
    transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
    filter: brightness(0.95) contrast(0.95) drop-shadow(0 0 8px rgba(255, 255, 255, 0.7)); 
    opacity: 0.85;
}

.app-store-link:hover img {
    transform: scale(1.03);
    opacity: 1;
}

.hero-image-link {
    display: block; /* Will be centered by parent flex container */
    /* margin: 0 auto; No longer primary centering method here */
    max-width: 70%; /* Control size relative to container */
    transition: transform 0.3s ease-in-out;
}

.hero-image-link:hover {
    transform: scale(1.03);
}

.hero-image {
    width: 100%; /* Ensure it scales within the link */
    border-radius: 10px;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color-light);
    margin-top: 0; /* Removed top margin as link handles spacing */
}

#hero .container {
    display: flex;
    flex-direction: column;
    align-items: center; /* This will center flex items like h2, p, cta-buttons, hero-image-link */
}

/* Sections General Styling */
section {
    padding: 80px 0;
}

section h2.section-title {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 50px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

/* Features Section - Grid Display */
#features {
    background-color: var(--bg-secondary);
}

.features-container { /* Renamed from features-slider in thought process */
    max-width: 1100px;
    margin: 0 auto;
}

.feature-slides { /* This is the flex container for cards */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
}

.feature-slide {
    flex: 1 1 300px; /* Grow and shrink, base 300px */
    max-width: 340px;
    box-sizing: border-box;
    padding: 30px;
    text-align: center;
    background-color: var(--bg-contrast);
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content to top */
    align-items: center;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    border: 1px solid transparent; /* For hover effect */
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.feature-slide:hover {
    transform: translateY(-8px) scale(1.05); /* Increased scale for more noticeable enlargement */
    box-shadow: var(--shadow-medium);
    border-color: var(--border-color-light);
}

.feature-icon-background {
    width: 130px;  /* Increased by 30% */
    height: 130px; /* Increased by 30% */
    background-color: var(--text-primary);
    border-radius: 50%; 
    margin: 0 auto 25px auto; /* Adjusted bottom margin */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 7px rgba(0,0,0,0.06); /* Adjusted shadow */
    transition: transform 0.2s ease;
}

.feature-slide:hover .feature-icon-background {
    transform: scale(1.05);
}

.feature-slide img.feature-icon {
    max-width: 117px; /* Increased by 30% (90 * 1.3) */
    max-height: 117px; /* Increased by 30% (90 * 1.3) */
    width: auto;
    object-fit: contain; /* To maintain aspect ratio */
}

.feature-slide h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 600;
}

.feature-slide p {
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Screenshots Section */
#screenshots {
    background-color: var(--bg-primary);
}

#screenshots .section-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.15em;
    line-height: 1.7;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 50px; /* Space before the gallery */
}

.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-items: center; /* Center images in their grid cells */
}

.screenshot-gallery img {
    width: 100%; 
    max-width: 300px; /* Reduced size */
    border-radius: 12px; 
    border: 1px solid var(--border-color); /* Added subtle border */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15); /* Adjusted shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    margin: 0 auto; 
}

.screenshot-gallery img:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); /* Adjusted hover shadow */
    border-color: var(--border-color-light); /* Lighter border on hover */
}

.screenshot-item img {
    display: block;
    width: 100%;
    height: auto;
}

/* Reviews Section */
#reviews {
    background-color: var(--bg-secondary);
}

.review-slider { /* Corrected selector to match HTML */
    display: grid;
    grid-template-columns: 1fr; /* Single column for stacking bubbles */
    gap: 20px; /* Space between bubbles */
    max-width: 700px; /* Constrain the width of the review area */
    margin: 40px auto 0; /* Center the review area and add top margin */
}

.review-item { /* Corrected selector to match HTML */
    background-color: var(--bg-contrast); /* Bubble background */
    padding: 15px 20px;
    border-radius: 20px; /* Rounded corners for bubble style */
    box-shadow: var(--shadow-soft);
    max-width: 75%; /* Bubbles don't take full width of the column */
    justify-self: center; /* Center the bubble within its grid cell */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Optional: Style for alternating bubbles if desired in the future */
/* .review-item:nth-child(even) {
    justify-self: end; 
    background-color: var(--bg-secondary); /* Different color for 'other side' bubble */
/* } */

.review-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: var(--shadow-medium);
}

.review-item p { /* Corrected selector for review text */
    font-size: 1em;
    font-style: normal;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.6;
    /* Ensure no leftover styles like border-left */
    border-left: none;
    padding-left: 0;
}

.review-item h4 { /* Corrected selector for author */
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text-tertiary);
    text-align: right;
    margin-top: 5px;
}

/* Contact Section */
#contact .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#contact {
    text-align: center; /* Fallback or for other content if any */
}

.contact-cta-buttons {
    margin-top: 30px; /* Add space above the App Store button */
    margin-bottom: 0; /* Remove extra space below the button */
    /* display: inline-block; Removed, alignment handled by flex parent */
}

.contact-cta-buttons .app-store-link img {
    height: 150px;
    transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
    filter: brightness(0.95) contrast(0.95) drop-shadow(0 0 8px rgba(255, 255, 255, 0.7));
    opacity: 0.85;
}

.contact-cta-buttons .app-store-link:hover img {
    transform: scale(1.03);
    opacity: 1;
}

#contact {
    background-color: var(--bg-primary);
    text-align: center;
}

#contact p {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-link {
    display: inline-block;
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    padding: 14px 30px;
    font-size: 1em;
    font-weight: 500;
    border-radius: 8px; /* Standard Apple button radius */
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow-soft);
}

.contact-link:hover {
    background-color: var(--accent-secondary);
    color: var(--bg-primary);
    transform: translateY(-2px);
    background-color: #005bb5;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 122, 255, 0.4);
}

/* Final CTA Section */
#final-cta {
    background: linear-gradient(135deg, #5e60ce 0%, #43447a 100%); /* Similar to hero */
    color: #ffffff;
    padding: 80px 0;
    text-align: center;
}

#final-cta h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    font-weight: 700;
}

.hero-image-link-bottom {
    margin-bottom: 30px;
}

.hero-image-link-bottom .hero-image {
    max-width: 60%; /* Slightly smaller or adjust as needed */
    margin-top: 0;
}

.bottom-cta .app-store-link img {
    height: 180px; /* Same as hero */
    transition: transform 0.3s ease, filter 0.3s ease;
}

.bottom-cta .app-store-link:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}


/* Footer */
footer .container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center all footer content */
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px; /* Space between logo and copyright */
}

.footer-logo img {
    height: 112px; /* 140px * 0.8 */
    margin-right: 12px; /* 15px * 0.8, or adjust as needed */
    filter: none;
    transition: transform 0.2s ease;
}

.footer-logo img:hover {
    transform: scale(1.03);
}

.footer-logo h1 {
    font-size: 2.56em; /* 3.2em * 0.8 */
    font-weight: 600;
    color: var(--text-secondary); /* Slightly dimmer for footer */
    letter-spacing: 0.5px;
    margin: 0; /* Remove default h1 margin */
}

footer {
    background-color: #141414; /* Very dark for footer */
    color: #888888;
    text-align: center;
    padding: 25px 0;
    font-size: 0.9em;
}

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

/* Responsive Design */
@media (max-width: 992px) { /* Tablet and below */
    .feature-item {
        flex: 0 0 280px; /* Adjust size for smaller screens */
    }
    .review-item {
        width: calc(50% - 30px); /* Two items per row */
    }
}


@media (max-width: 768px) { /* Mobile */
    header .container {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        margin-bottom: 10px;
    }

    header nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
        padding-left: 0;
    }

    header nav ul li {
        margin: 5px 8px;
    }

    #hero h2 {
        font-size: 2.4em;
    }

    #hero p {
        font-size: 1.1em;
    }

    .hero-image {
        max-width: 90%;
    }

    .feature-grid {
        padding-left: 20px; /* Ensure first item is not cut off */
        padding-right: 20px;
    }

    .feature-item {
        flex: 0 0 250px; /* Smaller items on mobile */
        margin-right: 15px;
    }

    .review-item {
        width: calc(100% - 20px);
        margin-bottom: 20px;
    }

    .screenshot-gallery img {
        max-width: 85%;
    }

    #contact p {
        font-size: 1.1em;
    }

    .email-link {
        padding: 12px 25px;
        font-size: 1em;
    }
}

@media (max-width: 480px) { /* Small mobile */
    #hero h2 {
        font-size: 2em;
    }
    .logo h1 {
        font-size: 1.6em;
    }
    header nav ul li a {
        font-size: 0.9em;
        padding: 6px 10px;
    }
    .feature-item {
        flex: 0 0 220px;
    }
}
