/* ============================================
   THE FEDERALIST PAPERS - Landing Page
   Colonial American Aesthetic Design System
   ============================================ */

:root {
    /* Core Colors from App Theme */
    --colonial-blue: #3d5ba3;
    --colonial-blue-dark: #2a4178;
    --parchment: #F5F0E0;
    --parchment-dark: #E8E0CC;
    --burgundy: #8B3A42;
    --burgundy-light: rgba(139, 58, 66, 0.1);
    --ink-brown: #2C241B;
    --secondary-text: #66593F;
    --separator: #C7B9AB;

    /* Extended Palette */
    --shadow-color: rgba(44, 36, 27, 0.12);
    --deep-shadow: rgba(44, 36, 27, 0.25);

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'EB Garamond', Georgia, serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-xxl: 6rem;
}

/* ============================================
   Base Styles
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    color: var(--ink-brown);
    background-color: var(--parchment);
    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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Parchment texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(139, 58, 66, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(61, 91, 163, 0.03) 0%, transparent 50%);
    z-index: 0;
}

/* ============================================
   Header
   ============================================ */

.main-header {
    background: linear-gradient(180deg, var(--colonial-blue) 0%, var(--colonial-blue-dark) 100%);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    position: relative;
    box-shadow: 0 4px 20px var(--deep-shadow);
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--burgundy);
}

.header-title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 600;
    color: white;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.header-flourish {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    position: relative;
}

.header-flourish::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--burgundy);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.header-flourish.left::before {
    right: -12px;
}

.header-flourish.right::before {
    left: -12px;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xxl) var(--space-lg);
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

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

.hero-badge {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    font-style: italic;
    color: var(--burgundy);
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--burgundy);
    background: var(--burgundy-light);
}

.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 600;
    line-height: 1.15;
    color: var(--ink-brown);
    margin-bottom: var(--space-md);
    position: relative;
}

.hero-headline::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: var(--burgundy);
    margin-top: var(--space-md);
}

.hero-subhead {
    font-size: 1.25rem;
    color: var(--secondary-text);
    margin-bottom: var(--space-lg);
    max-width: 480px;
}

/* CTA Button */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.cta-button.primary {
    background: var(--ink-brown);
    color: var(--parchment);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.cta-button.primary:hover {
    background: var(--colonial-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--deep-shadow);
}

.cta-button.large {
    font-size: 1.125rem;
    padding: 1.25rem 2.5rem;
}

.apple-icon {
    width: 20px;
    height: 20px;
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.app-preview {
    position: relative;
    z-index: 2;
}

.phone-frame {
    width: 280px;
    background: #1a1a1a;
    border-radius: 40px;
    padding: 12px;
    box-shadow:
        0 25px 60px var(--deep-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
    transition: transform 0.4s ease;
}

.phone-frame:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.phone-screen {
    background: var(--parchment);
    border-radius: 28px;
    overflow: hidden;
    aspect-ratio: 9/16;
}

.screen-header {
    background: linear-gradient(180deg, var(--colonial-blue) 0%, var(--colonial-blue-dark) 100%);
    padding: 2rem 1rem 1rem;
    text-align: center;
    color: white;
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    font-weight: 600;
}

.screen-content {
    padding: 1rem;
}

.paper-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--separator);
}

.paper-item:last-child {
    border-bottom: none;
}

.paper-num {
    font-family: var(--font-display);
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--burgundy);
    background: var(--burgundy-light);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    white-space: nowrap;
}

.paper-title {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--ink-brown);
    line-height: 1.4;
}

/* Decorative Elements */
.quill-decoration {
    position: absolute;
    top: -40px;
    right: 20px;
    width: 120px;
    height: 120px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M80 15c-5 8-15 20-35 45-15 18-25 30-30 35l5 5c10-5 25-15 45-35 15-15 20-30 18-45-1-5-2-8-3-5z' fill='%233d5ba3' opacity='0.15'/%3E%3C/svg%3E") no-repeat center;
    opacity: 0.6;
    z-index: 1;
}

.ink-splatter {
    position: absolute;
    bottom: 20px;
    left: 40px;
    width: 80px;
    height: 80px;
    background: radial-gradient(ellipse at center, var(--ink-brown) 0%, transparent 70%);
    opacity: 0.05;
    border-radius: 50%;
    transform: scale(1.5, 1);
}

/* ============================================
   Section Divider
   ============================================ */

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
}

.divider-line {
    width: 100px;
    height: 1px;
    background: var(--separator);
}

.divider-ornament {
    font-size: 1.5rem;
    color: var(--burgundy);
    opacity: 0.6;
}

/* ============================================
   Features Section
   ============================================ */

