/* ppuzzl.bid - The Botanist's Puzzle */
/* Creamy Pastel Greenhouse Palette */

:root {
    --paper: #f5f0e8;
    --ink: #3d3229;
    --sage: #7a7263;
    --petal: #e8b4b8;
    --leaf: #a8c5a0;
    --sky: #b5c8d9;
    --saffron: #d4b876;
    --umber: #6b4e3d;
    --compass: #b8a99a;
    --pencil: #c8bfb3;
    --space-unit: calc(1.618rem + 0.5vw);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.2vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cellipse cx='8' cy='12' rx='3' ry='2' fill='%23e8b4b8' opacity='0.7'/%3E%3Cline x1='8' y1='0' x2='8' y2='12' stroke='%236b4e3d' stroke-width='1' stroke-linecap='round'/%3E%3C/svg%3E") 8 14, auto;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ========================================
   COMPASS ROSE NAVIGATION
   ======================================== */

.compass-nav {
    position: fixed;
    top: calc(var(--space-unit) * 1.2);
    left: calc(var(--space-unit) * 1.2);
    z-index: 100;
}

.compass-icon {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.compass-nav:hover .compass-icon {
    opacity: 1;
    transform: rotate(45deg);
}

.compass-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease 0.1s;
}

.compass-nav:hover .compass-menu {
    pointer-events: auto;
    opacity: 1;
}

.compass-link {
    position: absolute;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--umber);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease, transform 0.3s ease;
    transform: translate(-50%, -50%);
}

.compass-link:hover {
    color: var(--petal);
}

.compass-n { top: -40px; left: 0; }
.compass-e { top: 0; left: 50px; }
.compass-s { top: 40px; left: 0; }
.compass-w { top: 0; left: -50px; }

/* ========================================
   CURSOR TRAIL
   ======================================== */

.cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
}

.trail-drop {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: trailFade 2s ease-out forwards;
}

@keyframes trailFade {
    0% {
        transform: scale(0.5);
        opacity: 0.15;
    }
    50% {
        transform: scale(1);
        opacity: 0.1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ========================================
   POLLEN PARTICLES
   ======================================== */

.pollen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.pollen {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--saffron);
    pointer-events: none;
}

@keyframes pollenDrift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(15px, -20px) rotate(90deg);
    }
    50% {
        transform: translate(-10px, -40px) rotate(180deg);
    }
    75% {
        transform: translate(20px, -25px) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* ========================================
   PENCIL GUIDELINES
   ======================================== */

.pencil-line {
    position: absolute;
    border-top: 0.5px solid var(--pencil);
    opacity: 0.35;
    pointer-events: none;
    z-index: 1;
}

.pencil-line-d {
    transform-origin: left center;
}

/* ========================================
   SECTION BASICS
   ======================================== */

.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.section-mask-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15vh;
    background: linear-gradient(to bottom, transparent, var(--paper));
    pointer-events: none;
    z-index: 10;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--ink);
}

h1 {
    font-size: clamp(2.8rem, 6vw, 5.2rem);
}

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

.annotation {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 1.1rem);
    color: var(--sage);
}

.card-mono {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: var(--compass);
    opacity: 0.6;
}

/* ========================================
   SECTION 1: THE UNFURLING
   ======================================== */

.section-unfurling {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: calc(var(--space-unit) * 3);
}

.unfurling-content {
    position: relative;
    z-index: 5;
    max-width: 30%;
    padding-left: calc(var(--space-unit) * 2);
}

.title-line {
    display: block;
}

.title-line-italic {
    font-style: italic;
    font-weight: 400;
    color: var(--umber);
}

.unfurling-subtitle {
    margin-top: calc(var(--space-unit) * 0.8);
    opacity: 0.8;
}

.unfurling-petal {
    position: absolute;
    right: -5%;
    top: 5%;
    width: 65%;
    height: 90%;
    z-index: 2;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.petal-svg {
    width: 100%;
    height: 100%;
}

.pressed-flower {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.pressed-flower-1 {
    bottom: 15%;
    left: 8%;
}

.pressed-flower-2 {
    top: 10%;
    right: 5%;
}

.pressed-flower-3 {
    bottom: 20%;
    right: 10%;
}

/* ========================================
   SECTION 2: THE SCATTER
   ======================================== */

.section-scatter {
    padding: calc(var(--space-unit) * 4) calc(var(--space-unit) * 2);
    min-height: 120vh;
}

.scatter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8vw;
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--space-unit) * 3) 0;
    position: relative;
    z-index: 5;
}

.puzzle-card {
    position: relative;
    background: var(--paper);
    padding: calc(var(--space-unit) * 2.5);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.6s ease;
    box-shadow: 0 4px 16px rgba(61, 50, 41, 0.06);
}

