:root {
    /* Dark Theme Palette */
    --primary-color: #0d1a2e; /* Very dark blue */
    --secondary-color: #00aaff; /* Brighter blue for accents */
    --accent-color: #00d4ff; /* Bright cyan for highlights */
    --text-color: #e0e0e0; /* Light gray for text */
    --bg-color: #050c14; /* Near black background */
    --card-bg-color: #102038; /* Dark blue for cards/sections */
    --border-color: #2a3f5a; /* Subtle border color */
    --header-bg: rgba(13, 26, 46, 0.8); /* Semi-transparent dark blue */
    --input-bg: var(--primary-color);
    --button-bg: var(--secondary-color);
    --button-text: var(--primary-color);
    --button-hover-bg: var(--accent-color);
    --button-hover-text: var(--bg-color);
    --hero-overlay: rgba(5, 12, 20, 0.5);
    --about-overlay: rgba(5, 12, 20, 0.8);
    --shadow-color: rgba(0, 170, 255, 0.1);
    --link-color: var(--accent-color);

    --border-radius: 6px;
    --box-shadow: 0 5px 20px var(--shadow-color);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

header {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 5px 5%;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.logo img {
    height: 45px;
    width: auto;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.logo a:hover img {
    transform: scale(1.05);
}

/* --- Hamburger Menu Styles --- */

.hamburger {
    display: inline-block;
    cursor: pointer;
    transition-property: opacity, filter;
    transition-duration: 0.15s;
    transition-timing-function: linear;
    font: inherit;
    color: inherit;
    text-transform: none;
    background-color: transparent;
    border: 0;
    margin: 0;
    overflow: visible;
    padding: 15px;
    z-index: 1001;
}
.hamburger:hover {
    opacity: 0.7;
}
.hamburger.is-active:hover {
    opacity: 0.7;
}
.hamburger.is-active .hamburger-inner,
.hamburger.is-active .hamburger-inner::before,
.hamburger.is-active .hamburger-inner::after {
    background-color: var(--text-color);
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -2px;
}
.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
    width: 30px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 4px;
    position: absolute;
    transition-property: transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}
.hamburger-inner::before, .hamburger-inner::after {
    content: "";
    display: block;
}
.hamburger-inner::before {
    top: -10px;
}
.hamburger-inner::after {
    bottom: -10px;
}

/* Animation (Spin) */
.hamburger--spin .hamburger-inner {
    transition-duration: 0.22s;
    transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}
.hamburger--spin .hamburger-inner::before {
    transition: top 0.1s 0.25s ease-in, opacity 0.1s ease-in;
}
.hamburger--spin .hamburger-inner::after {
    transition: bottom 0.1s 0.25s ease-in, transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.hamburger--spin.is-active .hamburger-inner {
    transform: rotate(225deg);
    transition-delay: 0.12s;
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
.hamburger--spin.is-active .hamburger-inner::before {
    top: 0;
    opacity: 0;
    transition: top 0.1s ease-out, opacity 0.1s 0.12s ease-out;
}
.hamburger--spin.is-active .hamburger-inner::after {
    bottom: 0;
    transform: rotate(-90deg);
    transition: bottom 0.1s ease-out, transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Nav Links Container */
.nav-links {
    display: none; /* Hide by default */
    position: absolute;
    top: 100%;
    right: 5%;
    left: auto;
    width: auto;
    min-width: 200px;
    max-width: 300px;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 10px 0;
    z-index: 999;
    border-radius: 0 0 var(--border-radius) var(--border-radius); /* Optional: round bottom corners */
}

.nav-links.is-active {
    display: block; /* Show when active */
}

.nav-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align items to the start (left) */
}

.nav-links ul li {
    margin: 0; /* Remove default vertical margin */
    width: 100%;
    text-align: left; /* Align text to the left */
}

.nav-links ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s ease;
    padding: 12px 20px; /* Adjust padding */
    display: block;
    width: 100%; /* Make link take full width */
    box-sizing: border-box;
}
.nav-links ul li a:hover,
.nav-links ul li a.active {
     color: var(--accent-color);
     background-color: rgba(0,0,0,0.1); /* Subtle hover/active background */
}

/* --- End Hamburger Menu Styles --- */


main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 5%;
}

section {
    padding: 60px 0;
    border-bottom: 1px solid var(--border-color);
}

section:last-of-type {
     border-bottom: none;
}

#hero {
    background-image: linear-gradient(var(--hero-overlay), var(--hero-overlay)), url('static/img/background.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    /* background-attachment: fixed; */ /* Removed for potential LCP improvement */
    padding: 120px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

#hero h1 {
    color: var(--accent-color);
    font-size: 3.2em;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

#hero p {
    font-size: 1.3em;
    font-weight: 400;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    text-align: center;
}

h2 {
    color: var(--accent-color);
    font-size: 2.2em;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Add background to the #about section */
#about {
    background-image: linear-gradient(var(--about-overlay), var(--about-overlay)), url('static/img/exertpise_bg.webp');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    padding-top: 60px;
    padding-bottom: 60px;
    position: relative;
    z-index: 1;
}

/* Styles for the About section feature boxes */
.features-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 40px;
}

.feature-box {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px 25px;
    box-sizing: border-box;
    text-align: center;
    flex-basis: 29%;
    flex-grow: 0;
    flex-shrink: 0;
    box-shadow: 0 3px 10px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.feature-box h3 {
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

/* Style for the divider */
.feature-divider {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 0 auto 15px auto;
    width: 80%;
}

.feature-box p {
    font-size: 1em;
    color: var(--text-color);
    line-height: 1.5;
    margin-bottom: 0;
    font-weight: 400;
}

#about p, #blog p:first-of-type, #contact p:first-of-type { /* Target only the intro paragraphs */
    max-width: 800px;
    margin: 0 auto 20px auto;
    text-align: center;
}

/* Add background to the #blog section */
#blog {
    background-image: linear-gradient(var(--about-overlay), var(--about-overlay)), url('static/img/exertpise_bg.webp');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    padding-top: 60px;
    padding-bottom: 60px;
    position: relative;
    z-index: 1;
    border-bottom: none;
}

#blog article {
    background-color: var(--card-bg-color);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#blog article:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}


#blog article h3 {
    margin-top: 0;
    color: var(--secondary-color);
}