.features {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    position: relative;
    z-index: 1;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    color: var(--ink-brown);
    margin-bottom: var(--space-xs);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--secondary-text);
    font-style: italic;
    margin-bottom: var(--space-xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.feature-card {
    background: white;
    padding: var(--space-lg);
    border: 1px solid var(--separator);
    position: relative;
    transition: all 0.3s ease;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--colonial-blue);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-color);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    color: var(--colonial-blue);
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-title {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--ink-brown);
    margin-bottom: var(--space-sm);
}

.feature-desc {
    font-size: 1rem;
    color: var(--secondary-text);
    line-height: 1.6;
}

/* ============================================
   Quote Section
   ============================================ */

.quote-section {
    background: linear-gradient(180deg, var(--colonial-blue) 0%, var(--colonial-blue-dark) 100%);
    padding: var(--space-xxl) var(--space-lg);
    position: relative;
    overflow: hidden;
}

.quote-section::before,
.quote-section::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.quote-section::before {
    top: -100px;
    left: -100px;
}

.quote-section::after {
    bottom: -150px;
    right: -100px;
}

.quote-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.quote-mark {
    font-family: var(--font-display);
    font-size: 6rem;
    color: rgba(255, 255, 255, 0.15);
    line-height: 0.5;
    margin-bottom: var(--space-md);
}

.main-quote {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 400;
    font-style: italic;
    color: white;
    line-height: 1.4;
    margin-bottom: var(--space-lg);
}

.quote-attribution {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.author-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.05em;
}

.paper-ref {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: normal;
}

/* ============================================
   Authors Section
   ============================================ */

.authors {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-xxl) var(--space-lg);
    text-align: center;
    position: relative;
    z-index: 1;
}

.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.author-card {
    padding: var(--space-lg);
}

.author-initial {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    background: var(--parchment-dark);
    border: 2px solid var(--burgundy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--burgundy);
    transition: all 0.3s ease;
}

.author-card:hover .author-initial {
    background: var(--burgundy);
    color: white;
    transform: scale(1.1);
}

.author-card .author-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink-brown);
    margin-bottom: 0.25rem;
}

.author-papers {
    font-size: 0.875rem;
    color: var(--secondary-text);
}

.authors-note {
    font-style: italic;
    color: var(--secondary-text);
    margin-top: var(--space-md);
}

.authors-note em {
    color: var(--burgundy);
    font-weight: 500;
}

/* ============================================
   Final CTA Section
   ============================================ */

.final-cta {
    background: var(--parchment-dark);
    padding: var(--space-xxl) var(--space-lg);
    text-align: center;
    position: relative;
    z-index: 1;
}

.final-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--burgundy);
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-headline {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--ink-brown);
    margin-bottom: var(--space-sm);
}

.cta-text {
    font-size: 1.25rem;
    color: var(--secondary-text);
    font-style: italic;
    margin-bottom: var(--space-lg);
}

/* ============================================
   Footer
   ============================================ */

.main-footer {
    background: var(--ink-brown);
    color: var(--parchment);
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
    position: relative;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.footer-links {
    display: flex;
    gap: var(--space-md);
}

.footer-link {
    color: var(--separator);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--parchment);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--separator);
    opacity: 0.7;
}

.footer-flourish {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--burgundy);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-xl);
    }

    .hero-content {
        order: 1;
    }

    .hero-visual {
        order: 2;
    }

    .hero-headline::after {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-subhead {
        margin-left: auto;
        margin-right: auto;
    }

    .phone-frame {
        width: 240px;
        transform: none;
    }

    .phone-frame:hover {
        transform: none;
    }

    .quill-decoration,
    .ink-splatter {
        display: none;
    }
}

@media (max-width: 600px) {
    :root {
        --space-lg: 1.5rem;
        --space-xl: 2.5rem;
        --space-xxl: 4rem;
    }

    .header-flourish {
        width: 30px;
    }

    .hero-badge {
        font-size: 0.75rem;
    }

    .cta-button {
        width: 100%;
        justify-content: center;
    }

    .features-grid {
        gap: var(--space-md);
    }

    .feature-card {
        padding: var(--space-md);
    }

    .authors-grid {
        gap: var(--space-md);
    }

    .author-card {
        padding: var(--space-md);
    }
}

/* ============================================
   Scroll Animations
   ============================================ */

.feature-card,
.author-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-card.visible,
.author-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays */
.features-grid .feature-card:nth-child(1) { transition-delay: 0s; }
.features-grid .feature-card:nth-child(2) { transition-delay: 0.1s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.2s; }

.authors-grid .author-card:nth-child(1) { transition-delay: 0s; }
.authors-grid .author-card:nth-child(2) { transition-delay: 0.1s; }
.authors-grid .author-card:nth-child(3) { transition-delay: 0.2s; }
