/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'BBHBogle';
    src: url('../fonts/BBHBogle-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Neonderthaw';
    src: url('../fonts/Neonderthaw-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

:root {
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-surface: #1C1C1E;
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #8E8E93;
    --color-accent: #0A84FF;
    --color-border: #3A3A3C;
}

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--color-black);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Scroll-Snap Sections ===== */
.hero,
.demo-section,
.comparison-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: 100vh;
    overflow: hidden;
}

/* ===== Section 1: Hero ===== */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
}

.hero-content {
    max-width: 600px;
}

.logo {
    font-family: 'BBHBogle', sans-serif;
    font-size: 64px;
    font-weight: 400;
    color: var(--color-white);
    margin-bottom: 60px;
    letter-spacing: 0.5px;
}

.tagline {
    margin-bottom: 80px;
}

.tagline-line {
    font-family: 'Neonderthaw', cursive;
    font-size: 44px;
    line-height: 1.2;
}

.tagline .light {
    font-weight: 400;
    color: var(--color-white);
}

.tagline .bold {
    font-weight: 700;
    color: var(--color-white);
}

.app-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.app-button {
    display: inline-block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

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

.app-button img {
    display: block;
    height: 60px;
    width: auto;
}

/* ===== Side-by-Side Grid (Sections 2 & 3) ===== */
.section-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

.text-block {
    max-width: 480px;
}

.section-heading {
    font-size: 42px;
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.section-desc {
    font-size: 18px;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.section-desc:last-child {
    margin-bottom: 0;
}

.section-desc.accent {
    color: var(--color-accent);
    font-weight: 600;
}

/* ===== Fade-In Animation ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Section 2: Demo Showcase ===== */
.demo-wrapper {
    display: flex;
    justify-content: center;
}

.demo-phone {
    position: relative;
    width: 320px;
    aspect-ratio: 9 / 16;
    border-radius: 24px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.demo-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.6s ease;
}

.demo-img-original {
    opacity: 1;
    z-index: 1;
}

.demo-img-result {
    opacity: 0;
    z-index: 2;
}

/* Edit with AI button */
.demo-edit-btn {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--color-accent);
    color: var(--color-white);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

.demo-edit-btn.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Modal bottom sheet */
.demo-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1C1C1E;
    border-radius: 16px 16px 0 0;
    padding: 16px 20px 24px;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
    z-index: 20;
}

.demo-modal.visible {
    transform: translateY(0);
}

.demo-modal-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-modal-handle {
    width: 36px;
    height: 4px;
    background: #48484A;
    border-radius: 2px;
    margin: 0 auto 4px;
}

.demo-modal-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.demo-modal-input {
    background: #2C2C2E;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--color-white);
    min-height: 42px;
    line-height: 1.4;
}

.demo-typed-text {
    white-space: pre-wrap;
}

.demo-cursor {
    color: var(--color-accent);
    font-weight: 300;
    opacity: 0;
}

.demo-cursor.visible {
    animation: blink 1.06s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.demo-modal-btn {
    background: #48484A;
    color: #636366;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    transition: background 0.3s ease, color 0.3s ease;
}

.demo-modal-btn.active {
    background: var(--color-accent);
    color: var(--color-white);
}

/* Loading sparkle overlay */
.demo-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.demo-loading.visible {
    opacity: 1;
}

.sparkle-container {
    position: relative;
    width: 60px;
    height: 60px;
    animation: sparkle-rotate 1.5s linear infinite;
}

@keyframes sparkle-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sparkle-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--color-white);
    border-radius: 50%;
}

.sparkle-1 { top: 0; left: 50%; transform: translateX(-50%); animation: sparkle-pulse 1.2s ease-in-out infinite 0s; }
.sparkle-2 { top: 9px; right: 9px; animation: sparkle-pulse 1.2s ease-in-out infinite 0.15s; }
.sparkle-3 { top: 50%; right: 0; transform: translateY(-50%); animation: sparkle-pulse 1.2s ease-in-out infinite 0.3s; }
.sparkle-4 { bottom: 9px; right: 9px; animation: sparkle-pulse 1.2s ease-in-out infinite 0.45s; }
.sparkle-5 { bottom: 0; left: 50%; transform: translateX(-50%); animation: sparkle-pulse 1.2s ease-in-out infinite 0.6s; }
.sparkle-6 { bottom: 9px; left: 9px; animation: sparkle-pulse 1.2s ease-in-out infinite 0.75s; }
.sparkle-7 { top: 50%; left: 0; transform: translateY(-50%); animation: sparkle-pulse 1.2s ease-in-out infinite 0.9s; }
.sparkle-8 { top: 9px; left: 9px; animation: sparkle-pulse 1.2s ease-in-out infinite 1.05s; }

.sparkle-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--color-white);
    border-radius: 50%;
    animation: sparkle-pulse 0.8s ease-in-out infinite;
}

