/* ============================================
   RRIPPL.com - Zen Ripple Effect Design
   Colors: Earth + Water complementary palette
   Fonts: Playfair Display + Libre Baskerville
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Libre Baskerville', serif;
    color: #3D3228;
    background-color: #EDE4D3;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Paper Texture Base --- */
.paper-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at center, transparent 50%, rgba(28,20,16,0.08) 100%),
        #EDE4D3;
}

.paper-texture::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    filter: url(#paperGrain);
    background: #EDE4D3;
}

/* --- Sidebar Navigation --- */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    z-index: 100;
    background: linear-gradient(to bottom, #2C2418, #E8DCC8);
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#sidebar.visible {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-inner {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 48px 24px;
    z-index: 2;
}

.sidebar-border {
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    z-index: 3;
}

.sidebar-logo {
    margin-bottom: 64px;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: 28px;
    color: #F5F0E6;
    letter-spacing: -0.03em;
}

/* Navigation Clusters */
.nav-cluster {
    margin-bottom: 48px;
}

.nav-cluster-1 {
    margin-top: 32px;
}

.nav-cluster-2 {
    margin-top: 64px;
}

.nav-cluster-3 {
    margin-top: 48px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    position: relative;
    cursor: pointer;
}

.nav-stroke {
    display: block;
    width: 40px;
    height: 2px;
    background-color: #F5F0E6;
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
}

.nav-label {
    font-family: 'Playfair Display SC', serif;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: #D9CEBC;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    white-space: nowrap;
}

.nav-item:hover .nav-label,
.nav-item.active .nav-label {
    opacity: 1;
    transform: translateX(0);
}

.nav-item:hover .nav-stroke {
    width: 24px;
}

.nav-item.active .nav-label {
    color: #A8D5D0;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 52px;
    width: 0;
    height: 1px;
    background: #2D8E89;
    animation: drawLine 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes drawLine {
    to { width: 50px; }
}

/* --- Mobile Header --- */
#mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: linear-gradient(to right, #2C2418, #3D3228);
    z-index: 200;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
}

#mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-logo {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: 20px;
    color: #F5F0E6;
    letter-spacing: -0.03em;
}

/* --- Main Content --- */
#content {
    margin-left: 240px;
    position: relative;
}

/* --- Scene (Section) Base --- */
.scene {
    position: relative;
    overflow: hidden;
}

.scene-content {
    position: relative;
    z-index: 2;
}

/* --- Ink Wash Stains --- */
.ink-wash-stain {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.stain-1 {
    width: 450px;
    height: 400px;
    top: 15%;
    right: 10%;
    background: radial-gradient(ellipse at center, rgba(61,50,40,0.03) 0%, transparent 70%);
}

.stain-2 {
    width: 500px;
    height: 350px;
    top: 30%;
    left: 5%;
    background: radial-gradient(ellipse at 40% 50%, rgba(61,50,40,0.03) 0%, transparent 70%);
}

.stain-3 {
    width: 380px;
    height: 420px;
    top: 10%;
    right: 20%;
    background: radial-gradient(ellipse at center, rgba(61,50,40,0.03) 0%, transparent 70%);
}

/* --- Torn Paper Dividers --- */
.torn-divider {
    position: absolute;
    width: 100%;
    height: 30px;
    z-index: 5;
    pointer-events: none;
    left: 0;
}

.divider-1 {
    top: calc(100vh - 15px);
}

.divider-2 {
    top: calc(190vh + 105px);
}

.divider-3 {
    top: calc(290vh + 225px);
}

/* =====================
   SECTION 1: OPENING
   ===================== */
.scene-opening {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opening-content {
    text-align: center;
    padding: 40px;
}

#site-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: 80px;
    color: #1C1410;
    letter-spacing: -0.03em;
    opacity: 0;
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 2s cubic-bezier(0.0, 0.0, 0.2, 1.0),
                opacity 0.3s ease-out;
}

#site-title.revealed {
    opacity: 1;
    clip-path: circle(100% at 50% 50%);
}

.site-subtitle {
    font-family: 'Playfair Display SC', serif;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.12em;
    color: #7A6B5D;
    margin-top: 24px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 1s ease-out 2.4s, transform 1s ease-out 2.4s;
}

#site-title.revealed ~ .site-subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* Ripple Container - Opening */
.ripple-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

.ripple-origin {
    width: 8px;
    height: 8px;
    background: #1A5C5A;
    border-radius: 50%;
    position: relative;
}

.ripple-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1.5px solid #2D8E89;
    pointer-events: none;
    opacity: 0;
}

.ripple-ring.animate {
    animation: rippleExpand var(--duration, 2s) cubic-bezier(0.0, 0.0, 0.2, 1.0) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes rippleExpand {
    0% {
        width: 8px;
        height: 8px;
        opacity: 0.6;
    }
    100% {
        width: var(--size, 300px);
        height: var(--size, 300px);
        opacity: 0;
    }
}

/* ========================
   SECTION 2: PHILOSOPHY
   ======================== */
.scene-philosophy {
    min-height: 90vh;
    padding: 120px 0;
}

.philosophy-content {
    display: flex;
    flex-direction: column;
    padding: 0 60px;
}

.philosophy-text {
    width: 60%;
    margin-left: auto;
    padding-right: 40px;
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 48px;
    color: #1C1410;
    letter-spacing: -0.03em;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.body-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    color: #3D3228;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.body-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.pull-quote {
    position: relative;
    margin-top: 56px;
    margin-left: 40px;
    padding-left: 32px;
    max-width: 400px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.pull-quote.visible {
    opacity: 1;
    transform: translateY(0);
}

.quote-brush {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom,
        #1C1410 0%,
        #3D3228 20%,
        #1C1410 40%,
        #7A6B5D 60%,
        #1C1410 80%,
        #3D3228 100%
    );
    border-radius: 2px;
}

.pull-quote p {
    font-family: 'Playfair Display', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 22px;
    line-height: 1.6;
    color: #3D3228;
}

/* Ripple Cluster (Philosophy Left Side) */
.ripple-cluster {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 35%;
    height: 60%;
    pointer-events: none;
    z-index: 1;
}

.ripple-set {
    position: absolute;
}

.ripple-set:nth-child(1) {
    top: 10%;
    left: 20%;
}

.ripple-set:nth-child(2) {
    top: 50%;
    left: 50%;
}

.ripple-set:nth-child(3) {
    top: 75%;
    left: 15%;
}

/* Static concentric rings */
.static-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid #2D8E89;
    pointer-events: none;
}

