@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

/* ============================================
   Context Bank — Marketing Website
   ============================================
   1. Custom Properties
   2. Reset / Base
   3. Typography
   4. Layout
   5. Phone Frame Component
   6. App Store Badge
   7. Hero
   8. Problem
   9. How It Works
   10. Benefits
   11. Screenshots
   12. CTA
   13. Footer
   14. Privacy Page
   15. Animations
   16. Media Queries
   ============================================ */

/* ----- 1. Custom Properties ----- */

:root {
    --color-bg: #000000;
    --color-bg-elevated: #0a0a0a;
    --color-bg-card: #1C1C1E;
    --color-text: #F5F5F7;
    --color-text-muted: rgba(245, 245, 247, 0.6);
    --color-text-faint: rgba(245, 245, 247, 0.3);
    --color-border: rgba(255, 255, 255, 0.06);

    /* App accent colors — from ColorPalette.swift */
    --color-coral: #EF4D55;
    --color-gold: #FF8E3D;
    --color-green: #4ED45A;
    --color-blue: #5B52FF;
    --color-purple: #F070D0;
    --color-stone: #7D706A;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                 'SF Pro Text', system-ui, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier Prime', 'Courier New', Courier, monospace;

    /* Spacing */
    --section-padding: clamp(60px, 10vw, 120px);
    --container-max: 1080px;
    --container-padding: clamp(20px, 5vw, 40px);

    /* Phone mockup */
    --phone-width: 260px;
    --phone-height: 563px;
    --phone-radius: 40px;
    --phone-bezel: 8px;
}

/* ----- 2. Reset / Base ----- */

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

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

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

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

a {
    color: var(--color-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ----- 3. Typography ----- */

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    font-weight: 400;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.hero-headline {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.hero-subheadline {
    font-size: clamp(1.0625rem, 2vw, 1.375rem);
    font-weight: 400;
    color: var(--color-text-muted);
    line-height: 1.5;
    max-width: 480px;
    margin-top: 20px;
}

.section-heading {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    text-align: left;
    margin-bottom: clamp(32px, 5vw, 56px);
}

/* Mono accent — used for labels, captions, small mechanical text */
.mono {
    font-family: var(--font-mono);
}

/* ----- 4. Layout ----- */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

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

section {
    padding: var(--section-padding) 0;
}

/* ----- 5. Phone Frame Component ----- */

.phone-frame {
    width: var(--phone-width);
    height: var(--phone-height);
    border-radius: var(--phone-radius);
    padding: var(--phone-bezel);
    background: #1a1a1a;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 3px #000;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.phone-frame::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 25px;
    background: #000;
    border-radius: 20px;
    z-index: 10;
}

.phone-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--phone-radius) - var(--phone-bezel));
}

/* ----- 6. App Store Badge ----- */

.app-store-badge {
    display: inline-block;
    margin-top: 28px;
    transition: opacity 0.2s ease;
}

.app-store-badge:hover {
    opacity: 0.8;
    text-decoration: none;
}

.app-store-badge svg {
    height: 52px;
    width: auto;
}

.coming-soon-badge {
    display: inline-block;
    margin-top: 28px;
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-text-secondary);
    padding: 12px 24px;
}

.waitlist-label {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 28px;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.waitlist-form {
    display: flex;
    max-width: 420px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
}

.waitlist-form input[type="email"] {
    flex: 1;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: var(--color-text);
    outline: none;
    min-width: 0;
}

.waitlist-form input[type="email"]::placeholder {
    color: var(--color-text-faint);
}

.waitlist-form button {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 14px 20px;
    border: none;
    background: var(--color-blue);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

.waitlist-form button:hover {
    opacity: 0.85;
}

/* ----- 7. Hero ----- */

.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding: 80px var(--container-padding) 80px;
    max-width: var(--container-max);
    margin: 0 auto;
    gap: 48px;
    position: relative;
}

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

.hero-subheadline {
    margin-left: 0;
    margin-right: 0;
}

.phone-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(
        ellipse at center,
        rgba(91, 82, 255, 0.15) 0%,
        rgba(240, 112, 208, 0.08) 40%,
        transparent 70%
    );
    border-radius: 50%;
    filter: blur(40px);
    z-index: -1;
    animation: glow-pulse 4s ease-in-out infinite alternate;
}

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

@keyframes glow-pulse {
    0% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* Hero entrance animation */
.hero-animate {
    animation: hero-enter 1s ease-out both;
}

.hero-device {
    position: relative;
    animation: hero-enter 1s ease-out 0.2s both, float 6s ease-in-out 1.2s infinite;
}

@keyframes hero-enter {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-text-faint);
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.4; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 0.8; }
}

/* ----- 8. Problem ----- */

.problem {
    background-color: var(--color-bg-elevated);
}

.problem-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.problem-card {
    background: var(--color-bg-card);
    border-radius: 16px;
    padding: 24px 20px;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.problem-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
}

.problem-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 10px;
}

.problem-card p {
    font-size: 1.0625rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ----- 9. How It Works ----- */

.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: left;
    max-width: 900px;
    margin: 0;
}

