/* ============================
   lupin.day - Styles
   McBling aesthetic meets Alpine Grandeur
   ============================ */

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

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

body {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    color: #F0EBF4;
    background-color: #1A0F1B;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.02em;
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 5vw, 3rem);
    color: #F5E6D8;
    margin-bottom: 1.2rem;
}

.body-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    color: #F0EBF4;
    margin-bottom: 1rem;
}

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

/* --- Hero Section --- */
.section-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(170deg, #1A0F1B 0%, #2D1B2E 30%, #8B6F9E 65%, #B76E79 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Mountain Layers (Hero) */
.mountain-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    transition: transform 0.1s linear;
}

.mountain-layer-1 {
    clip-path: polygon(0% 85%, 8% 55%, 15% 70%, 25% 35%, 35% 60%, 42% 30%, 52% 50%, 60% 25%, 70% 45%, 78% 20%, 88% 50%, 95% 35%, 100% 55%, 100% 100%, 0% 100%);
    background: #1A0F1B;
    opacity: 0.6;
    z-index: 4;
}

.mountain-layer-2 {
    clip-path: polygon(0% 70%, 10% 45%, 20% 55%, 30% 28%, 38% 48%, 50% 20%, 62% 42%, 72% 18%, 80% 38%, 90% 25%, 100% 45%, 100% 100%, 0% 100%);
    background: #2D1B2E;
    opacity: 0.45;
    z-index: 3;
}

.mountain-layer-3 {
    clip-path: polygon(0% 65%, 12% 40%, 22% 50%, 35% 22%, 45% 40%, 55% 15%, 65% 35%, 75% 12%, 85% 30%, 100% 38%, 100% 100%, 0% 100%);
    background: #8B6F9E;
    opacity: 0.25;
    z-index: 2;
}

.mountain-layer-4 {
    clip-path: polygon(0% 60%, 15% 35%, 28% 45%, 40% 18%, 55% 32%, 68% 10%, 80% 28%, 92% 15%, 100% 30%, 100% 100%, 0% 100%);
    background: #B76E79;
    opacity: 0.15;
    z-index: 1;
}

/* Hero Lupin SVG */
.hero-lupin-container {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -55%);
    width: 120px;
    height: 320px;
    opacity: 0.5;
    pointer-events: none;
}

.hero-lupin-svg {
    width: 100%;
    height: 100%;
}

/* Path draw animation for lupin */
.lupin-stem,
.lupin-leaf,
.lupin-floret,
.lupin-tip {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: pathDraw 3s ease forwards;
}

.lupin-stem { animation-delay: 0s; }
.lupin-leaf-1 { animation-delay: 0.5s; stroke-dasharray: 100; stroke-dashoffset: 100; }
.lupin-leaf-2 { animation-delay: 0.7s; stroke-dasharray: 100; stroke-dashoffset: 100; }
.lupin-leaf-3 { animation-delay: 0.9s; stroke-dasharray: 100; stroke-dashoffset: 100; }
.lupin-floret-1 { animation-delay: 1.0s; stroke-dasharray: 150; stroke-dashoffset: 150; }
.lupin-floret-2 { animation-delay: 1.15s; stroke-dasharray: 150; stroke-dashoffset: 150; }
.lupin-floret-3 { animation-delay: 1.3s; stroke-dasharray: 150; stroke-dashoffset: 150; }
.lupin-floret-4 { animation-delay: 1.45s; stroke-dasharray: 150; stroke-dashoffset: 150; }
.lupin-floret-5 { animation-delay: 1.6s; stroke-dasharray: 150; stroke-dashoffset: 150; }
.lupin-floret-6 { animation-delay: 1.75s; stroke-dasharray: 150; stroke-dashoffset: 150; }
.lupin-floret-7 { animation-delay: 1.9s; stroke-dasharray: 150; stroke-dashoffset: 150; }
.lupin-floret-8 { animation-delay: 2.05s; stroke-dasharray: 150; stroke-dashoffset: 150; }
.lupin-tip { animation-delay: 2.2s; stroke-dasharray: 50; stroke-dashoffset: 50; }

@keyframes pathDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 10vw, 6.5rem);
    color: #F0EBF4;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.letter {
    display: inline-block;
    opacity: 0;
    animation: letterFadeIn 0.6s ease forwards;
}

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

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: #F5E6D8;
    letter-spacing: 0.05em;
    opacity: 0;
    animation: subtitleFade 1.5s ease 2.8s forwards;
}

@keyframes subtitleFade {
    from { opacity: 0; }
    to { opacity: 0.85; }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: subtitleFade 1s ease 3.5s forwards;
}

.scroll-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #D4AF37;
}

.scroll-arrow {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* --- Timeline Container --- */
#timeline-container {
    position: relative;
    width: 100%;
    padding-top: clamp(4rem, 8vh, 6rem);
    padding-bottom: clamp(4rem, 8vh, 6rem);
}

