/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
    /* Light Mode (default) */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f5f7;
    --bg-navbar: rgba(255, 255, 255, 0.88);
    --navbar-border: rgba(0, 0, 0, 0.06);
    --bg-cta: #f0f0f5;
    --text-primary: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #888;
    --border-color: rgba(0, 0, 0, 0.08);
    --accent: #007AFF;
    --accent-soft: rgba(0, 122, 255, 0.1);
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 1px 8px rgba(0, 0, 0, 0.05);
    --phone-bg: #f2f2f7;
    --phone-border: #d1d1d6;
    --gradient-start: #ffffff;
    --gradient-end: #f0f0f5;
    --faq-bg: #f5f5f7;
    --footer-bg: #1a1a1a;
    --footer-text: #ccc;
    --scrollbar-thumb: #ccc;
}

[data-theme="dark"] {
    --bg-primary: #141420;
    --bg-secondary: #1C1B2E;
    --bg-card: #1E1D32;
    --bg-card-hover: #272640;
    --bg-navbar: rgba(22, 21, 38, 0.92);
    --navbar-border: rgba(107, 127, 191, 0.15);
    --bg-cta: #1C1B2E;
    --text-primary: rgba(230, 230, 240, 0.95);
    --text-secondary: rgba(190, 190, 210, 0.8);
    --text-muted: rgba(150, 150, 175, 0.6);
    --border-color: rgba(107, 127, 191, 0.1);
    --accent: #7B8FCC;
    --accent-soft: rgba(123, 143, 204, 0.12);
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 1px 8px rgba(0, 0, 0, 0.25);
    --phone-bg: #1C1B2E;
    --phone-border: #2E2D48;
    --gradient-start: #141420;
    --gradient-end: #1A1928;
    --faq-bg: #1C1B2E;
    --footer-bg: #0E0D1A;
    --footer-text: rgba(150, 150, 175, 0.6);
    --scrollbar-thumb: #2E2D48;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

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

/* ========================================
   Navbar
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-navbar);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--navbar-border);
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04);
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.navbar-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.navbar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.navbar-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.navbar-links a {
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.navbar-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: width 0.3s ease;
}

.navbar-links a:hover {
    color: var(--text-primary);
    opacity: 1;
}

.navbar-links a:hover::after {
    width: 100%;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Navbar App Store Badge */
.navbar-app-store {
    display: flex;
    align-items: center;
}

.navbar-app-store img {
    height: 32px;
    transition: transform 0.2s ease;
}

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

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.lang-btn.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-divider {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--accent-soft);
    border-radius: 10px;
    cursor: pointer;
    color: var(--accent);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.05);
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: block; }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   Hero
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 100px 24px 60px;
    background: linear-gradient(180deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    width: 100%;
}

.hero-content {
    flex: 1;
    max-width: 540px;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 460px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    align-items: center;
}

.app-store-badge img {
    height: 48px;
    transition: transform 0.2s ease;
}

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

/* Hero Mockup */
.hero-mockup {
    flex-shrink: 0;
}

.hero-phones {
    display: flex;
    gap: 20px;
    align-items: center;
    animation: heroBreathe 6s ease-in-out infinite;
}

.phone-frame-hero {
    width: 200px;
    background: var(--bg-card);
    border: 3px solid var(--phone-border);
    border-radius: 32px;
    padding: 8px;
    box-shadow: var(--shadow), 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

@keyframes heroBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hero-screenshot {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 24px;
}

/* Light mode: Dark left (order 1), Light right (order 2) */
.hero-phone-dark {
    order: 1;
}

.hero-phone-light {
    order: 2;
}

/* Dark mode: Light left (order 1), Dark right (order 2) */
[data-theme="dark"] .hero-phone-dark {
    order: 2;
}

[data-theme="dark"] .hero-phone-light {
    order: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: fadeInOut 4s ease-in-out;
    animation-fill-mode: forwards;
    pointer-events: none;
}

.scroll-indicator-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.04em;
}

.scroll-indicator-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: -4px;
    color: var(--text-muted);
    animation: bounceDown 2s ease-in-out infinite;
}

