/* ============================================
   ROOT STYLES & TYPOGRAPHY
   ============================================ */

:root {
    --bg-primary: #F4F0F8;
    --bg-surface: #E8F2EC;
    --text-primary: #2A2035;
    --text-secondary: #7A6B8A;
    --accent-rose: #D4889A;
    --accent-sage: #8AAE8A;
    --accent-sky: #8A9AC4;
    --rule-color: #C4BCD4;
    --marginalia-color: #B07A6A;
    --iso-top: #E8F2EC;
    --iso-left: #C4D8CC;
    --iso-right: #D4E4D8;
}

html {
    scroll-behavior: smooth;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(0.95rem, 1.05vw, 1.05rem);
    line-height: 1.8;
    letter-spacing: 0.01em;
    font-weight: 400;
}

/* Typography */

h1, h2, h3 {
    font-family: 'Kalam', cursive;
    font-weight: 700;
    line-height: 1.15;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

h3 {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1.2rem;
    color: var(--text-primary);
}

blockquote {
    font-family: 'Kalam', cursive;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-style: italic;
    color: var(--text-secondary);
    margin: 2rem 0;
    text-align: center;
}

code, kbd, samp {
    font-family: 'Courier Prime', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

/* ============================================
   SPREAD LAYOUT & STRUCTURE
   ============================================ */

.spread {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    position: relative;
    overflow: hidden;
}

.spread-container {
    width: 100%;
    max-width: 1100px;
}

/* Spread-specific background patterns */

.spread-cover {
    background-color: var(--bg-primary);
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 35px,
        rgba(0, 0, 0, 0.03) 35px,
        rgba(0, 0, 0, 0.03) 70px
    );
}

.spread-abstract {
    background-color: #E8E4F0;
    background-image: radial-gradient(
        circle,
        rgba(0, 0, 0, 0.04) 1px,
        transparent 1px
    );
    background-size: 20px 20px;
}

.spread-findings {
    background-color: var(--bg-primary);
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 40px,
        rgba(0, 0, 0, 0.025) 40px,
        rgba(0, 0, 0, 0.025) 80px
    );
}

.spread-appendix {
    background-color: #FAFAF8;
}

/* ============================================
   SPREAD I: COVER
   ============================================ */

.cover-content {
    text-align: center;
    width: 100%;
}

.report-title {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.cover-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
}

/* Isometric Desk Illustration */

.isometric-desk {
    width: 300px;
    height: 300px;
    margin: 3rem auto 0;
    perspective: 1000px;
}

.desk-top {
    width: 100%;
    height: 100%;
    position: relative;
    transform: rotateX(55deg) rotateZ(-45deg);
    transform-style: preserve-3d;
}

.desk-surface {
    position: absolute;
    width: 240px;
    height: 180px;
    background: var(--iso-top);
    border: 2px solid var(--rule-color);
    top: 30px;
    left: 30px;
}

.desk-surface::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 85px;
    height: 85px;
    background: var(--iso-left);
    border: 2px solid var(--rule-color);
    border-right: none;
    border-top: none;
    transform: skewY(30deg);
}

.desk-surface::before {
    content: '';
    position: absolute;
    top: -2px;
    right: 0;
    width: 85px;
    height: 85px;
    background: var(--iso-right);
    border: 2px solid var(--rule-color);
    border-left: none;
    border-top: none;
    transform: skewY(-30deg);
}

.papers {
    position: absolute;
    width: 80px;
    height: 100px;
    background: #F5F0E8;
    border: 1px solid var(--rule-color);
    top: 50px;
    left: 80px;
    transform: rotateZ(3deg);
}

.papers::before {
    content: '';
    position: absolute;
    width: 75px;
    height: 8px;
    background: #E8E0D0;
    top: 10px;
    left: 2px;
}

.papers::after {
    content: '';
    position: absolute;
    width: 75px;
    height: 8px;
    background: #E0D8C8;
    top: 22px;
    left: 2px;
}

