/* ============================================================
   MasqproT.com — Sepia Nostalgic + Dopamine Botanical Journal
   ============================================================ */

/* --- CSS Custom Properties (Palette) --- */
:root {
    --deep-ground: #3B2414;
    --primary-sepia: #D4B896;
    --light-ground: #F5EDE0;
    --text-primary: #2C1810;
    --botanical-green: #6B7F3A;
    --dopamine-coral: #E8614D;
    --dopamine-gold: #E5A832;
    --lens-flare: #FFF3D6;
    --flare-accent: #F0C78E;
    --sepia-border: #C4A882;

    --font-heading: 'Anybody', sans-serif;
    --font-body: 'Libre Baskerville', serif;
    --font-accent: 'Caveat', cursive;

    --gutter-left: 8vw;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--light-ground);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.72;
    overflow-x: hidden;
}

/* --- Film Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: multiply;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-heading);
    text-transform: none;
    letter-spacing: -0.03em;
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(4rem, 10vw, 9rem);
    color: var(--deep-ground);
    line-height: 1;
    position: relative;
    z-index: 3;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: var(--sepia-border);
    margin-top: 0.5rem;
    position: relative;
    z-index: 3;
}

.section-heading {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--deep-ground);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-heading--large {
    font-size: clamp(3rem, 8vw, 6rem);
}

.section-heading[data-underline]::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--dopamine-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-heading[data-underline].is-visible::after {
    transform: scaleX(1);
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    color: var(--deep-ground);
    margin-bottom: 1rem;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.72;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

.caveat-text {
    font-family: var(--font-accent);
}

/* --- Links with underline-draw --- */
a {
    color: var(--dopamine-coral);
    text-decoration: none;
    position: relative;
    display: inline-block;
}

a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--dopamine-coral);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

a:hover::after {
    transform: scaleX(1);
}

a:not(:hover)::after {
    transform-origin: right;
}

/* --- Specimen Labels --- */
.specimen-label {
    display: block;
    font-size: 0.9rem;
    color: var(--sepia-border);
    text-align: right;
    margin-top: 1.5rem;
    font-style: italic;
}

.specimen-label--section {
    margin-top: 3rem;
    padding-left: var(--gutter-left);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem var(--gutter-left);
    overflow: hidden;
    background: linear-gradient(135deg, var(--light-ground) 0%, var(--lens-flare) 50%, var(--light-ground) 100%);
}

.hero-lens-flare {
    position: absolute;
    top: -10%;
    right: -5%;
    width: 70vw;
    height: 70vw;
    max-width: 700px;
    max-height: 700px;
    background: radial-gradient(ellipse at 30% 20%, var(--lens-flare) 0%, var(--flare-accent) 35%, transparent 70%);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 1;
    animation: flare-pulse 6s ease-in-out infinite;
}

.hero-lens-flare-hex {
    position: absolute;
    top: 15%;
    right: 12%;
    width: 120px;
    height: 120px;
    background: radial-gradient(ellipse, var(--lens-flare) 0%, var(--flare-accent) 40%, transparent 70%);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 1;
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    animation: flare-pulse 6s ease-in-out infinite 1s;
    opacity: 0.7;
}

@keyframes flare-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 65%;
}

.hero-botanical-silhouettes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.botanical-sil {
    position: absolute;
    color: var(--botanical-green);
    opacity: 0.08;
}

.botanical-sil--fern {
    width: 180px;
    bottom: -20px;
    left: 5%;
    transform: rotate(-10deg);
}

.botanical-sil--lavender {
    width: 100px;
    top: 10%;
    right: 25%;
    opacity: 0.06;
    transform: rotate(5deg);
}

.botanical-sil--eucalyptus {
    width: 140px;
    top: 5%;
    left: 55%;
    opacity: 0.07;
    transform: rotate(-3deg);
}

.hero-sepia-photo {
    position: absolute;
    bottom: 8%;
    right: 10%;
    width: clamp(200px, 25vw, 380px);
    height: clamp(250px, 30vw, 460px);
    z-index: 2;
    transform: rotate(3deg);
}

.sepia-photo-inner {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(145deg, var(--primary-sepia) 0%, var(--sepia-border) 40%, var(--deep-ground) 100%);
    filter: sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05);
    box-shadow: 4px 6px 20px rgba(59, 36, 20, 0.15);
    position: relative;
    overflow: hidden;
}

