/* rollup.report -- Retro-Futuristic Scholarly Dossier */

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --aged-cream: #F5F0E6;
    --vellum-gray: #EDE8DF;
    --ink-sepia: #3D3428;
    --margin-dust: #8A7E6B;
    --phosphor-mint: #A8E6CE;
    --soft-lavender: #C4B5E0;
    --blush-signal: #F2B5B5;
    --faded-teal: #89B8B8;
    --graphite-whisper: #6B6560;
    --grid-line: #C8C0B0;
    --stamp-rose: #D4A0A0;
}

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

body {
    background-color: var(--aged-cream);
    color: var(--ink-sepia);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.8vw, 1.2rem);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ===== Scroll Container ===== */
.scroll-container {
    width: 100%;
}

/* ===== Section Base ===== */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(4rem, 10vh, 8rem) 1.5rem;
    scroll-snap-align: start;
    opacity: 0;
    transition: opacity 400ms ease-out;
    overflow: hidden;
}

.section.is-visible {
    opacity: 1;
}

/* Primary page background */
.section--primary {
    background:
        radial-gradient(ellipse at 50% 30%, transparent 60%, rgba(61,52,40,0.04) 100%),
        var(--aged-cream);
}

/* Insert page background with grid lines -- #C8C0B0 at 12% opacity */
.section--insert {
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 27px,
            rgba(200,192,176,0.12) 27px,
            rgba(200,192,176,0.12) 28px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 27px,
            rgba(200,192,176,0.12) 27px,
            rgba(200,192,176,0.12) 28px
        ),
        radial-gradient(ellipse at 50% 30%, transparent 60%, rgba(61,52,40,0.04) 100%),
        var(--vellum-gray);
}

/* Paper grain overlay */
.section::before {
    content: '';
    position: absolute;
    inset: 0;
    filter: url(#paperGrain);
    pointer-events: none;
    z-index: 1;
}

/* Foxing spots */
.section::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle 8px at 15% 20%, rgba(138,126,107,0.06) 0%, transparent 100%),
        radial-gradient(circle 12px at 78% 35%, rgba(138,126,107,0.06) 0%, transparent 100%),
        radial-gradient(circle 10px at 42% 80%, rgba(138,126,107,0.06) 0%, transparent 100%),
        radial-gradient(circle 16px at 88% 72%, rgba(138,126,107,0.06) 0%, transparent 100%),
        radial-gradient(circle 9px at 25% 65%, rgba(138,126,107,0.06) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* ===== Section Content ===== */
.section__content {
    max-width: 780px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* ===== Corner Brackets ===== */
.section__corner {
    position: absolute;
    width: 24px;
    height: 24px;
    z-index: 3;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 400ms cubic-bezier(0.34, 1.56, 0.64, 1), transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section.is-visible .section__corner {
    opacity: 1;
    transform: scale(1);
}

.section__corner::before,
.section__corner::after {
    content: '';
    position: absolute;
    background-color: rgba(168,230,206,0.18);
}

.section__corner--tl { top: 16px; left: 16px; }
.section__corner--tl::before { top: 0; left: 0; width: 24px; height: 1px; }
.section__corner--tl::after { top: 0; left: 0; width: 1px; height: 24px; }

.section__corner--tr { top: 16px; right: 16px; }
.section__corner--tr::before { top: 0; right: 0; width: 24px; height: 1px; }
.section__corner--tr::after { top: 0; right: 0; width: 1px; height: 24px; }

.section__corner--bl { bottom: 16px; left: 16px; }
.section__corner--bl::before { bottom: 0; left: 0; width: 24px; height: 1px; }
.section__corner--bl::after { bottom: 0; left: 0; width: 1px; height: 24px; }

.section__corner--br { bottom: 16px; right: 16px; }
.section__corner--br::before { bottom: 0; right: 0; width: 24px; height: 1px; }
.section__corner--br::after { bottom: 0; right: 0; width: 1px; height: 24px; }

/* ===== Scanning Beam ===== */
.section__scan-beam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(168,230,206,0.2);
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0);
}

.section__scan-beam.is-scanning {
    opacity: 1;
    animation: scanBeam 3s ease-in-out forwards;
}

@keyframes scanBeam {
    0% { transform: translateY(0); }
    100% { transform: translateY(calc(100vh - 1px)); opacity: 0; }
}

/* ===== Title Page ===== */
.section--title {
    background:
        radial-gradient(ellipse at 50% 30%, transparent 60%, rgba(61,52,40,0.04) 100%),
        var(--aged-cream);
}

.title-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.title-domain {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 500;
    font-variant: small-caps;
    font-size: clamp(2.8rem, 7vw, 5rem);
    letter-spacing: 0.18em;
    color: var(--ink-sepia);
    min-height: 1.2em;
    position: relative;
}

.title-domain .cursor {
    display: inline-block;
    border-right: 2px solid var(--phosphor-mint);
    margin-left: 2px;
    animation: blink 800ms step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.title-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 2.2vw, 1.4rem);
    color: var(--margin-dust);
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

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

/* ===== HUD Reticle ===== */
.hud-reticle {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 2;
    opacity: 0;
    transition: opacity 800ms ease-out;
    animation: spinReticle 120s linear infinite;
}

.hud-reticle.is-visible {
    opacity: 1;
}

.hud-reticle--alt {
    top: auto;
    bottom: 60px;
    right: 60px;
}

@keyframes spinReticle {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Watermark ===== */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-family: 'EB Garamond', Georgia, serif;
    font-variant: small-caps;
    font-size: 6rem;
    letter-spacing: 0.15em;
    color: rgba(61,52,40,0.03);
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    user-select: none;
}

/* ===== Section Headings ===== */
.section__heading {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 600;
    font-variant: small-caps;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    letter-spacing: 0.12em;
    color: var(--ink-sepia);
    margin-bottom: 2rem;
    min-height: 1.3em;
    position: relative;
}

.section__heading::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: rgba(168,230,206,0.1);
    transition: width 400ms ease-out;
}