/* ==========================
   SECTION 3: EXPLORATION
   ========================== */
.scene-exploration {
    min-height: 100vh;
    padding: 120px 0;
}

.exploration-content {
    padding: 0 60px;
}

.exploration-content .section-heading {
    text-align: left;
    margin-bottom: 60px;
}

.exploration-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    grid-template-rows: auto auto;
    gap: 40px;
}

.explore-block {
    position: relative;
    background: #F5F0E6;
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.explore-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.explore-block-1 {
    grid-column: 1;
    grid-row: 1;
}

.explore-block-2 {
    grid-column: 1;
    grid-row: 2;
}

.explore-block-3 {
    grid-column: 2;
    grid-row: 1 / 3;
}

.block-ripples {
    position: absolute;
    top: 20px;
    right: 20px;
    pointer-events: none;
    z-index: 0;
}

.block-content {
    position: relative;
    z-index: 1;
    padding: 40px;
}

.block-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 28px;
    color: #1C1410;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.block-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    color: #3D3228;
}

/* Block hover ripple zone */
.explore-block::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%),
        rgba(45,142,137,0.06) 0%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.4s ease-out;
    pointer-events: none;
    z-index: 0;
}

.explore-block:hover::after {
    opacity: 1;
}

/* =======================
   SECTION 4: CLOSING
   ======================= */
.scene-closing {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.closing-paper {
    background:
        radial-gradient(ellipse at center, transparent 30%, rgba(28,20,16,0.15) 100%),
        linear-gradient(to bottom, #EDE4D3, #D9CEBC);
}

.closing-content {
    text-align: center;
    padding: 40px;
}

.closing-message {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: 36px;
    color: #1C1410;
    letter-spacing: -0.03em;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.closing-message.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Closing Ripples (contracting) */
.closing-ripples {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

.closing-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1.5px solid #2D8E89;
    pointer-events: none;
    opacity: 0;
}

.closing-ring.animate {
    animation: rippleContract var(--duration, 2s) cubic-bezier(0.0, 0.0, 0.2, 1.0) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes rippleContract {
    0% {
        width: var(--size, 400px);
        height: var(--size, 400px);
        opacity: 0;
    }
    20% {
        opacity: 0.5;
    }
    100% {
        width: 8px;
        height: 8px;
        opacity: 0;
    }
}

/* Water Caustics */
.water-caustics {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.caustic-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    opacity: 0.04;
}

/* =======================
   PARALLAX LAYERS
   ======================= */
.parallax-bg {
    will-change: transform;
}

/* =======================
   MICRO RIPPLE ON HOVER
   ======================= */
.micro-ripple {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    border-radius: 50%;
    border: 1px solid #2D8E89;
    animation: microRippleExpand 0.4s cubic-bezier(0.0, 0.0, 0.2, 1.0) forwards;
}

@keyframes microRippleExpand {
    0% {
        width: 4px;
        height: 4px;
        opacity: 0.5;
        transform: translate(-50%, -50%);
    }
    100% {
        width: var(--size, 60px);
        height: var(--size, 60px);
        opacity: 0;
        transform: translate(-50%, -50%);
    }
}

/* =======================
   RESPONSIVE: MOBILE
   ======================= */
@media (max-width: 768px) {
    #sidebar {
        display: none;
    }

    #sidebar.mobile-open {
        display: block;
        width: 100%;
        height: 100vh;
        z-index: 300;
        opacity: 1;
        transform: translateX(0);
    }

    #mobile-header {
        display: flex;
    }

    #content {
        margin-left: 0;
        padding-top: 56px;
    }

    #site-title {
        font-size: 48px;
    }

    .section-heading {
        font-size: 36px;
    }

    .philosophy-text {
        width: 100%;
        padding-right: 0;
    }

    .philosophy-content {
        padding: 0 24px;
    }

    .exploration-content {
        padding: 0 24px;
    }

    .exploration-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .explore-block-1 {
        grid-column: 1;
        grid-row: 1;
    }

    .explore-block-2 {
        grid-column: 1;
        grid-row: 2;
    }

    .explore-block-3 {
        grid-column: 1;
        grid-row: 3;
    }

    .ripple-cluster {
        display: none;
    }

    .pull-quote {
        margin-left: 0;
    }

    .closing-message {
        font-size: 28px;
    }

    .block-content {
        padding: 28px;
    }
}

@media (max-width: 480px) {
    #site-title {
        font-size: 36px;
    }

    .section-heading {
        font-size: 28px;
    }

    .body-text {
        font-size: 15px;
    }

    .pull-quote p {
        font-size: 18px;
    }
}