.step-number {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.step:hover .step-number {
    transform: scale(1.15);
}

.step:nth-child(1) .step-number { color: var(--color-coral); }
.step:nth-child(2) .step-number { color: var(--color-gold); }
.step:nth-child(3) .step-number { color: var(--color-blue); }

.step h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.step p {
    font-size: 1rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    max-width: 320px;
    margin: 0;
}

/* ----- 10. Benefits ----- */

.benefits {
    background-color: var(--color-bg-elevated);
}

.benefits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.benefit {
    padding: 28px 24px;
    background: var(--color-bg-card);
    border-radius: 20px;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.benefit:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
}

.benefit-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.benefit-icon svg {
    width: 22px;
    height: 22px;
}

.benefit h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.benefit p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.55;
}

/* ----- 11. Screenshots ----- */

.screenshot-pair {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

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

.screenshot-caption {
    font-family: var(--font-mono);
    margin-top: 16px;
    font-size: 0.8125rem;
    color: var(--color-text-faint);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.screenshot-pair .phone-frame--dark {
    transform: rotate(-2deg);
}

.screenshot-pair .phone-frame--light {
    transform: rotate(2deg);
}

/* ----- 12. CTA ----- */

.cta {
    text-align: left;
    padding-bottom: clamp(60px, 10vw, 100px);
    position: relative;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: var(--container-padding);
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, var(--color-blue), transparent);
    opacity: 0.4;
}

.cta-headline {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.cta-subheadline {
    font-size: clamp(1.0625rem, 2vw, 1.375rem);
    color: var(--color-text-muted);
    margin-top: 16px;
}

.cta .app-store-badge {
    margin-top: 32px;
}

.cta .coming-soon-badge {
    margin-top: 32px;
}

.cta .waitlist-form {
    margin-top: 28px;
}

/* ----- 13. Footer ----- */

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 32px 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
}

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

.footer-colophon {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-faint);
    line-height: 1.6;
}

.footer-links a {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

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

.footer-legal {
    font-size: 0.75rem;
    color: var(--color-text-faint);
}

/* ----- 14. Privacy Page ----- */

.privacy-page {
    background-color: var(--color-bg);
}

.privacy-header {
    padding: clamp(40px, 8vw, 80px) 0 clamp(24px, 4vw, 40px);
}

.privacy-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 24px;
}

.effective-date {
    font-size: 0.875rem;
    color: var(--color-text-faint);
    margin-top: 8px;
}

.back-link {
    font-size: 0.9375rem;
    color: var(--color-blue);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.privacy-content {
    padding-bottom: var(--section-padding);
}

.privacy-content section {
    padding: 0;
    margin-bottom: 32px;
}

.privacy-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.privacy-content p {
    font-size: 1rem;
    color: var(--color-text-muted);
    line-height: 1.65;
}

.privacy-content a {
    color: var(--color-blue);
}

/* ----- 15. Animations ----- */

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

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

/* Stagger children */
.problem-grid .fade-in:nth-child(2) { transition-delay: 0.1s; }
.problem-grid .fade-in:nth-child(3) { transition-delay: 0.2s; }
.problem-grid .fade-in:nth-child(4) { transition-delay: 0.3s; }

.steps .fade-in:nth-child(2) { transition-delay: 0.15s; }
.steps .fade-in:nth-child(3) { transition-delay: 0.3s; }

.benefits-grid .fade-in:nth-child(2) { transition-delay: 0.1s; }
.benefits-grid .fade-in:nth-child(3) { transition-delay: 0.2s; }
.benefits-grid .fade-in:nth-child(4) { transition-delay: 0.3s; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-animate {
        animation: none;
        opacity: 1;
    }

    .hero-device {
        animation: none;
        opacity: 1;
    }

    .phone-glow {
        animation: none;
    }

    .scroll-indicator {
        animation: none;
        opacity: 0.5;
    }

    .screenshot-pair .phone-frame--dark,
    .screenshot-pair .phone-frame--light {
        transform: none;
    }

    .problem-card:hover,
    .benefit:hover {
        transform: none;
    }

    .step:hover .step-number {
        transform: none;
    }

    [data-parallax] {
        transform: none !important;
    }
}

/* ----- 16. Media Queries ----- */

/* Tablet (768px+) */
@media (min-width: 768px) {
    .hero {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: clamp(40px, 6vw, 80px);
        padding: 0 var(--container-padding);
    }

    .hero-content {
        flex: 1;
    }

    .hero-subheadline {
        margin-left: 0;
        margin-right: 0;
    }

    .hero-device {
        flex: 0 0 auto;
    }

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

    .steps {
        grid-template-columns: repeat(3, 1fr);
        gap: clamp(24px, 4vw, 48px);
    }

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

    .screenshot-pair {
        flex-direction: row;
        gap: 48px;
    }

    .footer-content {
        flex-direction: row;
        justify-content: flex-start;
        gap: 24px;
        align-items: baseline;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    :root {
        --phone-width: 300px;
        --phone-height: 650px;
        --phone-radius: 44px;
    }
}
