/* tanso.market -- watercolor carbon bazaar */

:root {
    --cream: #FFF8F0;
    --umber: #2D1B0E;
    --magenta: #FF2D6F;
    --coral: #FF6B4A;
    --teal: #00C9A7;
    --leather: #8B6914;
    --leather-light: #A0834A;
    --leather-dark: #6B4E0A;
    --parchment: #F5E6D0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Nunito", system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.76;
    letter-spacing: 0.005em;
    color: var(--umber);
    background: var(--cream);
    overflow-x: hidden;
}

.codex {
    position: relative;
    overflow: hidden;
}

/* ---------- Magazine Spread Base ---------- */
.spread {
    display: grid;
    grid-template-columns: 45% 55%;
    min-height: 100vh;
    position: relative;
    background: var(--cream);
    overflow: hidden;
}

.spread::before {
    content: "";
    position: absolute;
    left: 45%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg,
        var(--leather) 0%,
        var(--leather-light) 30%,
        var(--leather) 60%,
        var(--leather-dark) 100%);
    background-size: 100% 20px;
    box-shadow: 0 0 8px rgba(107, 78, 10, 0.25);
    transform: translateX(-2px);
    z-index: 5;
}

.spread::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(rgba(107, 78, 10, 0.04) 1px, transparent 1px);
    background-size: 3px 3px;
    opacity: 0.6;
    mix-blend-mode: multiply;
}

.page {
    position: relative;
    padding: clamp(1.6rem, 5vw, 5rem);
    overflow: hidden;
}

.page-left {
    background: linear-gradient(135deg, var(--cream) 0%, var(--parchment) 100%);
}

.page-right {
    background: var(--cream);
}

/* ---------- Typography ---------- */
.eyebrow {
    font-family: "Lora", serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--leather);
    letter-spacing: 0.08em;
    margin-bottom: 1.6rem;
}

.domain-title {
    font-family: "Lora", serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.02em;
    line-height: 1.05;
    color: var(--umber);
    margin-bottom: 1.4rem;
}

.domain-title .dot {
    color: var(--magenta);
    display: inline-block;
    transform: translateY(-0.02em);
}

.subhead {
    font-family: "Lora", serif;
    font-style: italic;
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    font-weight: 500;
    color: var(--umber);
    max-width: 34ch;
    line-height: 1.5;
    margin-bottom: 2.4rem;
}

.section-label {
    font-family: "Lora", serif;
    font-style: italic;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.82rem;
    color: var(--leather);
    margin-bottom: 1rem;
}

.section-heading {
    font-family: "Lora", serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-style: italic;
    line-height: 1.2;
    color: var(--umber);
    margin-bottom: 1.6rem;
    max-width: 22ch;
}

.body-text {
    max-width: 34ch;
    margin-bottom: 1.2rem;
    color: var(--umber);
}

.pull-quote {
    font-family: "Lora", serif;
    font-style: italic;
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--magenta);
    border-left: 3px solid var(--leather-light);
    padding-left: 1.1rem;
    margin-top: 1.6rem;
    max-width: 30ch;
    line-height: 1.5;
}

.closing-signature {
    font-family: "Lora", serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 0.02em;
    color: var(--umber);
    margin-top: 2rem;
    line-height: 1;
}

.closing-signature .dot {
    color: var(--magenta);
}

.colophon {
    font-family: "Lora", serif;
    font-style: italic;
    color: var(--leather);
    margin-top: 0.8rem;
    font-size: 0.95rem;
}

/* ---------- Hero (Spread 1) ---------- */
.page-left-hero {
    padding: 0;
    position: relative;
}

.watercolor {
    position: absolute;
    inset: -5%;
    width: 110%;
    height: 110%;
    overflow: visible;
    pointer-events: none;
}

.watercolor-hero {
    inset: -10%;
    width: 120%;
    height: 120%;
}

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

.right-inner {
    max-width: 40ch;
    padding: 1rem 0;
}

.scroll-cue {
    font-family: "Lora", serif;
    font-style: italic;
    color: var(--leather);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.scroll-arrow {
    display: inline-block;
    animation: bob 2.4s ease-in-out infinite;
    font-size: 1.2rem;
    color: var(--magenta);
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ---------- Ledger (Spread 2) ---------- */
.ledger-column {
    max-width: 34ch;
    padding-top: 2rem;
}

.page-right-ledger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.watercolor-ledger {
    inset: -5%;
    width: 110%;
    height: 110%;
}

/* ---------- Exchange (Spread 3) ---------- */
.spread-three {
    grid-template-columns: 1fr;
}

.spread-three::before {
    display: none;
}

.exchange-wide {
    position: relative;
    padding: clamp(2rem, 5vw, 5rem);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.exchange-heading {
    max-width: 28ch;
    margin-bottom: 2rem;
}

.leather-band {
    height: 14px;
    background: linear-gradient(180deg,
        var(--leather) 0%,
        var(--leather-light) 30%,
        var(--leather) 60%,
        var(--leather-dark) 100%);
    background-size: 20px 100%;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(107, 78, 10, 0.25);
    margin: 1.4rem 0 2rem;
    position: relative;
}

.leather-band::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(45, 27, 14, 0.3) 1px, transparent 1px);
    background-size: 4px 4px;
    opacity: 0.15;
}

.leather-band-bottom {
    margin: 2rem 0 2.5rem;
}

.stall-row {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1rem, 4vw, 3rem);
    justify-content: space-between;
    align-items: flex-end;
    margin: 1rem 0;
    padding: 1rem 0;
}

