/* ============================================================
   RRIPPL.com - "Autumn Pond" Design System
   Colors: #f5ece0, #ede3d3, #c45a2d, #d4782f, #8a9a6b, #3b2f25, #8c7a6b, #e8b84d
   Fonts: Space Mono (700, 400), Caveat (400, 700)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #f5ece0;
    color: #3b2f25;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    line-height: 1.8;
    overflow-x: hidden;
    cursor: default;
    position: relative;
}

/* --- Paper Grain Texture Overlay --- */
#paper-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Click Ripple Container --- */
#ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

.click-ripple {
    position: absolute;
    border: 1px solid #c45a2d;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.5;
    pointer-events: none;
    animation: clickRippleExpand 1.5s ease-out forwards;
}

@keyframes clickRippleExpand {
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* --- Blob Navigation --- */
#blob-nav {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
}

.nav-blob-trigger {
    width: 56px;
    height: 56px;
    background: #f5ece0;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-radius 0.6s ease-in-out, box-shadow 0.3s ease;
    box-shadow: 0 2px 12px rgba(59, 47, 37, 0.1);
    animation: navBlobBreathe 8s ease-in-out infinite;
}

.nav-blob-trigger:hover {
    box-shadow: 0 4px 20px rgba(59, 47, 37, 0.18);
}

@keyframes navBlobBreathe {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
}

.nav-blob-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#blob-nav:hover .nav-blob-menu,
#blob-nav.active .nav-blob-menu {
    pointer-events: auto;
    opacity: 1;
}

.nav-petal {
    position: absolute;
    display: block;
    padding: 6px 14px;
    background: #f5ece0;
    color: #c45a2d;
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50% 50% 50% 50%;
    box-shadow: 0 2px 8px rgba(59, 47, 37, 0.1);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, color 0.3s ease;
    white-space: nowrap;
}

.nav-petal:hover {
    background: #c45a2d;
    color: #f5ece0;
}

#blob-nav:hover .nav-petal,
#blob-nav.active .nav-petal {
    transform: translate(-50%, -50%) scale(1);
}

/* Petal positions in a radial flower pattern */
#blob-nav:hover .nav-petal[data-angle="0"],
#blob-nav.active .nav-petal[data-angle="0"] {
    top: 28px;
    left: 130px;
}
#blob-nav:hover .nav-petal[data-angle="72"],
#blob-nav.active .nav-petal[data-angle="72"] {
    top: 90px;
    left: 150px;
}
#blob-nav:hover .nav-petal[data-angle="144"],
#blob-nav.active .nav-petal[data-angle="144"] {
    top: 140px;
    left: 110px;
}
#blob-nav:hover .nav-petal[data-angle="216"],
#blob-nav.active .nav-petal[data-angle="216"] {
    top: 140px;
    left: 40px;
}
#blob-nav:hover .nav-petal[data-angle="288"],
#blob-nav.active .nav-petal[data-angle="288"] {
    top: 80px;
    left: 10px;
}

.nav-petal:nth-child(2) { transition-delay: 0s; }
.nav-petal:nth-child(3) { transition-delay: 0.05s; }
.nav-petal:nth-child(4) { transition-delay: 0.1s; }
.nav-petal:nth-child(5) { transition-delay: 0.15s; }
.nav-petal:nth-child(6) { transition-delay: 0.2s; }

/* --- Sections --- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* --- Hero Section --- */
.section-hero {
    background-color: #f5ece0;
    flex-direction: column;
}

.hero-content {
    position: relative;
    text-align: center;
    z-index: 2;
}

.hero-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.05em;
    text-transform: lowercase;
    color: #c45a2d;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: #8c7a6b;
    margin-top: 0.5em;
    opacity: 0;
    transform: translateY(10px);
    animation: heroSubtitleIn 1.5s ease 2s forwards;
}

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

