/* Color Palette Variables */
:root {
    --primary-dark: #2c3e50; /* Deep Navy/Charcoal Blue for primary elements */
    --accent-blue: #3498db;  /* A vibrant, academic blue for accents and links */
    --light-gray: #f8f9fa;   /* Very light gray for subtle section breaks */
    --white: #ffffff;        /* Pure white for backgrounds */
    --text-dark: #34495e;    /* Darker gray for main body text, readable */
    --text-light: #e0e6ec;   /* Lighter text for dark backgrounds */
    --button-primary: #007bff; /* A standard primary button blue */
    --button-primary-hover: #0056b3;
    --button-secondary: #6c757d; /* A subtle secondary button gray */
    --button-secondary-hover: #5a6268;
    --card-background: #ffffff;
    --card-border: #e9ecef; /* Light border for cards */
    --card-shadow: rgba(0, 0, 0, 0.08); /* Softer shadow */
}

/* Base Styles */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    line-height: 1.7; /* Increased line height for readability */
    color: var(--text-dark);
    background-color: var(--light-gray);
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
    -webkit-font-smoothing: antialiased; /* Smoother font rendering */
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1000px; /* Slightly wider container */
    margin: 0 auto;
    padding: 0 25px; /* More padding on sides */
}

/* Fixed Navigation Bar */
.navbar {
    background-color: var(--primary-dark);
    padding: 18px 0; /* Slightly more vertical padding */
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25); /* Stronger, more defined shadow */
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-family: 'Playfair Display', serif;
    font-size: 2.0em; /* Slightly larger logo */
    color: var(--accent-blue);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-links li {
    margin-left: 35px; /* More space between links */
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.05em; /* Slightly adjusted font size */
    font-weight: 400;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px; /* Thicker underline */
    bottom: -8px; /* Further below the text */
    left: 0;
    background-color: var(--accent-blue);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--white); /* White on hover for better contrast */
}

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

/* Mobile menu specific styles (overrides Tailwind's hidden for smaller screens) */
.mobile-menu-button {
    display: none; /* Hidden by default, shown by media query */
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.8em;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.mobile-menu-button:hover {
    color: var(--accent-blue);
}

#mobile-menu {
    display: none; /* Hidden by default, toggled by JS */
    position: absolute;
    top: 100%; /* Position below the navbar */
    left: 0;
    width: 100%;
    background-color: var(--primary-dark); /* Match navbar background */
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    padding: 15px 0;
}

#mobile-menu.active {
    display: block; /* Show when active */
}

#mobile-menu ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

#mobile-menu ul li {
    margin: 10px 0;
}

#mobile-menu ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.1em;
    padding: 10px 20px;
    display: block;
    width: 100%;
    text-align: center;
    transition: background-color 0.3s ease;
}

#mobile-menu ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle hover for mobile */
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-dark), #1a2c3d); /* Deeper, richer gradient */
    color: var(--white);
    text-align: center;
    padding-top: 180px; /* More top padding for aesthetic balance */
    padding-bottom: 120px;
    position: relative;
    overflow: hidden;
    border-bottom-left-radius: 30px; /* Rounded bottom corners */
    border-bottom-right-radius: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px; /* Larger, more subtle gradient effect */
    left: -100px;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.07), transparent 70%);
    animation: gradientShift 15s infinite alternate ease-in-out; /* Slower, smoother animation */
    pointer-events: none;
    opacity: 0.8;
}

@keyframes gradientShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-5%, -5%); } /* More subtle movement */
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4.2em; /* Larger, more impactful heading */
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5); /* Stronger text shadow for depth */
}

.hero .tagline {
    font-size: 1.65em; /* Larger tagline */
    font-weight: 300;
    margin-bottom: 50px; /* More space below tagline */
    color: var(--light-gray);
    opacity: 0.95;
    line-height: 1.4;
}

.social-links a {
    color: var(--white);
    font-size: 2.4em; /* Larger icons */
    margin: 0 22px; /* More space between icons */
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.3s ease; /* Smoother animation curve */
}