.stall {
    flex: 1 1 120px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.4s ease;
}

.stall:hover {
    transform: translateY(-6px);
}

.stall-icon {
    width: clamp(64px, 8vw, 100px);
    height: clamp(64px, 8vw, 100px);
    overflow: visible;
}

.stall figcaption {
    font-family: "Lora", serif;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--leather);
    margin-top: 0.4rem;
    letter-spacing: 0.03em;
}

.exchange-columns {
    column-count: 2;
    column-gap: clamp(2rem, 4vw, 4rem);
    column-rule: 1px dashed var(--leather-light);
    margin-top: 2rem;
}

.exchange-columns .column {
    break-inside: avoid;
    max-width: none;
    margin-bottom: 1.2rem;
}

/* ---------- Close (Spread 4) ---------- */
.page-left-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--parchment) 0%, var(--cream) 100%);
    position: relative;
}

.close-blob-stage {
    position: relative;
    width: min(80%, 420px);
    aspect-ratio: 1;
}

.watercolor-close {
    position: absolute;
    inset: -10%;
    width: 120%;
    height: 120%;
    overflow: visible;
}

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

.right-inner-close {
    max-width: 42ch;
}

/* ---------- Organic Blobs ---------- */
.blob {
    position: absolute;
    pointer-events: none;
    border-radius: 42% 58% 70% 30% / 45% 55% 60% 40%;
    animation: morph 8s ease-in-out infinite;
    z-index: 0;
    filter: blur(0.5px);
}

@keyframes morph {
    0% { border-radius: 42% 58% 70% 30% / 45% 55% 60% 40%; }
    50% { border-radius: 58% 42% 30% 70% / 55% 45% 40% 60%; }
    100% { border-radius: 42% 58% 70% 30% / 45% 55% 60% 40%; }
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(18px, -24px); }
}

.blob-hero-a {
    width: 260px;
    height: 260px;
    background: rgba(255, 45, 111, 0.25);
    top: 10%;
    left: 8%;
    animation: morph 8s ease-in-out infinite, drift 11s ease-in-out infinite;
    animation-delay: 0s, 0s;
}

.blob-hero-b {
    width: 200px;
    height: 200px;
    background: rgba(0, 201, 167, 0.22);
    bottom: 10%;
    right: 12%;
    animation: morph 9s ease-in-out infinite 2s, drift 13s ease-in-out infinite 1s;
}

.blob-ledger-a {
    width: 240px;
    height: 240px;
    background: rgba(255, 107, 74, 0.25);
    top: 8%;
    right: 12%;
    animation-delay: 0s;
}

.blob-ledger-b {
    width: 200px;
    height: 200px;
    background: rgba(0, 201, 167, 0.24);
    bottom: 12%;
    left: 10%;
    animation-delay: 2s;
}

.blob-ledger-c {
    width: 170px;
    height: 170px;
    background: rgba(255, 45, 111, 0.22);
    top: 45%;
    right: 30%;
    animation-delay: 4s;
}

.blob-exchange-a {
    width: 300px;
    height: 300px;
    background: rgba(255, 45, 111, 0.18);
    top: 15%;
    left: -4%;
    z-index: -1;
    animation-delay: 0s;
}

.blob-exchange-b {
    width: 260px;
    height: 260px;
    background: rgba(0, 201, 167, 0.18);
    bottom: 10%;
    right: -3%;
    z-index: -1;
    animation-delay: 2s;
}

.blob-exchange-c {
    width: 200px;
    height: 200px;
    background: rgba(255, 107, 74, 0.18);
    top: 55%;
    left: 45%;
    z-index: -1;
    animation-delay: 4s;
}

.blob-close {
    width: 100%;
    height: 100%;
    background: rgba(255, 45, 111, 0.38);
    position: absolute;
    inset: 0;
    animation: morph 10s ease-in-out infinite;
}

.blob-close-echo {
    width: 80%;
    height: 80%;
    background: rgba(255, 107, 74, 0.30);
    position: absolute;
    top: 15%;
    left: 12%;
    animation: morph 12s ease-in-out infinite 3s;
    mix-blend-mode: multiply;
}

/* ---------- Fade-Reveal Pattern ---------- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    will-change: opacity, transform;
}

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

/* ---------- Progress Rail ---------- */
.progress-rail {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(139, 105, 20, 0.12);
    z-index: 100;
}

.progress-ink {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--magenta), var(--coral), var(--teal));
    transition: width 0.15s ease-out;
    box-shadow: 0 0 8px rgba(255, 45, 111, 0.45);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .spread {
        grid-template-columns: 1fr;
    }

    .spread::before {
        display: none;
    }

    .page {
        min-height: 70vh;
    }

    .page-left-hero {
        min-height: 50vh;
    }

    .exchange-columns {
        column-count: 1;
    }

    .stall-row {
        justify-content: center;
    }

    .close-blob-stage {
        width: 70vw;
    }
}

@media (max-width: 600px) {
    .domain-title {
        font-size: clamp(2.2rem, 12vw, 3.4rem);
    }

    .page {
        padding: 1.5rem;
    }
}
