/* ==========================================================================
   continua.st -- Vintage editorial / nostalgic-retro design language
   ========================================================================== */

:root {
    --color-bg: #FAF0E6;
    --color-bg-warm: #F5E6D3;
    --color-text: #3E2723;
    --color-heading: #8B4513;
    --color-accent: #D4A76A;
    --color-accent-deep: #C75B39;
    --color-overlay: #2C1810;
    --color-highlight: #FFF8DC;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Lora', Georgia, serif;
    --font-caption: 'DM Sans', 'Helvetica Neue', sans-serif;

    --fade-duration: 1200ms;
    --fade-stagger: 200ms;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(212, 167, 106, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(199, 91, 57, 0.04) 0%, transparent 55%),
        repeating-linear-gradient(
            45deg,
            rgba(139, 69, 19, 0.012) 0px,
            rgba(139, 69, 19, 0.012) 1px,
            transparent 1px,
            transparent 3px
        );
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    position: relative;
}

::selection {
    background: var(--color-highlight);
    color: var(--color-overlay);
}

/* ==========================================================================
   Persistent Grain Overlay
   ========================================================================== */

.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.243 0 0 0 0 0.153 0 0 0 0 0.137 0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 160px 160px;
}

/* ==========================================================================
   Wordmark
   ========================================================================== */

.wordmark {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
    font-family: var(--font-caption);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-heading);
    transition: opacity 600ms ease-out, color 600ms ease-out;
    mix-blend-mode: multiply;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 640px;
    overflow: hidden;
    background-color: var(--color-overlay);
}

.hero-image {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 30%, #E8B97A 0%, transparent 45%),
        radial-gradient(ellipse at 70% 60%, #B8602A 0%, transparent 55%),
        linear-gradient(135deg, #6B3A1F 0%, #3E2723 60%, #2C1810 100%);
    filter: sepia(0.3) saturate(0.7);
}

.hero-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 8px,
            rgba(255, 248, 220, 0.02) 8px,
            rgba(255, 248, 220, 0.02) 9px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 12px,
            rgba(44, 24, 16, 0.06) 12px,
            rgba(44, 24, 16, 0.06) 13px
        );
    mix-blend-mode: overlay;
}

.hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(44, 24, 16, 0.85) 0%,
        rgba(44, 24, 16, 0.45) 35%,
        rgba(139, 69, 19, 0.18) 60%,
        rgba(212, 167, 106, 0.05) 100%
    );
    mix-blend-mode: multiply;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(212, 167, 106, 0.08) 0%,
        transparent 30%,
        transparent 70%,
        rgba(44, 24, 16, 0.4) 100%
    );
    pointer-events: none;
    z-index: 2;
}

/* Sprocket holes along hero left edge */
.sprocket-column {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 32px 0;
    background: rgba(44, 24, 16, 0.55);
    z-index: 3;
}

.sprocket {
    display: block;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    background: rgba(44, 24, 16, 0.95);
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Crop marks at hero corners */
.crop-mark {
    position: absolute;
    font-family: var(--font-caption);
    font-size: 18px;
    color: var(--color-accent);
    opacity: 0.4;
    z-index: 4;
    line-height: 1;
}

.crop-tl { top: 28px; left: 60px; }
.crop-tr { top: 28px; right: 28px; }
.crop-bl { bottom: 28px; left: 60px; }
.crop-br { bottom: 28px; right: 28px; }

/* Hero content */
.hero-content {
    position: absolute;
    left: 15%;
    bottom: 14%;
    right: 10%;
    max-width: 880px;
    z-index: 5;
}

.hero-meta {
    font-family: var(--font-caption);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 18px;
    opacity: 0;
    animation: heroMetaFade 1600ms ease-out 200ms forwards;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: 0.03em;
    line-height: 1.05;
    color: var(--color-bg);
    text-shadow: 0 2px 24px rgba(44, 24, 16, 0.6);
    opacity: 0;
    transition: opacity 2000ms ease-out 500ms;
}

.hero-title.is-visible {
    opacity: 1;
}

.hero-rule {
    display: block;
    height: 1px;
    width: 0;
    background: var(--color-accent);
    margin-top: 28px;
    transition: width 1500ms cubic-bezier(0.16, 1, 0.3, 1) 1200ms;
}

.hero-rule.is-visible {
    width: 32%;
}

.hero-credit {
    position: absolute;
    bottom: 32px;
    right: 32px;
    font-family: var(--font-caption);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(250, 240, 230, 0.55);
    z-index: 5;
}

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

/* ==========================================================================
   Halftone Divider
   ========================================================================== */

.halftone-divider {
    height: 40px;
    width: 100%;
    background-image: radial-gradient(circle, rgba(139, 69, 19, 0.15) 1px, transparent 1.5px);
    background-size: 8px 8px;
    background-position: center;
    border-top: 1px solid rgba(139, 69, 19, 0.08);
    border-bottom: 1px solid rgba(139, 69, 19, 0.08);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.section-header {
    margin-bottom: 56px;
    max-width: 720px;
}

.section-header-center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    padding: 0 8vw;
}

.dateline {
    font-family: var(--font-caption);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-heading);
    margin-bottom: 14px;
}

