/* ============================================================
   footprint.markets — A Quarterly Review
   Editorial / Magazine-Spread / Serif-Classic
   ============================================================ */

:root {
    --c-bg: #F5F0E8;          /* Aged Ivory */
    --c-ink: #1A1714;         /* Printer's Black */
    --c-deep: #0A0806;        /* Deep Walnut */
    --c-gold: #B8860B;        /* Dark Goldenrod */
    --c-tobacco: #6B5D4F;     /* Tobacco */
    --c-rule: #3D3529;        /* Engraving Line */
    --c-parchment: #D4C5A0;   /* Parchment Gold */
    --c-sepia: #8B7D6B;       /* Sepia Wash */
    --c-walnut-deep: #3D3529;

    --f-display: 'Cormorant Garamond', 'Garamond', 'Times New Roman', serif;
    --f-body: 'Lora', 'Georgia', 'Times New Roman', serif;
    --f-annot: 'Source Serif 4', 'Source Serif Pro', 'Georgia', serif;

    --ease-curtain: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-in-text: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out-text: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: var(--f-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    overflow: hidden;
}

::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Scroll progress line ------------------------------------------ */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 100vh;
    background: var(--c-gold);
    transform-origin: top center;
    transform: scaleY(0);
    z-index: 1000;
    pointer-events: none;
    transition: transform 0.18s linear;
}

/* Main reader (scroll snap container) --------------------------- */
#reader {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

#reader::-webkit-scrollbar {
    display: none;
}

/* Spread base --------------------------------------------------- */
.spread {
    position: relative;
    width: 100vw;
    height: 100vh;
    min-height: 640px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: var(--c-bg);
    color: var(--c-ink);
    padding: clamp(36px, 5vh, 64px) clamp(36px, 6vw, 96px);
    display: grid;
    overflow: hidden;
}

/* Section numeral cartouche ------------------------------------- */
.section-numeral {
    position: absolute;
    top: clamp(28px, 4vh, 52px);
    left: clamp(36px, 6vw, 96px);
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    color: var(--c-tobacco);
    opacity: 0.85;
    z-index: 5;
    padding: 8px 0;
    border-top: 1px solid rgba(107, 93, 79, 0.6);
    border-bottom: 1px solid rgba(107, 93, 79, 0.6);
    min-width: 56px;
    text-align: center;
}

.section-numeral.light {
    color: var(--c-parchment);
    border-top-color: rgba(212, 197, 160, 0.55);
    border-bottom-color: rgba(212, 197, 160, 0.55);
}

/* ============================================================
   Reveal animations
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateX(-40px);
    transition:
        opacity 800ms var(--ease-in-text),
        transform 800ms var(--ease-in-text);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-body {
    opacity: 0;
    transform: translateX(-40px);
    transition:
        opacity 800ms var(--ease-in-text) 200ms,
        transform 800ms var(--ease-in-text) 200ms;
}
.reveal-body.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-annot {
    opacity: 0;
    transform: translateX(-40px);
    transition:
        opacity 600ms var(--ease-out-text) 400ms,
        transform 600ms var(--ease-out-text) 400ms;
}
.reveal-annot.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-rule {
    opacity: 0;
    transition: opacity 400ms ease 500ms;
}
.reveal-rule.is-visible {
    opacity: 1;
}

.reveal-cap {
    opacity: 0;
    transform: scale(0.8);
    transform-origin: left top;
    transition:
        opacity 1200ms ease 0ms,
        transform 1200ms ease 0ms;
}
.reveal-cap.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================================
   Drop caps
   ============================================================ */
.drop-cap {
    font-family: var(--f-display);
    font-weight: 600;
    font-style: normal;
    color: var(--c-gold);
    float: left;
    font-size: clamp(4rem, 8vw, 6.5rem);
    line-height: 0.85;
    padding-top: 0.06em;
    padding-right: 0.12em;
    margin-right: 0.04em;
    margin-bottom: -0.08em;
    shape-outside: margin-box;
}

/* ============================================================
   Spread 1 — Masthead & Lead Essay
   ============================================================ */
.spread-1 {
    grid-template-rows: auto 1fr;
    gap: clamp(20px, 3vh, 36px);
}

.masthead {
    text-align: center;
    padding-top: clamp(18px, 3vh, 36px);
}