@keyframes sparkle-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* Fix transform override for positioned dots */
.sparkle-1, .sparkle-5 {
    animation: sparkle-pulse-x 1.2s ease-in-out infinite;
}
.sparkle-3, .sparkle-7 {
    animation: sparkle-pulse-y 1.2s ease-in-out infinite;
}
.sparkle-1 { animation-delay: 0s; }
.sparkle-5 { animation-delay: 0.6s; }
.sparkle-3 { animation-delay: 0.3s; }
.sparkle-7 { animation-delay: 0.9s; }

@keyframes sparkle-pulse-x {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes sparkle-pulse-y {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* AI Generated badge */
.demo-badge {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 132, 255, 0.9);
    color: var(--color-white);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 25;
    white-space: nowrap;
}

.demo-badge.visible {
    opacity: 1;
}

/* ===== Section 3: Comparison Slider ===== */
.comparison-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.comparison-slider {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.06);
}

.comparison-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.comparison-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 50% 0 0);
    z-index: 6;
}

.comparison-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.comparison-handle-line {
    flex: 1;
    width: 3px;
    background: var(--color-white);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.comparison-handle-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comparison-handle-circle svg {
    width: 16px;
    height: 16px;
    stroke: var(--color-black);
}

.comparison-slider.active .comparison-handle-circle {
    transform: scale(1.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.comparison-label-left,
.comparison-label-right {
    position: absolute;
    top: 16px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 5;
}

.comparison-label-left {
    left: 16px;
    background: rgba(10, 132, 255, 0.85);
    color: var(--color-white);
}

.comparison-label-right {
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--color-text-secondary);
}

.comparison-captions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding: 0 4px;
    width: 100%;
    max-width: 500px;
}

.comparison-note {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-weight: 400;
    max-width: 45%;
    text-align: right;
    transition: opacity 0.2s ease;
}

.comparison-note.highlight {
    color: var(--color-accent);
    font-weight: 600;
    text-align: left;
}

/* ===== Footer ===== */
.footer {
    padding: 60px 0 40px;
    background-color: var(--color-black);
    border-top: 1px solid var(--color-border);
}

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

.footer-nav {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: var(--color-white);
}

.copyright {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 13px;
}

/* ===== Responsive: Tablet & Mobile ===== */
@media (max-width: 768px) {
    .logo {
        font-size: 48px;
        margin-bottom: 40px;
    }

    .tagline-line {
        font-size: 32px;
    }

    .tagline {
        margin-bottom: 60px;
    }

    .hero,
    .demo-section,
    .comparison-section {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .section-content {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px 24px;
        height: auto;
        min-height: 100vh;
    }

    .text-block {
        max-width: 100%;
        text-align: center;
    }

    .section-heading {
        font-size: 32px;
    }

    .section-desc {
        font-size: 16px;
    }

    .demo-phone {
        width: 280px;
    }

    .comparison-slider {
        max-width: 100%;
    }

    .comparison-captions {
        max-width: 100%;
    }

    .comparison-label-left,
    .comparison-label-right {
        font-size: 12px;
        padding: 5px 10px;
    }

    .comparison-captions {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .comparison-note {
        max-width: 100%;
        text-align: center;
    }

    .comparison-note.highlight {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 36px;
    }

    .tagline-line {
        font-size: 28px;
    }

    .app-buttons {
        flex-direction: column;
        gap: 16px;
    }

    .app-button img {
        height: 48px;
    }

    .section-heading {
        font-size: 28px;
    }

    .demo-phone {
        width: 260px;
    }
}
