:root {
    --google-blue: #1a73e8;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --bg-white: #ffffff;
    --bg-gray: #f8f9fa;
    --bg-blue-light: #e8f0fe;
    --bg-green-light: #e6f4ea;
    --bg-yellow-light: #fef7e0;
    --radius-pill: 9999px;
    --radius-phone: 24px;
    --radius-screen: 16px;
    --radius-card: 32px;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

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

/* Header */
header {
    position: sticky;
    top: 0;
    width: 100%;
    height: 64px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2rem;
}

.logo img {
    height: 32px;
    border-radius: 6px;
}

/* Buttons */
.btn {
    padding: 0.8rem 2.2rem;
    border-radius: var(--radius-pill);
    font-weight: 500;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-primary {
    background: var(--google-blue);
    color: #fff;
}

.btn-primary:hover {
    background: #1967d2;
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

/* QR Code Bubble on Hover */
.download-wrapper {
    position: relative;
    display: inline-block;
}

.qr-bubble {
    position: absolute;
    bottom: calc(100% + 15px); 
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 100;
    pointer-events: none;
    text-align: center;
}

.qr-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #fff;
    box-shadow: 4px 4px 5px -2px rgba(0,0,0,0.1);
}

.qr-bubble img {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 4px;
}

.qr-bubble span {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Only show on PC (devices with hover capability) */
@media (hover: hover) and (pointer: fine) {
    .download-wrapper:hover .qr-bubble {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* Base Phone Mockup */
.mockup {
    position: relative;
    background: #202124;
    padding: 10px;
    border-radius: var(--radius-phone);
    aspect-ratio: 9/19.5;
    flex-shrink: 0;
}

.mockup-screen {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-screen);
    overflow: hidden;
    background: #fff;
}

.mockup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hero Section (Bold Split Layout) */
.hero {
    padding: 80px 0 120px;
    background: radial-gradient(circle at right center, var(--bg-blue-light) 0%, var(--bg-white) 60%);
    text-align: left;
    overflow: hidden;
}

.hero-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-text {
    flex: 1;
    max-width: 500px;
    z-index: 5;
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin: 0;
}

.hero-buttons {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    position: relative;
}

.hero-collage {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 550px; 
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    margin: 0; 
}

.hero-collage .mockup {
    position: absolute;
    width: 250px; /* Scaled down to fit the half-width */
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-collage .mockup.center {
    z-index: 3;
    transform: translateY(0) scale(1);
}

.hero-collage .mockup.left {
    z-index: 2;
    transform: translateX(-45%) translateY(30px) scale(0.9) rotate(-6deg);
    opacity: 0.9;
}

.hero-collage .mockup.right {
    z-index: 2;
    transform: translateX(45%) translateY(30px) scale(0.9) rotate(6deg);
    opacity: 0.9;
}

.hero-collage:hover .mockup.left {
    transform: translateX(-55%) translateY(10px) scale(0.95) rotate(-4deg);
}

.hero-collage:hover .mockup.right {
    transform: translateX(55%) translateY(10px) scale(0.95) rotate(4deg);
}

/* Section Common */
.section {
    padding: 120px 0;
}

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

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Changed to 2 columns so cards are same width */
    grid-template-rows: repeat(2, minmax(400px, auto));
    gap: 30px;
}

.bento-item {
    background: var(--bg-gray);
    border-radius: var(--radius-card);
    padding: 40px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Fix text overlapping by containing it */
.bento-text {
    position: relative;
    z-index: 3;
}

.bento-text h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.bento-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.bento-large {
    /* grid-column: span 2; Removed so it spans 1 column out of 2 */
    background: var(--bg-blue-light);
}

.bento-large .bento-text {
    max-width: 50%; /* Re-adjusted since width is now half */
    margin-left: auto;
}

.bento-tall {
    grid-row: span 2;
    background: var(--bg-yellow-light);
}

.bento-tall .bento-text {
    margin-bottom: 30px; 
}

.bento-square .bento-text {
    max-width: 50%; /* Keep text to the left */
}

/* Bento Visual Positioning */
.bento-mockup-wrapper {
    position: absolute;
    transition: transform 0.3s;
    z-index: 2;
}

/* Large Horizontal Card Phone - GUARANTEED TOP GAP */
.bento-large .bento-mockup-wrapper {
    left: -20px;
    top: 80px; 
    width: 280px; /* Reduced width slightly to fit better in half-width card */
}

/* Tall Vertical Card Phone */
.bento-tall .bento-mockup-wrapper {
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
}

/* Standard Square Card Phone */
.bento-square .bento-mockup-wrapper {
    right: -20px; 
    bottom: -40px;
    width: 240px; 
}

/* Full Width Card */
.bento-full {
    grid-column: span 2;
    min-height: 380px; /* Ensure card is tall enough to show half the phone */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center the text */
}

.bento-full .bento-text {
    max-width: 50%;
    position: relative;
    z-index: 2;
}

.bento-full .bento-mockup-wrapper {
    right: 60px;
    top: 40px; /* Push it down slightly so the top of the phone is visible */
    width: 320px;
}

/* Overlapping Stack Section */
.stack-section {
    text-align: center;
    background: var(--bg-gray);
    border-radius: 60px;
    padding: 100px 40px 0 40px;
    overflow: hidden;
}

.stack-section h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.stack-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 80px;
    margin-bottom: -120px;
    gap: 40px; 
    flex-wrap: wrap; 
}

.stack-container .mockup {
    width: 260px;
    position: relative;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    padding: 60px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 100px;
}

/* Hide cloned items on desktop */
.mobile-clone {
    display: none;
}

@media (max-width: 900px) {
    .mobile-clone {
        display: block;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 20px;
    }
    
    .bento-large, .bento-tall, .bento-square, .bento-full {
        grid-column: span 1;
        grid-row: span 1;
        min-height: auto;
        padding: 40px 20px 0; /* Keep top/side padding, remove bottom so phone can flush out */
        text-align: center;
    }

    .bento-text {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-bottom: 40px !important;
    }

    .bento-mockup-wrapper {
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important; 
        transform: none !important;
        width: 80% !important;
        max-width: 260px !important;
        margin: 0 auto;
        height: 280px !important; /* Only give the phone 280px of vertical space, clipping the rest */
    }
    
    .hero-split {
        flex-direction: column;
        text-align: left;
    }

    .hero-text {
        max-width: 100%;
        margin-bottom: 40px;
    }

    .hero-buttons {
        justify-content: flex-start;
    }

    .hero-visual {
        justify-content: center;
        width: 100%;
    }

    .hero-collage .mockup.left,
    .hero-collage .mockup.right {
        display: none;
    }
    
    .hero-collage {
        height: 500px;
    }

    .stack-section {
        padding: 60px 0;
        margin: 0; /* Remove lateral margins so it aligns with bento cards */
        border-radius: 32px;
        overflow: hidden; /* Clips to the rounded card edges */
    }

    .stack-section h2, 
    .stack-section p {
        padding: 0 30px; /* Keep text padded */
    }

    .stack-container {
        gap: 20px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 20px;
        margin-left: 0;
        margin-right: 0;
        padding-left: 30px; /* Start scrolling with same padding as text */
        padding-right: 30px;
    }

    .stack-container::-webkit-scrollbar {
        display: none; 
    }

    .stack-container .mockup {
        transform: none !important;
        flex-shrink: 0; 
    }
}
