/* ============================================================
   memorial.wiki - CSS Styles
   Frutiger Aero aesthetic with deep burgundy palette
   Design terms: Intersection Observer (not scroll event listeners with `threshold: 0.15`), Source Sans 3 Light: "A living place for the people we carry with us." Floating orbs drift slowly around the panel edges. The entire section fades in over 1.5 seconds on page load using `opacity` and `transform: translateY(20px)`. Each pool alternates its horizontal position (left-weighted, Source Sans 3" (Google Fonts).
   ============================================================ */

/* ============================================================
   1. RESET AND BASE STYLES
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    color: #4A2030;
    background: linear-gradient(to bottom,
        #FDF5F0 0%,
        #F5E6EC 40%,
        #D4A0B0 60%,
        #1E0A12 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* ============================================================
   2. TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: #3D1525;
}

h1 {
    font-size: clamp(1.8rem, 4.5vw, 3.6rem);
}

h2 {
    font-size: clamp(1.4rem, 3vw, 2.4rem);
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 2rem);
}

blockquote {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: #3D1525;
    letter-spacing: 0.01em;
}

/* Accent/Metadata text */
.memorial-dates,
.memorial-dates-small,
.closing-wordmark {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8B4A62;
}

p {
    max-width: 38em;
    line-height: 1.75;
}

/* ============================================================
   3. COLOR PALETTE
   ============================================================ */

:root {
    --primary-deep: #3D1525;
    --bg-warm: #FDF5F0;
    --accent-rose: #8B4A62;
    --glass-tint: #F5E6EC;
    --highlight-gold: #C8956E;
    --deep-bg: #1E0A12;
    --sky-gradient-start: #D4A0B0;
    --sky-gradient-end: #7B3F55;
    --body-text-light: #4A2030;
    --body-text-dark: #E8D0D8;
}

/* ============================================================
   4. GLASS PANEL CONSTRUCTION
   ============================================================ */

