:root {
    /* Color Palette */
    --bg-primary: #0a0f12;
    --bg-secondary: #121a20;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #f59e0b; /* Amber */
    --accent-hover: #d97706;
    
    /* Glassmorphism */
    --glass-bg: rgba(18, 26, 32, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
}

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

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: 1.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 1.1rem;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

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

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    /* We use the hero background image generated earlier */
    background: linear-gradient(to bottom, rgba(10, 15, 18, 0.4), var(--bg-primary)), url('../assets/hero_bg.png') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-attachment: fixed;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    padding: 2rem;
    animation: fadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-title {
    font-size: 5.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.1;
    background: linear-gradient(45deg, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 15px rgba(0,0,0,0.4));
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.8rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.6);
}

/* Sections */
.section {
    padding: 8rem 0;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin: 1.5rem auto 0;
    border-radius: 2px;
}

/* Eras Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.4s ease;
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-12px);
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(245, 158, 11, 0.3);
}

.card-content {
    padding: 3rem 2.5rem;
}

.card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.period-dates {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Gallery Controls */
.gallery-controls {
    padding: 1.5rem;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-radius: 16px;
    background: rgba(18, 26, 32, 0.6);
}

.search-container {
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5), 0 0 10px rgba(245, 158, 11, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .filters-wrapper {
        flex-direction: row;
        justify-content: space-between;
    }
}

.filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-label {
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 0.5rem;
    font-size: 0.95rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.load-more-container {
    text-align: center;
    margin-top: 4rem;
    width: 100%;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    height: 450px;
    cursor: pointer;
    border-radius: 24px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(10, 15, 18, 0.98) 0%, rgba(10, 15, 18, 0.8) 55%, transparent 100%);
    padding: 4rem 2rem 2rem;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
    opacity: 1;
}

.gallery-overlay h3 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
    color: #fff;
}

.gallery-overlay .dino-title {
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.gallery-overlay .dino-info {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s;
}

.gallery-item:hover .gallery-overlay .dino-info {
    opacity: 1;
    transform: translateY(0);
}

/* Timeline Components */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 4px;
    background: linear-gradient(to bottom, transparent, var(--accent), var(--accent-hover), transparent);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

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

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

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-primary);
    border: 4px solid var(--accent);
    top: 20px;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.timeline-item:nth-child(even)::after {
    left: -10px;
}

.timeline-content {
    padding: 2rem;
    position: relative;
    border-radius: 16px;
}

.timeline-date {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
}

/* Detail Pages Specific */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 900px) {
    .detail-grid {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: start;
    }
}

.dino-stats li {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dino-stats strong {
    color: var(--accent);
}

/* Footer */
footer {
    background-color: #05080a;
    padding: 3rem 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Animations Triggered by JS */
.fade-in-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
        background: rgba(10,15,18,0.9);
        backdrop-filter: blur(10px);
    }
    .hero-title {
        font-size: 3.5rem;
    }
    .hero-content {
        padding-top: 6rem;
    }
    .section {
        padding: 5rem 0;
    }
    .gallery-item {
        height: 350px;
    }
    .timeline::before {
        left: 20px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 0;
    }
    .timeline-item:nth-child(even) {
        left: 0;
    }
    .timeline-item::after {
        left: 10px;
    }
    .timeline-item:nth-child(even)::after {
        left: 10px;
    }
    .timeline-date {
        margin-bottom: 0.5rem;
        display: inline-block;
    }
}
