.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.essay-container {
    background-color: #1a1a1a;
    color: rgba(255, 255, 255, 0.9);
    min-height: 100vh;
}

.back-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-family: 'Space Mono', monospace;
    display: inline-block;
    margin-bottom: 2rem;
}

.back-link:hover {
    color: rgba(255, 255, 255, 1);
}

.essay-content {
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: rgba(255, 255, 255, 0.85);
}

.intro {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    margin-bottom: 3rem;
    color: rgba(255, 255, 255, 0.7);
}

.narrative {
    margin: 2rem 0 4rem;
    font-family: 'Space Mono', monospace;
    line-height: 1.8;
}

.narrative p {
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.8);
}

.narrative .reflection {
    font-style: italic;
    color: #4a9eff;  /* Same blue as the source link for consistency */
    opacity: 0.9;
}

.source-link {
    color: #4a9eff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.source-link:hover {
    color: #7cb9ff;
    text-decoration: underline;
}

.visualization-section {
    margin: 0.5rem 0;
}

.chart-container {
    height: 300px;
    margin-bottom: 0.5rem;
}

.shiny-container {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    position: relative;
    width: 100%;
    height: 800px;
    overflow: hidden;
}

.shiny-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

.data-notes {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1rem;
    padding: 1rem;
}

.data-notes p {
    margin: 0.5rem 0;
}

.methodology {
    margin: 0.5rem 0;
    font-family: 'Space Mono', monospace;
    line-height: 1.8;
}

.methodology h2 {
    margin-top: 0;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.85);
}

.methodology p, .methodology li {
    font-family: 'Space Mono', monospace;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.methodology ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.methodology li {
    margin: 0.5rem 0;
}

.api-info {
    font-family: 'Chakra Petch', sans-serif;
    background-color: rgba(74, 158, 255, 0.1);
    border-left: 3px solid #4a9eff;
    padding: 1.5rem;
    margin: 0.5rem 0;
    border-radius: 0 8px 8px 0;
}

.api-info .instruction {
    margin: 0.8rem 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 600;
}

.api-info .api-link {
    font-family: 'Space Mono', monospace;
    color: #4a9eff;
    word-break: break-all;
    padding: 0.5rem 0;
    display: block;
    text-decoration: none;
    transition: color 0.2s ease;
}

.api-info .api-link:hover {
    color: #7cb9ff;
    text-decoration: underline;
}

.notes-to-self {
    margin: 3rem 0 1rem;
    font-family: 'Space Mono', monospace;
    line-height: 1.6;
    opacity: 0.7;
}

.notes-to-self h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.8rem;
}

.notes-to-self ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.notes-to-self li {
    margin: 0.8rem 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .shiny-container {
        height: 600px; /* Smaller height for mobile devices */
    }

    .narrative {
        font-size: 0.95rem;
    }
} 