/* X Effect - Premium Landing Page */

:root {
    /* App Colors */
    --color-red: #FF3B30;
    --color-purple: #AF52DE;
    --color-blue: #007AFF;

    /* Base Theme */
    --bg-color: #000000;
    --text-color: #FFFFFF;
    --text-secondary: #8E8E93;
    --glass-bg: rgba(255, 255, 255, 0.08);
    /* Slightly clearer */
    --glass-border: rgba(255, 255, 255, 0.15);

    /* Font: Changed to sans-serif for better readability */
    --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-header: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Main Container - Increased padding to avoid edge hugging */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    /* Increased from 20px */
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

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

/* Background Effects */
.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    /* Increased blur for smoother gradient look */
    opacity: 0.4;
    will-change: transform;
    /* Hint to browser for optimization */
    animation: float 25s infinite ease-in-out;
}

.blob-1 {
    width: 700px;
    height: 700px;
    background: var(--color-purple);
    top: -20%;
    right: -10%;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: var(--color-blue);
    bottom: -10%;
    left: -10%;
    animation-delay: -5s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: var(--color-red);
    top: 30%;
    left: 30%;
    opacity: 0.2;
    animation-delay: -10s;
}

/* Use translate3d to force hardware acceleration */
@keyframes float {

    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(40px, -60px, 0);
    }
}

/* Header */
header {
    text-align: center;
    padding: 20px 20px 0;
    z-index: 10;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.app-logo {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 5rem;
    font-weight: 100;
    /* UltraLight equivalent */
    letter-spacing: -2px;
    color: #fff;
    font-family: "New York", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

.subtitle {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-top: 10px;
    font-weight: 400;
}

.app-store-badge {
    margin-top: 30px;
    height: 50px;
    transition: transform 0.2s;
}

.app-store-badge:hover {
    transform: scale(1.05);
}

/* Device Showcases */
.device-section {
    position: relative;
    width: 100%;
    height: 800px;
    /* Taller for layout */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    perspective: 2000px;
}

/* Main Container - Split Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    /* Removed top margin */
    padding: 0 40px;
    display: flex;
    flex-direction: row;
    /* Side by side on desktop */
    align-items: center;
    justify-content: space-between;
    min-height: 80vh;
    /* Fill vertical space */
}

/* Text Content - Left Side */
.text-content {
    text-align: left;
    width: 45%;
    max-width: 600px;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 20;
}

.text-content h2 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-sans);
}

.text-content p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0 0 30px 0;
    font-weight: 400;
}

.download-btn {
    display: inline-block;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.download-btn img {
    height: 50px;
    transition: transform 0.2s;
    pointer-events: none; /* Let the anchor handle the clicks */
}

.download-btn:hover img {
    transform: scale(1.05);
}

/* Device Showcase - Right Side */
.devices-container {
    position: relative;
    width: 55%;
    /* Assign other half */
    height: 600px;
    /* Reduced height to fit */
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0.85);
    /* Slightly scale down to fit comfortably */
    transform-origin: center right;
}

/* iPhone Wrapper - Front */
.iphone-wrapper {
    position: absolute;
    width: 320px;
    height: 650px;
    z-index: 20;
    bottom: -50px;
    left: 10%;
    transform: translate(0, 0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.iphone-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.6));
}

.iphone-screen {
    position: absolute;
    top: 14px;
    left: 16px;
    width: 289px;
    height: 623px;
    /* Precise fit */
    background: #000;
    border-radius: 44px;
    overflow: hidden;
    z-index: 1;
}

.iphone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    /* Ensure no stretching */
}

