/* ========================================
   GLOBAL RESET
   ======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========================================
   LANDING PAGE STYLES - EDITORIAL AESTHETIC
   Distinctive typography, warm colors, magazine layout
   ======================================== */

/* System font stacks - no external dependencies */
:root {
    --font-serif: Georgia, 'Times New Roman', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Landing Page Body */
body.landing-page {
    --lp-bg: #FAFAFA;
    --lp-bg-dark: #1E293B;
    --lp-text: #292524;
    --lp-text-muted: #78716C;
    --lp-accent: #475569;
    --lp-accent-dark: #334155;
    --lp-accent-light: #94A3B8;
    --lp-cream: #FFFFFF;
    --lp-charcoal: #44403C;

    font-family: var(--font-sans);
    background: var(--lp-bg);
    color: var(--lp-text);
    min-height: 100vh;
    overflow-x: hidden;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dark mode for landing page */
@media (prefers-color-scheme: dark) {
    body.landing-page {
        --lp-bg: #0F0F0F;
        --lp-bg-dark: #1E293B;
        --lp-text: #F5F5F5;
        --lp-text-muted: #A1A1AA;
        --lp-accent: #94A3B8;
        --lp-accent-dark: #64748B;
        --lp-accent-light: #475569;
        --lp-cream: #1A1A1A;
    }
}

body.landing-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 60px);
}

/* Noise texture overlay */
body.landing-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Navigation / Header */
.lp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    position: relative;
    z-index: 10;
}

.lp-header .back-link {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lp-text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.lp-header .back-link:hover {
    color: var(--lp-accent);
}

/* Hero Section - Editorial asymmetric layout */
.lp-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 60px;
    align-items: center;
    min-height: 40vh;
    padding: 0 0 30px;
    position: relative;
}

.lp-hero-content {
    position: relative;
    z-index: 2;
    min-width: 0;
    /* Ensure flex/grid item doesn't overflow */
}

.lp-hero .eyebrow {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--lp-accent);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.lp-hero .eyebrow::before {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--lp-accent);
}

.lp-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--lp-text);
    margin-bottom: 32px;
}

.lp-cta-section h2 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    color: var(--lp-text);
    margin-bottom: 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.lp-hero h1 em {
    font-style: italic;
    color: var(--lp-accent);
}

.lp-hero .hero-description {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--lp-text-muted);
    max-width: 440px;
    margin-bottom: 48px;
}

.lp-cta {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    background: var(--lp-text);
    color: var(--lp-cream);
    padding: 20px 36px;
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.lp-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--lp-accent);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lp-cta span {
    position: relative;
    z-index: 1;
}

.lp-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.lp-cta:hover::before {
    transform: translateX(0);
}

.lp-cta svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.lp-cta:hover svg {
    transform: translateX(4px);
}

/* Hero Visual - Clean side-by-side layout */
.lp-hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    padding-right: 40px;
}

.lp-phone {
    width: 200px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: transform 0.4s ease;
    transform: scale(1.4);
}

.lp-phone:hover {
    transform: scale(1.4) translateY(-8px);
}

.lp-phone img {
    width: 100%;
    display: block;
}

.lp-phone.featured {
    width: 250px;
    border-radius: 18px;
    box-shadow:
        0 40px 80px -20px rgba(0, 0, 0, 0.3);
    transform: scale(1.4);
}

.lp-phone.featured:hover {
    transform: scale(1.4) translateY(-8px);
}

/* Features Section - Magazine editorial grid */
.lp-features {
    padding: 60px 0;
    position: relative;
}

.lp-section-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
    align-items: end;
}

.lp-section-header h2 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    color: var(--lp-text);
}

.lp-section-header p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--lp-text-muted);
}

.lp-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.lp-feature {
    background: var(--lp-cream);
    padding: 48px 36px;
    transition: all 0.4s ease;
    position: relative;
}

