/* ============================================
   lupine.day -- Styles
   Coastal-blend palette, grainy-textured aesthetic
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --sky-slate: #7A8FA0;
    --sand-cream: #E8DCC8;
    --mountain-charcoal: #3A3A3A;
    --lupine-purple: #6A5090;
    --cliff-gray: #9A9A90;
    --ocean-foam: #B8C8CA;
    --deep-earth: #2A2A28;

    --font-headline: 'Space Grotesk', sans-serif;
    --font-body: 'Lora', serif;
    --font-caption: 'Inconsolata', monospace;

    --column-width: 720px;
    --scroll: 0;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.8;
    color: var(--mountain-charcoal);
    background-color: var(--sand-cream);
    overflow-x: hidden;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Grain Overlay --- */
#grain-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, var(--sky-slate) 0%, var(--ocean-foam) 40%, var(--sand-cream) 100%);
}

#hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    will-change: transform;
}

#topo-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#mountain-ridge {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 300px;
}

#mountain-path {
    stroke-dasharray: 5000;
    stroke-dashoffset: 5000;
    animation: drawMountain 2.5s ease-out forwards;
    fill: var(--mountain-charcoal);
    stroke: var(--mountain-charcoal);
    stroke-width: 1;
}

@keyframes drawMountain {
    0% {
        stroke-dashoffset: 5000;
        fill-opacity: 0;
    }
    60% {
        fill-opacity: 0;
    }
    100% {
        stroke-dashoffset: 0;
        fill-opacity: 1;
    }
}

#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1.2s ease-out 1.5s forwards;
}

#logotype {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(40px, 6vw, 72px);
    color: var(--deep-earth);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    line-height: 1.1;
}

#hero-tagline {
    color: var(--mountain-charcoal);
    opacity: 0.7;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

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

/* --- Scroll Indicator --- */
#scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 2.8s forwards;
}

#scroll-dot {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { cy: 12; }
    50% { cy: 28; }
}

/* --- Mountain Peak Dividers --- */
.mountain-divider {
    position: relative;
    width: 100%;
    height: 80px;
    z-index: 2;
}

.mountain-divider--cream {
    background-color: var(--sand-cream);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    margin-top: -1px;
}

.mountain-divider--slate {
    background-color: var(--sky-slate);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    margin-top: -1px;
}

.mountain-divider--dark {
    background-color: var(--deep-earth);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    margin-top: -1px;
}

/* --- Content Sections --- */
.content-section {
    position: relative;
    padding: 80px 24px 100px;
}

.content-section--cream {
    background-color: var(--sand-cream);
    color: var(--mountain-charcoal);
}

.content-section--slate {
    background-color: var(--sky-slate);
    color: var(--sand-cream);
}

.content-section--dark {
    background-color: var(--deep-earth);
    color: var(--ocean-foam);
}

.content-column {
    max-width: var(--column-width);
    margin: 0 auto;
}

/* --- Typography --- */
h2 {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: clamp(28px, 4.5vw, 56px);
    line-height: 1.2;
    margin-bottom: 32px;
    letter-spacing: -0.01em;
}

h3 {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: clamp(20px, 2.5vw, 28px);
    line-height: 1.3;
    margin-bottom: 16px;
}

p {
    margin-bottom: 24px;
}

.caption {
    font-family: var(--font-caption);
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* --- Section Illustrations --- */
.section-illustration {
    width: 100%;
    max-width: var(--column-width);
    height: auto;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* --- Data Blocks (Field Report) --- */
.data-block {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid rgba(58, 58, 58, 0.15);
}

.data-block:first-of-type {
    border-top: 1px solid rgba(58, 58, 58, 0.15);
    margin-top: 16px;
}

.data-value {
    font-family: var(--font-caption);
    font-size: 14px;
    font-weight: 400;
    color: var(--lupine-purple);
    letter-spacing: 0.01em;
}

/* --- Observation Entries --- */
.observation-entry {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(232, 220, 200, 0.15);
}

.observation-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.observation-date {
    color: var(--ocean-foam);
    margin-bottom: 8px;
    opacity: 0.7;
}

.content-section--slate h2 {
    color: var(--sand-cream);
}

.content-section--slate h3 {
    color: var(--sand-cream);
}

.content-section--slate p {
    color: rgba(232, 220, 200, 0.9);
}

/* --- Survey Stats --- */
.survey-stats {
    display: flex;
    gap: 48px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(58, 58, 58, 0.15);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-number {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.1;
    color: var(--lupine-purple);
    margin-bottom: 4px;
}

.stat-item .caption {
    color: var(--cliff-gray);
}

/* --- Footer --- */
#footer {
    padding-bottom: 60px;
}

#footer-mark {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 32px;
}

.footer-logotype {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 28px;
    color: var(--sand-cream);
    margin-bottom: 6px;
}

.footer-caption {
    color: var(--cliff-gray);
}

.footer-coordinates {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
    color: var(--cliff-gray);
    flex-wrap: wrap;
}

.footer-note {
    color: var(--cliff-gray);
    font-style: italic;
    font-size: 14px;
    max-width: 480px;
}

/* --- Scroll-triggered fade-in for content --- */
.content-column h2,
.content-column p,
.content-column .data-block,
.content-column .observation-entry,
.content-column .survey-stats,
.content-column .stat-item {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.content-column h2.visible,
.content-column p.visible,
.content-column .data-block.visible,
.content-column .observation-entry.visible,
.content-column .survey-stats.visible,
.content-column .stat-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer content should always be visible */
#footer .content-column h2,
#footer .content-column p,
#footer .content-column .footer-note {
    opacity: 1;
    transform: none;
    transition: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-section {
        padding: 60px 20px 80px;
    }

    .mountain-divider {
        height: 50px;
    }

    .survey-stats {
        flex-direction: column;
        gap: 24px;
    }

    .footer-coordinates {
        flex-direction: column;
        gap: 8px;
    }

    .data-block {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    #logotype {
        font-size: 36px;
    }

    .mountain-divider {
        height: 35px;
    }

    .section-illustration {
        margin-bottom: 32px;
    }
}
