/* 
==============================================
Responsive Design - The Gratitude Journal
==============================================
This file contains all the media queries to make the website responsive.
The desktop-first approach is used, so the base styles are for large screens,
and we override them here for smaller screens.

Breakpoints:
- Large Tablets: 1024px
- Tablets: 768px
- Mobile: 480px
*/

/* ============================================
   Large Tablets and Below (<= 1024px)
   ============================================ */
@media (max-width: 1024px) {
    /* --- General Layout & Typography --- */
    body {
        font-size: 16px;
    }

    section {
        padding: 60px 20px;
    }

    h2 {
        font-size: 2.5rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    /* --- Floating Navigation --- */
    .floating-nav {
        transform: scale(0.9);
        right: -20px;
        top: 50%;
    }

    /* --- Hero Section --- */
    .magical-title {
        font-size: 5rem;
    }

    .title-subtitle {
        font-size: 1.2rem;
    }

    /* --- Story Section --- */
    .path-step {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .path-step:nth-child(even) {
        flex-direction: column; /* Ensure it stays stacked */
    }

    .step-content, .step-visual {
        flex-basis: 100%;
        max-width: 100%;
    }

    /* --- Author Section --- */
    .about-author .author-container {
        flex-direction: column;
        gap: 30px;
    }

    .author-image-wrapper {
        max-width: 200px;
        margin: 0 auto;
    }

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

    /* --- Book Section --- */
    .living-book .book-container {
        flex-direction: column;
        gap: 40px;
    }

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

    /* --- Purchase Section --- */
    .marketplace-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    /* --- Coming Soon Section --- */
    .coming-soon-container {
        flex-direction: column;
        gap: 40px;
    }

    .coming-soon-content, .coming-soon-visual {
        text-align: center;
    }
}

/* ============================================
   Mobile Devices (<= 768px)
   ============================================ */
@media (max-width: 768px) {
    /* --- General Layout --- */
    section {
        padding: 40px 15px;
    }

    h2 {
        font-size: 2rem;
    }

    /* --- Floating Navigation --- */
    .floating-nav {
        flex-direction: row;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        justify-content: space-around;
        background: rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(10px); /* Increased blur */
        padding: 10px 5px; /* Added more vertical padding */
        padding-bottom: calc(10px + env(safe-area-inset-bottom)); /* iOS safe area */
        transform: scale(1);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    .nav-orb {
        transform: scale(0.8);
    }

    /* --- Hero Section --- */
    .hero.living-canvas {
        align-items: center; 
    }

    .hero-content {
        padding-top: 1rem;
    }

    .breathing-circle {
        width: 280px;
        height: 280px;
        font-size: 1.1rem;
    }

    .breathing-text-wrapper {
        transform: translateY(-20px); /* Nudge the text block up */
    }

    .breath-text-container {
        text-align: center; /* Center the text inside the container */
    }

    .title-magic {
        /* ... styles for title ... */
    }

    .magical-title {
        font-size: 3.5rem;
        line-height: 1.2;
        flex-direction: column;
        gap: 1rem;
    }
    
    /* The new flexbox model requires no layout changes here, just minor tweaks */
    .breathing-circle {
        width: 280px;
        height: 280px;
        font-size: 1.1rem;
    }
    
    .title-subtitle {
        font-size: 1rem;
        padding: 0 20px;
        margin-top: 2rem;
    }

    .hero-interaction {
        margin-top: 0;
        width: 100%;
    }

    .user-intention {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    /* --- Portal / Entry --- */
    .seed-container {
        transform: scale(0.8);
    }
    .seed-prompt {
        font-size: 1rem;
    }
    .intention-orbit {
        /* Set radius for tablets */
        --radius: 160px;
        transform: scale(0.8);
    }

    /* --- Book Section --- */
    .book-features {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* --- Contact Section --- */
    .connection-options {
        flex-direction: column;
    }

    /* --- Author Section --- */
    .about-author .author-container,
    .author-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 24px;
        width: 100%;
        max-width: 100%;
        padding: 0 0 50px 0;
    }
    .author-image-wrapper {
        max-width: 160px;
        width: 100%;
        height: auto;
        margin: 0 auto 16px auto;
    }
    .author-image {
        width: 100%;
        height: auto;
        max-width: 160px;
        min-width: 100px;
    }
    .author-bio {
        width: 100%;
        max-width: 500px;
        text-align: center;
        padding: 0 10px;
    }

    .persistent-intention {
        position: static;
        transform: none;
        margin-bottom: 0.2rem; /* Reduced margin to bring text closer */
    }
}

/* ============================================
   Small Mobile Devices (<= 480px)
   ============================================ */
@media (max-width: 480px) {
    /* --- General Body --- */
    body::-webkit-scrollbar {
        display: none; /* Hide scrollbar for WebKit browsers */
    }
    body {
        scrollbar-width: none; /* Hide scrollbar for Firefox */
        -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
    }

    /* --- Portal / Entry --- */
    .seed-container {
        transform: none; 
        width: 100vw;
        height: 100vw;
    }
    
    /* Make the sun bigger initially on mobile, and position it for animation */
    .portal-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(1); /* Start large and centered */
        opacity: 1;
        transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* When revealed, move the sun to the top but DO NOT shrink it */
    .seed-container.intentions-revealed .portal-container {
        transform: translate(-50%, -50%) scale(1); /* Ensure no scaling */
        top: 15%; /* Move to top */
    }

    /* Use a flexbox grid for the safest and cleanest layout */
    .intention-orbit {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-content: center;
        gap: 15px;
        padding: 20px;
        position: absolute;
        top: 35%; /* Adjust position for the 3x3 grid */
        left: 0;
        right: 0;
        bottom: 0;
        transform: scale(1);
    }

    .intention-word {
        /* Reset positioning for the new flex grid */
        position: static !important;
        transform: translateY(20px);
        opacity: 0;
        pointer-events: none; /* Not clickable when hidden */
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
        flex-basis: calc(33.333% - 10px); /* 3 items per row with 15px gap */
        text-align: center;
    }

    .seed-container.intentions-revealed .intention-word {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto; /* Clickable when visible */
    }

    /* Stagger the animation for the grid items */
    .seed-container.intentions-revealed .intention-word:nth-child(1) { transition-delay: 0.1s; }
    .seed-container.intentions-revealed .intention-word:nth-child(2) { transition-delay: 0.15s; }
    .seed-container.intentions-revealed .intention-word:nth-child(3) { transition-delay: 0.2s; }
    .seed-container.intentions-revealed .intention-word:nth-child(4) { transition-delay: 0.25s; }
    .seed-container.intentions-revealed .intention-word:nth-child(5) { transition-delay: 0.3s; }
    .seed-container.intentions-revealed .intention-word:nth-child(6) { transition-delay: 0.35s; }
    .seed-container.intentions-revealed .intention-word:nth-child(7) { transition-delay: 0.4s; }
    .seed-container.intentions-revealed .intention-word:nth-child(8) { transition-delay: 0.45s; }
    .seed-container.intentions-revealed .intention-word:nth-child(9) { transition-delay: 0.5s; }
    .seed-container.intentions-revealed .intention-word:nth-child(10) { transition-delay: 0.55s; }

    .seed-prompt {
        padding: 0 20px;
        position: absolute;
        font-size: 1.1rem;
        bottom: 10%;
    }

    /* --- Hero Section --- */
    .magical-title {
        font-size: 2.8rem; /* Further reduce for small screens */
        gap: 0.5rem; /* Tighter gap for small screens */
    }
    
    .title-word {
        display: inline; /* Let them wrap as text */
    }

    .title-subtitle {
        font-size: 0.9rem;
    }

    .breath-text-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
        text-align: center;
    }

    /* --- Navigation --- */
    .floating-nav {
        padding: 5px 0;
        padding-bottom: calc(5px + env(safe-area-inset-bottom));
    }
    
    .nav-orb {
        transform: scale(0.7);
    }

    /* --- Author Section --- */
    .about-author {
        padding: 32px 8px 32px 8px;
    }
    .author-container {
        padding: 0 0 32px 0;
    }
    .author-image-wrapper {
        margin-bottom: 18px;
    }
    .author-bio {
        padding: 0 12px;
        font-size: 0.98rem;
        text-align: left;
    }
    .author-bio h2,
    .author-bio h3 {
        text-align: left;
        margin-left: 2px;
    }
    .author-bio h2 {
        font-size: 1.35rem;
        margin-bottom: 0.3rem;
    }
    .author-bio h3 {
        font-size: 1.12rem;
        margin-bottom: 1.1rem;
    }
    .author-bio p {
        font-size: 0.96rem;
        text-indent: 1.2em;
        margin-bottom: 0.7em;
        line-height: 1.7;
    }

    .hero-content {
        padding-top: 8vh; /* Adjust for smaller screens */
    }
    
    .hero-interaction {
        margin-top: 2.5rem;
    }

    .user-intention {
        margin-bottom: 1rem;
    }

    .breathing-circle {
        width: 280px;
        height: 280px;
        font-size: 1.1rem;
    }
} 