/* ==========================================================================
   footprint.markets - Pop-Art Editorial Financial Design
   Colors: #3D1028, #2A1F2D, #6B1D3A, #F5EDE0, #9E4B6C, #8A6D7C, #1A8A7D, #E85D4A
   Fonts: Playfair Display 900, Cormorant Garamond 400/600i, IBM Plex Mono 400
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
    --bg: #F5EDE0;
    --text: #2A1F2D;
    --accent: #6B1D3A;
    --accent-secondary: #9E4B6C;
    --teal: #1A8A7D;
    --dark-ground: #3D1028;
    --coral: #E85D4A;
    --mauve: #8A6D7C;
    --cream: #F5EDE0;
    --ink: #2A1F2D;
}

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

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Typography --- */
h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 5.5rem;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--accent);
}

h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 3rem;
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--accent);
}

.body-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--text);
    max-width: 680px;
    margin-bottom: 1.5rem;
}

.callout-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-style: italic;
    font-size: 2rem;
    line-height: 1.3;
    letter-spacing: 0.01em;
    color: var(--accent-secondary);
    margin-bottom: 1.5rem;
    max-width: 680px;
}

.meta-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mauve);
}

/* --- Letter Animation Base --- */
.letter-span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.letter-span.visible {
    opacity: 1;
    transform: translateY(0);
}

.letter-span.space {
    width: 0.3em;
}

/* --- Spread Indicator --- */
.spread-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mauve);
    z-index: 100;
    mix-blend-mode: difference;
}

.spread-separator {
    margin: 0 2px;
}

/* --- Spread Labels --- */
.spread-label {
    position: absolute;
    top: 20px;
    right: 30px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mauve);
    opacity: 0.5;
}

/* --- Spreads Common --- */
.spread {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    padding: 80px 0;
}

/* Scroll transition animation */
.spread .spread-a-content,
.spread .spread-b-layout,
.spread .spread-c-layout,
.spread .spread-d-layout,
.spread .spread-e-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.spread.in-view .spread-a-content,
.spread.in-view .spread-b-layout,
.spread.in-view .spread-c-layout,
.spread.in-view .spread-d-layout,
.spread.in-view .spread-e-content {
    opacity: 1;
    transform: translateY(0);
}