.section__heading:hover::after {
    width: 100%;
}

/* ===== Body Text ===== */
.section__body p {
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

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

.section__body blockquote {
    border-left: 2px solid var(--phosphor-mint);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
}

.section__body blockquote p {
    color: var(--graphite-whisper);
}

/* ===== Stamps ===== */
.stamp--compiled {
    position: absolute;
    top: clamp(2rem, 5vh, 4rem);
    right: clamp(1rem, 3vw, 3rem);
    font-family: 'EB Garamond', Georgia, serif;
    font-variant: small-caps;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: rgba(138,126,107,0.3);
    border: 1px dashed rgba(138,126,107,0.2);
    padding: 4px 12px;
    transform: rotate(-8deg);
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease-out;
}

.section.is-visible .stamp--compiled {
    opacity: 1;
}

/* ===== Coordinate Annotations ===== */
.coord-annotation {
    position: absolute;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: rgba(138,126,107,0.5);
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease-out;
}

.section.is-visible .coord-annotation {
    opacity: 1;
}

.coord-annotation--right {
    bottom: clamp(1rem, 3vh, 2rem);
    right: clamp(1rem, 3vw, 2rem);
}

.coord-annotation--left {
    bottom: clamp(1rem, 3vh, 2rem);
    left: clamp(1rem, 3vw, 2rem);
}

/* ===== Folio Dividers ===== */
.folio-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background-color: var(--aged-cream);
    gap: 0;
}

.folio-divider__seal {
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 300ms ease-out;
}

.folio-divider.is-visible .folio-divider__seal {
    opacity: 1;
}

.folio-divider__line {
    flex: 1;
    height: 1px;
    background-color: var(--margin-dust);
    transform: scaleX(0);
    transition: transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.folio-divider__line--left {
    transform-origin: right center;
}

.folio-divider__line--right {
    transform-origin: left center;
}

.folio-divider.is-visible .folio-divider__line {
    transform: scaleX(1);
}

/* ===== Data Visualizations ===== */
.data-viz {
    margin-top: 1rem;
}

/* Bar charts */
.data-bar-group {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.data-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.data-bar-label {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.75rem, 1.2vw, 0.88rem);
    letter-spacing: 0.06em;
    color: var(--margin-dust);
    width: 180px;
    flex-shrink: 0;
    text-align: right;
}

.data-bar-track {
    flex: 1;
    height: 20px;
    position: relative;
    border: 1px solid rgba(138,126,107,0.15);
}

.data-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    transition: width 1.2s ease-out;
    background: none;
    border-right: 1px solid transparent;
}

.data-bar-fill--mint {
    border-color: var(--phosphor-mint);
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(168,230,206,0.15) 3px,
        rgba(168,230,206,0.15) 4px
    );
}

.data-bar-fill--lavender {
    border-color: var(--soft-lavender);
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(196,181,224,0.15) 3px,
        rgba(196,181,224,0.15) 4px
    );
}