/* iPad Wrapper - Back & Side */
.ipad-wrapper {
    position: absolute;
    width: 500px;
    height: auto;
    z-index: 10;
    top: 50px;
    right: -10%;
    /* Align to right within container */
    transform: scale(0.9);
    filter: brightness(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s ease;
    /* Smoother bounce */
}

/* iPad Expanded State */
.ipad-wrapper.expanded {
    z-index: 60;
    /* Topmost */
    filter: brightness(1) drop-shadow(0 30px 60px rgba(0, 0, 0, 0.5));
    transform: scale(1.0) translate(-50px, 0) !important;
    /* Move slightly left to center better */
}

/* Add cursor to iPad */
.ipad-wrapper {
    cursor: pointer;
}

.ipad-frame {
    width: 100%;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

.ipad-screen {
    position: absolute;
    top: 32px;
    left: 32px;
    /* Increased offset */
    width: 87%;
    /* Reduced width */
    height: 90%;
    /* Reduced height */
    background: #000;
    border-radius: 14px;
    /* Slightly tighter radius */
    overflow: hidden;
    z-index: -1;
}

.screen-image {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    /* Critical: prevents distortion */
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.screen-image.active {
    opacity: 1;
}

/* App Description Section */
.app-description {
    width: 100%;
    max-width: 1000px;
    margin: 40px auto 120px;
    /* Spacing above and below */
    padding: 0 40px;
    color: #fff;
    /* Solid white text */
    text-align: center;
    position: relative;
    z-index: 5;
}

.desc-container h3 {
    font-family: var(--font-header);
    font-size: 2.5rem;
    font-weight: 200;
    margin-bottom: 20px;
    color: #ffffff;
    /* Changed from purple to white per user request */
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto 50px;
    opacity: 0.95;
    /* Almost full opacity for "solid" look */
}

.desc-grid {
    display: flex;
    /* Changed from grid to flex for easy centering */
    flex-direction: column;
    gap: 60px;
    text-align: center;
    /* Center text */
    align-items: center;
    /* Center items */
}

.desc-column {
    max-width: 600px;
    /* Limit width to prevent side-hugging */
    margin: 0 auto;
}

.desc-column h4 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    display: inline-block;
    /* Keep underline only on text */
}

.desc-column ul {
    list-style: none;
    padding: 0;
    text-align: center;
    /* Ensure list items are centered */
}

.desc-column li {
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 1.05rem;
}

.desc-column p {
    line-height: 1.6;
    font-size: 1.05rem;
}

/* Features / Grid */
.features-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 100px;
    padding: 20px;
    position: relative;
    z-index: 5;
}

/* Base Feature Card (Neon Glow Style) */
.feature-card {
    background: #111;
    border: 1px solid #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    flex: 1 1 250px;
    max-width: 300px;
}

.feature-card:hover {
    border-color: var(--color-purple);
    box-shadow: 0 0 20px var(--color-purple);
    transform: scale(1.02);
}



/* Inner Element Styles */
.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-title {
    font-family: var(--font-sans);
    font-weight: 700;
    margin: 15px 0 10px;
}

.feature-desc {
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-family: var(--font-sans);
}

footer a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--color-blue);
}

/* Entrance Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUpDevices {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.85);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(0.85);
    }
}

/* Apply Animations */
header {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    /* Start hidden */
}

.text-content {
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.devices-container {
    animation: fadeInUpDevices 0.8s ease-out 0.6s forwards;
    /* Use custom animation to preserve scale */
    opacity: 0;
}

.app-description {
    animation: fadeInUp 0.8s ease-out 0.9s forwards;
    opacity: 0;
}

/* Staggered Feature Cards */
.feature-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.feature-card:hover {
    /* Ensure hover scale works after animation */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-card:nth-child(1) {
    animation-delay: 1.1s;
}

.feature-card:nth-child(2) {
    animation-delay: 1.2s;
}

.feature-card:nth-child(3) {
    animation-delay: 1.3s;
}

.feature-card:nth-child(4) {
    animation-delay: 1.4s;
}

/* Existing Utility */
.hidden {
    display: none;
}

@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    .iphone-wrapper {
        transform: scale(0.9);
        margin-bottom: 50px;
    }

    .ipad-wrapper.portrait {
        transform: scale(0.7);
        margin-top: -100px;
    }
}

/* Mobile Responsiveness for Split Layout */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        text-align: center;
        margin-top: 20px;
    }

    .text-content {
        width: 100%;
        text-align: center;
        margin-bottom: 40px;
    }

    .text-content p {
        margin: 0 auto 30px;
    }

    /* Container adjustment - overlapping style */
    .devices-container {
        width: 100%;
        transform: scale(1);
        height: 550px;
        margin-bottom: 50px;
        display: block; /* Ensure wrappers can position absolutely within this block */
    }

    /* iPhone Positioned to overlap */
    .iphone-wrapper {
        left: 50%;
        top: 60px;
        bottom: auto;
        /* Shift left to overlap left side of iPad */
        transform: translateX(-70%) scale(0.75);
        margin-left: 0;
        z-index: 20;
    }

    /* iPhone Expanded on Mobile */
    .iphone-wrapper.expanded {
        top: 20px;
        transform: translateX(-50%) scale(0.85) !important;
        z-index: 50;
    }

    /* iPad Positioned behind */
    .ipad-wrapper {
        right: auto;
        left: 50%;
        top: 0;
        /* Shift right to sit behind iPhone */
        transform: translateX(-25%) scale(0.65);
        margin-right: 0;
        z-index: 10;
    }

    /* iPad Expanded on Mobile */
    .ipad-wrapper.expanded {
        top: 20px;
        transform: translateX(-50%) scale(0.75) !important;
        z-index: 60;
    }

}

/* Interactivity & Expanded States */
.feature-card {
    cursor: pointer;
    /* Indicate interactivity */
}

.feature-more-info {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s ease;
    font-size: 0.9rem;
    color: #bbb;
    margin-top: 0;
}

.feature-card.expanded {
    transform: scale(1.1);
    z-index: 100;
    background: #1a1a1a;
    border-color: var(--color-purple);
    box-shadow: 0 10px 40px rgba(175, 82, 222, 0.3);
}

.feature-card.expanded .feature-more-info {
    max-height: 200px;
    /* Allow content to show */
    opacity: 1;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
    margin-bottom: 10px;
    /* Prevent hitting the edge/line */
}

/* Expanded Device State */
.iphone-wrapper.expanded {
    transform: translate(0, -30px) scale(1.1) !important;
    z-index: 50;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.8));
}

/* Add cursor to phone */
.iphone-wrapper {
    cursor: pointer;
}