:root {
    --bg-color: #fcfbf9; /* Warm paper */
    --text-color: #2d2d2d; /* Soft black */
    --accent-color: #0a4f6d; /* Deep Medical Blue */
    --secondary-accent: #ae2012; /* Warning Red */
    --muted-text: #666;
    --border-color: #e0e0e0;
    
    --font-serif: 'Lora', serif;
    --font-sans: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    line-height: 1.8;
    font-size: 18px;
    overflow-x: hidden;
}

/* --- Progress Bar --- */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.1s linear;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-sans);
    font-weight: 700;
    line-height: 1.2;
    color: #111;
}

h1 { font-size: 3rem; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--accent-color); }
h4 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }

p { margin-bottom: 1.5rem; }
strong { font-weight: 700; color: #000; }
em { font-style: italic; color: var(--muted-text); }

/* --- Hero Section --- */
.hero {
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

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

.publication-date {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--secondary-accent);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--muted-text);
    margin: 1.5rem 0 3rem 0;
    font-family: var(--font-sans);
}

.intro-text {
    font-size: 1.2rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Main Story Container --- */
.story-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* --- Era Sections (Grid Layout) --- */
.era {
    display: grid;
    grid-template-columns: 1fr 2fr; /* 1/3 for date, 2/3 for text */
    gap: 4rem;
    margin-bottom: 8rem;
    position: relative;
    opacity: 0.3; /* Start faded out */
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.era.active {
    opacity: 1;
    transform: translateY(0);
}

/* Sticky Timeline Marker */
.era-marker {
    position: sticky;
    top: 20vh;
    align-self: start;
    text-align: right;
    padding-right: 2rem;
    border-right: 2px solid var(--border-color);
}

.year-display {
    font-variant-numeric: tabular-nums;
    color: var(--text-color);
}

.era-title {
    font-size: 1.1rem;
    font-weight: 400;
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--muted-text);
    margin-top: 0.5rem;
}

.narrative {
    max-width: 650px;
}

/* --- Comparison Cards --- */
.card-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 3rem 0;
}

.card {
    background: #fff;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border-radius: 4px;
}

.card.patient { border-top: 3px solid var(--secondary-accent); }
.card.doctor { border-top: 3px solid var(--accent-color); }

.card p {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.6;
}

/* --- System Callouts --- */
.callout {
    background: #f1f8fa;
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    margin: 2rem 0;
    font-family: var(--font-sans);
}

.callout h4 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.callout p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* --- Conclusion --- */
.conclusion .era-marker {
    border: none;
}

.big-statement {
    font-size: 2rem;
    font-family: var(--font-sans);
    font-weight: 800;
    color: var(--secondary-accent);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 4rem;
    border-top: 1px solid var(--border-color);
    color: var(--muted-text);
    font-family: var(--font-sans);
    font-size: 0.8rem;
}

/* --- Endnotes --- */
.endnotes {
    max-width: 800px;
    margin: 4rem auto;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--muted-text);
    background-color: #fcfbf9;
}

.endnotes h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.endnotes ol {
    padding-left: 1.5rem;
}

.endnotes li {
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.citation-ref {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 600;
    margin-left: 2px;
    font-size: 0.7em;
    vertical-align: super;
}

.citation-ref:hover {
    text-decoration: underline;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    
    .era {
        grid-template-columns: 1fr; /* Stack vertically */
        gap: 1rem;
        margin-bottom: 4rem;
    }

    .era-marker {
        position: relative;
        top: 0;
        text-align: left;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding-bottom: 1rem;
        padding-right: 0;
        margin-bottom: 2rem;
        background: var(--bg-color); /* Cover scrolling text */
        z-index: 10;
    }

    .card-comparison {
        grid-template-columns: 1fr;
    }
}
