/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #0d1117;
    --text-color: #e6edf3;
    --muted-text: #8b949e;
    --accent: #d2a85e; /* Gold/Bronze */
    --accent-hover: #e8c886;
    --glass-bg: rgba(22, 27, 34, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
}

body.theme-dark {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    font-weight: 700;
}

.highlight {
    color: var(--accent);
    font-style: italic;
}

.section-title {
    font-size: 3rem;
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.section-title span {
    color: var(--accent);
    font-style: italic;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0;
}

.text-center {
    text-align: center;
}

.mb-5 { margin-bottom: 3rem; }
.mt-5 { margin-top: 3rem; }
.mt-4 { margin-top: 2rem; }
.mt-auto { margin-top: auto; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.shadow-lg {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.rounded-image {
    border-radius: 12px;
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Navbar */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    transition: padding 0.3s ease;
}

.static-nav {
    position: sticky;
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-brand span {
    color: var(--accent);
    font-style: italic;
    font-weight: 400;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links li a {
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--accent);
}

/* Background Image & Parallax for Hero */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
    z-index: -1;
    transform: scale(1.1); /* for parallax effect without revealing edges */
}

/* In Script.js we will handle .hero-bg transform */

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

.hero-content h1 {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    color: #ccc;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--accent);
    color: #000;
    font-weight: 600;
    border-radius: 30px;
    letter-spacing: 1px;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(210, 168, 94, 0.3);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

.scroll-indicator span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mouse {
    width: 24px;
    height: 36px;
    border: 2px solid white;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 5px;
}

.wheel {
    width: 4px;
    height: 8px;
    background: white;
    border-radius: 2px;
    animation: scroll 1.5s infinite;
}

/* Cards */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px 30px;
    border-radius: 16px;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.glass-card.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
    border-color: rgba(210, 168, 94, 0.3);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.highlight-card {
    background: linear-gradient(135deg, rgba(210, 168, 94, 0.1) 0%, rgba(22, 27, 34, 0.8) 100%);
    border-color: rgba(210, 168, 94, 0.2);
}

/* Timeline / Infographics */
.infographic-page {
    background-image: radial-gradient(circle at 50% 0%, #1a2235 0%, var(--bg-color) 70%);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--glass-border);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 40px;
}

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

.timeline-dot {
    position: absolute;
    top: 30px;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -8px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -8px;
}

.timeline-content {
    padding: 30px;
}

.timeline-date {
    display: inline-block;
    color: var(--accent);
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.timeline-item:nth-child(even) .glass-card {
    border-left: 2px solid var(--accent);
}

.timeline-item:nth-child(odd) .glass-card {
    border-right: 2px solid var(--accent);
}

.marker-end::after {
    content: "А что дальше?";
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--muted-text);
    font-style: italic;
    white-space: nowrap;
}
.timeline-item:nth-child(odd) .marker-end::after { left: auto; right: -80px; transform: none; }
.timeline-item:nth-child(even) .marker-end::after { left: -80px; right: auto; transform: none; }


.stat-card {
    text-align: center;
    padding: 30px 20px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--accent);
    margin-bottom: 10px;
}

/* Glossary */
.glossary-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.glossary-container {
    max-width: 900px;
}

.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 60px;
}

.glossary-term {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 12px 24px;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.glossary-term:hover, .glossary-term.active {
    background: var(--text-color);
    color: var(--bg-color);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.definition-panel {
    text-align: left;
    min-height: 300px;
    opacity: 1;
    transition: opacity 0.5s ease;
    position: relative;
    overflow: hidden;
}

.definition-panel.hidden {
    opacity: 0;
    pointer-events: none;
}

.def-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    display: inline-block;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}

.def-title {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 15px;
}

.def-text {
    font-size: 1.1rem;
    color: #cbd5e1;
    line-height: 1.8;
}

.def-img-wrapper {
    margin-top: 20px;
    width: 100%;
}

.def-image {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    display: block;
    animation: fadeIn 0.5s ease;
}

.def-image.hidden {
    display: none;
}


/* Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-15px) translateX(-50%); }
    60% { transform: translateY(-7px) translateX(-50%); }
}

@keyframes scroll {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(15px); opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }
.delay-4 { transition-delay: 0.8s; }

.reveal-text {
    background: linear-gradient(90deg, #fff, #8b949e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: revealText 1.5s ease forwards;
}

@keyframes revealText {
    from { opacity: 0; filter: blur(10px); transform: scale(0.95); }
    to { opacity: 1; filter: blur(0); transform: scale(1); }
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.appear,
.slide-in-right.appear {
    opacity: 1;
    transform: translateX(0);
}

/* Footer */
footer {
    padding: 30px 0;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 80px !important;
        padding-right: 0 !important;
        left: 0 !important;
    }
    
    .timeline-dot {
        left: 22px !important;
        right: auto !important;
    }
    
    .timeline-item:nth-child(even) .glass-card,
    .timeline-item:nth-child(odd) .glass-card {
        border-left: 2px solid var(--accent);
        border-right: none;
    }

    .timeline-item:nth-child(even) .marker-end::after,
    .timeline-item:nth-child(odd) .marker-end::after {
        left: 30px;
        right: auto;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .nav-links {
        display: none; /* Add mobile menu logic separately if needed */
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}
