/* ============================================
   Addie and The Magic Jar - Website Styles
   A whimsical children's book experience
   ============================================ */

/* CSS Custom Properties */
:root {
    /* Colors from the book */
    --sky-light: #87CEEB;
    --sky-mid: #5BA3C6;
    --sky-deep: #2E6B8A;
    --sky-night: #1E4A6B;

    --coral: #E86B6B;
    --coral-dark: #D35A5A;
    --pink-soft: #F4A5A5;

    --green-light: #98D89E;
    --green-mid: #6BBF73;
    --green-dark: #4A9B52;
    --green-deep: #2D7234;

    --gold: #F5D56E;
    --gold-dark: #D4A84B;

    --cream: #FFF9E6;
    --cream-dark: #F5EDD6;

    --text-dark: #2D3748;
    --text-light: #FFFFFF;

    /* Typography */
    --font-display: 'Fredoka', sans-serif;
    --font-body: 'Nunito', sans-serif;

    /* Spacing */
    --section-padding: 100px;
    --container-max: 1200px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-med: 0.4s ease;
    --transition-slow: 0.8s ease;
}

/* Reset & Base */
*, *::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.6;
    color: var(--text-dark);
    background: var(--cream);
    overflow-x: hidden;
}

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

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

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.2;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--sky-deep);
    margin-bottom: 24px;
}

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

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

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-dark);
    opacity: 0.8;
    margin-bottom: 48px;
}

/* ============================================
   Sparkles Animation
   ============================================ */
.sparkles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkle-float 3s ease-in-out infinite;
    opacity: 0;
}

@keyframes sparkle-float {
    0%, 100% {
        opacity: 0;
        transform: scale(0) translateY(0);
    }
    50% {
        opacity: 1;
        transform: scale(1) translateY(-20px);
    }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.parallax-layer.sky {
    background: linear-gradient(180deg,
        var(--sky-night) 0%,
        var(--sky-deep) 30%,
        var(--sky-mid) 60%,
        var(--sky-light) 100%);
}

.parallax-layer.stars {
    background-image:
        radial-gradient(2px 2px at 20% 15%, white, transparent),
        radial-gradient(2px 2px at 40% 25%, white, transparent),
        radial-gradient(1px 1px at 60% 10%, white, transparent),
        radial-gradient(2px 2px at 80% 20%, white, transparent),
        radial-gradient(1px 1px at 10% 30%, white, transparent),
        radial-gradient(2px 2px at 70% 35%, white, transparent),
        radial-gradient(1px 1px at 30% 8%, white, transparent),
        radial-gradient(1px 1px at 50% 18%, white, transparent),
        radial-gradient(2px 2px at 90% 12%, white, transparent),
        radial-gradient(1px 1px at 15% 22%, white, transparent);
    animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.parallax-layer.clouds {
    pointer-events: none;
}

.cloud {
    position: absolute;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.cloud svg {
    width: 100%;
    height: auto;
}

.cloud-1 {
    width: 200px;
    top: 10%;
    left: 5%;
    animation: cloud-drift 30s linear infinite;
}

.cloud-2 {
    width: 180px;
    top: 20%;
    right: 10%;
    animation: cloud-drift 40s linear infinite reverse;
}

.cloud-3 {
    width: 120px;
    top: 35%;
    left: 60%;
    animation: cloud-drift 35s linear infinite;
}

@keyframes cloud-drift {
    0% { transform: translateX(-10%); }
    100% { transform: translateX(10%); }
}

.parallax-layer.hills-back {
    background: var(--green-dark);
    clip-path: polygon(0 70%, 15% 55%, 35% 65%, 55% 50%, 75% 60%, 100% 55%, 100% 100%, 0 100%);
    opacity: 0.7;
}

.parallax-layer.hills-mid {
    background: var(--green-mid);
    clip-path: polygon(0 80%, 20% 70%, 40% 78%, 60% 68%, 80% 75%, 100% 70%, 100% 100%, 0 100%);
    opacity: 0.85;
}

.parallax-layer.hills-front {
    background: linear-gradient(180deg, var(--green-light) 0%, var(--green-mid) 100%);
    clip-path: polygon(0 88%, 25% 82%, 50% 88%, 75% 80%, 100% 85%, 100% 100%, 0 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    max-width: var(--container-max);
    padding: 120px 24px 60px;
    width: 100%;
}

.hero-text {
    flex: 1;
    max-width: 550px;
}

.hero-title {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

.title-addie {
    font-size: clamp(3rem, 8vw, 5rem);
    color: var(--coral);
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
    letter-spacing: -2px;
}

.title-and {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--cream);
    margin: -8px 0;
    font-weight: 500;
}

.title-magic-jar {
    font-size: clamp(2.5rem, 7vw, 4rem);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.1));
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--cream);
    margin-bottom: 32px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.5;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: 50px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-icon {
    margin-right: 8px;
    display: inline;
}

.btn-sub {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 4px;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-mid) 0%, var(--green-dark) 100%);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(74, 155, 82, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(74, 155, 82, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(232, 107, 107, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(232, 107, 107, 0.5);
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.2rem;
}

/* Book Display */
.hero-book {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 400px;
}

.book-wrapper {
    position: relative;
    animation: book-float 4s ease-in-out infinite;
}

@keyframes book-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

.book-cover {
    border-radius: 8px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 4px var(--cream),
        0 0 0 8px rgba(255, 255, 255, 0.3);
    max-width: 350px;
}

.book-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(ellipse at center, rgba(245, 213, 110, 0.3) 0%, transparent 70%);
    z-index: -1;
    animation: glow-pulse 3s ease-in-out infinite;
}

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

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--cream);
    font-size: 0.9rem;
    animation: bounce 2s ease-in-out infinite;
    z-index: 10;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 3px solid var(--cream);
    border-bottom: 3px solid var(--cream);
    transform: rotate(45deg);
    margin-top: 8px;
}

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