.glass-panel {
    background: rgba(245, 230, 236, 0.55);
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(61, 21, 37, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    padding: 2.5rem;
}

/* Darker glass for deep memory section */
.deep-memory .glass-panel {
    background: rgba(139, 74, 98, 0.2);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
}

/* ============================================================
   5. NAVIGATION
   ============================================================ */

.nav-pill {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: rgba(245, 230, 236, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    z-index: 100;
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #3D1525;
    font-weight: 700;
}

.remember-link {
    position: fixed;
    top: 2rem;
    right: 2rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    color: #3D1525;
    text-decoration: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    z-index: 100;
    pointer-events: none;
}

.remember-link.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.remember-link:hover {
    color: #C8956E;
}

/* ============================================================
   6. SECTIONS
   ============================================================ */

section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Opening Vista */
.opening-vista {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10vw;
    position: relative;
}

.vista-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #D4A0B0 0%, #7B3F55 100%);
    z-index: 1;
}

.hero-panel {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 480px;
    text-align: center;
    animation: heroFadeIn 1.5s ease-out forwards;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-title {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 3rem;
    color: #3D1525;
    margin-bottom: 1rem;
}

.site-tagline {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    color: #4A2030;
    letter-spacing: 0.02em;
}

/* Remembrance Stream */
.remembrance-stream {
    padding: 20vh 0;
    position: relative;
    min-height: 250vh;
}

/* Quiet Center */
.quiet-center {
    padding: 15vh 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.quote-panel {
    width: 70vw;
    max-width: 700px;
    text-align: center;
    position: relative;
    z-index: 10;
}

/* Deep Memory */
.deep-memory {
    padding: 15vh 0;
    min-height: 200vh;
    position: relative;
}

/* Closing Light */
.closing-light {
    padding: 15vh 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.closing-panel {
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.closing-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: 1rem;
}

.closing-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: 1.2rem;
    color: #4A2030;
    margin-bottom: 2rem;
}

.closing-wordmark {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #8B4A62;
}

/* ============================================================
   7. MEMORY POOLS AND CARDS
   ============================================================ */

.memory-pool {
    margin: 12vh auto;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    position: relative;
    will-change: transform, opacity;
}

.memory-pool.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Alternating alignment for asymmetric river */
.pool-1 {
    margin-left: 8vw;
    max-width: 520px;
}

.pool-2 {
    margin-right: 8vw;
    margin-left: auto;
    max-width: 520px;
    transform: translateX(40px);
}

.pool-2.revealed {
    transform: translateX(0);
}

.pool-3 {
    margin: 12vh auto;
    max-width: 400px;
}

.pool-4 {
    margin-left: 8vw;
    max-width: 520px;
}

.pool-5 {
    margin-right: 8vw;
    margin-left: auto;
    max-width: 520px;
    transform: translateX(40px);
}

.pool-5.revealed {
    transform: translateX(0);
}

/* Deep Memory Pools */
.deep-memory .memory-pool {
    margin: 8vh auto;
    max-width: 380px;
    transform: translateY(30px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.deep-memory .memory-pool.revealed {
    transform: translateY(0);
}

.memory-card,
.memory-card-small {
    position: relative;
}

.memory-card {
    padding: 2.5rem;
}

.memory-card-small {
    padding: 1.5rem;
}

.memorial-name,
.memorial-name-small {
    font-style: italic;
    margin: 1.5rem 0 0.5rem 0;
    color: #3D1525;
}

.memorial-narrative,
.memorial-narrative-small {
    font-size: clamp(0.95rem, 1vw, 1.1rem);
    color: #4A2030;
    margin-top: 1rem;
}

/* ============================================================
   8. PHOTO FRAMES
   ============================================================ */

.memory-photo-frame {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #D4A0B0 0%, #C8956E 100%);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(61, 21, 37, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.memorial-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(0.92) saturate(0.85) brightness(1.08) sepia(0.12);
}

/* ============================================================
   9. DEW DROPS
   ============================================================ */

.dew-drop {
    position: absolute;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.drop-1 {
    width: 8px;
    height: 8px;
    top: 15px;
    left: 20px;
}

.drop-2 {
    width: 6px;
    height: 6px;
    top: 25px;
    right: 30px;
}

.drop-3 {
    width: 7px;
    height: 7px;
    bottom: 20px;
    left: 25px;
}

/* ============================================================
   10. FLOATING ELEMENTS
   ============================================================ */

.floating-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        rgba(200, 149, 110, 0.4) 0%,
        rgba(139, 74, 98, 0.15) 50%,
        transparent 70%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateZ(0);
    will-change: transform;
    animation: drift 8s ease-in-out infinite;
}

.opening-vista .floating-orb {
    animation-duration: 8s;
}

.pool-orb-1 {
    width: 60px;
    height: 60px;
    top: -30px;
    right: 10%;
    animation-delay: 0s;
}

.pool-orb-2 {
    width: 40px;
    height: 40px;
    bottom: 20px;
    left: -20px;
    animation-delay: 2s;
}

.pool-orb-3 {
    width: 80px;
    height: 80px;
    top: -40px;
    left: 15%;
    animation-delay: 1s;
}

.pool-orb-4 {
    width: 50px;
    height: 50px;
    bottom: 30px;
    right: -25px;
    animation-delay: 3s;
}

.pool-orb-5 {
    width: 70px;
    height: 70px;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0.5s;
}

.pool-orb-6 {
    width: 45px;
    height: 45px;
    top: 50%;
    right: 5%;
    animation-delay: 2.5s;
}

.pool-orb-7 {
    width: 65px;
    height: 65px;
    bottom: -30px;
    left: 5%;
    animation-delay: 1.5s;
}

.pool-orb-8 {
    width: 55px;
    height: 55px;
    top: 30%;
    left: -27px;
    animation-delay: 0.8s;
}

.orb-1 {
    width: 100px;
    height: 100px;
    top: 20%;
    right: 5%;
    animation-delay: 0s;
}

.orb-2 {
    width: 70px;
    height: 70px;
    bottom: 30%;
    left: 10%;
    animation-delay: 1.5s;
}

.orb-3 {
    width: 120px;
    height: 120px;
    top: 50%;
    right: 15%;
    animation-delay: 3s;
}

@keyframes drift {
    0%, 100% {
        transform: translateY(0px) translateZ(0);
    }
    50% {
        transform: translateY(-15px) translateZ(0);
    }
}

/* Converging orbs */
.converging-orbs {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        rgba(200, 149, 110, 0.4) 0%,
        rgba(139, 74, 98, 0.15) 50%,
        transparent 70%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    will-change: transform;
}

.orb-converge-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
}

.orb-converge-2 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    right: 15%;
}

.orb-converge-3 {
    width: 50px;
    height: 50px;
    top: 60%;
    right: 5%;
}

.orb-converge-4 {
    width: 70px;
    height: 70px;
    bottom: 10%;
    left: 20%;
}

/* ============================================================
   11. LEAF SILHOUETTES
   ============================================================ */

.leaf-silhouette {
    position: absolute;
    opacity: 0.08;
    animation: spin 30s linear infinite;
    will-change: transform;
}

.leaf-1 {
    width: 150px;
    height: 150px;
    top: 10%;
    left: 5%;
    background: #D4A0B0;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.leaf-2 {
    width: 120px;
    height: 120px;
    top: 40%;
    right: 8%;
    background: #D4A0B0;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation-delay: 5s;
}

.leaf-3 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 15%;
    background: #D4A0B0;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation-delay: 10s;
}

.leaf-4 {
    width: 130px;
    height: 130px;
    top: 30%;
    right: 20%;
    background: #D4A0B0;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation-delay: 15s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================================
   12. BOKEH LIGHTS
   ============================================================ */

.bokeh-light {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%,
        rgba(200, 149, 110, 0.4) 0%,
        rgba(200, 149, 110, 0.1) 50%,
        transparent 70%);
    animation: bokehPulse 4s ease-in-out infinite;
    will-change: opacity;
}

.bokeh-1 {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.bokeh-2 {
    width: 100px;
    height: 100px;
    top: 40%;
    right: 15%;
    animation-delay: 1s;
}

.bokeh-3 {
    width: 80px;
    height: 80px;
    bottom: 25%;
    left: 10%;
    animation-delay: 2s;
}

.bokeh-4 {
    width: 90px;
    height: 90px;
    bottom: 10%;
    right: 20%;
    animation-delay: 1.5s;
}

@keyframes bokehPulse {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.4;
    }
}

/* ============================================================
   13. TYPEWRITER ANIMATION FOR QUOTE
   ============================================================ */

.memorial-quote {
    display: inline-block;
}

.quote-char {
    display: inline-block;
    opacity: 0;
    animation: typewriteChar 0.08s ease-out forwards;
    animation-play-state: paused;
}

.quote-panel.revealed .quote-char {
    animation-play-state: running;
}

.quote-char:nth-child(1) { animation-delay: 0.08s; }
.quote-char:nth-child(2) { animation-delay: 0.16s; }
.quote-char:nth-child(3) { animation-delay: 0.24s; }
.quote-char:nth-child(4) { animation-delay: 0.32s; }
.quote-char:nth-child(5) { animation-delay: 0.40s; }
.quote-char:nth-child(6) { animation-delay: 0.48s; }
.quote-char:nth-child(7) { animation-delay: 0.56s; }
.quote-char:nth-child(8) { animation-delay: 0.64s; }
.quote-char:nth-child(9) { animation-delay: 0.72s; }
.quote-char:nth-child(10) { animation-delay: 0.80s; }
.quote-char:nth-child(11) { animation-delay: 0.88s; }
.quote-char:nth-child(12) { animation-delay: 0.96s; }
.quote-char:nth-child(13) { animation-delay: 1.04s; }
.quote-char:nth-child(14) { animation-delay: 1.12s; }
.quote-char:nth-child(15) { animation-delay: 1.20s; }
.quote-char:nth-child(16) { animation-delay: 1.28s; }
.quote-char:nth-child(17) { animation-delay: 1.36s; }
.quote-char:nth-child(18) { animation-delay: 1.44s; }
.quote-char:nth-child(19) { animation-delay: 1.52s; }
.quote-char:nth-child(20) { animation-delay: 1.60s; }
.quote-char:nth-child(21) { animation-delay: 1.68s; }
.quote-char:nth-child(22) { animation-delay: 1.76s; }
.quote-char:nth-child(23) { animation-delay: 1.84s; }
.quote-char:nth-child(24) { animation-delay: 1.92s; }
.quote-char:nth-child(25) { animation-delay: 2.00s; }
.quote-char:nth-child(26) { animation-delay: 2.08s; }
.quote-char:nth-child(27) { animation-delay: 2.16s; }
.quote-char:nth-child(28) { animation-delay: 2.24s; }
.quote-char:nth-child(29) { animation-delay: 2.32s; }
.quote-char:nth-child(30) { animation-delay: 2.40s; }
.quote-char:nth-child(31) { animation-delay: 2.48s; }
.quote-char:nth-child(32) { animation-delay: 2.56s; }
.quote-char:nth-child(33) { animation-delay: 2.64s; }
.quote-char:nth-child(34) { animation-delay: 2.72s; }
.quote-char:nth-child(35) { animation-delay: 2.80s; }
.quote-char:nth-child(36) { animation-delay: 2.88s; }
.quote-char:nth-child(37) { animation-delay: 2.96s; }
.quote-char:nth-child(38) { animation-delay: 3.04s; }
.quote-char:nth-child(39) { animation-delay: 3.12s; }
.quote-char:nth-child(40) { animation-delay: 3.20s; }
.quote-char:nth-child(41) { animation-delay: 3.28s; }

@keyframes typewriteChar {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================================
   14. FORM STYLES
   ============================================================ */

.memorial-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.memorial-input {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 1rem 1.35rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    color: #3D1525;
    transition: all 0.3s ease;
}

.memorial-input::placeholder {
    color: rgba(61, 21, 37, 0.5);
}

.memorial-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(200, 149, 110, 0.5);
}

/* ============================================================
   15. RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    .opening-vista {
        padding-right: 2rem;
        padding-left: 2rem;
    }

    .nav-pill {
        top: 1rem;
        left: 1rem;
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .remember-link {
        top: 1rem;
        right: 1rem;
        font-size: 0.85rem;
    }

    .pool-1, .pool-3, .pool-4 {
        margin-left: 1rem;
        margin-right: 1rem;
        max-width: 100%;
    }

    .pool-2, .pool-5 {
        margin-left: 1rem;
        margin-right: 1rem;
        max-width: 100%;
    }

    .quote-panel {
        width: 90%;
        padding: 1.5rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .closing-panel {
        width: 95%;
        padding: 1.5rem;
    }
}

.memory-pool:not(.revealed) {
    will-change: transform, opacity;
}

.memory-pool.revealed {
    will-change: auto;
}