/* Timeline Spine SVG */
.timeline-spine {
    position: absolute;
    top: 0;
    left: 33%;
    width: 2px;
    height: 100%;
    z-index: 1;
    overflow: visible;
}

#spine-line {
    stroke: #B76E79;
    stroke-width: 2;
    stroke-dasharray: var(--spine-total-length, 5000);
    stroke-dashoffset: var(--spine-offset, 5000);
    transition: stroke-dashoffset 0.05s linear;
}

/* --- Timeline Sections --- */
.timeline-section {
    position: relative;
    padding: clamp(4rem, 8vh, 8rem) 0;
}

/* Rhinestone dot pattern overlay */
.rhinestone-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(circle, rgba(212, 175, 55, 0.10) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    background-position: 6px 6px;
}

/* Mountain ridge dividers */
.mountain-ridge {
    position: absolute;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 0;
    pointer-events: none;
}

.mountain-ridge-top {
    top: 0;
    clip-path: polygon(0% 100%, 5% 60%, 12% 80%, 20% 40%, 30% 65%, 40% 25%, 50% 50%, 60% 20%, 70% 45%, 80% 15%, 88% 40%, 95% 30%, 100% 50%, 100% 100%);
    background: linear-gradient(180deg, rgba(139, 111, 158, 0.15) 0%, transparent 100%);
}

/* Section backgrounds (warming gradient) */
#section-lower-slopes {
    background: linear-gradient(170deg, #1A0F1B 0%, #2D1B2E 60%, rgba(139, 111, 158, 0.15) 100%);
}

#section-alpine-meadow {
    background: linear-gradient(170deg, #2D1B2E 0%, rgba(139, 111, 158, 0.2) 50%, rgba(199, 133, 74, 0.08) 100%);
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
}

#section-summit-ridge {
    background: linear-gradient(170deg, #2D1B2E 0%, rgba(139, 111, 158, 0.25) 40%, rgba(199, 133, 74, 0.15) 100%);
    clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%);
    border-bottom: 1px solid #C7854A;
}

/* --- Timeline Nodes --- */
.timeline-node {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: clamp(8rem, 15vh, 12rem);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.timeline-node.visible {
    opacity: 1;
    transform: translateX(0) !important;
}

/* Node positioning: Right panels */
.node-right {
    margin-left: 33%;
    padding-left: 2rem;
    transform: translateX(40px);
}

.node-right .node-medallion {
    flex-shrink: 0;
    margin-right: 1.5rem;
    transform: translateX(-50%);
}

.node-right .node-panel {
    max-width: 55vw;
    width: 100%;
}

/* Node positioning: Left panels */
.node-left {
    flex-direction: row-reverse;
    margin-right: calc(100% - 33%);
    padding-right: 2rem;
    justify-content: flex-start;
    transform: translateX(-40px);
}

.node-left .node-medallion {
    flex-shrink: 0;
    margin-left: 1.5rem;
    transform: translateX(50%);
}

.node-left .node-panel {
    max-width: 30vw;
    width: 100%;
    text-align: right;
}

/* Node Medallion */
.node-medallion {
    position: relative;
    width: 48px;
    height: 48px;
}

.node-medallion::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(212, 175, 55, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

/* Glass Card Panel */
.glass-card {
    background: rgba(45, 27, 46, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(45, 27, 46, 0.7) 0%, rgba(139, 111, 158, 0.3) 100%);
    z-index: -1;
    border-radius: 8px;
}

/* Rich panels (Summit Ridge section) */
.panel-rich {
    border-width: 2px;
}

/* Metallic border shimmer */
.metallic-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #D4AF37, #B76E79, #D4AF37);
    background-size: 200% 100%;
    animation: metallicShimmer 8s linear infinite;
}

@keyframes metallicShimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* --- Pull Quote --- */
.pull-quote {
    position: relative;
    margin: clamp(3rem, 6vh, 5rem) 0;
    padding-left: 36%;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease;
}

.pull-quote.visible {
    opacity: 1;
}

.quote-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-style: italic;
    color: #F5E6D8;
    text-shadow: 0 0 30px rgba(183, 110, 121, 0.4);
    line-height: 1.5;
    border: none;
    padding: 0;
    margin: 0;
}

/* --- Chain Link Dividers --- */
.chain-divider {
    position: relative;
    z-index: 2;
    width: 60%;
    margin: clamp(2rem, 4vh, 3rem) auto;
    opacity: 0.5;
}

