/* prototype.report - Swiss Typography Academic Report */

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

:root {
    --paper-white: #FFFFFF;
    --figure-gray: #FAFAFA;
    --border-subtle: #D0D0D0;
    --border-light: #E0E0E0;
    --text-primary: #1A1A1A;
    --text-secondary: #707070;
    --accent-blue: #1A5CBA;
    --accent-red: #C62828;
    --accent-green: #2E7D32;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--paper-white);
    color: var(--text-primary);
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

/* =====================
   REPORT CONTAINER
   ===================== */
.report-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 24px 120px;
    position: relative;
}

/* =====================
   REPORT HEADER
   ===================== */
.report-header {
    margin-bottom: 0;
    padding-bottom: 60vh;
}

.report-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 36px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}

.title-rule {
    border: none;
    height: 2px;
    background: var(--accent-blue);
    margin-bottom: 24px;
}

.abstract {
    padding-left: 24px;
    margin-bottom: 24px;
}

.abstract-text {
    font-family: 'Source Sans 3', sans-serif;
    font-style: italic;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.header-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.meta-item {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* =====================
   SECTIONS
   ===================== */
.report-section {
    position: relative;
    margin-bottom: 64px;
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.section-head.revealed {
    opacity: 1;
}

.section-number {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 28px;
    color: var(--text-primary);
}

.subsection-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 32px;
    margin-bottom: 12px;
}

.subsection-number {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--accent-blue);
}

.subsection-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--text-primary);
}

p {
    margin-bottom: 16px;
}

strong {
    font-weight: 600;
}

/* =====================
   MARGIN ANNOTATIONS
   ===================== */
.margin-note {
    display: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.margin-note.revealed {
    opacity: 1;
    transform: translateX(0);
}

@media (min-width: 1200px) {
    .margin-note {
        display: block;
        position: absolute;
        left: -200px;
        width: 160px;
    }
}

/* =====================
   FIGURE BLOCKS
   ===================== */
.figure-block {
    margin: 32px 0;
    border: 1px solid var(--border-light);
    background: var(--figure-gray);
    overflow: hidden;
    position: relative;
}

/* Border animation pseudo-elements */
.figure-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 2px solid var(--accent-blue);
    border-left: 2px solid var(--accent-blue);
    transition: width 0.3s ease, height 0.3s ease 0.3s;
    z-index: 2;
}

.figure-block::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-bottom: 2px solid var(--accent-blue);
    border-right: 2px solid var(--accent-blue);
    transition: width 0.3s ease 0.3s, height 0.3s ease;
    z-index: 2;
}

.figure-block.border-drawn::before {
    width: 100%;
    height: 100%;
}

.figure-block.border-drawn::after {
    width: 100%;
    height: 100%;
}

.figure-content {
    padding: 24px;
}

.figure-caption {
    padding: 12px 24px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
    margin-bottom: 0;
}

.caption-label {
    font-variant: small-caps;
    font-weight: 600;
    margin-right: 4px;
}

/* Figure diagram */
.figure-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.diagram-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border-subtle);
    background: var(--paper-white);
    min-width: 100px;
}

.phase-label {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 11px;
    color: var(--accent-blue);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.phase-name {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    color: var(--text-primary);
}

.diagram-arrow {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Data table */
.data-table {
    width: 100%;
}

.table-row {
    display: flex;
    border-bottom: 1px solid var(--border-light);
}

.table-row:last-child {
    border-bottom: none;
}

.table-header {
    background: var(--paper-white);
    border-bottom: 2px solid var(--border-subtle);
}

.table-header .table-cell {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.table-cell {
    flex: 1;
    padding: 10px 12px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 15px;
}

.cell-green {
    color: var(--accent-green);
    font-weight: 600;
}

/* =====================
   PULL QUOTES
   ===================== */
.pull-quote {
    margin: 32px 0;
    padding: 0 0 0 20px;
    border-left: 3px solid var(--accent-blue);
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    position: relative;
}

.pull-quote.revealed {
    opacity: 1;
    transform: translateX(0);
}

.pull-quote p {
    font-family: 'Source Sans 3', sans-serif;
    font-style: italic;
    font-size: 19px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 0;
}

/* =====================
   FOOTNOTES
   ===================== */
.footnote {
    position: relative;
    cursor: help;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-blue);
    vertical-align: super;
    line-height: 0;
    margin-left: 2px;
}

.footnote::after {
    content: attr(data-note);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--paper-white);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 13px;
    font-style: normal;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 4px;
    width: 240px;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.footnote:hover::after {
    opacity: 1;
}

/* =====================
   SECTION RULES & FOOTER
   ===================== */
.section-rule {
    border: none;
    height: 1px;
    background: var(--border-subtle);
    margin: 40px 0 24px;
}

.report-footer {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-item {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
    .report-container {
        padding: 40px 20px 80px;
    }

    .report-title {
        font-size: 28px;
    }

    .section-title {
        font-size: 22px;
    }

    .report-header {
        padding-bottom: 30vh;
    }

    .figure-diagram {
        flex-direction: column;
    }

    .diagram-arrow {
        transform: rotate(90deg);
    }

    .header-meta,
    .report-footer {
        flex-direction: column;
        gap: 8px;
    }
}