.sepia-photo-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom right,
        rgba(255, 243, 214, 0.3) 0%,
        transparent 40%,
        rgba(59, 36, 20, 0.1) 100%);
}

.sepia-photo-inner::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(ellipse at center, var(--lens-flare) 0%, var(--flare-accent) 30%, transparent 65%);
    mix-blend-mode: screen;
    opacity: 0.6;
}

/* --- About Section (F-pattern second stroke) --- */
.about-section {
    position: relative;
    min-height: 80vh;
    padding: 6rem 12vw 6rem var(--gutter-left);
    overflow: hidden;
}

.section-lens-flare {
    position: absolute;
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(ellipse at 30% 20%, var(--lens-flare) 0%, var(--flare-accent) 35%, transparent 70%);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.section-lens-flare--bottom {
    top: auto;
    bottom: -15%;
    right: auto;
    left: -10%;
}

.section-lens-flare--left {
    right: auto;
    left: -5%;
    top: 20%;
}

.about-grid {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 3rem;
    align-items: start;
    max-width: 80vw;
}

.about-text-card {
    background: rgba(255, 243, 214, 0.5);
    border: 1px solid var(--sepia-border);
    border-radius: 12px;
    padding: 2.5rem;
    transform: rotate(-0.5deg);
    position: relative;
    z-index: 1;
}

.about-botanical {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.botanical-illustration {
    width: 100%;
    max-width: 300px;
}

.vine-border-group .vine-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.2s ease-out;
}

.vine-border-group.is-visible .vine-path {
    stroke-dashoffset: 0;
}

/* --- Botanical Dividers --- */
.botanical-divider {
    width: 100%;
    padding: 1rem var(--gutter-left);
    opacity: 0;
    transform: scaleY(0.5);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.botanical-divider.is-visible {
    opacity: 1;
    transform: scaleY(1);
}

.botanical-divider svg {
    width: 100%;
    height: 80px;
}

.divider-vine {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-out;
}

.botanical-divider.is-visible .divider-vine {
    stroke-dashoffset: 0;
}

/* --- Field Notes Section --- */
.field-notes-section {
    position: relative;
    min-height: 80vh;
    padding: 6rem 12vw 6rem var(--gutter-left);
    overflow: hidden;
}

.field-note-card {
    background: rgba(255, 243, 214, 0.4);
    border: 1px solid var(--sepia-border);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.field-note-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.field-note-card--wide {
    width: 65vw;
    max-width: 900px;
    transition-delay: 0s;
}

.field-note-card--medium {
    width: 50vw;
    max-width: 700px;
    transition-delay: 0.15s;
}

.field-note-card--narrow {
    width: 40vw;
    max-width: 560px;
    transition-delay: 0.3s;
}

.card-vine-border {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    pointer-events: none;
}

.card-vine-border svg {
    width: 100%;
    height: 100%;
}

.card-vine {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.2s ease-out;
}

.card-vine-inner {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.2s ease-out 0.3s;
}

.field-note-card.is-visible .card-vine,
.field-note-card.is-visible .card-vine-inner {
    stroke-dashoffset: 0;
}

/* --- Collection Section --- */
.collection-section {
    position: relative;
    min-height: 80vh;
    padding: 6rem 12vw 6rem var(--gutter-left);
    overflow: hidden;
}

.section-intro {
    max-width: 55vw;
    margin-bottom: 3rem;
}

.collection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2.5rem;
    max-width: 75vw;
}

.collection-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.collection-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.collection-item:nth-child(1) { transition-delay: 0s; }
.collection-item:nth-child(2) { transition-delay: 0.15s; }
.collection-item:nth-child(3) { transition-delay: 0.3s; }

.collection-photo {
    width: 100%;
    height: 220px;
    border-radius: 8px;
    background: linear-gradient(160deg, var(--primary-sepia) 0%, var(--sepia-border) 50%, #8B6B4A 100%);
    filter: sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05);
    box-shadow: 4px 6px 20px rgba(59, 36, 20, 0.15);
    position: relative;
    overflow: hidden;
}

.collection-photo--tall {
    height: 300px;
}

.photo-sepia {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom right,
        rgba(255, 243, 214, 0.2) 0%,
        transparent 50%,
        rgba(59, 36, 20, 0.08) 100%);
}

.photo-flare {
    position: absolute;
    top: -20%;
    right: -15%;
    width: 70%;
    height: 70%;
    background: radial-gradient(ellipse at center, var(--lens-flare) 0%, var(--flare-accent) 30%, transparent 65%);
    mix-blend-mode: screen;
    opacity: 0.5;
}

.collection-caption {
    font-size: 0.95rem;
    color: var(--sepia-border);
    margin-top: 0.75rem;
    line-height: 1.4;
}

/* --- Process Section --- */
.process-section {
    position: relative;
    min-height: 80vh;
    padding: 6rem 12vw 6rem var(--gutter-left);
    overflow: hidden;
    background: linear-gradient(180deg, var(--light-ground) 0%, var(--lens-flare) 50%, var(--light-ground) 100%);
}

.process-steps {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 55vw;
}

.process-step {
    padding-left: 2rem;
    border-left: 2px solid var(--sepia-border);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.process-step.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.process-step:nth-child(1) { transition-delay: 0s; }
.process-step:nth-child(2) { transition-delay: 0.15s; }
.process-step:nth-child(3) { transition-delay: 0.3s; }

.step-number {
    font-size: 1.4rem;
    color: var(--dopamine-gold);
    display: block;
    margin-bottom: 0.25rem;
}

.step-title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--deep-ground);
    margin-bottom: 0.75rem;
}