/* --- Panoramic Mountains (Summit Ridge) --- */
.panoramic-mountains {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.pano-mountain {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
}

.pano-mountain-1 {
    height: 60%;
    clip-path: polygon(0% 80%, 10% 50%, 18% 65%, 28% 30%, 38% 50%, 48% 20%, 58% 40%, 68% 15%, 78% 35%, 88% 10%, 95% 30%, 100% 20%, 100% 100%, 0% 100%);
    background: rgba(26, 15, 27, 0.6);
    z-index: 5;
}

.pano-mountain-2 {
    height: 65%;
    clip-path: polygon(0% 70%, 8% 42%, 16% 55%, 26% 25%, 36% 45%, 46% 15%, 56% 35%, 66% 10%, 76% 30%, 86% 8%, 94% 28%, 100% 15%, 100% 100%, 0% 100%);
    background: rgba(45, 27, 46, 0.4);
    z-index: 4;
}

.pano-mountain-3 {
    height: 70%;
    clip-path: polygon(0% 65%, 12% 38%, 22% 50%, 32% 22%, 42% 40%, 52% 12%, 62% 30%, 72% 8%, 82% 25%, 92% 5%, 100% 18%, 100% 100%, 0% 100%);
    background: rgba(139, 111, 158, 0.2);
    z-index: 3;
}

.pano-mountain-4 {
    height: 75%;
    clip-path: polygon(0% 58%, 14% 32%, 24% 44%, 36% 18%, 48% 36%, 58% 8%, 68% 26%, 78% 4%, 88% 20%, 100% 12%, 100% 100%, 0% 100%);
    background: rgba(183, 110, 121, 0.12);
    z-index: 2;
}

.pano-mountain-5 {
    height: 80%;
    clip-path: polygon(0% 52%, 16% 28%, 28% 38%, 40% 14%, 52% 30%, 62% 5%, 74% 22%, 84% 2%, 92% 16%, 100% 8%, 100% 100%, 0% 100%);
    background: rgba(199, 133, 74, 0.08);
    z-index: 1;
}

/* --- Peak Section --- */
.section-peak {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(170deg, #2D1B2E 0%, #8B6F9E 30%, #F0EBF4 80%);
    overflow: hidden;
    padding: 4rem 2rem;
}

.peak-mountain-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    clip-path: polygon(0% 60%, 15% 35%, 30% 50%, 45% 20%, 55% 35%, 70% 10%, 80% 30%, 90% 18%, 100% 35%, 100% 100%, 0% 100%);
    background: rgba(45, 27, 46, 0.05);
    z-index: 0;
}

.peak-medallion {
    position: relative;
    z-index: 2;
    margin-bottom: 3rem;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.peak-medallion.visible {
    opacity: 1;
}

.peak-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 700px;
    opacity: 0;
    transition: opacity 2s ease;
}

.peak-content.visible {
    opacity: 1;
}

.peak-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 6vw, 4rem);
    color: #2D1B2E;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

/* Inverted lupin */
.inverted-lupin-container {
    position: relative;
    z-index: 2;
    margin-top: 3rem;
    width: 120px;
    height: 280px;
    transform: rotate(180deg);
    opacity: 0;
    transition: opacity 2s ease 0.5s;
}

.inverted-lupin-container.visible {
    opacity: 1;
}

.inv-lupin-stem,
.inv-lupin-floret {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
}

.inverted-lupin-container.drawing .inv-lupin-stem,
.inverted-lupin-container.drawing .inv-lupin-floret {
    animation: pathDraw 3s ease forwards;
}

.inverted-lupin-container.drawing .inv-floret-1 { animation-delay: 0.5s; stroke-dasharray: 100; stroke-dashoffset: 100; }
.inverted-lupin-container.drawing .inv-floret-2 { animation-delay: 0.8s; stroke-dasharray: 100; stroke-dashoffset: 100; }
.inverted-lupin-container.drawing .inv-floret-3 { animation-delay: 1.1s; stroke-dasharray: 100; stroke-dashoffset: 100; }
.inverted-lupin-container.drawing .inv-floret-4 { animation-delay: 1.4s; stroke-dasharray: 100; stroke-dashoffset: 100; }
.inverted-lupin-container.drawing .inv-floret-5 { animation-delay: 1.7s; stroke-dasharray: 100; stroke-dashoffset: 100; }

.peak-domain {
    position: relative;
    z-index: 2;
    margin-top: 4rem;
    opacity: 0;
    transition: opacity 2s ease 1s;
}

.peak-domain.visible {
    opacity: 1;
}

.peak-domain-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8B6F9E;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .timeline-spine {
        left: 1.5rem;
    }

    .node-right {
        margin-left: 3rem;
        padding-left: 1rem;
    }

    .node-right .node-panel {
        max-width: calc(100vw - 5rem);
    }

    .node-left {
        flex-direction: row;
        margin-right: 0;
        margin-left: 3rem;
        padding-right: 0;
        padding-left: 1rem;
        justify-content: flex-start;
    }

    .node-left .node-medallion {
        margin-left: 0;
        margin-right: 1rem;
        transform: translateX(-50%);
    }

    .node-left .node-panel {
        max-width: calc(100vw - 5rem);
        text-align: left;
    }

    .pull-quote {
        padding-left: 4rem;
        padding-right: 1rem;
    }

    .hero-lupin-container {
        width: 80px;
        height: 220px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .glass-card {
        padding: 1.2rem;
    }

    .chain-divider {
        width: 80%;
    }
}