.lp-feature::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 36px;
    right: 36px;
    height: 2px;
    background: var(--lp-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lp-feature:hover {
    background: var(--lp-bg);
}

.lp-feature:hover::after {
    transform: scaleX(1);
}

a.lp-feature {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.lp-feature-number {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 400;
    color: var(--lp-accent-light);
    line-height: 1;
    margin-bottom: 24px;
}

.lp-feature h3 {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--lp-text);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.lp-feature p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--lp-text-muted);
}

/* How It Works - Horizontal editorial scroll */
.lp-process {
    padding: 40px 0;
    background: var(--lp-bg-dark);
    margin: 0 calc(-1 * clamp(20px, 5vw, 60px));
    padding-left: clamp(20px, 5vw, 60px);
    padding-right: clamp(20px, 5vw, 60px);
    position: relative;
    overflow: hidden;
}

.lp-process h2 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    color: #FFFFFF;
    margin-bottom: 60px;
}

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

.lp-step {
    position: relative;
    padding-left: 40px;
}

.lp-step::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--lp-accent);
    border-radius: 50%;
}

.lp-step-number {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #94A3B8;
    margin-bottom: 16px;
}

.lp-step h3 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 12px;
}

.lp-step p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

/* CTA Section */
.lp-cta-section {
    padding: 60px 0;
    text-align: center;
    position: relative;
}

.lp-cta-section h2 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    color: var(--lp-text);
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.lp-cta-section h2 em {
    font-style: italic;
    color: var(--lp-accent);
}

.lp-cta-section .tagline {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--lp-text-muted);
    margin-bottom: 48px;
    letter-spacing: 0.05em;
}

.lp-cta-section .tagline strong {
    color: var(--lp-accent);
    font-weight: 600;
}