.masthead-overline {
    font-family: var(--f-annot);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.72rem, 1vw, 0.85rem);
    letter-spacing: 0.18em;
    color: var(--c-tobacco);
    text-transform: uppercase;
    margin-bottom: clamp(10px, 1.5vh, 18px);
}

.masthead-title {
    font-family: var(--f-display);
    font-weight: 600;
    font-style: normal;
    font-size: clamp(2.8rem, 9vw, 7rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-ink);
    line-height: 1.0;
    margin-bottom: clamp(12px, 2vh, 22px);
}

.masthead-meta {
    font-family: var(--f-annot);
    font-weight: 300;
    font-style: normal;
    font-size: clamp(0.72rem, 1vw, 0.85rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-tobacco);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: clamp(14px, 2vh, 22px);
}

.masthead-divider {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--c-gold);
    transform: rotate(45deg);
}

.masthead-rule {
    border: none;
    height: 1px;
    background: var(--c-rule);
    width: 100%;
    margin: 0;
}

.spread-1-body {
    display: grid;
    grid-template-columns: 7fr 1fr 4fr;
    column-gap: 20px;
    align-items: start;
    overflow: hidden;
}

.lead-essay {
    grid-column: 1 / 2;
    max-height: 100%;
    overflow: hidden;
}

.essay-eyebrow {
    font-family: var(--f-annot);
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--c-tobacco);
    margin-bottom: 0.5em;
}

.essay-title {
    font-family: var(--f-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.6rem, 4vw, 3.2rem);
    letter-spacing: 0.01em;
    color: var(--c-ink);
    line-height: 1.1;
    margin-bottom: 0.4em;
}

.essay-byline {
    font-family: var(--f-annot);
    font-weight: 300;
    font-style: italic;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    color: var(--c-tobacco);
    margin-bottom: 1.4em;
    padding-bottom: 1em;
    border-bottom: 1px solid rgba(61, 53, 41, 0.4);
}

.essay-paragraph {
    font-family: var(--f-body);
    font-weight: 400;
    font-size: clamp(0.92rem, 1.2vw, 1.05rem);
    line-height: 1.72;
    color: var(--c-ink);
    text-align: justify;
    hyphens: auto;
    margin-bottom: 0.8em;
    letter-spacing: 0.01em;
}

.essay-paragraph + .essay-paragraph {
    text-indent: 1.5em;
}

sup.ref {
    font-family: var(--f-annot);
    color: var(--c-gold);
    font-size: 0.7em;
    margin-left: 1px;
    cursor: pointer;
    transition: color 0.3s ease;
}
sup.ref.is-active {
    color: var(--c-gold);
    background: rgba(184, 134, 11, 0.15);
    padding: 0 3px;
    border-radius: 2px;
}

.lead-sidebar {
    grid-column: 3 / 4;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-self: stretch;
    max-height: 100%;
    overflow: hidden;
}

.sidebar-overline {
    font-family: var(--f-annot);
    font-weight: 300;
    font-size: 0.72rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--c-tobacco);
    border-bottom: 1px solid var(--c-rule);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.annotation-block {
    border: 1px solid var(--c-rule);
    padding: 14px 16px;
    background: transparent;
    transition: background-color 0.4s ease, border-color 0.4s ease;
    cursor: default;
}

.annotation-block:hover {
    background: rgba(212, 197, 160, 0.18);
    border-color: var(--c-gold);
}

.annotation-date {
    font-family: var(--f-annot);
    font-weight: 300;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-gold);
    font-variant: small-caps;
    margin-bottom: 8px;
}

.annotation-text {
    font-family: var(--f-body);
    font-style: italic;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--c-ink);
    margin-bottom: 8px;
}

.annotation-source {
    font-family: var(--f-annot);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--c-tobacco);
    font-variant: small-caps;
}

/* ============================================================
   Spread 2 — Analytical Deep-Dive
   ============================================================ */
.spread-2 {
    grid-template-columns: 3fr 9fr;
    column-gap: 32px;
    padding-top: clamp(72px, 9vh, 110px);
}

.pullquote-rail {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding-right: 22px;
    border-right: 1px solid var(--c-rule);
}

.pullquote {
    position: relative;
    padding: 28px 18px 28px 36px;
    color: var(--c-gold);
    font-family: var(--f-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.2rem, 2.2vw, 1.9rem);
    line-height: 1.18;
    letter-spacing: 0.005em;
}

