/* lupine.day - Watercolor Trail Journal
   Colors: Deep Forest #2c4a3a, Trail Green #3d6b4f, Sage Mist #5a8a6b,
           Lupine Violet #7b6b8a, Parchment #f5f0e8, Worn Paper #e8dcc8,
           Dawn Blush #c8a88a, Night Canopy #1a2e22, Pencil Gray #6b6b5e
   Fonts: Cormorant Garamond (display), Lora (body), Caveat (annotations)
*/

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

:root {
    --deep-forest: #2c4a3a;
    --trail-green: #3d6b4f;
    --sage-mist: #5a8a6b;
    --lupine-violet: #7b6b8a;
    --parchment: #f5f0e8;
    --worn-paper: #e8dcc8;
    --dawn-blush: #c8a88a;
    --night-canopy: #1a2e22;
    --pencil-gray: #6b6b5e;
    --text-dark: #3a3a32;
    --warm-parchment: #d4cbb8;
    --text-light: #c8c0a8;
    --wash-opacity-1: 0.1;
    --wash-opacity-2: 0.08;
    --wash-opacity-3: 0.06;
    --wash-hue: 0;
    --section-progress: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(16px, 1.1vw, 19px);
    line-height: 1.72;
    color: var(--text-dark);
    background-color: var(--parchment);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Paper Texture Overlay */
.paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    mix-blend-mode: overlay;
    background:
        repeating-conic-gradient(
            rgba(107, 107, 94, 0.1) 0% 25%,
            transparent 0% 50%
        ) 0 0 / 4px 4px;
}

/* Watercolor Wash Layers */
.wash-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    transition: opacity 2s ease, background 3s ease;
}

.wash-layer-1 {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(90, 138, 107, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(200, 168, 138, 0.08) 0%, transparent 50%);
    opacity: var(--wash-opacity-1);
}

