/* General Body & Typography */
body {
    margin: 0;
    font-family: 'SF Pro Display', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f8f8f8;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

h1, h2, h3 {
    color: #1a1a1a;
    font-weight: 700;
    margin-bottom: 15px;
}

h1 {
    font-size: 3.5em;
    line-height: 1.1;
}

h2 {
    font-size: 2.5em;
    line-height: 1.2;
}

h3 {
    font-size: 1.6em;
    line-height: 1.3;
}

p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

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

/* --- Header & Navigation --- */
header {
    background-color: transparent;
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    background-color: rgba(0, 0, 0, 0.9); /* Dark background when scrolled */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); /* Stronger shadow for dark header */
    backdrop-filter: blur(8px);
}

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

.logo-img {
    height: 40px; /* Adjust logo size */
    width: 40px;
}

.desktop-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    margin-left: 30px;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

header.scrolled .desktop-nav a {
    color: #fff; /* Keep text white when scrolled */
}

.desktop-nav a:hover {
    color: #007aff; /* Apple blue */
}

.cta-button {
    background-color: #007aff; /* Apple blue */
    color: #fff !important; /* !important to override desktop-nav a rule */
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* Prevent button text from wrapping */
}

.cta-button:hover {
    background-color: #005bb5;
}

/* --- Hamburger Menu (Mobile) --- */
.hamburger-btn {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative; /* To position spans */
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff; /* White bars for contrast on hero */
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

header.scrolled .hamburger-btn span {
    background-color: #fff; /* Keep bars white when scrolled */
}

/* Hamburger animation */
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation Overlay */
.mobile-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.4s ease-in-out;
    transform: translateX(100%); /* Start off-screen to the right */
}

.mobile-nav.active {
    transform: translateX(0); /* Slide in */
    display: flex; /* Show when active */
}

.mobile-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 2em;
    padding: 15px 0;
    opacity: 0; /* Hidden initially for stagger effect */
    transform: translateY(20px); /* Slide from bottom */
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.mobile-nav.active a {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for mobile nav links */
.mobile-nav.active a:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav.active a:nth-child(2) { transition-delay: 0.2s; }
.mobile-nav.active a:nth-child(3) { transition-delay: 0.3s; }
.mobile-nav.active a:nth-child(4) { transition-delay: 0.4s; } /* For the CTA button */


/* --- Hero Section --- */
#hero {
    position: relative;
    height: 100vh; /* Full viewport height */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff; /* Ensure all text in hero is white */
    text-align: center;
    overflow: hidden; /* Hide video overflow */
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Place behind content */
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the entire area */
    filter: brightness(1) grayscale(0.2); /* Increased brightness, less grayscale */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Lighter dark overlay */
    z-index: 0; /* Above video, below content */
}

.hero-content {
    position: relative;
    z-index: 1; /* Above overlay */
    max-width: 800px;
    padding: 20px;
}

.hero-content h1 {
    font-size: 5em;
    margin-bottom: 0;
    color: #fff; /* Explicitly white */
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.hero-content .tagline {
    font-size: 2.5em;
    margin-top: 10px;
    margin-bottom: 30px;
    font-weight: 500;
    color: #fff; /* Explicitly white */
    text-shadow: 1px 1px 6px rgba(0,0,0,0.4);
}

/* NEW: Style for the rotating tagline */
.hero-sub-tagline {
    font-size: 1.6em; /* Larger than previous p */
    /*min-height: 80px; /*2.5em; /* Ensure enough height for the longest sentence to prevent layout shift */
   height: 90px;
 width: 600px;
 margin: 20px auto; /* Center with auto margins, provide vertical spacing */
/*    max-width: 600px*/;
    color: #fff;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
    opacity: 1; /* Initial state for fade-in */
    transition: opacity 0.7s ease-in-out; /* Fade transition */
}

/* Classes for fading effect */
.hero-sub-tagline.fade-out {
    opacity: 0;
}

.hero-sub-tagline.fade-in {
    opacity: 1;
}

/* --- Features Section (DARK THEME) --- */
#features {
    padding: 80px 0;
    background-color: #1a1a1a; /* Dark background color, similar to footer */
    color: #f8f8f8; /* Light text color for contrast */
    position: relative; /* Needed for absolute positioning of parallax mockup */
    overflow: hidden; /* Ensure parallax element doesn't cause overflow */
}

#features .multi-line-heading h2 {
    color: #f8f8f8; /* Ensure headings are also light */
}

/* Ensure default paragraph text within #features is light */
#features p {
    color: #ccc;
}

/* Letter-by-Letter Animation styles */
.animate-by-letter span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    color: #f8f8f8; /* Ensure animated text is light */
}

.animate-by-letter.visible span {
    opacity: 1;
    transform: translateY(0);
}