.pullquote p {
    margin: 0 0 0.6em 0;
}

.pullquote::before {
    content: '\201C';
    position: absolute;
    top: -18px;
    left: -6px;
    font-family: var(--f-display);
    font-weight: 300;
    font-size: 6rem;
    color: var(--c-gold);
    opacity: 0.25;
    line-height: 1;
}

.pullquote::after {
    content: '\201D';
    position: absolute;
    bottom: -54px;
    right: 8px;
    font-family: var(--f-display);
    font-weight: 300;
    font-size: 6rem;
    color: var(--c-gold);
    opacity: 0.25;
    line-height: 1;
}

.pullquote cite {
    display: block;
    font-family: var(--f-annot);
    font-style: normal;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-tobacco);
    margin-top: 6px;
}

.dual-essay {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    column-gap: 28px;
    height: 100%;
    overflow: hidden;
}

.dual-divider {
    width: 1px;
    background: var(--c-rule);
    height: 100%;
    justify-self: center;
}

.dual-column {
    overflow: hidden;
    padding: 0 6px;
}

.column-eyebrow {
    font-family: var(--f-annot);
    font-weight: 300;
    font-size: 0.74rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--c-tobacco);
    margin-bottom: 0.6em;
}

.column-title {
    font-family: var(--f-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.3rem, 2.4vw, 2rem);
    letter-spacing: 0.01em;
    color: var(--c-ink);
    line-height: 1.15;
    margin-bottom: 0.4em;
}

.column-byline {
    font-family: var(--f-annot);
    font-weight: 300;
    font-style: italic;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--c-tobacco);
    margin-bottom: 1.2em;
    padding-bottom: 0.9em;
    border-bottom: 1px solid rgba(61, 53, 41, 0.4);
}

.dual-column p {
    font-family: var(--f-body);
    font-size: clamp(0.88rem, 1.05vw, 1rem);
    line-height: 1.7;
    color: var(--c-ink);
    text-align: justify;
    hyphens: auto;
    margin-bottom: 0.7em;
    letter-spacing: 0.005em;
}

.dual-column p + p {
    text-indent: 1.4em;
}

/* ============================================================
   Spread 3 — Photographic Interlude
   ============================================================ */
.spread-3 {
    padding: 0;
    background: var(--c-deep);
    grid-template-rows: 1fr;
}

.photo-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.photo-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1400ms var(--ease-curtain);
}

.spread-3.is-visible .photo-canvas {
    clip-path: inset(0 0 0 0);
}

.photo-svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: grayscale(0.85) sepia(0.35) contrast(1.1) brightness(0.75);
}

.photo-canvas::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.35'/></svg>");
    opacity: 0.18;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.photo-overlay {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 42%;
    min-width: 360px;
    height: 40%;
    min-height: 260px;
    background: rgba(10, 8, 6, 0.78);
    color: var(--c-bg);
    padding: clamp(24px, 4vh, 48px) clamp(28px, 4vw, 56px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid rgba(184, 134, 11, 0.4);
    border-top: 1px solid rgba(184, 134, 11, 0.4);
}

.overlay-text {
    font-family: var(--f-display);
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.05rem, 1.6vw, 1.5rem);
    line-height: 1.5;
    color: #F5F0E8;
    margin-bottom: 1.2em;
    letter-spacing: 0.005em;
}

.overlay-rule {
    border: none;
    height: 1px;
    background: var(--c-gold);
    width: 60px;
    margin: 0 0 1em 0;
    opacity: 0.7;
}

.overlay-credit {
    font-family: var(--f-annot);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-parchment);
    font-variant: small-caps;
}

/* ============================================================
   Spread 4 — Marginalia
   ============================================================ */
.spread-4 {
    padding-top: clamp(72px, 9vh, 110px);
}

.marginalia-grid {
    display: grid;
    grid-template-columns: 3fr 6fr 3fr;
    column-gap: 28px;
    height: 100%;
    overflow: hidden;
}

.margin {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.margin-overline {
    font-family: var(--f-annot);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--c-tobacco);
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--c-rule);
}

.margin-note {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    padding: 12px 10px;
    transition: background-color 0.4s ease;
    cursor: default;
}

