/* ===== General Setup & CSS Variables ===== */
:root {
    /* Light Theme Palette */
    --bg-color: #F8F9FA;
    --bg-color-alt: #FFFFFF;
    --text-color: #212529;
    --heading-color: #111;
    --accent-color: #4D5BCE;
    --accent-color-hover: #3747b1;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.05);

    /* Typography */
    --font-header: 'Poppins', sans-serif;
    --font-body: 'Open Sans', sans-serif;

    /* Sizing & Spacing */
    --header-height: 70px;
    --border-radius: 12px;
    --container-width: 1140px;
    --container-padding: 1rem;
}

/* Dark theme variables */
html[data-theme='dark'] {
    --bg-color: #0A071B;
    --bg-color-alt: #120d2b;
    --text-color: #E0E0E0;
    --heading-color: #FFFFFF;
    --accent-color: #5865f2;
    --accent-color-hover: #7b85f7;
    --border-color: #2a2546;
    --shadow-color: rgba(0, 0, 0, 0.2);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== General Styling ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

h1,
h2,
h3 {
    font-family: var(--font-header);
    color: var(--heading-color);
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

p {
    margin-bottom: 1rem;
    max-width: 65ch;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

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

/* ===== Header ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: color-mix(in srgb, var(--bg-color) 80%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

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

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

.nav-link {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 0.5rem 0;
    position: relative;
}

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

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
}

html[data-theme='light'] .theme-toggle-btn .fa-sun {
    display: none;
}

html[data-theme='dark'] .theme-toggle-btn .fa-moon {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-toggle .fa-xmark {
    display: none;
}

.main-nav.is-open+.header-actions .mobile-menu-toggle .fa-bars {
    display: none;
}

.main-nav.is-open+.header-actions .mobile-menu-toggle .fa-xmark {
    display: block;
}

/* ===== Hero Section ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--header-height) var(--container-padding) 0;
    position: relative;
    overflow: hidden;

    /* Background image without the overlay */
    background-image: url('https://images.unsplash.com/photo-1531297484001-80022131f5a1?auto=format&fit=crop&w=2020&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Adds a shadow to the text for better readability */
.hero-headline,
.hero-subheadline {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
}

.hero-headline {
    color: #E0E0E0;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 1rem;
}

.hero-subheadline {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    margin: 0 auto 2rem;
    color: #FFFFFF;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: #fff;
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-family: var(--font-body);
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    background-color: var(--accent-color-hover);
    color: #fff;
    transform: translateY(-3px);
}

/* ===== Content Sections ===== */
.content-section,
.content-section-alt {
    padding: 5rem var(--container-padding);
}

.content-section-alt {
    background-color: var(--bg-color-alt);
}

.content-section p,
.content-section-alt p {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.content-section .cta-button {
    margin-top: 1.5rem;
}

/* ===== Links Section ===== */
.links-grid {
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(auto-fit, minmax(320px, 500px));
    gap: 2rem;
}

.link-card {
    display: block;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-color);
}

.link-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px var(--shadow-color);
    color: var(--text-color);
}

html[data-theme='dark'] .link-card {
    background-color: var(--bg-color);
}

.link-card-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.link-card-content {
    padding: 1.5rem 2rem;
    text-align: left;
}

.link-card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.link-card-text {
    margin-bottom: 1.5rem;
    text-align: left;
    font-size: 0.95rem;
}

.link-card-anchor {
    font-weight: 600;
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.link-card:hover .link-card-anchor {
    gap: 0.8rem;
}

.link-card-anchor .fa-arrow-right {
    transition: transform 0.3s ease;
}

.link-card:hover .link-card-anchor .fa-arrow-right {
    transform: translateX(4px);
}

/* ===== Footer ===== */
.site-footer-bottom {
    background-color: var(--bg-color);
    padding: 2rem var(--container-padding);
    border-top: 1px solid var(--border-color);
}

.footer-copyright {
    width: 100%;
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-copyright p {
    margin-bottom: 0;
}

/* ===== Back to Top Button ===== */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    z-index: 999;
}

.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background-color: var(--accent-color-hover);
    color: #fff;
}

/* ===== Scroll Animations ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive (Mobile-First approach) ===== */
@media (max-width: 768px) {
    h2 {
        font-size: 2rem;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        display: flex;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    }

    .main-nav.is-open {
        transform: translateX(0);
    }

    .nav-list {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .nav-link {
        font-size: 1.8rem;
    }

    .mobile-menu-toggle {
        display: block;
    }
}