/* Hero Ripple Rings */
.hero-ripples {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.ripple-ring {
    position: absolute;
    border: 1.5px solid #c45a2d;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.ring-1 {
    width: 120px;
    height: 120px;
    animation: heroRipple 3s ease-out 0.3s forwards;
}

.ring-2 {
    width: 220px;
    height: 220px;
    animation: heroRipple 3s ease-out 0.6s forwards;
}

.ring-3 {
    width: 350px;
    height: 350px;
    animation: heroRipple 3s ease-out 0.9s forwards;
}

.ring-4 {
    width: 500px;
    height: 500px;
    animation: heroRipple 3s ease-out 1.2s forwards;
}

.ring-5 {
    width: 680px;
    height: 680px;
    animation: heroRipple 3s ease-out 1.5s forwards;
}

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

/* --- Floating Botanicals --- */
.floating-botanical {
    position: absolute;
    z-index: 1;
    animation: floatDrift 6s ease-in-out infinite;
}

.botanical-1 {
    right: 8%;
    bottom: 15%;
    animation-delay: 0s;
}

.botanical-2 {
    left: 6%;
    top: 20%;
    animation-delay: -2s;
}

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

/* --- Diagonal Dividers --- */
.diagonal-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 3;
    line-height: 0;
}

.diagonal-divider svg {
    display: block;
    width: 100%;
    height: 60px;
}

.divider-up svg {
    transform: scaleX(-1);
}

/* --- Section Content --- */
.section-story {
    background-color: #ede3d3;
}

.section-grow {
    background-color: #f5ece0;
}

.section-bloom {
    background-color: #ede3d3;
}

.section-reach {
    background-color: #f5ece0;
}