/* Footer */
.lp-footer {
    padding: 60px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lp-footer-links a {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--lp-text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.lp-footer-links a:hover {
    color: var(--lp-accent);
}

.lp-footer-contact {
    font-size: 0.85rem;
    color: var(--lp-text-muted);
}

.lp-footer-contact a {
    color: var(--lp-text);
    text-decoration: none;
    border-bottom: 1px solid var(--lp-accent);
    transition: color 0.3s ease;
}

.lp-footer-contact a:hover {
    color: var(--lp-accent);
}

/* Animations */
@keyframes lp-fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

.lp-hero-content {
    animation: lp-fadeUp 1s ease-out 0.2s backwards;
}

.lp-hero-visual {
    animation: lp-fadeUp 1s ease-out 0.4s backwards;
}

.lp-feature {
    animation: lp-fadeUp 0.8s ease-out backwards;
}

.lp-feature:nth-child(1) {
    animation-delay: 0.1s;
}

.lp-feature:nth-child(2) {
    animation-delay: 0.2s;
}

.lp-feature:nth-child(3) {
    animation-delay: 0.3s;
}

.lp-feature:nth-child(4) {
    animation-delay: 0.4s;
}

.lp-feature:nth-child(5) {
    animation-delay: 0.5s;
}

.lp-feature:nth-child(6) {
    animation-delay: 0.6s;
}

/* Ensure larger sizes on desktop screens */
@media (min-width: 1025px) {
    .lp-phone {
        width: 200px !important;
        transform: scale(1.4) !important;
    }

    .lp-phone.featured {
        width: 250px !important;
        transform: scale(1.4) !important;
    }

    .lp-phone:hover {
        transform: scale(1.4) translateY(-8px) !important;
    }

    .lp-phone.featured:hover {
        transform: scale(1.4) translateY(-8px) !important;
    }

    .lp-hero-visual {
        gap: 60px !important;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .lp-hero {
        grid-template-columns: 1fr;
        gap: 60px;
        min-height: auto;
        padding: 60px 0;
    }

    .lp-hero-visual {
        height: auto;
        justify-content: center;
        padding-right: 20px;
        margin-top: 0;
        margin-bottom: 40px;
        order: -1;
        gap: 40px;
        /* Move images to top */
    }

    .lp-phone {
        width: 160px;
        border-radius: 12px;
        transform: scale(1);
    }

    .lp-phone:hover {
        transform: scale(1);
    }

    .lp-phone.featured {
        width: 220px;
        border-radius: 16px;
        transform: scale(1);
    }

    .lp-phone.featured:hover {
        transform: scale(1);
    }

    .lp-section-header {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .lp-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .lp-hero h1 {
        font-size: 2.5rem;
    }

    .lp-hero-visual {
        gap: 30px;
        justify-content: center;
        padding-right: 20px;
    }

    .lp-phone {
        width: 180px;
        transform: scale(1);
    }

    .lp-phone:hover {
        transform: scale(1);
    }

    .lp-phone.featured {
        width: 240px;
        transform: scale(1);
    }

    .lp-phone.featured:hover {
        transform: scale(1);
    }

    .lp-features-grid {
        grid-template-columns: 1fr;
    }

    .lp-steps {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .lp-footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .lp-hero-decor {
        display: none;
    }
}

@media (max-width: 480px) {
    .lp-cta {
        width: 100%;
        justify-content: center;
    }

    .lp-hero {
        padding: 40px 0;
    }

    /* Fix horizontal overflow on mobile phones */
    .lp-phone {
        width: 100px;
        transform: scale(1);
    }

    .lp-phone:hover {
        transform: scale(1);
    }

    .lp-phone.featured {
        width: 140px;
        transform: scale(1);
    }

    .lp-phone.featured:hover {
        transform: scale(1);
    }

    .lp-hero-visual {
        gap: 15px;
        padding-right: 25px;
    }

    .lp-hero h1,
    .lp-cta-section h2,
    .lp-hero .eyebrow {
        white-space: normal;
        font-size: 2.5rem;
        /* Ensure readable size that fits */
        word-wrap: break-word;
    }

    .lp-hero .eyebrow {
        font-size: 0.75rem;
    }

    /* Disable full-bleed negative margins that might cause scroll */
    .lp-process {
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
        width: calc(100% + 40px);
    }
}

/* Specific fix for iPhone 14 Pro and similar sizes (around 393px) */
@media (max-width: 430px) and (min-width: 375px) {
    .lp-hero-visual {
        padding-right: 30px;
        gap: 12px;
    }

    .lp-phone {
        width: 95px;
    }

    .lp-phone:hover {
        transform: scale(1);
    }

    .lp-phone.featured {
        width: 130px;
    }

    .lp-phone.featured:hover {
        transform: scale(1);
    }
}

/* Global overflow enforcement */
html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* ========================================
   MIGRATED LEGACY HELPERS
   Adapted to use new variables
   ======================================== */

/* Legacy Helper - App Icon */
.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: block;
}

/* Legacy Helper - Download Button */
.download-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

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

.download-btn img {
    height: 54px;
    width: auto;
}

/* Legacy Helper - Document Container (Privacy/Terms) */
.document-container {
    background: var(--lp-cream);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    padding: clamp(20px, 4vw, 48px);
    margin-bottom: 40px;
    margin-top: 40px;
}

.document-container h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 3.5vw + 1rem, 3rem);
    margin-bottom: 0.25em;
    letter-spacing: -0.5px;
    color: var(--lp-text);
}

.document-content {
    color: var(--lp-text);
    margin-top: 12px;
}

.document-content h2 {
    font-family: var(--font-serif);
    color: var(--lp-text);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-size: 1.5rem;
}

.document-content h3 {
    font-family: var(--font-sans);
    margin-top: 1.2em;
    margin-bottom: 0.4em;
    color: var(--lp-text);
    font-size: 1.25rem;
    font-weight: 600;
}

.document-content p,
.document-content li {
    color: var(--lp-text-muted);
    line-height: 1.6;
    margin-bottom: 1em;
}

.document-content strong {
    color: var(--lp-text);
    font-weight: 600;
}