/* --- Closing Section --- */
.closing-section {
    position: relative;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 6rem var(--gutter-left);
    overflow: hidden;
}

.closing-lens-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vw;
    max-width: 900px;
    max-height: 900px;
    background: radial-gradient(ellipse at center, var(--lens-flare) 0%, var(--flare-accent) 30%, transparent 60%);
    mix-blend-mode: screen;
    pointer-events: none;
    opacity: 0.4;
    animation: flare-pulse 6s ease-in-out infinite 2s;
}

.closing-content {
    position: relative;
    z-index: 1;
    max-width: 65vw;
}

.closing-text {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    max-width: 50vw;
    margin-bottom: 2rem;
}

.closing-signature {
    font-size: 1.2rem;
    color: var(--sepia-border);
}

/* --- Seed Pod Scatter --- */
.seed-pod-scatter {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.seed-pod {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--color);
    opacity: 0.4;
}

/* --- Footer --- */
.site-footer {
    padding: 3rem var(--gutter-left);
    text-align: center;
    border-top: 1px solid var(--sepia-border);
}

.footer-botanical svg {
    width: 100px;
    height: 40px;
    margin-bottom: 1rem;
}

.footer-text {
    font-size: 1rem;
    color: var(--sepia-border);
}

/* --- Scroll-driven flare parallax (custom property updated by JS) --- */
.hero-lens-flare {
    transform: translate(var(--flare-x, 0px), var(--flare-y, 0px)) scale(var(--flare-scale, 1));
}

.section-lens-flare {
    transform: translate(var(--flare-x, 0px), var(--flare-y, 0px));
}

/* --- Responsive --- */
@media (max-width: 900px) {
    :root {
        --gutter-left: 5vw;
    }

    .hero-content {
        max-width: 90%;
    }

    .hero-sepia-photo {
        width: 40vw;
        height: 45vw;
        right: 5%;
        bottom: 5%;
        opacity: 0.5;
    }

    .about-grid {
        grid-template-columns: 1fr;
        max-width: 90vw;
    }

    .about-botanical {
        display: none;
    }

    .field-note-card--wide,
    .field-note-card--medium,
    .field-note-card--narrow {
        width: 85vw;
        max-width: 100%;
    }

    .collection-grid {
        grid-template-columns: 1fr 1fr;
        max-width: 90vw;
    }

    .process-steps {
        max-width: 85vw;
    }

    .closing-content {
        max-width: 90vw;
    }

    .closing-text {
        max-width: 85vw;
    }

    .section-intro {
        max-width: 85vw;
    }
}

@media (max-width: 600px) {
    .collection-grid {
        grid-template-columns: 1fr;
    }

    .hero-sepia-photo {
        display: none;
    }

    .about-section,
    .field-notes-section,
    .collection-section,
    .process-section {
        padding-right: 5vw;
    }
}
