/* --- CSS Variables & Theme (Patriotic & Historic) --- */
:root {
    --bg-dark: #121212;
    --text-primary: #f0e9df; /* Parchment white */
    --text-secondary: #c2baa6;
    --bulgarian-red: #c02026; /* Deep historically accurate red */
    --bulgarian-green: #00966e; /* Deep historically accurate green */
    --bulgarian-white: #ffffff;
    --gold: #d4af37;
    --card-bg: rgba(26, 26, 26, 0.85);
    
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lora', serif;
}

/* --- Base Reset & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Use the generated historical texture with a dark fallback */
    background-image: linear-gradient(rgba(18, 18, 18, 0.85), rgba(18, 18, 18, 0.95)), url('assets/parchment.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

ul {
    list-style-position: inside;
    margin-top: 10px;
}

strong {
    color: var(--gold);
    font-weight: 600;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-image: url('assets/hero.png'); /* Dynamic generated hero */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient combining dark vignette and patriotic subtle glow */
    background: linear-gradient(
        to bottom, 
        rgba(0,0,0,0.6) 0%, 
        rgba(0,0,0,0.3) 50%, 
        rgba(18,18,18,1) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 10;
    padding: 2rem;
}

.title {
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--bulgarian-white);
    text-shadow: 2px 4px 10px rgba(0,0,0,0.8), 0 0 40px rgba(192, 32, 38, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.subtitle {
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--gold);
    margin-bottom: 1.5rem;
    text-shadow: 1px 2px 5px rgba(0,0,0,0.8);
}

.tagline {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-style: italic;
    color: var(--text-secondary);
    border-top: 1px solid var(--text-secondary);
    padding-top: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.scroll-down {
    display: inline-block;
    margin-top: 3rem;
    font-size: 2rem;
    color: var(--bulgarian-white);
    animation: bounce 2s infinite;
    transition: color 0.3s ease;
}

.scroll-down:hover {
    color: var(--bulgarian-green);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 1.5s ease-out forwards;
}

/* --- Container & Timeline --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 4rem;
    color: var(--gold);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--bulgarian-white), var(--bulgarian-green), var(--bulgarian-red));
}

/* Timeline Layout */
.timeline {
    position: relative;
}

/* The vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background-color: rgba(212, 175, 55, 0.3); /* faint gold */
    top: 0;
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 2rem 3rem;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    z-index: 2;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    color: #fff;
}

.timeline-item:nth-child(odd) .timeline-icon {
    right: -25px;
}

.timeline-item:nth-child(even) .timeline-icon {
    left: -25px;
}

/* Colors for Timeline Icons & Highlights based on BG Flag Colors */
.bg-red { background-color: var(--bulgarian-red); }
.bg-green { background-color: var(--bulgarian-green); }
.bg-white { background-color: #e0e0e0; color: #333 !important; }

.highlight-green { color: #5ad1aa; font-weight: bold; }
.highlight-red { color: #ff6b6b; font-weight: bold; }

.timeline-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-top: 2px solid;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(5px);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.timeline-item:nth-child(3n+1) .timeline-content { border-top-color: var(--bulgarian-red); }
.timeline-item:nth-child(3n+2) .timeline-content { border-top-color: var(--bulgarian-green); }
.timeline-item:nth-child(3n+3) .timeline-content { border-top-color: var(--bulgarian-white); }

.timeline-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--bulgarian-white);
}

.timeline-content p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.timeline-content ul {
    text-align: left; /* Keep lists readable even on right-aligned items */
    display: inline-block;
}

/* Connecting arrows */
.timeline-content::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-style: solid;
}

.timeline-item:nth-child(odd) .timeline-content::after {
    right: -15px;
    border-width: 10px 0 10px 15px;
    border-color: transparent transparent transparent var(--card-bg);
}

.timeline-item:nth-child(even) .timeline-content::after {
    left: -15px;
    border-width: 10px 15px 10px 0;
    border-color: transparent var(--card-bg) transparent transparent;
}


/* --- Scroll Animations (Reveal) --- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

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


/* --- Footer --- */
footer {
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.creator-name {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.creator-class {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.social-links {
    margin-bottom: 2rem;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #24292e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-family: 'Inter', var(--font-body);
    font-weight: bold;
    font-size: 1.1rem;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.github-btn:hover {
    background-color: #2f363d;
    transform: scale(1.05);
}

.copyright {
    font-size: 0.9rem;
    color: #777;
}

/* --- Responsive Design (Mobile Support) --- */
@media screen and (max-width: 768px) {
    .timeline::before {
        left: 31px; /* Align to the left side */
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
        text-align: left;
    }

    .timeline-icon {
        left: 5px !important;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    /* Arrows on mobile point left */
    .timeline-item:nth-child(odd) .timeline-content::after,
    .timeline-item:nth-child(even) .timeline-content::after {
        left: -15px;
        right: auto;
        border-width: 10px 15px 10px 0;
        border-color: transparent var(--card-bg) transparent transparent;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
}
