/* economics.quest -- austere academic minimalism */

:root {
    --bg: #F7F7F7;
    --text-primary: #0D0D0D;
    --text-body: #2B2B2B;
    --text-tertiary: #5C5C5C;
    --border: #D4D4D4;
    --annotation: #A0A0A0;
    --hover-surface: #EBEBEB;
    --ink: #050505;
    --watermark-color: #8A8A8A;

    --col-width: 720px;
    --margin-col-width: 200px;
    --margin-col-offset: 48px;

    --font-sans: 'Outfit', 'Inter', system-ui, sans-serif;
    --font-mono: 'Azeret Mono', 'Space Mono', ui-monospace, monospace;

    --section-gap: 160px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text-body);
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.72;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Watermark in upper-left corner */
.watermark {
    position: fixed;
    top: 16px;
    left: 16px;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.04em;
    color: var(--watermark-color);
    z-index: 100;
    opacity: 1;
    transition: opacity 400ms ease-out;
    pointer-events: none;
    user-select: none;
}

.watermark.faded {
    opacity: 0.3;
}

/* Document container -- single centered column */
.document {
    max-width: var(--col-width);
    margin: 0 auto;
    padding: 120px 32px 200px;
    position: relative;
}

/* Opening viewport */
.opening {
    min-height: calc(100vh - 240px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: var(--section-gap);
    opacity: 0;
    transform: translateY(0);
    animation: fadeInOpening 600ms ease-out 100ms forwards;
}

.opening-inner {
    width: 100%;
}

@keyframes fadeInOpening {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.title {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    text-align: left;
    margin-bottom: 32px;
}

.subtitle {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.6;
    color: var(--text-tertiary);
    max-width: 560px;
}

/* Section blocks */
.block {
    margin-bottom: var(--section-gap);
    position: relative;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
}

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

.block:last-of-type {
    margin-bottom: 0;
}

/* Axis stub -- L-shaped origin marker */
.axis-stub {
    position: absolute;
    left: -40px;
    top: 4px;
    width: 24px;
    height: 24px;
    display: block;
    pointer-events: none;
}

.axis-stub svg {
    display: block;
}

/* Thesis (h2) */
.thesis {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 24px;
    transition: transform 200ms ease-out, background-color 200ms ease-out;
    transform-origin: left center;
    padding: 4px 8px;
    margin-left: -8px;
    border-radius: 0;
    cursor: default;
}

.thesis:hover {
    transform: scale(1.03);
    background-color: var(--hover-surface);
}

/* Two-column row: body + annotations */
.row {
    position: relative;
    margin-bottom: 32px;
}

.body-col p {
    color: var(--text-body);
    margin-bottom: 1.4em;
}

.body-col p:last-child {
    margin-bottom: 0;
}

/* Margin annotations -- visible on wide viewports only */
.annotations {
    display: none;
}

.annotations p {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: var(--annotation);
    text-transform: uppercase;
    margin-bottom: 14px;
}

.annotations p:last-child {
    margin-bottom: 0;
}

.annotations em {
    font-style: italic;
}

/* Implication -- italic closing line */
.implication {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--text-tertiary);
    margin-top: 32px;
    max-width: 600px;
}

.implication em {
    font-style: italic;
}

/* Pull-quote */
.pullquote {
    position: relative;
    padding-left: 56px;
    margin: 16px 0 24px;
}

.pullquote .bracket {
    position: absolute;
    left: 0;
    top: 4px;
    width: 32px;
    height: 48px;
    display: block;
}

.pullquote .bracket svg {
    display: block;
}

.pullquote p {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* Inline mono fragments */
.mono-frag {
    font-family: var(--font-mono);
    font-size: 0.92em;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    padding: 0 2px;
}

/* Yield curve figure -- the page's single visual */
.yield-figure {
    margin: 56px 0 32px;
    transition: transform 200ms ease-out, background-color 200ms ease-out;
    padding: 16px 0;
    cursor: default;
}

.yield-figure:hover {
    transform: scale(1.03);
    background-color: var(--hover-surface);
}

.yield-curve {
    width: 100%;
    height: 120px;
    display: block;
}

.caption {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: var(--annotation);
    text-transform: uppercase;
    margin-top: 16px;
}

/* Single horizontal rule */
.single-rule {
    border: none;
    border-top: 1px solid var(--border);
    height: 1px;
    width: 100%;
    max-width: var(--col-width);
    margin: 0 auto var(--section-gap);
    background: var(--border);
}

/* End marker */
.end-marker {
    margin-top: 80px;
    text-align: left;
}

.end-marker .mono-frag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--annotation);
    text-transform: uppercase;
}

/* Responsive: wide viewports -- show margin annotation column */
@media (min-width: 1200px) {
    .document {
        max-width: calc(var(--col-width) + var(--margin-col-offset) + var(--margin-col-width));
        padding-left: 0;
        padding-right: 0;
    }

    .opening,
    .block,
    .single-rule,
    .end-marker {
        max-width: var(--col-width);
        margin-left: auto;
        margin-right: auto;
    }

    .opening {
        margin-left: max(32px, calc(50% - (var(--col-width) + var(--margin-col-offset) + var(--margin-col-width)) / 2));
    }

    .row {
        position: relative;
    }

    .annotations {
        display: block;
        position: absolute;
        top: 0;
        left: calc(100% + var(--margin-col-offset));
        width: var(--margin-col-width);
        opacity: 0.4;
        transition: opacity 300ms ease-out;
    }

    .row:hover .annotations,
    .body-col:hover ~ .annotations {
        opacity: 1;
    }
}

@media (min-width: 1200px) {
    /* Re-center the entire document properly on wide viewports */
    .document {
        max-width: 1100px;
        padding: 120px 32px 200px;
    }
    .opening,
    .block,
    .end-marker {
        margin-left: 0;
        margin-right: 0;
        max-width: var(--col-width);
    }
    .single-rule {
        margin-left: 0;
        margin-right: 0;
        width: var(--col-width);
    }
}

/* Responsive: narrow viewports -- hide axis stubs, inline annotations */
@media (max-width: 768px) {
    .axis-stub {
        display: none;
    }

    .document {
        padding: 96px 20px 160px;
    }

    :root {
        --section-gap: 120px;
    }

    .pullquote {
        padding-left: 40px;
    }

    .pullquote .bracket {
        width: 24px;
        height: 36px;
    }

    .pullquote .bracket svg {
        width: 24px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .document {
        padding: 80px 16px 120px;
    }

    :root {
        --section-gap: 96px;
    }

    .opening {
        min-height: 70vh;
    }
}

/* Selection styling kept monochrome */
::selection {
    background: var(--text-primary);
    color: var(--bg);
}

::-moz-selection {
    background: var(--text-primary);
    color: var(--bg);
}