#blog article a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
}

#blog article a:hover {
    text-decoration: underline;
}

/* Style for the "Read More" link */
.read-more {
    display: inline-block;
    margin-top: 10px;
    /* Removed padding, background, border-radius */
    color: var(--secondary-color); /* High contrast link color */
    text-decoration: underline; /* Standard link appearance */
    font-weight: 600;
    transition: color 0.3s ease; /* Only transition color */
}

.read-more:hover {
    /* Removed background-color */
    color: var(--text-color); /* High contrast hover color */
    text-decoration: none; /* Remove underline on hover */
}

/* Add background to the #contact section */
#contact {
    background-image: linear-gradient(var(--about-overlay), var(--about-overlay)), url('static/img/background.webp'); /* Changed to main background image */
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    padding-top: 60px;
    padding-bottom: 60px;
    position: relative;
    z-index: 1;
}

#contact form {
    max-width: 600px;
    margin: 30px auto 0 auto;
    padding: 30px;
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

#contact label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-color);
}

#contact input[type="text"],
#contact input[type="email"],
#contact input[type="number"], /* Added math challenge input */
#contact textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--input-bg);
    color: var(--text-color);
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-size: 1em;
}

#contact textarea {
    resize: vertical;
}

#contact button {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#contact button:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
    transform: translateY(-2px);
}

/* Specific styling for the math challenge input */
#contact #math_challenge_answer {
    background-color: var(--input-bg);
    color: var(--text-color);
    width: auto; /* Override width: 100% */
    max-width: 100px; /* Limit width */
    display: inline-block; /* Adjust display */
    vertical-align: middle; /* Align with button */
    margin-right: 10px; /* Add space before button */
}
    /* Inherit padding, border, etc. from the general rule */
/* Removed extra closing brace */

/* Specific styles for the blog post page */
.blog-post-page main {
    max-width: 800px;
    margin: 40px auto;
    /* Background styles removed, will be applied to body instead */
}

/* Style for the optional header image in blog posts */
.blog-post-page .post-header-image {
    margin-bottom: 30px;
    text-align: center;
}

.blog-post-page .post-header-image img {
    max-width: 300px;
    height: auto;
    border-radius: var(--border-radius);
}

.blog-post-page h1 {
    color: var(--accent-color);
    font-size: 2.5em;
    margin-bottom: 15px;
}

.blog-post-page .post-meta {
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 0.9em;
}

.blog-post-page article p {
    color: var(--text-color); /* Ensure base text color */
    font-size: 1em; /* Match base paragraph size */
    line-height: 1.6; /* Match base line height */
    margin-bottom: 1.2em; /* Standard paragraph spacing */
}

.blog-post-page article a {
    color: var(--link-color);
}

.blog-post-page article a:hover {
    text-decoration: underline;
}

/* Background for individual blog post pages */
body.blog-page-body {
    background-image: linear-gradient(var(--about-overlay), var(--about-overlay)), url('static/img/exertpise_bg.webp');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed; /* Keep parallax effect */
    background-color: var(--bg-color); /* Fallback */
}

/* Ensure blog content area itself is transparent to see body background */
.blog-post-page main {
    background: none; /* Remove any background from main */
    box-shadow: none; /* Remove any shadow from main */
    padding: 40px 0; /* Adjust padding if needed, maybe remove side padding */
}

footer {
    text-align: center;
    padding: 20px 5%;
    margin-top: 40px;
    background-color: var(--primary-color);
    color: var(--text-color);
    font-size: 0.9em;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Ensure hamburger is visible */
    .hamburger {
        display: inline-block;
    }

    /* Adjust header padding slightly if needed */
    header {
        padding: 5px 5%;
    }

    #hero h1 {
        font-size: 2.5em;
    }

    h2 {
        font-size: 1.8em;
    }

    main {
        margin: 20px auto;
    }

    section {
        padding: 40px 0;
    }
    /* Stack feature boxes vertically on mobile */
    .features-container {
        flex-direction: column;
        align-items: center;
    }

    .feature-box {
        flex-basis: 90%;
        max-width: 400px;
        margin-bottom: 20px;
    }

    .feature-box:last-child {
        margin-bottom: 0;
    }
}

/* Media query to make menu full width only on smaller screens */
@media (max-width: 480px) {
    .nav-links {
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
    }
    .nav-links ul li {
        text-align: center;
    }
     .nav-links ul li a {
        margin: 0 auto;
     }
     
     /* --- Mobile Optimizations --- */
     @media (max-width: 768px) {
       /* Disable fixed backgrounds on mobile for performance */
       #about,
       #blog,
       #contact { /* Apply to contact as well */
         background-attachment: scroll;
       }
}
} /* Added missing closing brace for @media query */

/* Styles for thanks.html page */
.thank-you-content {
    min-height: calc(100vh - 150px); /* Adjust based on header/footer height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 5%;
}
.thank-you-content h1 {
     color: var(--accent-color);
     margin-bottom: 20px;
}
 .thank-you-content p {
     color: var(--text-color);
     max-width: 600px;
     margin-bottom: 30px;
 }
 .thank-you-content a {
    color: var(--link-color);
    text-decoration: underline;
 }
 