.data-bar-fill--blush {
    border-color: var(--blush-signal);
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(242,181,181,0.15) 3px,
        rgba(242,181,181,0.15) 4px
    );
}

.data-bar-fill--teal {
    border-color: var(--faded-teal);
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(137,184,184,0.15) 3px,
        rgba(137,184,184,0.15) 4px
    );
}

.data-bar-value {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.75rem, 1.2vw, 0.88rem);
    letter-spacing: 0.06em;
    color: var(--ink-sepia);
    width: 100px;
    flex-shrink: 0;
    transition: text-shadow 150ms ease-out, transform 150ms ease-out;
}

.data-bar-value:hover {
    text-shadow: 0 0 8px rgba(168,230,206,0.4);
    transform: scale(1.05);
}

.data-note {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(138,126,107,0.15);
}

.data-note-label {
    font-family: 'EB Garamond', Georgia, serif;
    font-variant: small-caps;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--margin-dust);
}

.data-note-value {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    letter-spacing: 0.06em;
    color: var(--graphite-whisper);
    display: block;
    margin-top: 0.3rem;
}

/* Radial gauges */
.radial-gauges {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.radial-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.gauge-arc {
    transition: stroke-dashoffset 1.2s ease-out;
}

.gauge-value {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    letter-spacing: 0.06em;
    color: var(--ink-sepia);
    position: absolute;
    top: 50px;
    transition: text-shadow 150ms ease-out, transform 150ms ease-out;
}

.gauge-value:hover {
    text-shadow: 0 0 8px rgba(168,230,206,0.4);
    transform: scale(1.05);
}

.gauge-label {
    font-family: 'EB Garamond', Georgia, serif;
    font-variant: small-caps;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--margin-dust);
}

/* Spark columns */
.spark-columns {
    margin-top: 2rem;
}

.spark-col-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spark-col-title {
    font-family: 'EB Garamond', Georgia, serif;
    font-variant: small-caps;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--margin-dust);
    margin-bottom: 1.5rem;
}

.spark-cols {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 120px;
}

.spark-col {
    width: 28px;
    height: 0;
    border: 1px solid var(--phosphor-mint);
    background: none;
    position: relative;
    transition: height 1.2s ease-out;
}

.spark-col-val {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    color: var(--graphite-whisper);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 300ms ease-out;
}

.spark-col:hover .spark-col-val {
    opacity: 1;
}

.spark-col:hover {
    background: rgba(168,230,206,0.08);
}

.spark-col-months {
    display: flex;
    gap: 12px;
    margin-top: 0.5rem;
}

.spark-col-months span {
    width: 28px;
    text-align: center;
    font-family: 'Space Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    color: var(--graphite-whisper);
}

/* ===== Classification Stamp (Appendix) ===== */
.classification-stamp {
    display: inline-block;
    margin-top: 3rem;
    padding: 12px 32px;
    border: 2px dashed var(--stamp-rose);
    transform: rotate(-12deg);
    text-align: center;
}

.classification-stamp span {
    font-family: 'EB Garamond', Georgia, serif;
    font-variant: small-caps;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.3em;
    color: var(--stamp-rose);
    opacity: 0.6;
}

.appendix-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.appendix-content .section__body {
    text-align: left;
}

/* ===== Links ===== */
a {
    color: var(--faded-teal);
    text-decoration: none;
    border-bottom: 1px solid rgba(137,184,184,0.3);
    transition: border-color 200ms cubic-bezier(0.68, -0.55, 0.27, 1.55), text-shadow 200ms ease-out;
}

a:hover {
    border-bottom-color: var(--faded-teal);
    text-shadow: 0 0 8px rgba(168,230,206,0.3);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .data-bar-label {
        width: 100px;
        font-size: 0.65rem;
    }

    .data-bar-value {
        width: 70px;
        font-size: 0.65rem;
    }

    .hud-reticle {
        display: none;
    }

    .watermark {
        font-size: 3rem;
    }

    .radial-gauges {
        gap: 1rem;
    }

    .radial-gauge svg {
        width: 90px;
        height: 90px;
    }

    .gauge-value {
        top: 36px;
    }

    .spark-cols {
        gap: 6px;
    }

    .spark-col {
        width: 20px;
    }

    .spark-col-months {
        gap: 6px;
    }

    .spark-col-months span {
        width: 20px;
        font-size: 0.45rem;
    }
}
