/* lottery.day - The Greenhouse of Chance */
/* Glassmorphic split-screen narrative experience */


/* ==================== DESIGN COLORS (COMPLIANCE) ==================== */
/* All design colors referenced for compliance */
:root {
    --deep-ground: #2b3040;
    --frost-gray: #c8ced8;
    --silver-mist: #d8dee9;
    --sage-crystal: #7a9e8e;
    --champagne-gold: #c9a96e;
    --forest-jade: #3d6b5a;
    --pale-frost: #eef1f5;
    --cool-charcoal: #3a3f4d;
    --muted-pewter: #6b7280;
    --aurora-teal: #5fb8a5;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #2b3040;
    color: #3a3f4d;
    font-family: 'Lora', Georgia, serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ==================== LAYER 0: BACKGROUND ==================== */
#bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#fracture-bg {
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

/* ==================== LAYER 1: AMBIENT ==================== */
#ambient-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}

.ambient-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(95,184,165,0.12) 0%, transparent 70%);
    top: -10%;
    left: 20%;
    animation: ambientDrift1 30s ease-in-out infinite;
}

.ambient-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(122,158,142,0.1) 0%, transparent 70%);
    bottom: -5%;
    right: 15%;
    animation: ambientDrift2 35s ease-in-out infinite;
}

.ambient-orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(201,169,110,0.08) 0%, transparent 70%);
    top: 40%;
    left: -5%;
    animation: ambientDrift3 28s ease-in-out infinite;
}

.ambient-orb-4 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(61,107,90,0.1) 0%, transparent 70%);
    top: 60%;
    right: 30%;
    animation: ambientDrift4 32s ease-in-out infinite;
}

@keyframes ambientDrift1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(60px, 40px); }
    50% { transform: translate(-30px, 80px); }
    75% { transform: translate(40px, -20px); }
}

@keyframes ambientDrift2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-50px, -30px); }
    50% { transform: translate(40px, -60px); }
    75% { transform: translate(-20px, 40px); }
}

@keyframes ambientDrift3 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(70px, 30px); }
    66% { transform: translate(-40px, 60px); }
}

@keyframes ambientDrift4 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-60px, -40px); }
    66% { transform: translate(30px, -70px); }
}

/* ==================== MAIN GRID ==================== */
#greenhouse {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 55fr 45fr;
    height: 100vh;
    width: 100vw;
}

/* ==================== PANES ==================== */
.pane {
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    height: 100vh;
}

/* Scrollbar styling */
.pane::-webkit-scrollbar {
    width: 4px;
}

.pane::-webkit-scrollbar-track {
    background: transparent;
}

.pane::-webkit-scrollbar-thumb {
    background: rgba(200, 210, 220, 0.2);
    border-radius: 2px;
}

.pane::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 210, 220, 0.4);
}

/* ==================== CONSERVATORY (LEFT PANE) ==================== */
#conservatory {
    background: rgba(200, 210, 220, 0.04);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 clamp(2rem, 5vw, 5rem);
}

.conservatory-section {
    min-height: 61.8vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 38.2vh 0 0;
    text-align: center;
}

.conservatory-section:first-child {
    padding-top: 15vh;
}

/* ==================== ARCHIVE (RIGHT PANE) ==================== */
#archive {
    background: rgba(200, 210, 220, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 clamp(1.5rem, 4vw, 4rem);
}

.archive-section {
    padding: 8vh 0 4vh;
}

.archive-section:first-child {
    padding-top: 15vh;
}

/* ==================== TYPOGRAPHY ==================== */
.display-title {
    font-family: 'Poiret One', 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c9a96e;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.display-heading {
    font-family: 'Poiret One', 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #eef1f5;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.josefin {
    font-family: 'Josefin Sans', sans-serif;
}

.subtitle {
    font-weight: 300;
    font-size: clamp(1.1rem, 2.5vw, 1.75rem);
    letter-spacing: 0.06em;
    color: #d8dee9;
    margin-bottom: 3rem;
}

.narrative-text {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: #d8dee9;
    max-width: 52ch;
    margin: 0 auto 2.5rem;
    text-align: left;
}

.closing-mark {
    font-weight: 300;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    letter-spacing: 0.1em;
    color: #c9a96e;
    opacity: 0.7;
    margin-top: 2rem;
}

/* ==================== SPECIMEN CARDS ==================== */
.specimen-card {
    background: rgba(200, 210, 220, 0.08);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 1.5rem;
    transition: backdrop-filter 0.4s ease,
                border-color 0.4s ease,
                box-shadow 0.4s ease,
                transform 0.3s ease;
}

.specimen-card:hover {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-color: rgba(95, 184, 165, 0.35);
    box-shadow: 0 8px 32px rgba(43, 48, 64, 0.3);
    transform: translateY(-2px);
}

.specimen-card:hover .glass-sphere {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 20px rgba(95, 184, 165, 0.3);
}

.specimen-card:hover .petals path,
.specimen-card:hover .petals polygon,
.specimen-card:hover .petals ellipse {
    stroke-dashoffset: 0;
}

.specimen-title {
    font-weight: 600;
    font-size: clamp(1rem, 2vw, 1.3rem);
    letter-spacing: 0.04em;
    color: #eef1f5;
    margin-bottom: 0.8rem;
}

.specimen-text {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.65;
    color: #d8dee9;
    margin-bottom: 1rem;
}

.specimen-data {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: #5fb8a5;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(216, 222, 233, 0.1);
    border-bottom: 1px solid rgba(216, 222, 233, 0.1);
}

.specimen-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: #6b7280;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.closing-card {
    text-align: center;
    border: 1px solid rgba(201, 169, 110, 0.2);
}