.social-links a:hover {
    transform: translateY(-8px) scale(1.1); /* Lift and slight scale effect */
    color: var(--accent-blue);
}

/* Section Styling */
.section-padded {
    padding: 100px 0; /* Generous top and bottom padding */
    background-color: var(--white);
    border-bottom: 1px solid var(--card-border); /* Subtle border */
}

.section-padded:nth-of-type(odd):not(#home) {
    background-color: var(--light-gray); /* Light gray for alternating sections */
}

.section-padded h2 {
    font-family: 'Playfair Display', serif;
    font-size: 3.2em; /* Larger section titles */
    text-align: center;
    margin-bottom: 50px; /* More space below heading */
    color: var(--primary-dark);
    position: relative;
    letter-spacing: -0.5px;
}

.section-padded h2::after {
    content: '';
    display: block;
    width: 80px; /* Wider underline */
    height: 5px; /* Thicker underline */
    background-color: var(--accent-blue);
    margin: 20px auto 0; /* More space below line */
    border-radius: 3px;
}

.section-padded p {
    font-size: 1.18em; /* Slightly larger body text */
    margin-bottom: 25px; /* More space between paragraphs */
    text-align: justify;
    line-height: 1.8; /* Increased line height for better readability */
    color: var(--text-dark);
    max-width: 800px; /* Constrain text width for readability */
    margin-left: auto;
    margin-right: auto;
}

/* Accent Section (e.g., Projects) */
.section-accent {
    background: linear-gradient(135deg, var(--accent-blue), #2a7bbe);
    color: var(--white);
    padding: 100px 0; /* Consistent padding */
    border-top-left-radius: 30px; /* Rounded top corners */
    border-top-right-radius: 30px;
    box-shadow: 0 -10px 20px rgba(0,0,0,0.2);
}

.section-accent h2 {
    color: var(--white);
}

.section-accent h2::after {
    background-color: var(--white);
}

.section-accent p {
    color: var(--text-light);
    opacity: 0.9;
}

/* Call to Action Buttons */
.project-link-container, .blog-link-container {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 30px;
}

.main-button {
    display: inline-block;
    background-color: var(--button-primary); /* Primary button color */
    color: var(--white);
    padding: 18px 40px; /* More generous padding */
    border-radius: 8px; /* Slightly more rounded corners */
    text-decoration: none;
    font-size: 1.3em; /* Larger font size */
    font-weight: 600; /* Medium bold */
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); /* Deeper shadow */
    letter-spacing: 0.8px; /* More prominent letter spacing */
    border: none; /* Ensure no default button border */
}

.main-button:hover {
    background-color: var(--button-primary-hover);
    transform: translateY(-7px); /* More pronounced lift effect */
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35); /* Stronger shadow on hover */
}

.main-button i {
    margin-left: 15px; /* More space for icon */
    font-size: 0.9em; /* Slightly smaller icon relative to text */
}