.quill {
    position: absolute;
    width: 6px;
    height: 80px;
    background: #8B7355;
    top: 60px;
    left: 180px;
    transform: rotateZ(-25deg);
}

.quill::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #D4889A;
    border-radius: 50%;
    bottom: -8px;
    left: -3px;
}

.quill::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #E8F2EC 40%, transparent 70%);
    border: 2px solid var(--rule-color);
    border-radius: 50%;
    top: -30px;
    left: -7px;
}

.orb {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #8A9AC4, #7A8BA8);
    border-radius: 50%;
    top: 40px;
    right: 50px;
    border: 2px solid var(--accent-sky);
    box-shadow: inset -10px -10px 20px rgba(0, 0, 0, 0.1);
}

/* ============================================
   SPREAD II: ABSTRACT
   ============================================ */

.abstract-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 40px;
    align-items: start;
}

.abstract-main {
    padding-right: 20px;
    border-right: 2px solid var(--rule-color);
}

.abstract-main h2 {
    margin-top: 0;
}

.abstract-sidebar h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.key-terms {
    list-style: none;
}

.key-term {
    position: relative;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.key-term::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-rose);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.key-term.reveal {
    color: var(--text-primary);
    transition: color 300ms ease-in;
}

.key-term.reveal::after {
    transform: scaleX(1);
}

/* ============================================
   SPREAD III: FINDINGS
   ============================================ */

.findings-title {
    text-align: center;
    margin-bottom: 2rem;
}

.findings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-bottom: 2rem;
    position: relative;
}

.findings-grid::before,
.findings-grid::after {
    content: '';
    position: absolute;
    background: var(--rule-color);
    top: 0;
    bottom: 0;
    width: 2px;
}

.findings-grid::before {
    left: 33.333%;
}

.findings-grid::after {
    left: 66.666%;
}

.finding-column {
    padding: 0 20px;
}

.finding-column:first-child {
    padding-left: 0;
}

.finding-column:last-child {
    padding-right: 0;
}

.finding-chart {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.isometric-chart {
    width: 180px;
    height: 160px;
    perspective: 1000px;
    position: relative;
}

.chart-bar {
    position: absolute;
    bottom: 20px;
    background: var(--iso-top);
    border: 1px solid var(--rule-color);
    transform: rotateX(55deg) rotateZ(-45deg);
}

.chart-1 .bar-1 {
    width: 30px;
    height: 50px;
    left: 30px;
    background: var(--accent-rose);
}

.chart-1 .bar-1::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.1);
    left: -15px;
    top: 0;
}

.chart-1 .bar-2 {
    width: 30px;
    height: 70px;
    left: 75px;
    background: var(--accent-sage);
}

.chart-1 .bar-2::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.1);
    left: -15px;
    top: 0;
}

.chart-1 .bar-3 {
    width: 30px;
    height: 55px;
    left: 120px;
    background: var(--accent-sky);
}

.chart-1 .bar-3::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.1);
    left: -15px;
    top: 0;
}

.chart-2 .bar-1,
.chart-2 .bar-2,
.chart-2 .bar-3,
.chart-3 .bar-1,
.chart-3 .bar-2,
.chart-3 .bar-3 {
    width: 30px;
    background: var(--accent-rose);
    opacity: 0.8;
}

.chart-2 .bar-1 {
    height: 45px;
    left: 30px;
}

.chart-2 .bar-2 {
    height: 65px;
    left: 75px;
    background: var(--accent-sage);
}

.chart-2 .bar-3 {
    height: 48px;
    left: 120px;
    background: var(--accent-sky);
}

.chart-3 .bar-1 {
    height: 60px;
    left: 30px;
    background: var(--accent-sky);
}

.chart-3 .bar-2 {
    height: 75px;
    left: 75px;
    background: var(--accent-rose);
}