/* Fix for h2 headings to prevent word splitting (Recommendation for current issue) */
.multi-line-heading h2 {
    white-space: nowrap; /* Prevent words from wrapping to the next line */
    overflow: hidden; /* Hide overflowing text if it's too long for the container */
    text-overflow: ellipsis; /* Add ellipsis if text is truncated */
    /* Adjustments for mobile can be made below */
}


/* --- Who It's For Section (MAKE IT DARK) --- */
#who-its-for {
    padding: 80px 0;
    background-color: #222; /* Set a dark background for this section */
    color: #f8f8f8; /* Light text for contrast */
    position: relative;
    overflow: hidden;
}

#who-its-for .multi-line-heading h2 {
    color: #f8f8f8; /* Ensure headings are light */
}

#who-its-for p {
    color: #ccc; /* Ensure paragraphs are light */
}


/* --- Parallax App Mockup Styling (Adjusted for visibility & dark background) --- */
.parallax-app-mockup {
    position: absolute; /* Position relative to the features section */
    top: 0; /* Align to the top of the section */
    left: 0; /* Align to the left edge of the section */
    width: 60%; /* Take up a portion of the background */
    height: 100%; /* Cover the height of the section */
    display: flex; /* Use flex for centering the image within this div */
    align-items: center;
    justify-content: center;
    z-index: 0; /* Keep it in the background, below the content grid */
    pointer-events: none; /* Prevent it from blocking clicks on elements behind it */
    opacity: 0.08; /* Start with a very subtle opacity for background effect */
    transition: opacity 0.5s ease-in-out; /* Smooth fade in/out */
    will-change: transform, opacity; /* Hint to browsers for performance */
    overflow: hidden; /* Hide any overflow of the image */
}

.parallax-app-mockup img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.7) grayscale(0.8); /* Dim and desaturate slightly to blend with background */
    transform: scale(1.1); /* Slightly zoom in image to ensure coverage */
}

/* Adjust for larger screens (e.g., desktop) for parallax mockup */
@media (min-width: 1024px) {
    .parallax-app-mockup {
        width: 45%; /* Adjust width on desktop */
        height: 100%;
        top: 0;
        left: 5%; /* Position slightly from the left edge */
        opacity: 0.12; /* Slightly more visible on desktop */
    }
}

/* Hide on very small screens if it still obstructs content */
@media (max-width: 768px) {
    .parallax-app-mockup {
        display: none; /* Hide on mobile to prevent obstruction */
    }
    /* Adjust font size for the new rotating tagline on mobile */
    .hero-sub-tagline {
        font-size: 1.1em; /* Smaller on mobile for better fit */
        min-height: 3.5em; /* Adjust height for potentially longer wraps on mobile */
    }
    /* Reduce h2 font size on mobile to help prevent overflow/truncation */
    .multi-line-heading h2 {
        font-size: 1.6em; /* Adjust as needed for better fit */
        white-space: normal; /* Allow normal wrapping on very small screens if nowrap causes excessive overflow */
        text-overflow: clip; /* Remove ellipsis if wrapping normally */
    }
}


.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    position: relative; /* Ensure grid content is above parallax mockup */
    z-index: 3; /* Keep content above parallax */
}

.feature-card {
    background-color: #2a2a2a; /* Darker background for cards */
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Stronger shadow on dark bg */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); /* Enhanced hover shadow */
}

.feature-card i {
    font-size: 3em;
    color: #0096ff; /* A slightly brighter blue for contrast on dark */
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.4em;
    margin-top: 0;
    color: #f8f8f8; /* Light text for headings */
}

.feature-card p {
    font-size: 0.95em;
    color: #bbb; /* Lighter text for paragraphs */
}


/* --- Showcase Section (NOW DARK) --- */
#showcase {
    background-color: #222; /* Dark background for this section */
    padding: 80px 0;
    text-align: center;
}

#showcase .multi-line-heading h2 {
    color: #f8f8f8; /* White text for headings */
}