.section-content {
    max-width: 60%;
    padding: 4rem 3rem;
    position: relative;
    z-index: 2;
    /* Initial state for scroll animation - will be animated by JS */
    opacity: 0;
    transform: translateX(-30px) rotate(-2deg);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-content.visible {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
}

/* Increasing max-width for concentric ripple grid effect */
.section-story .section-content { max-width: 60%; }
.section-grow .section-content { max-width: 70%; transform: translateX(30px) rotate(2deg); }
.section-bloom .section-content { max-width: 80%; }
.section-reach .section-content { max-width: 90%; transform: translateX(30px) rotate(2deg); }

.section-grow .section-content.visible,
.section-reach .section-content.visible {
    transform: translateX(0) rotate(0deg);
}

/* --- Blob Containers --- */
.blob-container {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: rgba(245, 236, 224, 0.6);
    backdrop-filter: blur(2px);
    box-shadow: 0 4px 30px rgba(59, 47, 37, 0.06);
}

.blob-1 {
    animation: blobBreathe1 8s ease-in-out infinite;
    animation-play-state: paused;
}

.blob-1.visible {
    animation-play-state: running;
}

.blob-2 {
    animation: blobBreathe2 9.5s ease-in-out infinite;
    animation-play-state: paused;
    background: rgba(237, 227, 211, 0.6);
}

.blob-2.visible {
    animation-play-state: running;
}

.blob-3 {
    animation: blobBreathe3 11s ease-in-out infinite;
    animation-play-state: paused;
    background: rgba(245, 236, 224, 0.6);
}

.blob-3.visible {
    animation-play-state: running;
}

.blob-4 {
    animation: blobBreathe4 8.5s ease-in-out infinite;
    animation-play-state: paused;
    background: rgba(237, 227, 211, 0.5);
}

.blob-4.visible {
    animation-play-state: running;
}

@keyframes blobBreathe1 {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    33% { border-radius: 50% 50% 60% 40% / 40% 60% 40% 60%; }
    66% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
}

@keyframes blobBreathe2 {
    0%, 100% { border-radius: 60% 40% 50% 50% / 40% 60% 40% 60%; }
    33% { border-radius: 40% 60% 70% 30% / 50% 50% 50% 50%; }
    66% { border-radius: 30% 70% 40% 60% / 60% 40% 70% 30%; }
}

@keyframes blobBreathe3 {
    0%, 100% { border-radius: 70% 30% 50% 50% / 30% 70% 40% 60%; }
    33% { border-radius: 50% 50% 30% 70% / 60% 40% 70% 30%; }
    66% { border-radius: 30% 70% 70% 30% / 50% 50% 50% 50%; }
}

@keyframes blobBreathe4 {
    0%, 100% { border-radius: 40% 60% 60% 40% / 50% 50% 50% 50%; }
    33% { border-radius: 70% 30% 40% 60% / 30% 70% 60% 40%; }
    66% { border-radius: 50% 50% 70% 30% / 60% 40% 30% 70%; }
}

/* --- Section Labels --- */
.section-label {
    display: inline-block;
    font-family: 'Caveat', cursive;
    font-size: 0.875rem;
    color: #8c7a6b;
    text-transform: lowercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

/* --- Section Titles --- */
.section-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.05em;
    text-transform: lowercase;
    color: #c45a2d;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* --- Section Body Text --- */
.section-body {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.8;
    color: #3b2f25;
    margin-bottom: 1.2rem;
}

.section-body em {
    font-family: 'Caveat', cursive;
    font-size: 1.15em;
    color: #c45a2d;
    font-style: normal;
}

/* --- Section Botanical Illustrations --- */
.section-botanical {
    position: absolute;
    z-index: 0;
    opacity: 0.3;
}

.section-story .section-botanical {
    right: -60px;
    top: 20px;
}

.section-grow .section-botanical {
    left: -40px;
    bottom: 10px;
}

.section-bloom .section-botanical {
    right: -50px;
    bottom: 20px;
}

.section-reach .section-botanical {
    left: -60px;
    top: 10px;
}

/* --- SVG Path Draw Animation --- */
.draw-path {
    stroke-dasharray: var(--path-length, 300);
    stroke-dashoffset: var(--path-length, 300);
    transition: stroke-dashoffset 2s ease-in-out, fill-opacity 0.8s ease 2s;
    fill-opacity: 0;
}

.draw-path.drawn {
    stroke-dashoffset: 0;
    fill-opacity: 0.15;
}

/* --- Field Guide Margin (Desktop) --- */
.field-guide {
    position: fixed;
    right: 16px;
    top: 0;
    height: 100%;
    width: 80px;
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.field-guide-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(0);
    transition: transform 0.1s linear;
}

.field-label {
    font-family: 'Caveat', cursive;
    font-size: 0.75rem;
    color: #8c7a6b;
    white-space: nowrap;
    margin-top: 2px;
    opacity: 0.7;
}

/* --- Footer --- */
.section-footer {
    background-color: #ede3d3;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-text {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: #8c7a6b;
}

.footer-copyright {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #8c7a6b;
    letter-spacing: 0.1em;
    text-transform: lowercase;
}

.footer-ripple-mark {
    opacity: 0.6;
}

/* --- Custom Cursor (leaf) --- */
.leaf-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform 0.05s linear;
}

/* ============================================================
   Responsive Styles
   ============================================================ */

@media (max-width: 768px) {
    .section-content {
        max-width: 90% !important;
        padding: 2.5rem 1.5rem;
        transform: translateX(-15px) rotate(-1deg);
    }

    .section-grow .section-content {
        transform: translateX(15px) rotate(1deg);
    }

    .section-reach .section-content {
        transform: translateX(15px) rotate(1deg);
    }

    .blob-container {
        border-radius: 20px !important;
        animation: none !important;
    }

    .diagonal-divider svg {
        height: 30px;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .field-guide {
        display: none;
    }

    .floating-botanical {
        opacity: 0.2;
    }

    .botanical-1 {
        right: 2%;
    }

    .botanical-2 {
        left: 2%;
    }

    .section-botanical {
        display: none;
    }

    #blob-nav {
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
    }

    .nav-blob-menu {
        bottom: 60px;
        top: auto;
        left: -70px;
        width: 200px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        background: #f5ece0;
        border-radius: 20px;
        padding: 16px;
        box-shadow: 0 4px 20px rgba(59, 47, 37, 0.15);
    }

    #blob-nav:hover .nav-petal,
    #blob-nav.active .nav-petal {
        position: static;
        transform: scale(1);
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .section {
        min-height: auto;
        padding: 3rem 0;
    }

    .section-hero {
        min-height: 100vh;
    }

    .section-content {
        padding: 2rem 1.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .ripple-ring {
        display: none;
    }

    .ring-1, .ring-2, .ring-3 {
        display: block;
    }
}