.chart-3 .bar-3 {
    height: 52px;
    left: 120px;
    background: var(--accent-sage);
}

.pull-quote {
    grid-column: span 2;
    margin: 3rem auto;
    max-width: 600px;
    text-align: center;
    position: relative;
    padding: 0 40px;
}

.pull-quote::before,
.pull-quote::after {
    content: '"';
    font-size: 3rem;
    color: var(--accent-rose);
    opacity: 0.3;
    position: absolute;
    line-height: 1;
}

.pull-quote::before {
    left: 0;
    top: -10px;
}

.pull-quote::after {
    right: 0;
    bottom: -20px;
}

.pull-quote::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    width: 60px;
    height: 2px;
    background: var(--accent-rose);
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pull-quote.reveal {
    color: var(--accent-rose);
    transition: color 300ms ease-in;
}

.pull-quote.reveal::after {
    transform: translateX(-50%) scaleX(1);
}

/* ============================================
   SPREAD IV: APPENDIX
   ============================================ */

.appendix-content {
    max-width: 800px;
}

.marginalia-section {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 100px;
}

.marginalia {
    position: absolute;
    left: -100px;
    width: 80px;
    font-family: 'Kalam', cursive;
    font-size: 0.75rem;
    color: var(--marginalia-color);
    transform: rotate(-2deg);
    text-align: right;
    line-height: 1.4;
}

.marginalia-section:nth-child(2) .marginalia {
    transform: rotate(1deg);
}

.marginalia-section:nth-child(3) .marginalia {
    transform: rotate(-1.5deg);
}

.marginalia-section:nth-child(4) .marginalia {
    transform: rotate(2deg);
}

.marginalia-section:nth-child(5) .marginalia {
    transform: rotate(-0.5deg);
}

.marginalia-section:nth-child(6) .marginalia {
    transform: rotate(1.5deg);
}

.report-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--rule-color);
    text-align: center;
}

.footer-text {
    font-family: 'Courier Prime', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

/* ============================================
   ANIMATIONS
   ============================================ */

.animate-underline {
    position: relative;
}

.animate-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-rose);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-underline.reveal {
    color: var(--text-primary);
    transition: color 300ms ease-in 600ms;
}

.animate-underline.reveal::after {
    transform: scaleX(1);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .spread {
        padding: 40px 30px;
        min-height: auto;
    }

    .abstract-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .abstract-main {
        padding-right: 0;
        border-right: none;
        border-bottom: 2px solid var(--rule-color);
        padding-bottom: 30px;
    }

    .findings-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .findings-grid::before,
    .findings-grid::after {
        display: none;
    }

    .finding-column {
        padding: 0;
        border-bottom: 2px solid var(--rule-color);
        padding-bottom: 30px;
        margin-bottom: 30px;
    }

    .finding-column:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    .pull-quote {
        font-size: clamp(1.2rem, 2.5vw, 1.8rem);
        margin: 2rem 0;
        padding: 0 20px;
    }

    h1 {
        font-size: clamp(2rem, 5vw, 3.5rem);
    }

    h2 {
        font-size: clamp(1.3rem, 3vw, 2rem);
    }

    .marginalia-section {
        padding-left: 0;
        margin-bottom: 1.5rem;
    }

    .marginalia {
        position: static;
        display: inline-block;
        transform: rotate(0);
        text-align: left;
        margin-bottom: 0.5rem;
        margin-right: 1rem;
        font-weight: 600;
    }

    .marginalia::after {
        content: ':';
    }
}

@media (max-width: 480px) {
    .spread {
        padding: 30px 20px;
    }

    body {
        font-size: 0.95rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .pull-quote {
        font-size: 1.2rem;
        margin: 1.5rem 0;
    }

    .isometric-desk {
        width: 200px;
        height: 200px;
        margin: 2rem auto 0;
    }

    .cover-subtitle {
        font-size: 1rem;
    }
}