/* ============================================
   Section Decorations
   ============================================ */
.section-decoration {
    position: relative;
    height: 80px;
    margin-top: -80px;
    z-index: 5;
}

.section-decoration svg {
    width: 100%;
    height: 100%;
}

.section-decoration.decoration-top {
    color: var(--cream);
}

.section-decoration.cream {
    color: var(--sky-deep);
}

/* ============================================
   Story Section
   ============================================ */
.story-section {
    background: var(--cream);
    padding: var(--section-padding) 0;
    position: relative;
}

.story-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.story-jar {
    flex: 0 0 200px;
}

.magic-jar {
    animation: jar-wobble 3s ease-in-out infinite;
}

.jar-svg {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

.jar-sparkle {
    animation: jar-sparkle-float 2s ease-in-out infinite;
}

.jar-sparkle.s1 { animation-delay: 0s; }
.jar-sparkle.s2 { animation-delay: 0.4s; }
.jar-sparkle.s3 { animation-delay: 0.8s; }
.jar-sparkle.s4 { animation-delay: 1.2s; }
.jar-sparkle.s5 { animation-delay: 1.6s; }

@keyframes jar-sparkle-float {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-10px); opacity: 0.6; }
}

@keyframes jar-wobble {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

.story-text {
    flex: 1;
}

.story-lead {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--sky-deep);
    margin-bottom: 16px;
}

.story-text p {
    margin-bottom: 16px;
}

.story-text em {
    color: var(--coral);
    font-style: italic;
}

.story-text strong {
    color: var(--sky-deep);
}

.story-features {
    display: flex;
    gap: 24px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    font-weight: 500;
}

.feature-icon {
    font-size: 1.3rem;
}

/* ============================================
   Peek Inside Section
   ============================================ */
.peek-section {
    background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
    padding: var(--section-padding) 0;
    position: relative;
    overflow: hidden;
}

.book-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform var(--transition-med);
}

.gallery-item:hover {
    transform: scale(1.02) rotate(1deg);
}

.gallery-item img {
    width: 100%;
    height: auto;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-flower, .floating-butterfly {
    position: absolute;
    font-size: 2rem;
    animation: float-around 10s ease-in-out infinite;
}

.floating-flower.f1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-flower.f2 {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.floating-butterfly {
    top: 40%;
    left: 50%;
    animation: butterfly-flutter 8s ease-in-out infinite;
}

@keyframes float-around {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -15px) rotate(5deg); }
    50% { transform: translate(-5px, -25px) rotate(-3deg); }
    75% { transform: translate(15px, -10px) rotate(8deg); }
}