.closing-text {
    font-weight: 300;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #c9a96e;
    letter-spacing: 0.04em;
    line-height: 1.6;
}

/* ==================== GLASS SPHERE ==================== */
.glass-sphere {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: rgba(200, 210, 220, 0.06);
    transition: backdrop-filter 0.4s ease,
                box-shadow 0.4s ease;
}

/* ==================== GLASS SHELF ==================== */
.glass-shelf {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    margin: 2rem 0;
}

/* ==================== PROBABILITY FLOWERS ==================== */
.probability-flower {
    display: block;
    margin: 2rem auto;
    opacity: 0.85;
}

.probability-flower .petals polygon,
.probability-flower .petals ellipse,
.probability-flower .petals path {
    transition: opacity 0.6s ease;
}

.probability-flower:hover .petals polygon,
.probability-flower:hover .petals ellipse,
.probability-flower:hover .petals path {
    opacity: 0.9;
    fill-opacity: 0.25;
}

/* ==================== FERN ILLUSTRATION ==================== */
.fern-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.fern-illustration {
    display: block;
}

.fern-leaf {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.6s ease;
    transition-delay: calc(var(--delay) * 100ms);
}

.fern-container.visible .fern-leaf,
.visible .fern-leaf {
    stroke-dashoffset: 0;
}

.fern-stem {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.2s ease;
}

.fern-container.visible .fern-stem,
.visible .fern-stem {
    stroke-dashoffset: 0;
}

/* ==================== ART DECO FAN ==================== */
.art-deco-fan {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
    opacity: 0.8;
}

/* ==================== SEED POD ==================== */
.seed-pod-diagram {
    display: block;
    margin: 1rem auto;
}

.seed-pod-card {
    text-align: center;
}

/* ==================== SLIDE-REVEAL ANIMATION ==================== */
.reveal-block {
    clip-path: inset(100% 0 0 0);
    transform: translateY(40px);
    transition: clip-path 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-block.visible {
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
}

/* ==================== ANIMATED TITLE ==================== */
.animated-title .char {
    display: inline-block;
    clip-path: inset(100% 0 0 0);
    transform: translateY(20px);
    transition: clip-path 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                color 0.3s ease 0.2s;
}

.animated-title.animate .char {
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
    }

    #greenhouse {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .pane {
        height: auto;
        overflow: visible;
    }

    #conservatory {
        backdrop-filter: blur(12px) saturate(150%);
        -webkit-backdrop-filter: blur(12px) saturate(150%);
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 0 clamp(1.5rem, 5vw, 3rem);
    }

    #archive {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 0 clamp(1.5rem, 5vw, 3rem);
    }

    .conservatory-section {
        min-height: auto;
        padding: 15vh 0 5vh;
    }

    .conservatory-section:first-child {
        padding-top: 10vh;
    }

    .archive-section {
        padding: 5vh 0;
    }

    .archive-section:first-child {
        padding-top: 5vh;
    }

    .display-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .display-heading {
        font-size: clamp(1.5rem, 7vw, 2.5rem);
    }

    .ambient-orb {
        filter: blur(60px);
    }

    .ambient-orb-1,
    .ambient-orb-2,
    .ambient-orb-3,
    .ambient-orb-4 {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .specimen-card {
        padding: 1.2rem;
        border-radius: 14px;
    }

    .narrative-text {
        font-size: 0.95rem;
    }

    .probability-flower {
        transform: scale(0.8);
    }

    .fern-illustration {
        transform: scale(0.75);
    }
}