.margin-note.is-active,
.margin-note:hover {
    background: rgba(212, 197, 160, 0.22);
}

.margin-num {
    font-family: var(--f-display);
    font-weight: 600;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--c-gold);
    letter-spacing: 0.04em;
    line-height: 1.5;
}

.margin-note p {
    font-family: var(--f-annot);
    font-weight: 300;
    font-size: clamp(0.74rem, 0.95vw, 0.86rem);
    line-height: 1.55;
    color: var(--c-tobacco);
    letter-spacing: 0.015em;
}

.margin-note p em {
    font-style: italic;
    color: var(--c-ink);
}

.smallcap {
    font-variant: small-caps;
    letter-spacing: 0.06em;
    color: var(--c-ink);
}

.margin-rule {
    border: none;
    height: 0.5px;
    background: rgba(107, 93, 79, 0.4);
    width: 100%;
    transition: background-color 0.6s ease;
}

.margin-rule:hover,
.margin .is-active + .margin-rule {
    background: var(--c-gold);
}

.margin-body {
    overflow: hidden;
    padding: 0 10px;
}

.body-eyebrow {
    font-family: var(--f-annot);
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--c-tobacco);
    margin-bottom: 0.5em;
}

.body-title {
    font-family: var(--f-display);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.6rem);
    letter-spacing: 0.01em;
    color: var(--c-ink);
    line-height: 1.1;
    margin-bottom: 0.8em;
    padding-bottom: 0.6em;
    border-bottom: 1px solid var(--c-rule);
}

.margin-body p {
    font-family: var(--f-body);
    font-size: clamp(0.92rem, 1.15vw, 1.05rem);
    line-height: 1.72;
    color: var(--c-ink);
    text-align: justify;
    hyphens: auto;
    margin-bottom: 0.8em;
    letter-spacing: 0.01em;
}

.margin-body p + p {
    text-indent: 1.5em;
}

/* ============================================================
   Spread 5 — Colophon
   ============================================================ */
.spread-5 {
    background: var(--c-deep);
    color: var(--c-bg);
    grid-template-rows: 1fr;
    align-items: center;
    justify-items: center;
    text-align: center;
    padding: 0 clamp(36px, 8vw, 140px);
}

.spread-5 .section-numeral {
    color: var(--c-parchment);
    border-top-color: rgba(212, 197, 160, 0.55);
    border-bottom-color: rgba(212, 197, 160, 0.55);
}

.colophon {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: 33% auto;
    align-items: end;
    justify-items: center;
}

.colophon-rule-top {
    align-self: end;
    width: 38%;
    min-width: 280px;
    height: 1px;
    border: none;
    background: var(--c-gold);
    margin: 0;
    opacity: 0.85;
}

.colophon-body {
    width: 100%;
    max-width: 720px;
    padding-top: clamp(36px, 6vh, 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(18px, 3vh, 28px);
}

.colophon-mark {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: clamp(1.4rem, 2.6vw, 2.2rem);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--c-bg);
    padding-right: 0.4em;
}

.colophon-statement {
    font-family: var(--f-body);
    font-style: italic;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    color: var(--c-parchment);
    max-width: 56ch;
    text-align: center;
}

.colophon-line {
    font-family: var(--f-annot);
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--c-tobacco);
    font-variant: small-caps;
}

.colophon-rule-bottom {
    width: 60px;
    height: 1px;
    border: none;
    background: var(--c-gold);
    margin: clamp(8px, 1.6vh, 16px) 0;
}

.colophon-finis {
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.32em;
    color: var(--c-gold);
    text-transform: lowercase;
}

/* ============================================================
   Reduced viewport guards
   ============================================================ */
@media (max-width: 900px) {
    .spread {
        padding: 56px 28px 28px 28px;
    }
    .spread-1-body {
        grid-template-columns: 1fr;
        gap: 18px;
        overflow-y: auto;
    }
    .lead-sidebar {
        grid-column: 1 / 2;
    }
    .spread-2 {
        grid-template-columns: 1fr;
    }
    .pullquote-rail {
        display: none;
    }
    .dual-essay {
        grid-template-columns: 1fr;
    }
    .dual-divider {
        display: none;
    }
    .marginalia-grid {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    .margin {
        display: none;
    }
    .photo-overlay {
        width: 78%;
        height: 46%;
    }
}
