/* p9.rs - Blobitecture meets Pastoral Romanticism */

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

:root {
    --burgundy: #6b1d3a;
    --oxblood: #3d0f22;
    --dried-rose: #c27a8e;
    --dusty-sage: #8a9a7b;
    --antique-cream: #f5efe6;
    --parchment: #e2d8c8;
    --gold: #b8934a;
    --charcoal: #2a2a2e;
    --fog: #9e9a94;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--oxblood);
}

body {
    font-family: 'Cormorant Garamond', serif;
    color: var(--charcoal);
}

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

/* Spreads Container */
.spreads-container {
    display: flex;
    width: 500vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.spread {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.spread[data-bg="oxblood"] {
    background: var(--oxblood);
    color: var(--antique-cream);
}

.spread[data-bg="cream"] {
    background: var(--antique-cream);
    color: var(--charcoal);
}

.spread[data-bg="parchment"] {
    background: var(--parchment);
    color: var(--charcoal);
}

/* Spread Content Layout */
.spread-content {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 2fr;
    padding: 6vh 4vw;
    position: relative;
}

.text-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 4vw;
    z-index: 2;
}

.visual-column {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Typography */
.site-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 6.5rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 0.92;
    color: var(--antique-cream);
}

.title-line {
    width: 0;
    height: 1px;
    background: var(--dried-rose);
    margin: 2rem 0;
    transition: width 2s ease-out;
}

.title-line.animate {
    width: 60%;
}

.epigraph {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.72;
    color: var(--dried-rose);
    max-width: 30ch;
}

.spread-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 5rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 0.92;
    margin-bottom: 2rem;
    color: var(--burgundy);
}

.spread[data-bg="oxblood"] .spread-heading {
    color: var(--antique-cream);
}

.body-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.72;
    margin-bottom: 1.5rem;
    max-width: 38ch;
}

.caption {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.04em;
    color: var(--fog);
    margin-top: 0.5rem;
}

/* Blobs */
.blob {
    width: 100%;
    max-width: 450px;
    height: auto;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.blob.visible {
    opacity: 1;
}

.blob-spec {
    width: 100%;
    max-width: 150px;
    height: auto;
}

/* Specimen Grid */
.specimen-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4vh 8vw;
}

.specimen-title {
    margin-bottom: 4rem;
    text-align: left;
    align-self: flex-start;
}

.specimen-row {
    display: flex;
    gap: 4vw;
    margin-bottom: 3rem;
}

.specimen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.gutter-garden {
    position: absolute;
    right: 8vw;
    top: 10%;
    height: 80%;
    width: 60px;
    opacity: 0.6;
}

/* Floral Rosettes */
.floral-rosette {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.18;
    animation: rotate-slow 60s linear infinite;
}

.floral-rosette::before,
.floral-rosette::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--dried-rose);
}

.floral-rosette::before {
    transform: scale(0.6) rotate(36deg);
    border-color: var(--dusty-sage);
}

.floral-rosette::after {
    transform: scale(0.8) rotate(72deg);
}

.rosette-1 { right: 15%; bottom: 20%; }
.rosette-2 { right: 10%; top: 15%; animation-direction: reverse; }
.rosette-3 { left: 35%; bottom: 10%; }
.rosette-5 { left: 20%; top: 15%; animation-direction: reverse; }

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Particle Canvas */
.spread-4 .spread-content {
    grid-template-columns: 1fr;
    position: relative;
}

.text-overlay {
    position: absolute;
    left: 4vw;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    max-width: 35ch;
}

.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Spread 5 Closing */
.spread-5 .spread-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    grid-template-columns: none;
}

.closing-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(8rem, 20vw, 20rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 0.92;
    color: var(--antique-cream);
    position: relative;
    z-index: 2;
}

.char-clip {
    display: inline-block;
    background: linear-gradient(135deg, var(--antique-cream), var(--dried-rose));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.closing-epigraph {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    line-height: 1.72;
    color: var(--dried-rose);
    margin-top: 2rem;
    z-index: 2;
}

.spread-5 .blob-5 {
    position: absolute;
    width: 60%;
    max-width: 500px;
    bottom: 5%;
    right: 5%;
    opacity: 0.4;
}

.spread-5 .botanical-5 {
    position: absolute;
    width: 40%;
    bottom: 0;
    right: 10%;
    opacity: 0.5;
}

/* Spread Indicator */
.spread-indicator {
    position: fixed;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 100;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fog);
    opacity: 0.4;
    transition: all 0.4s ease;
}

.indicator-dot.active {
    opacity: 1;
    background: var(--gold);
    transform: scale(1.3);
}

/* Botanical SVG Lines */
.botanical line,
.botanical circle {
    stroke: var(--dusty-sage);
    fill: none;
    stroke-width: 1;
}

.botanical circle {
    fill: var(--dried-rose);
    stroke: none;
}

/* Text entrance animations */
.fade-in {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Grain overlay on spreads */
.spread::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractal' baseFrequency='0.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
