/* ========================================
   resar.one — Cinematic Atelier Folio
   ======================================== */

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

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.03em;
    color: #3d3024;
    background-color: #faf5eb;
}

/* --- Paper Grain Texture --- */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* --- Magazine Container --- */
.magazine {
    width: 100%;
}

/* --- Spread Base --- */
.spread {
    width: 100%;
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh 8vw;
}

.spread-inner {
    width: 100%;
    height: 100%;
    display: grid;
    gap: 4vw;
}

/* --- Typography --- */
.title-word {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #3d3024;
}

.title-suffix {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #8b7355;
    display: block;
    margin-top: 0.8rem;
}

.section-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #8b7355;
    display: block;
    margin-bottom: 2rem;
}

.spread-headline {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 3.2rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #3d3024;
    margin-bottom: 1.5rem;
}

.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #3d3024;
}

p {
    margin-bottom: 1.2rem;
    color: #3d3024;
}

a {
    color: #a07d42;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #c9a96e;
}

/* --- Ornament Divider --- */
.ornament-divider {
    margin-bottom: 1.5rem;
}

/* --- Spread 0: Title Card --- */
.spread-0 {
    align-items: flex-end;
    justify-content: flex-start;
}

.title-composition {
    position: absolute;
    left: 12%;
    top: 65%;
    transform-origin: left center;
}

.title-rule {
    width: 58vw;
    height: 1px;
    background-color: #c9a96e;
    margin-top: 0.6rem;
}

/* Title card zoom animation */
.spread-0 .title-composition {
    animation: titleZoom 8s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
}

@keyframes titleZoom {
    from { transform: scale(1.0); }
    to { transform: scale(1.03); }
}

/* --- Spread 1: The Origin --- */
.spread-1 {
    background-color: #faf5eb;
}

.origin-layout {
    grid-template-columns: 58% 42%;
    align-items: center;
}

.col-left {
    display: flex;
    align-items: center;
    justify-content: center;
}

.col-right {
    display: flex;
    align-items: center;
}

.origin-illustration {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.text-block p {
    max-width: 480px;
}

/* --- Spread 2: The Object --- */
.spread-2 {
    background-color: #faf5eb;
}

.object-layout {
    grid-template-columns: 35% 65%;
    align-items: center;
    position: relative;
}

.col-left-narrow {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80vh;
}

.col-left-narrow .pull-quote {
    transform: rotate(-90deg);
    transform-origin: left center;
    position: absolute;
    left: 50%;
    white-space: nowrap;
    font-size: clamp(1.5rem, 3vw, 3rem);
}

.col-right-wide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.object-illustration {
    width: 100%;
    max-width: 700px;
    height: auto;
}

/* --- Spread 3: The Process --- */
.spread-3 {
    background-color: #faf5eb;
}

.three-col {
    grid-template-columns: 30% 40% 30%;
    align-items: center;
}

.col-process-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.col-process-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2vw;
}

.col-process-right {
    overflow: hidden;
    display: flex;
    align-items: center;
}

.detail-illustration {
    width: 120%;
    max-width: none;
    height: auto;
    margin-right: -20%;
}

.process-step {
    text-align: center;
}

.illustration-small {
    width: 140px;
    height: auto;
}

.step-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #8b7355;
    display: block;
    margin-top: 0.5rem;
}

/* --- Spread 4: The Colophon --- */
.spread-4 {
    background-color: #f0e6d3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.watermark {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 50vw;
    color: #e8dcc8;
    line-height: 1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

.colophon-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.colophon-text {
    margin-bottom: 2rem;
}

.colophon-detail {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #2a1f14;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
}

.colophon-rule {
    width: 30vw;
    height: 1px;
    background-color: #c9a96e;
    margin-bottom: 1.5rem;
}

.monogram {
    display: block;
}

/* --- Zoom-Focus Animation --- */
.zoom-target {
    transform: scale(0.96);
    opacity: 0.85;
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.zoom-target.in-view {
    transform: scale(1.0);
    opacity: 1.0;
}

/* Slow breathing zoom after entering view */
.zoom-target.in-view.breathing {
    animation: breathe 6s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
    animation-delay: 1.2s;
}

@keyframes breathe {
    from { transform: scale(1.0); }
    to { transform: scale(1.02); }
}

/* --- Fade Animation --- */
.fade-target {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-target.in-view {
    opacity: 1;
}

/* --- Stagger Delays --- */
.stagger-0 { transition-delay: 0ms; }
.stagger-1 { transition-delay: 200ms; }
.stagger-2 { transition-delay: 400ms; }

/* --- Scroll Zoom (Spread 2) --- */
.scroll-zoom {
    will-change: transform;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .spread {
        padding: 6vh 6vw;
    }

    .origin-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .object-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .col-left-narrow {
        height: auto;
    }

    .col-left-narrow .pull-quote {
        transform: none;
        position: relative;
        left: auto;
        white-space: normal;
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }

    .three-col {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .col-process-left {
        flex-direction: row;
        justify-content: center;
    }

    .detail-illustration {
        width: 100%;
        margin-right: 0;
    }

    .watermark {
        font-size: 80vw;
    }

    .title-composition {
        left: 8%;
        top: 55%;
    }
}