.section-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    line-height: 1.18;
    color: var(--color-heading);
    letter-spacing: 0.005em;
    margin-bottom: 20px;
}

.ornament-rule {
    display: block;
    position: relative;
    height: 1px;
    width: 120px;
    background: var(--color-accent);
    margin-top: 12px;
}

.section-header-center .ornament-rule {
    margin-left: auto;
    margin-right: auto;
}

.ornament-rule::after {
    content: "";
    position: absolute;
    top: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    transform: translateX(-50%) rotate(45deg);
}

/* ==========================================================================
   Editorial Spread Section
   ========================================================================== */

.editorial {
    padding: 120px 0 100px;
    position: relative;
}

.editorial-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 15%;
    padding-right: 8%;
}

.editorial-grid {
    display: grid;
    grid-template-columns: 35% 10% 55%;
    grid-gap: 0;
    align-items: start;
    margin-top: 40px;
}

.editorial-text {
    grid-column: 1 / 2;
    max-width: 62ch;
}

.editorial-text .lead {
    margin-bottom: 1.2em;
}

.editorial-text p {
    margin-bottom: 1.2em;
}

.dropcap {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 4.5em;
    color: var(--color-accent-deep);
    float: left;
    line-height: 0.9;
    margin-right: 12px;
    margin-top: 8px;
    margin-bottom: -8px;
}

.caption {
    font-family: var(--font-caption);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-heading);
    margin-top: 28px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 167, 106, 0.5);
    max-width: 320px;
}

.editorial-aside {
    grid-column: 3 / 4;
    padding-top: 60px;
}

.aside-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    line-height: 1.55;
    color: var(--color-heading);
    margin-top: 32px;
    padding-left: 24px;
    border-left: 2px solid var(--color-accent);
    max-width: 50ch;
}

/* Inset photo */
.inset-photo {
    margin: 0 0 24px;
    position: relative;
}

.photo-frame {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 4px solid var(--color-accent);
    box-shadow:
        0 1px 0 rgba(255, 248, 220, 0.4) inset,
        0 8px 24px rgba(44, 24, 16, 0.18),
        0 2px 6px rgba(44, 24, 16, 0.12);
    position: relative;
    overflow: hidden;
    filter: sepia(0.3) saturate(0.7);
}