/* --- Ben-Day Dot Patterns --- */
.benday-subtle {
    background-image: radial-gradient(circle, #9E4B6C 1px, transparent 1px);
    background-size: 8px 8px;
}

.benday-bold {
    background-image: radial-gradient(circle, #6B1D3A 3px, transparent 3px);
    background-size: 14px 14px;
}

.benday-fill {
    background-image: radial-gradient(circle, #6B1D3A 1.5px, transparent 1.5px);
    background-size: 6px 6px;
}

.benday-fill-light {
    background-image: radial-gradient(circle, #F5EDE0 1.5px, transparent 1.5px);
    background-size: 6px 6px;
}

/* --- Shape Vocabulary --- */
.shape {
    position: absolute;
    will-change: transform;
}

.circle {
    border-radius: 50%;
    border: 3px solid var(--ink);
}

.triangle {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.polygon {
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

/* --- Fish Common --- */
.fish {
    will-change: transform;
    display: block;
}

/* ==========================================================================
   SPREAD A: The Overture
   ========================================================================== */
.spread-a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 12%;
    padding-right: 23%;
    background-color: var(--bg);
    background-image: radial-gradient(circle, #9E4B6C 1px, transparent 1px);
    background-size: 8px 8px;
    background-position: center;
}

.spread-a-content {
    position: relative;
    z-index: 2;
}

.spread-a-headline {
    transform: rotate(-3deg);
    transform-origin: left center;
    margin-bottom: 1.5rem;
}

.spread-a-tagline {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--accent-secondary);
    letter-spacing: 0.01em;
    margin-left: 4px;
}

/* Spread A Shapes */
.spread-a-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.spread-a-shapes .circle-large {
    width: 280px;
    height: 280px;
    top: 8%;
    right: 10%;
    background-color: var(--accent);
    border-color: var(--ink);
}

.spread-a-shapes .circle-medium {
    width: 120px;
    height: 120px;
    top: 55%;
    right: 25%;
    background-color: var(--coral);
    border-color: var(--ink);
}

.spread-a-shapes .triangle-1 {
    width: 160px;
    height: 160px;
    top: 15%;
    right: 35%;
    background-color: var(--teal);
    border: none;
}

.spread-a-shapes .triangle-1::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    background: transparent;
    border: 3px solid var(--ink);
    box-sizing: border-box;
}

.spread-a-shapes .circle-small {
    width: 60px;
    height: 60px;
    bottom: 20%;
    right: 8%;
    background-color: var(--accent-secondary);
    border-color: var(--ink);
}

.spread-a-shapes .polygon-1 {
    width: 100px;
    height: 100px;
    bottom: 30%;
    right: 40%;
    background: linear-gradient(135deg, #6B1D3A, #9E4B6C);
    border: none;
}

/* Spread A Fish */
.spread-a-fish {
    position: absolute;
    bottom: 15%;
    right: 12%;
    z-index: 2;
}

/* ==========================================================================
   SPREAD B: The Statement
   ========================================================================== */
.spread-b {
    display: flex;
    align-items: center;
    background-color: var(--bg);
    padding: 120px 0;
}

.spread-b-layout {
    display: flex;
    width: 100%;
    padding-left: 12%;
    padding-right: 5%;
    gap: 5%;
}

.spread-b-text {
    flex: 0 0 65%;
}

.spread-b-headline {
    margin-bottom: 2.5rem;
}

.spread-b-shapes-column {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    position: relative;
    padding-top: 20px;
}

.spread-b-shapes-column .circle-stack-1 {
    position: relative;
    width: 100px;
    height: 100px;
    background-color: var(--accent);
    border-color: var(--ink);
}

.spread-b-shapes-column .triangle-stack-1 {
    position: relative;
    width: 80px;
    height: 80px;
    background-color: var(--coral);
    border: none;
}

.spread-b-shapes-column .polygon-stack-1 {
    position: relative;
    width: 90px;
    height: 90px;
    background: linear-gradient(180deg, #6B1D3A, #9E4B6C);
    border: none;
}

.spread-b-shapes-column .circle-stack-2 {
    position: relative;
    width: 70px;
    height: 70px;
    background-color: var(--accent-secondary);
    border-color: var(--ink);
}

.spread-b-shapes-column .discus-fish-stack {
    position: relative;
}

/* ==========================================================================
   SPREAD C: The Exhibition
   ========================================================================== */
.spread-c {
    display: flex;
    align-items: center;
    background-color: var(--bg);
    background-image: radial-gradient(circle, #6B1D3A 3px, transparent 3px);
    background-size: 14px 14px;
}

.spread-c-layout {
    display: flex;
    width: 100%;
    height: 60vh;
    align-items: center;
}

.spread-c-callout {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.callout-word {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(80px, 12vw, 180px);
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--accent);
    display: block;
}

.spread-c-divider {
    width: 4px;
    height: 60vh;
    background-color: var(--accent);
    flex-shrink: 0;
}

.spread-c .fish {
    display: block;
}

/* ==========================================================================
   SPREAD D: The Manifesto (Inverted)
   ========================================================================== */
.spread-d.inverted {
    background-color: var(--dark-ground);
}

.spread-d.inverted h2 {
    color: var(--cream);
}

.spread-d.inverted .body-text {
    color: var(--cream);
}

.spread-d.inverted .callout-text {
    color: var(--accent-secondary);
}

.spread-d.inverted .spread-label {
    color: var(--cream);
    opacity: 0.3;
}

.spread-d-layout {
    display: flex;
    width: 100%;
    min-height: 80vh;
    align-items: center;
    padding-left: 12%;
    padding-right: 5%;
    gap: 5%;
}

.spread-d-text {
    flex: 0 0 50%;
    z-index: 2;
}

.spread-d-headline {
    margin-bottom: 2.5rem;
}

.spread-d-composition {
    flex: 0 0 45%;
    position: relative;
    height: 500px;
}

/* Spread D Shapes */
.d-circle-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 20%;
    background-color: var(--accent);
    border-color: var(--cream);
    opacity: 0.8;
}

.d-circle-2 {
    width: 160px;
    height: 160px;
    top: 30%;
    left: 45%;
    background-color: var(--accent-secondary);
    border-color: var(--cream);
}

.d-circle-3 {
    width: 100px;
    height: 100px;
    bottom: 15%;
    left: 10%;
    background-color: var(--coral);
    border-color: var(--cream);
}

.d-triangle-1 {
    width: 140px;
    height: 140px;
    top: 5%;
    right: 10%;
    background-color: var(--teal);
    border: none;
}

.d-polygon-1 {
    width: 120px;
    height: 120px;
    bottom: 10%;
    right: 20%;
    background: linear-gradient(135deg, #9E4B6C, #6B1D3A);
    border: none;
}

.angel-fish-d {
    position: absolute;
    top: 40%;
    left: 35%;
    z-index: 2;
}

/* ==========================================================================
   SPREAD E: The Coda
   ========================================================================== */
.spread-e {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--bg);
    padding: 120px 12%;
}

.spread-e-content {
    max-width: 680px;
    margin-bottom: 80px;
}

.spread-e-headline {
    margin-bottom: 2rem;
}

.spread-e-body {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

.spread-e .meta-text {
    margin-top: 2rem;
}

/* Spread E Fish Constellation */
.spread-e-fish-constellation {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 60px 80px;
    width: 500px;
    height: 300px;
    position: relative;
}

.school-fish {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    justify-self: center;
    align-self: center;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    h1 {
        font-size: 3.5rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    .spread-a {
        padding-left: 8%;
        padding-right: 8%;
    }

    .spread-b-layout {
        flex-direction: column;
        padding-left: 8%;
        padding-right: 8%;
    }

    .spread-b-text {
        flex: 1;
    }

    .spread-b-shapes-column {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding-top: 40px;
    }

    .spread-c-layout {
        flex-direction: column;
        height: auto;
        gap: 40px;
        padding: 0 8%;
    }

    .spread-c-divider {
        width: 80%;
        height: 4px;
    }

    .callout-word {
        font-size: 60px;
    }

    .spread-d-layout {
        flex-direction: column;
        padding-left: 8%;
        padding-right: 8%;
    }

    .spread-d-text {
        flex: 1;
    }

    .spread-d-composition {
        height: 300px;
        width: 100%;
    }

    .spread-e-fish-constellation {
        width: 320px;
        gap: 30px 40px;
    }

    .spread-a-shapes .circle-large {
        width: 160px;
        height: 160px;
    }

    .spread-a-shapes .triangle-1 {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .body-text {
        font-size: 1.1rem;
    }

    .callout-text {
        font-size: 1.5rem;
    }

    .callout-word {
        font-size: 40px;
    }

    .spread-e-fish-constellation {
        grid-template-columns: repeat(3, 1fr);
        width: 240px;
        gap: 25px 30px;
    }
}