.project-teaser, .blog-teaser {
    text-align: center;
    font-style: italic;
    color: var(--text-dark);
    margin-top: 25px;
    font-size: 1.1em;
    opacity: 0.8;
}
/* Styling for inline text links */
.text-link {
    color: var(--accent-blue); /* Use your accent blue for links */
    text-decoration: none; /* Remove default underline */
    border-bottom: 2px solid var(--accent-blue); /* Subtle underline effect */
    padding-bottom: 2px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.text-link:hover {
    color: var(--primary-dark); /* Change color on hover */
    border-color: var(--primary-dark); /* Change underline color on hover */
}
.section-accent .project-teaser {
    color: var(--text-light);
}

/* Medium button specific override */
.medium-button {
    background-color: #007bff; /* Consistent with primary button, or choose a distinct brand color */
}

.medium-button:hover {
    background-color: #0056b3;
}

/* Blog Posts Grid and Cards */
.blog-posts-grid { /* Renamed container to grid for clarity */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Adjusted min-width for larger cards */
    gap: 35px; /* More space between cards */
    margin-top: 60px;
    justify-content: center;
}

.blog-card {
    background-color: var(--card-background);
    border-radius: 12px; /* More rounded corners */
    border: 1px solid var(--card-border); /* Subtle border */
    box-shadow: 0 6px 18px var(--card-shadow); /* Softer, wider shadow */
    padding: 35px; /* More internal padding */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.blog-card:hover {
    transform: translateY(-10px); /* More pronounced lift */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* More prominent shadow on hover */
}

.blog-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.9em; /* Larger card titles */
    color: var(--primary-dark);
    margin-top: 0;
    margin-bottom: 18px;
    line-height: 1.35;
    transition: color 0.3s ease;
}

.blog-card h3 a {
    text-decoration: none; /* Remove underline from title links */
    color: inherit; /* Inherit color from h3 */
}

.blog-card h3 a:hover {
    color: var(--accent-blue); /* Change color on hover for title links */
}

.blog-card .blog-excerpt {
    font-size: 1.05em; /* Slightly larger excerpt text */
    color: var(--text-dark);
    margin-bottom: 30px; /* More space before button */
    flex-grow: 1;
    line-height: 1.6;
    opacity: 0.95;
}

.blog-card .read-more-button {
    display: inline-block;
    background-color: var(--button-primary); /* Consistent button styling */
    color: var(--white);
    padding: 12px 25px; /* More padding for button */
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.98em;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
    align-self: flex-start;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.blog-card .read-more-button:hover {
    background-color: var(--button-primary-hover);
    transform: translateX(7px); /* More pronounced slide effect */
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

/* Footer */
.footer {
    background-color: var(--primary-dark);
    color: var(--text-light);
    text-align: center;
    padding: 40px 0; /* More padding */
    font-size: 0.95em;
    border-top: 5px solid var(--accent-blue); /* A strong accent line */
    border-top-left-radius: 30px; /* Rounded top corners */
    border-top-right-radius: 30px;
    box-shadow: 0 -10px 20px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 992px) {
    .container {
        padding: 0 20px;
    }
    .hero h1 {
        font-size: 3.6em;
    }
    .hero .tagline {
        font-size: 1.4em;
    }
    .section-padded h2 {
        font-size: 2.8em;
    }
    .section-padded p {
        font-size: 1.1em;
    }
    .blog-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }
    .blog-card h3 {
        font-size: 1.7em;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: row; /* Keep logo and button in a row */
        justify-content: space-between;
        align-items: center;
    }
    .site-logo {
        margin-bottom: 0;
    }
    .nav-links {
        display: none; /* Hide desktop nav links */
    }
    .mobile-menu-button {
        display: block; /* Show hamburger button */
    }
    .hero {
        padding-top: 140px;
        padding-bottom: 100px;
    }
    .hero h1 {
        font-size: 3em;
    }
    .hero .tagline {
        font-size: 1.25em;
    }
    .social-links a {
        font-size: 2.2em;
        margin: 0 18px;
    }
    .section-padded {
        padding: 80px 0;
    }
    .section-padded h2 {
        font-size: 2.5em;
    }
    .section-padded p {
        font-size: 1.05em;
    }
    .main-button {
        font-size: 1.15em;
        padding: 16px 30px;
    }
    .blog-posts-grid {
        grid-template-columns: 1fr; /* Stack blog cards on smaller screens */
        gap: 30px;
    }
    .blog-card {
        padding: 30px;
    }
    .blog-card h3 {
        font-size: 1.8em;
    }
    .blog-card .read-more-button {
        font-size: 0.95em;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .site-logo {
        font-size: 1.8em;
    }
    .hero {
        padding-top: 120px;
        padding-bottom: 80px;
    }
    .hero h1 {
        font-size: 2.5em;
    }
    /* Adjust padding for mobile menu items */
    #mobile-menu ul li a {
        padding: 8px 15px;
    }
}