.scroll-indicator-arrows svg:last-child {
    margin-top: -10px;
    opacity: 0.5;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    15% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* ========================================
   Sections
   ======================================== */
.section {
    padding: 100px 0;
    position: relative;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.05rem;
    text-align: center;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 56px;
    line-height: 1.6;
}

/* ========================================
   Features (3 Cards)
   ======================================== */
.features {
    background: var(--bg-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 36px 28px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 2.4rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   How It Works
   ======================================== */
.how-it-works {
    background: var(--bg-secondary);
    transition: background-color 0.4s ease;
}

.how-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.how-card {
    text-align: center;
    padding: 20px;
}

.how-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.how-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.how-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   Feature Detail Grid
   ======================================== */
.feature-detail {
    background: var(--bg-primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 28px 22px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.detail-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.detail-icon {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.detail-card h3 {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.detail-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ========================================
   Screenshots
   ======================================== */
.screenshots {
    background: var(--bg-secondary);
    transition: background-color 0.4s ease;
    overflow: hidden;
}

.screenshots-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.screenshot-phone {
    text-align: center;
}

/* Real screenshot phone frames */
.phone-frame-real {
    width: 220px;
    background: var(--bg-card);
    border: 2px solid var(--phone-border);
    border-radius: 32px;
    padding: 8px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.phone-frame-real:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}

.screenshot-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 24px;
    transition: opacity 0.3s ease;
}

.screenshot-label {
    margin-top: 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
}

.screenshots-mode-label {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 32px 0 16px;
    letter-spacing: 0.02em;
}

.screenshots-mode-label:first-of-type {
    margin-top: 0;
}

/* ========================================
   FAQ
   ======================================== */
.faq {
    background: var(--bg-primary);
}

.faq-list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    transition: color 0.2s ease;
    font-family: inherit;
}

.faq-question:hover {
    color: var(--accent);
}

.faq-chevron {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.open .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    padding: 0 24px 18px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
    background: var(--bg-secondary);
    transition: background-color 0.4s ease;
}

.cta-box {
    background: linear-gradient(135deg, var(--accent-soft), transparent);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 64px 48px;
    text-align: center;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.cta-box h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.cta-box p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.cta-box .app-store-badge img {
    height: 52px;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--footer-bg);
    padding: 48px 0;
    transition: background-color 0.4s ease;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.footer-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--footer-text);
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    font-size: 0.88rem;
    color: var(--footer-text);
    transition: color 0.2s ease;
}

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

.footer-copy {
    font-size: 0.8rem;
    color: var(--footer-text);
    opacity: 0.6;
}

/* ========================================
   Scroll Reveal Animations
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Stagger children */
.features-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.features-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.how-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.how-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.detail-grid .reveal:nth-child(2) { transition-delay: 0.05s; }
.detail-grid .reveal:nth-child(3) { transition-delay: 0.1s; }
.detail-grid .reveal:nth-child(4) { transition-delay: 0.15s; }
.detail-grid .reveal:nth-child(5) { transition-delay: 0.2s; }
.detail-grid .reveal:nth-child(6) { transition-delay: 0.25s; }
.detail-grid .reveal:nth-child(7) { transition-delay: 0.3s; }
.detail-grid .reveal:nth-child(8) { transition-delay: 0.35s; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar-links {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-navbar);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px 24px;
        gap: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .navbar-links.open {
        display: flex;
    }

    .navbar-links li {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .navbar-links li:last-child {
        border-bottom: none;
    }

    .navbar-app-store {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-subtitle {
        max-width: 100%;
    }

    .hero-cta {
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .how-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .screenshots-row {
        gap: 20px;
    }

    .phone-frame-real {
        width: 180px;
    }

    .cta-box {
        padding: 40px 24px;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .section {
        padding: 72px 0;
    }
}

@media (max-width: 480px) {
    .navbar-logo-text {
        display: none;
    }

    .hero-phones {
        gap: 12px;
    }

    .phone-frame-hero {
        width: 140px;
    }

    .screenshots-row {
        flex-direction: column;
        align-items: center;
    }

    .phone-frame-real {
        width: 200px;
    }
}
