/* cbdc.study - Scholarly Research Library */

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

:root {
    --parchment: #FAF8F5;
    --card-surface: #FFFFFF;
    --ink: #2D2A26;
    --body-text: #4A4540;
    --sidenote-text: #8B7D6B;
    --rule-tan: #C4B5A0;
    --accent-burgundy: #8B3A3A;
    --accent-gold: #B8860B;
    --diagram-blue: #34659A;
    --light-tint: #F5F2ED;
}

body {
    background-color: var(--parchment);
    color: var(--body-text);
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    overflow-x: hidden;
}

/* ============================
   HERO: TITLE PAGE
   ============================ */

#hero {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 35vh;
    background-color: var(--parchment);
}

#hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(5rem, 14vw, 11rem);
    letter-spacing: 0.06em;
    color: var(--ink);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#hero-title.visible {
    opacity: 1;
    transform: translateY(0);
}

#hero-rule {
    width: 30vw;
    max-width: 300px;
    height: 1px;
    background-color: var(--rule-tan);
    margin: 2rem 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.6s ease 1s;
}

#hero-rule.visible {
    transform: scaleX(1);
}

#hero-subtitle {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--sidenote-text);
    opacity: 0;
    transition: opacity 0.6s ease 1.6s;
}

#hero-subtitle.visible {
    opacity: 1;
}

/* ============================
   ABSTRACT
   ============================ */

#abstract {
    max-width: 42rem;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.abstract-block {
    border-left: 3px solid var(--ink);
    padding-left: 24px;
}

.abstract-block p {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--body-text);
}

/* Section Break */
.section-break {
    text-align: center;
    font-size: 0.9rem;
    color: var(--rule-tan);
    letter-spacing: 1em;
    padding: 3rem 0;
}

/* ============================
   CHAPTERS
   ============================ */

.chapter {
    position: relative;
    max-width: 72rem;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.chapter-number {
    position: absolute;
    left: -2rem;
    top: 3rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 5rem;
    color: var(--rule-tan);
    opacity: 0.3;
}

.chapter-content {
    display: grid;
    grid-template-columns: 65% 30%;
    gap: 5%;
}

.chapter-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: 0.02em;
    color: var(--ink);
    margin-bottom: 1.5rem;
}

.main-column p {
    margin-bottom: 1.5rem;
}

/* Drop Cap */
.drop-cap {
    float: left;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 4.5rem;
    line-height: 0.85;
    color: var(--ink);
    margin-right: 8px;
    margin-top: 4px;
}

/* Side Column */
.side-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 3rem;
}

.sidenote {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--sidenote-text);
    padding: 0.75rem;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.sidenote:hover {
    background-color: var(--light-tint);
}

.sidenote strong {
    font-weight: 600;
    color: var(--body-text);
    display: block;
    margin-bottom: 0.25rem;
}

/* ============================
   PULL QUOTE
   ============================ */

.pull-quote {
    text-align: center;
    padding: 48px 2rem;
    margin: 2rem 0;
}

.pull-rule {
    width: 40vw;
    max-width: 400px;
    height: 1px;
    background-color: var(--rule-tan);
    margin: 0 auto;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.5s ease;
}

.pull-rule.visible {
    transform: scaleX(1);
}

.pull-quote p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: var(--accent-burgundy);
    line-height: 1.6;
    padding: 1.5rem 0;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================
   FLOWCHART DIAGRAM
   ============================ */

.diagram {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.diagram.visible {
    opacity: 1;
}

.flow-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.flow-box {
    border: 1.5px solid var(--diagram-blue);
    border-radius: 8px;
    padding: 12px 20px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.85rem;
    color: var(--diagram-blue);
    text-align: center;
    background-color: var(--card-surface);
    min-width: 140px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.flow-box.visible {
    opacity: 1;
}

.flow-box.primary {
    background-color: var(--diagram-blue);
    color: var(--card-surface);
    font-weight: 600;
}

.flow-box.consumer {
    border-style: dashed;
}

.flow-connector {
    width: 1.5px;
    height: 30px;
    background-color: var(--diagram-blue);
    margin: 0 auto;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.2s ease;
}

.flow-connector.visible {
    transform: scaleY(1);
}

.flow-connector.short {
    height: 20px;
}

.flow-connector-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.flow-connector-row .flow-connector {
    margin: 0;
    min-width: 140px;
    width: 1.5px;
    display: flex;
    justify-content: center;
}

/* ============================
   COMPARISON TABLE
   ============================ */

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.comparison-table thead tr {
    border-bottom: 2px solid var(--rule-tan);
}

.comparison-table th {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidenote-text);
    text-align: left;
    padding: 12px 16px;
}

.comparison-table td {
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    color: var(--body-text);
    padding: 12px 16px;
    border-bottom: 1px solid var(--rule-tan);
}

/* ============================
   BIBLIOGRAPHY FOOTER
   ============================ */

#bibliography {
    max-width: 42rem;
    margin: 0 auto;
    padding: 4rem 2rem 3rem;
}

.bib-rule {
    width: 100%;
    height: 1px;
    background-color: var(--rule-tan);
    margin-bottom: 2rem;
}

.bib-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--ink);
    margin-bottom: 1.5rem;
}

.bib-list {
    list-style: none;
    counter-reset: bib-counter;
}

.bib-list li {
    counter-increment: bib-counter;
    font-family: 'Lora', serif;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--body-text);
    padding-left: 2em;
    text-indent: -2em;
    margin-bottom: 8px;
}

.bib-list li::before {
    content: counter(bib-counter) ". ";
    font-weight: 400;
}

.bib-list li em {
    font-style: italic;
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule-tan);
}

.footer-domain {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--ink);
}

.footer-copy {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    color: var(--sidenote-text);
}

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

@media (max-width: 768px) {
    .chapter-content {
        grid-template-columns: 1fr;
    }

    .chapter-number {
        position: static;
        display: block;
        margin-bottom: 1rem;
        font-size: 3rem;
    }

    .side-column {
        padding-top: 1rem;
        border-top: 1px solid var(--rule-tan);
    }

    .flow-row {
        flex-direction: column;
        align-items: center;
    }

    .flow-connector-row {
        flex-direction: column;
        align-items: center;
    }
}