.wash-layer-2 {
    background:
        radial-gradient(ellipse at 60% 40%, rgba(61, 107, 79, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 20% 80%, rgba(123, 107, 138, 0.06) 0%, transparent 45%);
    opacity: var(--wash-opacity-2);
}

.wash-layer-3 {
    background:
        radial-gradient(ellipse at 80% 15%, rgba(200, 192, 168, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 10% 50%, rgba(90, 138, 107, 0.08) 0%, transparent 60%);
    opacity: var(--wash-opacity-3);
    mix-blend-mode: multiply;
}

.wash-layer-4 {
    background:
        conic-gradient(from 45deg at 50% 50%, rgba(61, 107, 79, 0.04) 0deg, transparent 90deg, rgba(200, 168, 138, 0.04) 180deg, transparent 270deg);
    opacity: 0.15;
    mix-blend-mode: multiply;
}

/* Trail SVG */
.trail-svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 960px;
    height: 6500px;
    z-index: 1;
    pointer-events: none;
}

.trail-path {
    stroke-dasharray: 4 8;
    stroke-dashoffset: 0;
}

/* Main Container */
.container {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    z-index: 2;
}

/* Sections */
.section {
    position: relative;
    padding: 80px 0;
}

/* Section: Trailhead */
.section-trailhead {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 15%;
}

.trailhead-mountains {
    position: absolute;
    bottom: 0;
    left: -5%;
    width: 110%;
    height: 300px;
    z-index: 0;
}

.trailhead-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.domain-name {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: clamp(48px, 8vw, 120px);
    color: var(--deep-forest);
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.trailhead-tagline {
    margin-top: 12px;
    margin-left: 4px;
}

/* Contour Lines */
.contour-lines {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.trailhead-contours {
    top: 20%;
    right: 5%;
    width: 300px;
    height: 300px;
}

.ridge-contours {
    top: 40%;
    left: 10%;
    width: 250px;
    height: 250px;
}

.contour {
    position: absolute;
    border: 1px solid var(--trail-green);
    border-radius: 50%;
    opacity: 0.06;
}

.contour-1 {
    width: 200px;
    height: 160px;
    top: 20%;
    left: 10%;
    border-top-color: transparent;
    border-left-color: transparent;
    transform: rotate(25deg);
}

.contour-2 {
    width: 260px;
    height: 200px;
    top: 10%;
    left: 5%;
    border-bottom-color: transparent;
    border-right-color: transparent;
    transform: rotate(-15deg);
}

.contour-3 {
    width: 160px;
    height: 120px;
    top: 35%;
    left: 25%;
    border-top-color: transparent;
    border-right-color: transparent;
    transform: rotate(40deg);
}

.contour-4 {
    width: 180px;
    height: 140px;
    top: 20%;
    left: 15%;
    border-bottom-color: transparent;
    border-left-color: transparent;
    transform: rotate(-20deg);
}

.contour-5 {
    width: 220px;
    height: 180px;
    top: 5%;
    left: 5%;
    border-top-color: transparent;
    border-right-color: transparent;
    transform: rotate(35deg);
}

/* Mountain Silhouettes */
.mountain-silhouette {
    pointer-events: none;
}

.ridge-divider {
    width: 110%;
    height: 200px;
    margin-left: -5%;
    margin-bottom: 40px;
}

/* Section Titles */
.section-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: clamp(28px, 5vw, 72px);
    color: var(--deep-forest);
    letter-spacing: 0.04em;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.section-title-light {
    color: var(--worn-paper);
}

/* Annotations (Caveat) */
.annotation {
    font-family: 'Caveat', cursive;
    font-size: 15px;
    color: #6b8a6b;
    letter-spacing: 0.02em;
}

/* Waypoint System */
.waypoint {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 80px;
    gap: 0;
}

.waypoint-left {
    flex-direction: row;
    margin-left: 15%;
}

.waypoint-right {
    flex-direction: row-reverse;
    margin-left: 55%;
}

.waypoint-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--sage-mist);
    border: 2px solid var(--parchment);
    flex-shrink: 0;
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.waypoint.visible .waypoint-marker {
    opacity: 1;
    transform: scale(1);
}

.waypoint-line {
    width: 0;
    height: 1px;
    background: var(--trail-green);
    opacity: 0.3;
    align-self: center;
    margin-top: 7px;
    transition: width 0.3s ease-out 0.15s;
}

.waypoint.visible .waypoint-line {
    width: 30px;
}

.waypoint-panel {
    background: rgba(245, 240, 232, 0.85);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 3px;
    padding: 24px 28px;
    max-width: min(420px, 38vw);
    box-shadow: 0 2px 12px rgba(61, 107, 79, 0.08);
    opacity: 0;
    transition: opacity 0.5s ease-out 0.25s, transform 0.5s ease-out 0.25s;
}

.waypoint-left .waypoint-panel {
    transform: translateX(-20px);
}

.waypoint-right .waypoint-panel {
    transform: translateX(20px);
}

.waypoint.visible .waypoint-panel {
    opacity: 1;
    transform: translateX(0);
}

.waypoint-panel-dusk {
    background: rgba(26, 46, 34, 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.waypoint-marker-dusk {
    background: var(--text-light);
    border-color: var(--night-canopy);
}

.waypoint-line-dusk {
    background: var(--text-light);
    opacity: 0.2;
}

.waypoint-label {
    display: block;
    margin-bottom: 8px;
}

.waypoint-label-dusk {
    color: var(--sage-mist);
}

.panel-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: clamp(20px, 2.5vw, 28px);
    color: var(--deep-forest);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 0.4s ease-out 0.45s;
}

.waypoint.visible .panel-title {
    opacity: 1;
}

.panel-title-dusk {
    color: var(--worn-paper);
}

.panel-text {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.72;
    color: var(--text-dark);
    max-width: 42ch;
    margin-bottom: 12px;
    opacity: 0;
    transition: opacity 0.4s ease-out 0.55s;
}

.panel-text:last-child {
    margin-bottom: 0;
}

.waypoint.visible .panel-text {
    opacity: 1;
}

.panel-text-dusk {
    color: var(--text-light);
}

/* Morning Section */
.section-morning {
    padding-top: 120px;
    min-height: 150vh;
}

/* Ridge Section */
.section-ridge {
    padding-top: 60px;
    min-height: 150vh;
}

/* Alpine Garden Section */
.section-alpine {
    padding-top: 120px;
    min-height: 150vh;
}

/* Specimen Garden */
.specimen-garden {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 60px 0 80px;
    flex-wrap: wrap;
}

.specimen-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.specimen-branch.visible {
    opacity: 1;
    transform: translateY(0);
}

.branch-left { transition-delay: 0s; }
.branch-center { transition-delay: 0.2s; }
.branch-right { transition-delay: 0.4s; }

.specimen-marker {
    width: 12px;
    height: 12px;
    background: var(--sage-mist);
    border: 2px solid var(--parchment);
}

.specimen-card {
    background: rgba(245, 240, 232, 0.9);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 3px;
    padding: 20px;
    max-width: 200px;
    box-shadow: 0 2px 12px rgba(61, 107, 79, 0.08);
    text-align: center;
}

.specimen-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
    margin-bottom: 12px;
}

.specimen-name {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-style: italic;
    font-size: 16px;
    color: var(--deep-forest);
    margin-bottom: 8px;
}

.specimen-note {
    font-size: 13px;
    line-height: 1.5;
    color: #6b8a6b;
}

/* Dusk Section */
.section-dusk {
    min-height: 100vh;
    padding-top: 120px;
    padding-bottom: 120px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(26, 46, 34, 0.3) 30%,
        rgba(26, 46, 34, 0.7) 60%,
        var(--night-canopy) 100%
    );
    border-radius: 0;
    margin-left: -50vw;
    margin-right: -50vw;
    padding-left: calc(50vw - 480px + 24px);
    padding-right: calc(50vw - 480px + 24px);
    position: relative;
    left: 50%;
    right: 50%;
    width: 100vw;
}

.dusk-closing {
    text-align: center;
    margin-top: 120px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

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

.closing-text {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(22px, 3vw, 36px);
    color: var(--warm-parchment);
    letter-spacing: 0.03em;
    max-width: 500px;
    margin: 0 auto 40px;
    line-height: 1.5;
}

.trail-terminus {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--trail-green);
    opacity: 0.5;
    margin: 0 auto;
}

/* Lupine Flowers (CSS-drawn) */
.lupine {
    position: relative;
    width: 14px;
    height: 70px;
}

.lupine-stem {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 1.5px;
    height: 100%;
    background: var(--sage-mist);
}

.lupine .petal {
    position: absolute;
    width: 6px;
    height: 3.5px;
    border-radius: 50%;
    display: block;
    bottom: calc(8px + var(--i) * 5px);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.lupine .petal:nth-child(odd) {
    left: 1px;
}

.lupine .petal:nth-child(even) {
    left: 7px;
}

/* Petal colors: deeper at bottom, lighter at top */
.lupine .petal:nth-child(2) { background: #6b5a7a; }
.lupine .petal:nth-child(3) { background: #6b5a7a; }
.lupine .petal:nth-child(4) { background: #7b6b8a; }
.lupine .petal:nth-child(5) { background: #7b6b8a; }
.lupine .petal:nth-child(6) { background: #7b6b8a; }
.lupine .petal:nth-child(7) { background: #887896; }
.lupine .petal:nth-child(8) { background: #887896; }
.lupine .petal:nth-child(9) { background: #9a88a8; }
.lupine .petal:nth-child(10) { background: #9a88a8; }
.lupine .petal:nth-child(11) { background: #a898b4; }
.lupine .petal:nth-child(12) { background: #a898b4; }

.lupine.bloomed .petal {
    opacity: 1;
    transform: scale(1);
}

/* Stagger petal animation */
.lupine.bloomed .petal:nth-child(2) { transition-delay: 0ms; }
.lupine.bloomed .petal:nth-child(3) { transition-delay: 60ms; }
.lupine.bloomed .petal:nth-child(4) { transition-delay: 120ms; }
.lupine.bloomed .petal:nth-child(5) { transition-delay: 180ms; }
.lupine.bloomed .petal:nth-child(6) { transition-delay: 240ms; }
.lupine.bloomed .petal:nth-child(7) { transition-delay: 300ms; }
.lupine.bloomed .petal:nth-child(8) { transition-delay: 360ms; }
.lupine.bloomed .petal:nth-child(9) { transition-delay: 420ms; }
.lupine.bloomed .petal:nth-child(10) { transition-delay: 480ms; }
.lupine.bloomed .petal:nth-child(11) { transition-delay: 540ms; }
.lupine.bloomed .petal:nth-child(12) { transition-delay: 600ms; }

/* Hero Lupine */
.lupine-hero {
    height: 120px;
    width: 20px;
    flex-shrink: 0;
}

.lupine-hero .petal {
    width: 8px;
    height: 5px;
    bottom: calc(12px + var(--i) * 8px);
}

.lupine-hero .petal:nth-child(odd) { left: 0; }
.lupine-hero .petal:nth-child(even) { left: 12px; }

/* Trail-side lupines */
.lupine-trail {
    position: absolute;
    z-index: 3;
}

.lupine-trail-1 {
    left: 35%;
    bottom: 25%;
}

.lupine-trail-2 {
    right: 30%;
    bottom: 15%;
}

.lupine-trail-3 {
    left: 40%;
    bottom: 40%;
}

/* Specimen lupine (smaller) */
.lupine-specimen {
    height: 80px;
    width: 14px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .waypoint-left,
    .waypoint-right {
        margin-left: 5%;
        flex-direction: row;
    }

    .waypoint-right {
        flex-direction: row;
    }

    .waypoint-panel {
        max-width: calc(100% - 60px);
    }

    .section-trailhead {
        padding-left: 5%;
    }

    .specimen-garden {
        flex-direction: column;
        align-items: center;
    }

    .section-dusk {
        padding-left: 24px;
        padding-right: 24px;
    }

    .trailhead-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .domain-name {
        font-size: clamp(36px, 10vw, 60px);
    }

    .waypoint-left,
    .waypoint-right {
        margin-left: 2%;
    }
}
