/* --- General Setup & Variables --- */
:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

    /* Light Mode Colors */
    --background-color: #f8f9fa;
    --text-color: #212529;
    --secondary-text-color: #6c757d;
    --primary-color: #007bff;
    --border-color: #dee2e6;
    --card-bg-color: #ffffff;
    --gradient-start: #007bff;
    --gradient-end: #6f42c1;
}

/* Dark Mode Color Overrides */
html.dark-mode {
    --background-color: #121212;
    --text-color: #e0e0e0;
    --secondary-text-color: #a0a0a0;
    --border-color: #333333;
    --card-bg-color: #1e1e1e;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Add a smooth transition for color changes */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Container & Layout --- */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

/* --- Typography --- */
h1,
h2,
h3 {
    line-height: 1.2;
    font-weight: 700;
}

.gradient-text {
    font-weight: 900;
    font-size: clamp(2.5rem, 8vw, 4rem);
    /* Fluid typography */
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.tagline {
    font-size: 1.25rem;
    color: var(--secondary-text-color);
    margin-top: 0.5rem;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--secondary-text-color);
    margin-top: 0;
    margin-bottom: 3rem;
}

/* --- Header & Navigation --- */
.site-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    /* Needed for positioning the toggle button */
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

html.dark-mode .theme-toggle .sun-icon {
    display: block;
}

html.dark-mode .theme-toggle .moon-icon {
    display: none;
}

.main-nav {
    margin-top: 1.5rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.main-nav a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: var(--text-color);
}

/* --- Intro Section --- */
.intro {
    font-size: 1.15rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4rem;
    margin-bottom: 4rem;
}

/* --- Series Grid & Cards --- */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

/* MODIFIED: Changed h3 to h2 to match the new HTML structure */
.card h2 {
    margin-top: 0;
    color: var(--primary-color);
}

.card p {
    flex-grow: 1;
    /* Makes the p tag take up available space */
    margin-bottom: 1.5rem;
}

.card-link {
    font-weight: 500;
    color: var(--primary-color);
}

.cta-button {
    display: inline-block;
    /* Behaves like text for centering but allows padding */
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    /* Remove underline from the link */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: #0056b3;
    /* Darker shade on hover */
    transform: translateY(-2px);
    /* Subtle lift effect */
}

/* --- Newsletter Section --- */
#newsletter {
    margin-top: 5rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

/* --- Social Links in Footer --- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    /* Added margin-bottom for spacing */
}

.social-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
}

.social-links a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.social-links a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}


/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 5rem;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 600px) {
    .social-links {
        flex-wrap: wrap;
        gap: 1rem 1.5rem;
    }

    .header-content {
        /* Adds top padding to clear the toggle button, keeps horizontal padding for centering */
        padding: 50px 45px 0;
    }

    .gradient-text {
        /* Reduces font size on small screens to prevent overflow */
        font-size: 2.5rem;
    }

}

