/* ===========================
   ReadFocus Landing Page
   =========================== */

/* --- Custom Properties --- */
:root {
    --bg-primary: #08080d;
    --bg-secondary: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-border: rgba(255, 255, 255, 0.06);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);
    --accent: #8b5cf6;
    --accent-start: #6366f1;
    --accent-end: #a855f7;
    --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3 {
    font-family: var(--font-serif);
    color: var(--text-primary);
    line-height: 1.2;
    font-weight: 600;
}

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

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 8, 13, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bg-card-border);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
}

.navbar-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.navbar-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid var(--bg-card-border);
    transition: color 0.2s, border-color 0.2s;
}

.navbar-link:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- Hero --- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 100px 0 80px;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
}

.hero-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 100px;
    background: rgba(139, 92, 246, 0.08);
}

.hero h1 {
    font-size: 56px;
    letter-spacing: -0.02em;
}

.hero-sub {
    font-size: 19px;
    color: var(--text-secondary);
    max-width: 440px;
}

.hero-phone {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-glow {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* --- App Store Button --- */
.app-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
    background: var(--text-primary);
    color: #000;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 17px;
    transition: opacity 0.2s, transform 0.2s;
}

.app-store-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.app-store-btn svg {
    flex-shrink: 0;
}

.app-store-btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.app-store-btn-text small {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* --- Phone Mockup --- */
.phone-mockup {
    position: relative;
    width: 280px;
    aspect-ratio: 9 / 19.5;
    border-radius: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    background: #000;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 25px 60px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.phone-mockup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 37px;
}

.phone-mockup--hero {
    width: 300px;
    animation: hero-float 5s ease-in-out infinite;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 0 120px rgba(139, 92, 246, 0.1);
}

@keyframes hero-float {
    0%, 100% { transform: rotate(-3deg) translateY(0); }
    50%      { transform: rotate(-1deg) translateY(-12px); }
}

.phone-mockup--small {
    width: 220px;
}

/* --- Screenshots --- */
.screenshots {
    padding: 60px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-card-border);
    border-bottom: 1px solid var(--bg-card-border);
}

.screenshots-track {
    display: flex;
    gap: 28px;
    justify-content: center;
    padding: 0 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.screenshots-track::-webkit-scrollbar {
    display: none;
}

.screenshots-track .phone-mockup {
    scroll-snap-align: center;
}

/* --- Features --- */
.features {
    padding: 120px 0;
}

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

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 16px;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.feature-card h2 {
    font-size: 22px;
}

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

/* --- CTA --- */
.cta {
    position: relative;
    overflow: hidden;
    padding: 120px 0;
    border-top: 1px solid var(--bg-card-border);
}

.cta-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.cta-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
}

.cta h2 {
    font-size: 40px;
    letter-spacing: -0.02em;
}

.cta-sub {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.cta-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--bg-card-border);
    padding: 32px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
}

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

.footer-links a {
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-secondary);
}

/* --- Legal Pages --- */
.legal-page {
    padding: 80px 0 60px;
}

.legal-container {
    max-width: 720px;
}

.legal-page h1 {
    font-size: 40px;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.legal-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.legal-section {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 16px;
}

.legal-section h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

.legal-section p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.legal-section p + p {
    margin-top: 12px;
}

.legal-section a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.legal-section a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.legal-section ul {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

.legal-section ul li {
    padding: 6px 0;
}

.legal-section ul li::before {
    content: "→ ";
    color: var(--accent);
    margin-right: 4px;
}

/* --- Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger animation for screenshot strip */
.screenshots-track .fade-in:nth-child(1) { transition-delay: 0s; }
.screenshots-track .fade-in:nth-child(2) { transition-delay: 0.08s; }
.screenshots-track .fade-in:nth-child(3) { transition-delay: 0.16s; }
.screenshots-track .fade-in:nth-child(4) { transition-delay: 0.24s; }
.screenshots-track .fade-in:nth-child(5) { transition-delay: 0.32s; }

/* --- Responsive: Tablet --- */
@media (max-width: 1023px) {
    .hero {
        padding: 80px 0 60px;
    }

    .hero-inner {
        gap: 40px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero-sub {
        font-size: 17px;
    }

    .phone-mockup--hero {
        width: 260px;
    }

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

    .features-grid .feature-card:last-child {
        grid-column: 1 / -1;
        max-width: 50%;
        justify-self: center;
    }

    .phone-mockup--small {
        width: 190px;
    }
}

/* --- Responsive: Mobile --- */
@media (max-width: 767px) {
    body {
        font-size: 16px;
    }

    .hero {
        padding: 60px 0 40px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 48px;
    }

    .hero-text {
        align-items: center;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero-sub {
        font-size: 16px;
    }

    .hero-phone {
        order: -1;
    }

    .phone-mockup--hero {
        width: 240px;
        animation: hero-float-mobile 5s ease-in-out infinite;
    }

    @keyframes hero-float-mobile {
        0%, 100% { transform: translateY(0); }
        50%      { transform: translateY(-8px); }
    }

    .hero-glow {
        top: -10%;
        right: -30%;
        width: 400px;
        height: 400px;
    }

    .screenshots {
        padding: 40px 0;
    }

    .screenshots-track {
        justify-content: flex-start;
        padding: 0 24px;
        gap: 20px;
    }

    .phone-mockup--small {
        width: 180px;
    }

    .features {
        padding: 80px 0;
    }

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

    .features-grid .feature-card:last-child {
        max-width: 100%;
    }

    .feature-card {
        padding: 28px 24px;
    }

    .cta {
        padding: 80px 0;
    }

    .cta h2 {
        font-size: 28px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .legal-page {
        padding: 48px 0 40px;
    }

    .legal-page h1 {
        font-size: 28px;
    }

    .legal-section {
        padding: 20px 20px;
    }

    .legal-section h2 {
        font-size: 18px;
    }
}