.puzzle-card-1 {
    clip-path: url(#puzzle-piece-1);
    transform: rotate(-1.5deg);
}

.puzzle-card-2 {
    clip-path: url(#puzzle-piece-2);
    transform: rotate(2deg);
}

.puzzle-card-3 {
    clip-path: url(#puzzle-piece-3);
    transform: rotate(1deg);
}

.puzzle-card-4 {
    clip-path: url(#puzzle-piece-4);
    transform: rotate(-2.5deg);
}

.puzzle-card:hover {
    transform: translateY(-4px) rotate(0deg);
    box-shadow: 0 8px 32px rgba(61, 50, 41, 0.12);
}

.card-inner {
    position: relative;
    z-index: 2;
}

.card-watercolor-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.card-annotation {
    display: block;
    margin-bottom: calc(var(--space-unit) * 0.5);
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.puzzle-card:hover .card-annotation {
    opacity: 1;
}

.card-title {
    margin-bottom: calc(var(--space-unit) * 0.6);
    font-weight: 600;
}

.card-body {
    color: var(--sage);
    margin-bottom: calc(var(--space-unit) * 0.8);
}

.vine-svg {
    position: absolute;
    height: 100%;
    width: 60px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
}

.vine-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0.05s linear;
}

/* ========================================
   SECTION 3: THE BLOOM
   ======================================== */

.section-bloom {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.bloom-wash {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 30% 40%, rgba(232, 180, 184, 0.15), transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(168, 197, 160, 0.12), transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(181, 200, 217, 0.1), transparent 60%),
        radial-gradient(ellipse at 40% 70%, rgba(212, 184, 118, 0.08), transparent 45%);
    z-index: 1;
}

.bloom-content {
    position: relative;
    z-index: 5;
    max-width: 38ch;
    text-align: left;
    padding: calc(var(--space-unit) * 2);
}

.bloom-text {
    margin-bottom: calc(var(--space-unit) * 1.2);
    color: var(--ink);
}

.bloom-text:last-of-type {
    margin-bottom: calc(var(--space-unit) * 0.8);
}

.bloom-annotation {
    display: block;
    text-align: right;
    opacity: 0.6;
}

.bloom-leaf {
    position: absolute;
    right: 8%;
    bottom: 10%;
    z-index: 3;
    opacity: 0.7;
    transition: transform 0.8s ease;
}

/* ========================================
   SECTION 4: THE ROOT SYSTEM
   ======================================== */

.section-root {
    min-height: 120vh;
    padding: calc(var(--space-unit) * 4) calc(var(--space-unit) * 2);
    position: relative;
}

.root-system {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    min-height: 80vh;
}

.root-vine-svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.root-text {
    position: relative;
    z-index: 5;
    max-width: 340px;
    padding: calc(var(--space-unit) * 1.5);
}

.root-text-1 {
    margin-left: 5%;
    padding-top: calc(var(--space-unit) * 6);
}

.root-text-2 {
    margin-left: auto;
    margin-right: 5%;
    padding-top: calc(var(--space-unit) * 4);
}

.root-text-3 {
    margin-left: 10%;
    padding-top: calc(var(--space-unit) * 4);
}

.root-heading {
    margin-bottom: calc(var(--space-unit) * 0.5);
    font-style: italic;
    font-weight: 400;
}

.root-body {
    color: var(--sage);
    margin-bottom: calc(var(--space-unit) * 0.4);
}

.water-droplet {
    position: absolute;
    width: 10px;
    height: 12px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6), transparent);
    border: 0.5px solid rgba(181, 200, 217, 0.3);
    z-index: 6;
    pointer-events: none;
}

.water-droplet-sm {
    width: 6px;
    height: 8px;
}

/* ========================================
   SECTION 5: THE SEED
   ======================================== */

.section-seed {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: calc(var(--space-unit) * 4);
}

.seed-content {
    text-align: center;
    max-width: 500px;
}

.seed-illustration {
    margin: 0 auto calc(var(--space-unit) * 2);
    transition: transform 0.8s ease;
}

.seed-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    line-height: 1.5;
    color: var(--ink);
    margin-bottom: calc(var(--space-unit) * 1);
}

.seed-annotation {
    display: block;
    opacity: 0.5;
}

/* ========================================
   BOTANICAL ELEMENT INTERACTIONS
   ======================================== */

.botanical-element {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .unfurling-content {
        max-width: 60%;
        padding-left: var(--space-unit);
    }

    .unfurling-petal {
        width: 80%;
        right: -15%;
        opacity: 0.6;
    }

    .scatter-grid {
        grid-template-columns: 1fr;
        gap: 6vw;
    }

    .puzzle-card {
        clip-path: none;
        transform: rotate(0deg);
        border-radius: 4px;
    }

    .puzzle-card:hover {
        transform: translateY(-2px);
    }

    .root-text {
        max-width: 100%;
    }

    .root-text-2 {
        margin-left: 0;
    }

    .bloom-leaf {
        display: none;
    }

    .compass-nav {
        top: var(--space-unit);
        left: var(--space-unit);
    }
}
