/* ========================================
   BibleBuddy Kids Marketing Website
   Design System & Styles
   ======================================== */

/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
    /* Colors */
    --color-cream: #F9F6F2;
    --color-cream-light: #FDFCFA;
    --color-cream-dark: #F0EDE8;
    --color-red: #8B2E2D;
    --color-red-dark: #6B2220;
    --color-red-light: #A64241;
    --color-text-primary: #2C2C2C;
    --color-text-secondary: #5C5C5C;
    --color-text-light: #8C8C8C;
    --color-white: #FFFFFF;

    /* Typography */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --font-size-hero: clamp(2.5rem, 5vw, 4rem);
    --font-size-h1: clamp(2rem, 4vw, 3rem);
    --font-size-h2: clamp(1.75rem, 3.5vw, 2.5rem);
    --font-size-h3: clamp(1.5rem, 3vw, 2rem);
    --font-size-h4: clamp(1.25rem, 2.5vw, 1.75rem);
    --font-size-body: clamp(1rem, 2vw, 1.125rem);
    --font-size-small: clamp(0.875rem, 1.75vw, 1rem);

    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
    --space-4xl: 8rem;

    --section-padding: clamp(3rem, 8vw, 6rem);

    /* Borders & Shadows */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-device: 0 20px 40px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Layout */
    --max-width: 1200px;
    --max-width-narrow: 800px;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-body);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-cream);
}

/* ========================================
   Typography
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h3);
}

h4 {
    font-size: var(--font-size-h4);
}

p {
    margin-bottom: var(--space-md);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-secondary);
}

.hero-title {
    font-size: var(--font-size-hero);
    margin-bottom: var(--space-lg);
}

.subheadline {
    font-family: var(--font-sans);
    font-size: var(--font-size-h4);
    font-weight: 500;
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-family: var(--font-sans);
    font-size: var(--font-size-body);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    min-height: 44px;
    /* Touch target size */
}

.btn-primary {
    background-color: var(--color-red);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--color-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.app-store-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    background-color: var(--color-text-primary);
    color: var(--color-white);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.app-store-btn:hover {
    background-color: #000;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Layout Components
   ======================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

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

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

.section-alt {
    background-color: var(--color-cream-light);
}

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

/* ========================================
   Hero Section
   ======================================== */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-cream-light) 100%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

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

.hero-cta {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

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

.hero-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(var(--shadow-device));
    animation: float 6s ease-in-out infinite;
}

/* ========================================
   Feature Sections
   ======================================== */
.feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.feature-reverse {
    direction: rtl;
}

.feature-reverse>* {
    direction: ltr;
}

.feature-text h2 {
    margin-bottom: var(--space-md);
}

.feature-text h3 {
    font-family: var(--font-sans);
    font-size: var(--font-size-h4);
    font-weight: 600;
    color: var(--color-red);
    margin-bottom: var(--space-sm);
}

.feature-text p {
    font-size: var(--font-size-body);
    line-height: var(--line-height-relaxed);
}

.feature-image {
    display: flex;
    justify-content: center;
}

.feature-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Story Grid Section
   ======================================== */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.story-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.story-icon {
    width: 80px;
    height: 80px;
    background: var(--color-cream-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.story-name {
    font-size: var(--font-size-small);
    font-weight: 600;
    text-align: center;
    color: var(--color-text-primary);
}

/* ========================================
   Dark Mode Showcase
   ======================================== */
.dark-mode-showcase {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: var(--color-white);
}

.dark-mode-showcase h2,
.dark-mode-showcase p {
    color: var(--color-white);
}

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

.dark-mode-images img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ========================================
   CTA Section
   ======================================== */
.cta {
    background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-dark) 100%);
    color: var(--color-white);
    text-align: center;
}

.cta h2,
.cta p {
    color: var(--color-white);
}

.cta-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-xl);
}

.cta .btn-primary {
    background-color: var(--color-white);
    color: var(--color-red);
}

.cta .btn-primary:hover {
    background-color: var(--color-cream);
    color: var(--color-red-dark);
}

/* ========================================
   Footer
   ======================================== */
footer {
    background-color: var(--color-text-primary);
    color: var(--color-white);
    padding: var(--space-xl) 0 var(--space-lg);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

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

.footer-links a {
    color: var(--color-white);
    text-decoration: none;
    font-size: var(--font-size-small);
    transition: color var(--transition-fast);
}

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

.copyright {
    font-size: var(--font-size-small);
    color: var(--color-text-light);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Animation classes triggered by JavaScript */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

/* Initially hidden elements for animation */
.animate-on-scroll {
    opacity: 0;
}

.animate-on-scroll.animated {
    opacity: 1;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 968px) {

    .hero-content,
    .feature {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .feature-reverse {
        direction: ltr;
    }

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

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

    .story-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

@media (max-width: 640px) {
    :root {
        --section-padding: clamp(2rem, 6vw, 3rem);
    }

    .hero {
        min-height: auto;
        padding-top: var(--space-3xl);
        padding-bottom: var(--space-3xl);
    }

    .hero-cta,
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn,
    .app-store-btn {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .dark-mode-images {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Accessibility & Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--color-red);
    outline-offset: 2px;
}

/* ========================================
   Utility Classes
   ======================================== */
.mt-xs {
    margin-top: var(--space-xs);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mb-xs {
    margin-bottom: var(--space-xs);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}