/* --- CSS Variables for Easy Theming --- */
:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --primary-accent: #0d3b66; /* Deep blue from TikZ */
    --secondary-accent: #c94c4c; /* Reddish from TikZ */
    --subtle-gray: #dee2e6;
    --code-bg: #e9ecef;
    --font-serif: 'Lora', serif;
    --font-sans: 'Montserrat', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

/* --- General Body & Layout Styling --- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* --- Subtle Background Pattern --- */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(13, 59, 102, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 59, 102, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
    opacity: 0.5;
}

/* --- Header Styling --- */
header {
    text-align: center;
    padding: 4rem 1rem 2rem 1rem;
    border-bottom: 1px solid var(--subtle-gray);
}

header h1 {
    font-family: var(--font-sans);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-accent);
    margin: 0;
}

header h2 {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 400;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* --- Section and Typography Styling --- */
section {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--subtle-gray);
}

section:last-of-type {
    border-bottom: none;
}

h2, h3, h4 {
    font-family: var(--font-sans);
    color: var(--text-color);
}

h3 {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    color: #6c757d;
}

h2 {
    font-size: 1.8rem;
    margin-top: 0;
}

h4 {
    font-size: 1.3rem;
    font-style: italic;
    color: #495057;
    margin-top: -1rem;
    margin-bottom: 2rem;
}

p {
    margin-bottom: 1rem;
}

strong {
    font-weight: 700;
    color: var(--secondary-accent);
}

/* --- Blockquote styling (for Epigraph) --- */
blockquote {
    font-size: 1.25rem;
    font-style: italic;
    margin: 2.5rem 0;
    padding-left: 1.5rem;
    border-left: 4px solid var(--primary-accent);
    color: #495057;
}

/* --- Inline Code for Symbols --- */
code {
    font-family: var(--font-mono);
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

/* --- Link Section Styling --- */
.link-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.link-container a {
    flex-grow: 1;
    text-decoration: none;
    color: var(--primary-accent);
    background-color: transparent;
    border: 2px solid var(--primary-accent);
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-align: center;
    font-family: var(--font-sans);
    font-weight: 700;
    transition: all 0.3s ease;
}

.link-container a:hover {
    background-color: var(--primary-accent);
    color: var(--bg-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(13, 59, 102, 0.2);
}

.link-container a i {
    margin-right: 0.5rem;
}

/* --- Footer Styling --- */
footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

/* --- Animation Styling --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Responsive Design --- */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    .link-container {
        flex-direction: column;
    }
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.header-text {
    flex: 1;
}

.header-portrait {
    width: 60px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