.photo-frame-amber {
    background:
        radial-gradient(ellipse at 35% 40%, #E8B97A 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, #C75B39 0%, transparent 60%),
        linear-gradient(135deg, #8B4513 0%, #3E2723 100%);
}

.photo-frame-warm {
    background:
        radial-gradient(ellipse at 50% 30%, #F5E6D3 0%, transparent 45%),
        radial-gradient(ellipse at 30% 80%, #D4A76A 0%, transparent 55%),
        linear-gradient(160deg, #8B4513 10%, #5C3A20 100%);
}

.photo-frame-ochre {
    background:
        radial-gradient(ellipse at 70% 35%, #FFF8DC 0%, transparent 40%),
        radial-gradient(ellipse at 25% 70%, #C75B39 0%, transparent 55%),
        linear-gradient(120deg, #6B3A1F 0%, #3E2723 100%);
}

.photo-frame-terra {
    background:
        radial-gradient(ellipse at 40% 45%, #D4A76A 0%, transparent 50%),
        radial-gradient(ellipse at 75% 75%, #C75B39 0%, transparent 60%),
        linear-gradient(150deg, #2C1810 0%, #5C3A20 50%, #8B4513 100%);
}

.photo-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.27 0 0 0 0 0.07 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>");
    background-size: 120px 120px;
    opacity: 0.18;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.photo-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.12), rgba(212, 167, 106, 0.08));
    mix-blend-mode: multiply;
    pointer-events: none;
}

.inset-photo figcaption {
    font-family: var(--font-caption);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-heading);
    margin-top: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 167, 106, 0.5);
}

/* ==========================================================================
   Feature Strip / Pull Quote
   ========================================================================== */

.feature-strip {
    background-color: var(--color-bg-warm);
    padding: 120px 8vw;
    position: relative;
    border-top: 1px solid rgba(139, 69, 19, 0.12);
    border-bottom: 1px solid rgba(139, 69, 19, 0.12);
}

.feature-strip::before,
.feature-strip::after {
    content: "+";
    position: absolute;
    font-family: var(--font-caption);
    font-size: 18px;
    color: var(--color-accent);
    opacity: 0.5;
}

.feature-strip::before {
    top: 22px;
    left: 22px;
}

.feature-strip::after {
    bottom: 22px;
    right: 22px;
}

.feature-inner {
    max-width: 920px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

.pull-rule {
    display: block;
    height: 1px;
    width: 0;
    background: var(--color-accent);
    margin: 0 auto;
    transition: width 800ms ease-in-out;
}

.pull-rule.is-visible {
    width: 40%;
}

.pull-rule-top {
    margin-bottom: 48px;
}

.pull-rule-bottom {
    margin-top: 32px;
}

.pull-quote {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.35;
    color: var(--color-heading);
    letter-spacing: 0.005em;
}

.pull-attribution {
    font-family: var(--font-caption);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text);
    margin-top: 28px;
}

/* ==========================================================================
   Gallery Section
   ========================================================================== */

.gallery-section {
    padding: 120px 8vw 140px;
    position: relative;
    overflow: hidden;
}

.gallery-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    margin-top: 60px;
    position: relative;
    min-height: 380px;
    padding: 40px 0;
}

.gallery-photo {
    position: relative;
    width: 280px;
    margin: 0;
    background: #FFF8DC;
    padding: 12px 12px 18px;
    box-shadow:
        0 1px 0 rgba(255, 248, 220, 0.4) inset,
        0 12px 28px rgba(44, 24, 16, 0.22),
        0 4px 8px rgba(44, 24, 16, 0.14);
    transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
    transform: translate(0, 0) rotate(0deg);
    will-change: transform;
}

/* Pre-scatter stacked positions (initial) */
.gallery-photo.is-stacked {
    position: absolute;
    left: 50%;
    top: 40px;
    margin-left: -140px;
}

.gallery-photo.is-stacked.gallery-photo-1 { transform: translate(0, 0) rotate(-2deg); z-index: 3; }
.gallery-photo.is-stacked.gallery-photo-2 { transform: translate(0, 0) rotate(1deg); z-index: 2; }
.gallery-photo.is-stacked.gallery-photo-3 { transform: translate(0, 0) rotate(-1deg); z-index: 1; }

/* Scattered final positions */
.gallery-photo.is-scattered.gallery-photo-1 { transform: translate(-280px, 0px) rotate(-4deg); }
.gallery-photo.is-scattered.gallery-photo-2 { transform: translate(0px, -24px) rotate(2deg); }
.gallery-photo.is-scattered.gallery-photo-3 { transform: translate(280px, -8px) rotate(-2deg); }

.gallery-photo .photo-frame {
    aspect-ratio: 1 / 1;
    border: none;
    box-shadow: inset 0 0 0 1px rgba(44, 24, 16, 0.1);
}

.gallery-photo figcaption {
    font-family: var(--font-caption);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-heading);
    margin-top: 14px;
    text-align: center;
}

/* Photo album corners */
.photo-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--color-accent);
    opacity: 0.55;
    pointer-events: none;
}

.photo-corner-tl {
    top: 0;
    left: 0;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.photo-corner-tr {
    top: 0;
    right: 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.photo-corner-bl {
    bottom: 28px;
    left: 0;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.photo-corner-br {
    bottom: 28px;
    right: 0;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.gallery-note {
    font-family: var(--font-caption);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-heading);
    text-align: center;
    margin-top: 80px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* ==========================================================================
   Closing Section
   ========================================================================== */

.closing {
    position: relative;
    width: 100%;
    min-height: 90vh;
    overflow: hidden;
    background-color: var(--color-overlay);
    padding: 120px 0 60px;
}

.closing-image {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 30%, #D4A76A 0%, transparent 40%),
        radial-gradient(ellipse at 30% 60%, #C75B39 0%, transparent 50%),
        linear-gradient(180deg, #6B3A1F 0%, #3E2723 50%, #1a0e08 100%);
    filter: sepia(0.3) saturate(0.7);
}

.closing-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(44, 24, 16, 0.2) 0%,
        rgba(44, 24, 16, 0.5) 60%,
        rgba(0, 0, 0, 0.95) 100%
    );
}

.closing-fade {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 8px,
            rgba(44, 24, 16, 0.04) 8px,
            rgba(44, 24, 16, 0.04) 9px
        );
    mix-blend-mode: overlay;
}

.closing-content {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 60px 8vw 0;
    color: var(--color-bg);
}

.postmark {
    width: 140px;
    height: 140px;
    margin: 0 auto 32px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.postmark-text {
    font-family: var(--font-caption);
    font-weight: 500;
}

.closing-text {
    font-family: var(--font-caption);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(250, 240, 230, 0.85);
    margin-top: 24px;
}

.colophon {
    position: absolute;
    bottom: 32px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-caption);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(250, 240, 230, 0.4);
    z-index: 5;
}

/* ==========================================================================
   Reveal Animation
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--fade-duration) ease-out, transform var(--fade-duration) ease-out;
}

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

.reveal[data-stagger="1"] { transition-delay: calc(var(--fade-stagger) * 1); }
.reveal[data-stagger="2"] { transition-delay: calc(var(--fade-stagger) * 2); }
.reveal[data-stagger="3"] { transition-delay: calc(var(--fade-stagger) * 3); }
.reveal[data-stagger="4"] { transition-delay: calc(var(--fade-stagger) * 4); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .editorial-inner {
        padding-left: 8vw;
        padding-right: 8vw;
    }

    .editorial-grid {
        grid-template-columns: 1fr;
    }

    .editorial-text,
    .editorial-aside {
        grid-column: 1 / -1;
    }

    .editorial-aside {
        padding-top: 0;
        margin-top: 48px;
    }

    .hero-content {
        left: 8vw;
        right: 8vw;
        bottom: 18%;
    }
}

@media (max-width: 768px) {
    .sprocket-column {
        display: none;
    }

    .crop-tl { left: 20px; }
    .crop-bl { left: 20px; }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    .gallery-row {
        flex-direction: column;
        align-items: center;
        gap: 40px;
        min-height: auto;
    }

    .gallery-photo {
        position: relative !important;
        width: 80vw;
        max-width: 320px;
        left: auto !important;
        top: auto !important;
        margin-left: 0 !important;
    }

    .gallery-photo.is-stacked.gallery-photo-1,
    .gallery-photo.is-stacked.gallery-photo-2,
    .gallery-photo.is-stacked.gallery-photo-3,
    .gallery-photo.is-scattered.gallery-photo-1,
    .gallery-photo.is-scattered.gallery-photo-2,
    .gallery-photo.is-scattered.gallery-photo-3 {
        transform: translate(0, 0) rotate(0deg);
    }

    .feature-strip {
        padding: 80px 8vw;
    }

    .editorial {
        padding: 80px 0 60px;
    }

    .closing {
        padding: 80px 0 60px;
    }

    .wordmark {
        top: 16px;
        left: 16px;
    }
}