@keyframes butterfly-flutter {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -20px) rotate(10deg); }
    50% { transform: translate(-20px, -40px) rotate(-5deg); }
    75% { transform: translate(40px, -15px) rotate(15deg); }
}

/* ============================================
   Testimonials Section
   ============================================ */
.testimonials-section {
    background: linear-gradient(135deg, var(--sky-deep) 0%, var(--sky-night) 100%);
    padding: var(--section-padding) 0;
    position: relative;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.testimonial-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform var(--transition-med);
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

.testimonial-quote {
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--coral);
    line-height: 1;
    margin-bottom: -20px;
    opacity: 0.5;
}

.testimonial-text {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--green-light);
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sky-mid) 0%, var(--sky-deep) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--sky-deep);
}

.author-title {
    font-size: 0.9rem;
    color: var(--text-dark);
    opacity: 0.7;
}

/* ============================================
   Author Section
   ============================================ */
.author-section {
    background: var(--cream);
    padding: var(--section-padding) 0;
}

.author-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.author-photo-wrapper {
    flex: 0 0 350px;
    position: relative;
}

.author-main-photo {
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.photo-frame {
    position: absolute;
    top: 15px;
    left: 15px;
    right: -15px;
    bottom: -15px;
    border: 4px solid var(--coral);
    border-radius: 20px;
    z-index: -1;
}

.author-text {
    flex: 1;
}

.letter {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    position: relative;
}

.letter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--gold), var(--green-light), var(--sky-mid));
    border-radius: 12px 12px 0 0;
}

.letter p {
    margin-bottom: 16px;
}

.signature {
    margin-top: 24px;
    font-style: italic;
}

.author-name-sig {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-style: normal;
    color: var(--sky-deep);
}

.author-photo-secondary {
    margin-top: 60px;
    text-align: center;
}

.secondary-photo {
    max-width: 400px;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.photo-caption {
    margin-top: 16px;
    font-style: italic;
    color: var(--text-dark);
    opacity: 0.7;
}

/* ============================================
   CTA Section
   ============================================ */
.cta-section {
    position: relative;
    padding: calc(var(--section-padding) * 1.5) 0;
    overflow: hidden;
}

.cta-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--sky-mid) 0%, var(--sky-deep) 100%);
    z-index: 0;
}

.cta-hills {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(180deg, var(--green-light) 0%, var(--green-mid) 100%);
    clip-path: polygon(0 60%, 20% 40%, 40% 55%, 60% 35%, 80% 50%, 100% 40%, 100% 100%, 0 100%);
}

.cta-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
}

.cta-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 16px;
    color: white;
}

.cta-subtitle {
    font-size: 1.3rem;
    margin-bottom: 32px;
    opacity: 0.9;
}

.cta-price {
    margin-bottom: 32px;
}

.price-tag {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
}

.price-note {
    display: block;
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 8px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.cta-note {
    font-size: 1rem;
    opacity: 0.85;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--sky-night);
    color: var(--cream);
    padding: 60px 0 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 32px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.footer-author, .footer-illustrator {
    font-size: 0.9rem;
    opacity: 0.8;
}

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

.footer-links a {
    color: var(--cream);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.footer-links a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-tagline {
    margin-top: 8px;
    font-family: var(--font-display);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
    }

    .hero-text {
        max-width: 100%;
    }

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

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

    .story-features {
        justify-content: center;
    }

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

    .author-photo-wrapper {
        flex: none;
        width: 100%;
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }

    .book-gallery {
        grid-template-columns: 1fr;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-large {
        width: 100%;
        max-width: 300px;
    }

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

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

    .scroll-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
    }

    .book-cover {
        max-width: 280px;
    }

    .story-jar {
        flex: none;
    }

    .jar-svg {
        width: 100px;
    }

    .gallery-item {
        border-radius: 8px;
    }

    .letter {
        padding: 24px;
    }
}

/* ============================================
   Animations on Scroll (added via JS)
   ============================================ */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