/* NEW CSS for .scrolling-wrapper (the outer container) */
.scrolling-wrapper {
    overflow: hidden; /* Hide anything outside its bounds */
    position: relative; /* For proper positioning of inner content */
    padding: 20px 0; /* Keep padding for visual spacing */
    
    /* Hide scrollbar, even though overflow is hidden now */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrolling-wrapper::-webkit-scrollbar {
    display: none;
}

/* NEW CSS for .scrolling-content-inner (the animated flex container) */
.scrolling-content-inner {
    display: flex; /* Make it a flex container */
    /* Ensure it's wide enough to contain all items without wrapping */
    width: max-content; /* This makes it as wide as all its flex children combined */
    
    /* Safari/WebKit momentum scrolling for touch devices (optional, can remove if it causes issues) */
    -webkit-overflow-scrolling: touch; 
    
    /* Add properties for smooth animation */
    will-change: transform; /* Optimize for transform animations */
    transform: translateX(0); /* Initial state */
    /* Transition is handled by requestAnimationFrame in JS */
}

.scrolling-content-inner.paused {
    /* If you want to pause the JS animation AND also freeze the layout on modal open */
    /* You would stop the JS animation in script.js and just have this class for visual cues */
}

.video-card {
    flex: 0 0 auto; /* Don't grow, don't shrink, base on content */
    width: 350px; /* Fixed width for each video card */
    margin: 0 15px; /* Spacing between cards */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* Stronger shadow on dark background */
    cursor: pointer;
    transition: transform 0.3s ease; /* For hover effect */
}

.video-card:hover {
    transform: scale(1.03); /* Slight zoom on hover */
}

.video-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Duplicated cards for infinite scroll illusion */
.video-card[aria-hidden="true"] {
    display: none; /* These are hidden by default, ensure they are copied in HTML */
}


/* --- Modals (Video Player & Feature Details) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1002; /* Above all other content */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff; /* Keep modal content light for readability */
    padding: 30px;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
display: flex; /* Make it a flex container */
    flex-direction: column; /* Stack children vertically */
}
/* NEW: Add styles for modal-body */
#modal-body {
    min-height: 150px; /* Adjust this value based on your typical shortest modal content */
    /* This helps reserve space even for short content.
       You might also consider setting a fixed height for images within the modal if they are not dynamically sized. */
}
.modal-overlay.visible .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    color: #555;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: #333;
}

.feature-detail-content { /* ADD THIS NEW RULE */
    display: none; /* This will hide the content by default */
}

.feature-detail-content h3 {
    font-size: 1.8em;
    color: #007aff;
}

.feature-detail-content p {
    font-size: 1.1em;
    color: #333;
}

/* --- Footer --- */
footer {
    background-color: #1a1a1a;
    color: #aaa;
    padding: 40px 0;
    text-align: center;
    font-size: 0.9em;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.app-store-badge img {
    height: 50px; /* Adjust badge size */
}

.social-links {
    margin-bottom: 20px; /* Space above other footer links */
    display: flex; /* Make it a flex container */
    justify-content: center; /* Center the icons horizontally */
    gap: 15px; /* Adjust spacing between icons */
}

.social-links a {
    color: #fff; /* White icons on dark footer background */
    font-size: 1.8em; /* Adjust icon size */
    margin: 0; /* Remove individual margins, let gap handle it */
    transition: color 0.3s ease, transform 0.2s ease;
    display: inline-flex; /* Treat as an inline-flex container */
    width: 40px; /* Fixed width for the icon container */
    height: 40px; /* Fixed height for the icon container */
    justify-content: center; /* Center icon horizontally */
    align-items: center; /* Center icon vertically */
}

.social-links a:hover {
    color: #007aff; /* Apple blue on hover */
    transform: translateY(-3px); /* Subtle lift on hover */
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

.desktop-view-switch button {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.desktop-view-switch button:hover {
    background-color: #555;
}

/* Force Desktop View for small screens */
body.force-desktop {
    min-width: 1200px; /* Force minimum width to simulate desktop */
    overflow-x: auto; /* Allow scrolling horizontally if content exceeds */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .desktop-nav, .desktop-cta {
        display: none; /* Hide desktop nav and CTA */
    }

    .hamburger-btn {
        display: block; /* Show hamburger on mobile */
    }

    .hero-content h1 {
        font-size: 3.5em;
    }

    .hero-content .tagline {
        font-size: 1.8em;
    }

    /* .hero-content p was replaced by .hero-sub-tagline */
    /* .hero-content p {
        font-size: 1em;
    } */

    .multi-line-heading h2 {
        font-size: 2em; /* Keep it at a reasonable size for most mobile */
        white-space: nowrap; /* Keep words on one line for better appearance */
        overflow: hidden; /* Hide overflow */
        text-overflow: ellipsis; /* Add ellipsis to truncated text */
        display: block; /* Ensures overflow/ellipsis works */
    }

    /* Further refine for very small screens if necessary */
    @media (max-width: 480px) {
        .multi-line-heading h2 {
            font-size: 1.4em; /* Smaller for very narrow screens */
            /* You might consider white-space: normal here IF ellipsis is too aggressive for your content,
               but that risks mid-word breaks if words are long and font size isn't small enough.
               Generally, for headings, keeping them on one line with ellipsis is preferred. */
        }
    }

    .features-grid {
        grid-template-columns: 1fr; /* Stack cards on mobile */
    }

    .feature-card {
        padding: 20px;
    }

    .feature-card h3 {
        font-size: 1.2em;
    }

    .feature-card p {
        font-size: 0.9em;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .scrolling-wrapper {
        margin: 0; /* Remove negative margin on small screens */
    }

    .video-card {
        width: 90vw; /* Make video cards take up most of the viewport width */
        margin: 0 10px; /* Adjust spacing */
    }

    footer .footer-links a {
        margin: 0 10px;
    }
}

