/* Basic Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}
 
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: #2a2a2a;
    background-color: #6A9FCD; /* Cerulean-like Darker Blue body background */
}

.container { 
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
} 

h1, h2, h3, h4 {
    color: #253544; /* Slightly darker blue-grey for headings */
}

h2 { /* Section titles */
    display: block; /* Ensure h2 behaves as a block-level element */
    width: 100%;    /* Make h2 span the full width of its container */
    clear: both;    /* Clear any potential floats affecting layout */
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.6rem; /* Slightly adjusted for balance */
    font-weight: 600;
    position: relative;
    padding-bottom: 15px; /* Space for the underline */
}

h2::after { /* Underline accent for section titles */
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: rgb(0, 123, 255); /* Primary accent color */
}

/* Header & Navigation */
header {
    background: #F5FAFF; /* Very light off-white blue header */
    color: #2a2a2a;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08); /* Slightly more pronounced shadow */
    border-bottom: 1px solid #B8CCE0; /* Darker light blue border */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
}

.logo-text-group { /* Wrapper for h1 and p.tagline for proper flex alignment with toggle */ }

header .logo h1 {
    margin: 0;
    font-size: 2rem;
    color: #007bff;
    font-weight: 700;
}

header .logo .tagline {
    font-size: 0.9rem;
    color: #17a2b8; /* Secondary accent color for tagline */
    margin-top: -5px;
}

header nav ul {
    list-style: none;
    display: flex;
}

header nav ul li {
    margin-left: 25px;
}

header nav ul li a {
    color: #2a2a2a;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 5px;
    transition: color 0.3s ease, background-color 0.3s ease;
    font-size: 1rem;
}

header nav ul li a:hover,
header nav ul li a.active {
    color: #004c99; /* Even darker blue on hover/active */
    background-color: #C0D6EF; /* Darker light blue hover background */
    font-weight: 600;
}

/* CSS Variables for Theme Toggle Icon */
:root {
    --icon-outline-color: #606060;         /* Light mode: Outline color */
    --icon-fill-color-default: #4a4a4a;  /* Light mode: Default icon color */ 
    --icon-fill-color-animated: #0056b3; /* Light mode: Fill color during animation peak */
}

/* Theme Toggle Button */
.theme-toggle-button {
    background: none;
    border: 1px solid transparent; /* Keep space consistent */
    color: var(--icon-fill-color-default); /* Icon's color */
    cursor: pointer;
    font-size: 1.1rem; /* Icon size */
    padding: 6px 8px;
    border-radius: 50%; /* Keep it circular */
    margin-right: 15px; /* Space between toggle and logo text */
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    animation: intermittentWiggle 15s infinite ease-in-out; /* Add intermittent wiggle animation */
    line-height: 1; /* Helps center icon if padding is symmetrical */
}

.theme-toggle-button:hover {
    background-color: #C8DCEF; /* Darker light blue hover */
    color: #007bff; /* Icon fill color on hover */
    /* -webkit-text-stroke-color: var(--icon-outline-color); */ /* Outline remains defined by variable */
    transform: scale(1.1); /* Slightly enlarge the button */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* Add a subtle shadow */
}
.theme-toggle-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--background-color, #ffffff), 0 0 0 4px var(--heading-color, #253544), 0 2px 8px rgba(0, 0, 0, 0.15);
}
.theme-toggle-button i {
    transition: transform 0.3s ease, display 0s !important; /* Add transform transition, prevent display transition */
}

.theme-toggle-button:hover .fa-moon,
.theme-toggle-button:hover .fa-sun {
    transform: rotate(20deg); /* Rotate the icon on hover */
}

/* Keyframes for the intermittent wiggle animation */
@keyframes intermittentWiggle {
  /* Normal state for most of the cycle */
  0%, 84.9% {
    transform: rotate(0deg);
    color: var(--icon-fill-color-default); /* Icon uses default fill */
    opacity: 1; /* Ensure button is fully opaque */
  }

  /* Start of wiggle, icon keeps default color */
  85% {
    transform: rotate(7deg);
    color: var(--icon-fill-color-default);
    opacity: 1;
  }
  87% { /* Wiggle back */
    transform: rotate(-7deg);
    color: var(--icon-fill-color-default);
    opacity: 1;
  }
  89% { /* Wiggle forth */
    transform: rotate(7deg);
    color: var(--icon-fill-color-animated); /* Fill appears with animated color */
    opacity: 1;
  }
  91% { /* Wiggle back */
    transform: rotate(-7deg);
    color: var(--icon-fill-color-animated);
    opacity: 1;
  }
  93% { /* Wiggle forth */
    transform: rotate(7deg);
    color: var(--icon-fill-color-animated);
    opacity: 1;
  }
  95% { /* Settle rotation, keep animated fill color */
    transform: rotate(0deg);
    color: var(--icon-fill-color-animated);
    opacity: 1;
  }
  /* End of blink, smoothly return to normal background and state */
  97%, 100% {
    transform: rotate(0deg);
    color: var(--icon-fill-color-default); /* Fill returns to default */
    opacity: 1;
  }
}

/* Hamburger Menu Toggle Button */
.nav-toggle {
    display: none; /* Hidden by default, shown on mobile via media query */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001; /* Ensures it's clickable if nav items overlap */
    margin-left: 15px; /* Space from other nav items if any, or edge */
}
.nav-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--background-color, #ffffff), 0 0 0 4px var(--heading-color, #253544);
}

.hamburger-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #2a2a2a; /* Hamburger line color */
    position: relative;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #2a2a2a; /* Hamburger line color */
    transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}

.hamburger-icon::before {
    top: -8px; /* Space for the top line */
}

.hamburger-icon::after {
    bottom: -8px; /* Space for the bottom line */
}

.nav-toggle[aria-expanded="true"] .hamburger-icon { background-color: transparent; } /* Middle line fades out */
.nav-toggle[aria-expanded="true"] .hamburger-icon::before { transform: rotate(45deg); top: 0; }
.nav-toggle[aria-expanded="true"] .hamburger-icon::after { transform: rotate(-45deg); bottom: 0; }

/* Sections General Styling */
section {
    padding: 80px 0; 
    background-color: #59b2f7; /* Uniform Medium Cerulean-like Blue for all sections */
}

section:nth-child(even) { 
    /* This rule is now overridden by the general 'section' rule above for light mode */
    /* background-color: #EBF4FF; */ 
}

/* Hero Section */
.hero-section {
    /* background-image removed, will use section's solid color */
    text-align: center;
    padding: 90px 0 30px; /* Shortened top and adjusted bottom padding */
    min-height: auto; /* Adjusted min-height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-section h2 { /* Intro text */
    font-size: 2rem; /* Made intro text more prominent */
    margin-bottom: 30px;
    color: #15202b; /* Even darker for more emphasis */
    max-width: 750px;
    line-height: 1.5;
    margin-left: auto; /* Ensures the block itself is centered */
    margin-right: auto; /* Ensures the block itself is centered */
    font-weight: 400;
}

.hero-section h2::after { display: none; } /* No underline for hero intro */

.cta-buttons .button {
    margin: 10px 15px;
    padding: 14px 32px; /* Slightly adjusted padding */
    font-size: 1.1rem;
}

/* Buttons */
.button {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 12px 28px;
    text-decoration: none;
    border-radius: 50px; /* Pill-shaped buttons */
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    border: 2px solid transparent; /* For potential outline effect on focus */
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.15); /* Softer shadow */
}

.button:hover {
    background: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.25);
}
.button:focus-visible {
    outline: none;
    /* Create a ring effect: inner shadow matches background, outer shadow is the focus color */
    box-shadow: 0 0 0 2px var(--background-color, #ffffff), 0 0 0 4px var(--heading-color, #253544);
}


/* Adjust top padding for the projects section specifically */
.projects-section {
    padding-top: 5px; /* Reduced top padding */
    padding-bottom: 40px;
    /* background-image removed, will use section's solid color */
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    max-width: 900px; /* Adjust as needed - Increased from 800px */
    margin: 30px auto 0; 
    overflow: hidden;
    background-color: #ffffff; /* Changed to white */
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    border: 1px solid #B8CCE0; /* Darker light blue border for carousel container */
}

.carousel-slides {
    display: flex; /* Helps if using CSS transitions for sliding, not strictly needed for fade */
    height: 740px;      /* Reduced height by 100px */
                       /* Adjust this value based on your tallest slide content */
    /* For fade effect, slides will be position:absolute or display:none/block */
}

.carousel-slide {
    width: 100%;
    flex-shrink: 0; /* Prevents shrinking if using flex for sliding */
    padding: 20px 50px; /* Increased horizontal padding from 20px to 50px */
    box-sizing: border-box;
    text-align: left; /* Default text alignment for content within slide */

    /* Flexbox for vertical alignment of content and button */
    display: flex; /* Initially none, JS will set to flex or block */
    flex-direction: column;
    height: 100%; /* Make slide fill the fixed height of .carousel-slides */
    overflow-y: visible; /* Prevent scrollbars, content will expand the slide */
}

.carousel-slide h3,
.carousel-slide p {
    margin-bottom: 15px; /* Consistent bottom margin for text blocks */
}

.carousel-slide h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #007bff;
    font-size: 1.6rem;
}
.carousel-slide h3 a {
    color: inherit;
    text-decoration: none;
}
.carousel-slide h3 a:hover {
    text-decoration: underline;
}
.carousel-slide p {
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.6;
}

/* Style for the "View on GitHub" button within the carousel slide */
.carousel-slide .project-link-btn {
    margin-top: auto;     /* Pushes button to the bottom of the flex container */
    align-self: center;   /* Centers button horizontally */
    margin-bottom: 10px;  /* Optional: space at the very bottom of the slide */
}

/* New Project Metrics Styling */
.project-metrics {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 12px 15px; /* Adjusted padding */
    background-color: rgba(0,0,0,0.02); /* Lighter, more subtle background */
    border-radius: 8px; /* Softer radius */
    border: 1px solid #dde2e7; /* Lighter border */
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0; /* Increased padding */
    font-size: 0.95rem; /* Consistent font size */
    border-bottom: 1px dashed #e0e5ea; /* Lighter dashed separator */
}

.metric-item:last-child {
    border-bottom: none;
}

.metric-label {
    font-weight: 500;
    color: #4a5568; /* Softer dark grey for labels */
    margin-right: 10px;
    display: inline-flex; /* Align icon and text */
    align-items: center;
}
.metric-label i {
    margin-right: 8px; /* Increased space for icon */
    color: #007bff; /* Primary color for icons */
    font-size: 0.9em; /* Slightly smaller icon relative to label */
}

.metric-value {
    font-weight: 600;
    text-align: right; /* Ensure values align to the right */
}

.metric-value.time-saved-per-use { color: #2f855a; } /* Darker, richer green */
.metric-value.frequency-of-use { color: #2b6cb0; } /* Darker, richer blue */

.metric-item.annual-savings .metric-label i { color: #b7791f; } /* Darker gold/yellow */
.metric-value.annual-hours-saved {
    color: #c53030; /* Darker, richer red for high impact */
    font-size: 1.05rem;
}

.metric-note.compounding-note {
    display: block;
    font-size: 0.85rem;
    color: #718096; /* Softer grey for notes */
    text-align: right;
    margin-top: 5px; /* Increased margin */
}
.metric-note.compounding-note i { margin-right: 5px; color: #718096; }

.project-rationale {
    font-size: 0.88rem; /* Slightly smaller for detailed text */
    color: #4a5568; /* Made rationale text darker */
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 0 5px;
    line-height: 1.5;
}

.project-rationale strong { /* The "Rationale:" label */
    font-weight: 600;
    color: #343a40; /* Made "Rationale:" label even darker */
    display: block;
    margin-bottom: 8px;
    font-style: normal; /* Ensure label is not italic */
}

.project-rationale p {
    margin-bottom: 8px;
    font-style: normal; /* Ensure paragraphs are not italic */
}

.project-rationale ul.rationale-list {
    list-style-type: disc; /* Or decimal if you prefer actual numbers */
    padding-left: 20px; /* Indent list items */
    margin-top: 5px;
    margin-bottom: 10px;
    font-style: normal; /* Ensure list is not italic */
}
.project-rationale ul.rationale-list li {
    margin-bottom: 5px;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(42, 42, 42, 0.5); /* Darker button background for light mode */
    color: #f0f0f0; /* Lighter icon color on darker button */
    border: none;
    cursor: pointer; 
    border-radius: 50%;
    z-index: 10;
    width: 40px; /* Ensure it's circular */
    height: 40px;
    padding: 0; /* Remove padding, use flex to center icon */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem; /* Adjust arrow size if needed */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Subtle shadow for depth */
    transition: background-color 0.3s ease;
}
.carousel-button.prev { left: 15px; } /* Increased space from container edge */
.carousel-button.next { right: 15px; } /* Increased space from container edge */
.carousel-button:hover { background-color: rgba(30, 30, 30, 0.7); } /* Darker hover for button */

.carousel-dots {
    text-align: center;
    padding-top: 15px;
}

.carousel-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: #b0b4b8; /* Darker inactive dot */
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-dot.active {
    background-color: #0069d9; /* Slightly darker active dot */
}

/* Projects Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
}

.project-card {
    background: #F5FAFF; /* Very light off-white blue card background */
    padding: 30px;
    border-radius: 12px; /* Slightly more rounded corners */
    border: 1px solid #B8CCE0; /* Darker light blue border */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); /* Softer, more diffused shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px); /* More lift on hover */
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12); /* More prominent shadow on hover */
}

.project-card h3 {
    margin-top: 0;
    margin-bottom: 18px;
    color: #007bff;
    font-size: 1.4rem;
}

.project-card h3 i, .project-card h3 .fas, .project-card h3 .fab { /* For emojis/icons in title */
    margin-right: 8px;
}

.project-card p {
    margin-bottom: 12px;
    font-size: 1rem;
    flex-grow: 1; /* Makes paragraphs take available space */
}

.project-card strong {
    font-weight: 600;
    color: #2f343a; /* Darker strong text */
}

.project-links {
    margin-top: 20px;
    display: flex; /* Align links horizontally */
    gap: 15px; /* Space between link buttons */
}

.project-link-btn {
    display: inline-flex; /* For icon and text alignment */
    align-items: center;
    padding: 8px 18px;
    border-radius: 20px; /* Pill shape */
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.2s ease;
}

.project-link-btn:focus {
    outline: none;
}
.project-link-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--background-color, #ffffff), 0 0 0 4px var(--heading-color, #253544);
}

.project-link-btn i {
    margin-right: 8px;
}

.project-link-btn:first-of-type { /* GitHub button */
    background-color: #24292e; /* GitHub dark color */
    color: #fff;
}
.project-link-btn:first-of-type:hover { background-color: #1b1f23; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

.project-link-btn:last-of-type { /* Demo button */
    background-color: #dfe2e6; /* Darker background */
    color: #007bff; /* Original: blue text on light gray */
}
.project-link-btn:last-of-type:hover { background-color: #c8ccd0; color: #0056b3; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* Skills Section specific padding adjustment */
.skills-section {
    padding-top: 40px; /* Reduced top padding to decrease space after Projects section */
    padding-bottom: 60px; /* Adjusted to reduce gap before About section */
    /* background-image removed, will use section's solid color */
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); /* Increased again for wider columns */
    gap: 30px; 
}

.skill-category {
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    background-color: #ffffff; /* Changed to white */
}

.skill-category h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2a2a2a; /* Darker text */
    font-size: 1.3rem;
    display: flex; /* Ensures icon and text are on the same line and can be centered */    align-items: center; /* Vertically aligns icon and text if they have different heights */
    justify-content: center;
    min-height: 4.42rem; /* Accommodate ~2 lines of text (1.3rem font-size * 1.7 line-height * 2 lines) */
                         /* This helps align the start of the skill lists below the titles */
}

.skill-category h4 i {
    margin-right: 12px; /* Increased spacing between icon and text */
    color: #17a2b8; /* Secondary accent for skill icons */
    font-size: 1.2em; /* Makes the icon slightly larger relative to the h4 text */
}

.skill-category ul {
    list-style: none;
    padding: 0;
}

.skill-category ul li {
    margin-bottom: 10px;
    font-size: 0.95rem; /* Slightly smaller font for smaller bubbles */
    background-color: #f8f9fa; /* Very light gray for a cleaner background */
    color: #34495e; /* Slightly softer, professional dark blue-gray text */
    border: 1px solid #A0B4CE; /* Made border slightly darker */
    padding: 5px 12px; /* Increased padding for better text spacing */
    border-radius: 20px;
    display: inline-block;
    margin: 2px; /* Simplified margin for tighter packing */
    font-weight: 500; /* Slightly bolder text for a more defined look */
}

/* About Section specific padding to act as a buffer */
.about-section {
    padding-top: 30px;     /* Adjusted to reduce gap after Skills section */
    padding-bottom: 50px;  /* Increased padding to manage space before Contact, margin removed from Contact */
    /* background-image removed, will use section's solid color */
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    /* align-items: start; */ /* Removed, default 'stretch' is better for equal height columns */
    margin-bottom: 50px;
    text-align: left;
    background-color: #ffffff; /* Changed to white */
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.about-item h4 + p { /* Style for a paragraph directly following an H4 in about-item */
    margin-bottom: 15px; /* Add some space below the introductory paragraph */
    font-size: 1.05rem; /* Slightly larger for emphasis */
    /* Ensure consistent height for these paragraphs to align the <ul> below them.
       Removed fixed min-height for mobile responsiveness.
    */
    /* min-height: 5.355rem; */ /* Removed for mobile */
}

.about-item h4 {
    color: #007bff;
    margin-bottom: 2px; /* Minimized space below the H4 box */
    font-size: 1.3rem;
    /* Ensure consistent height for H4s - Removed fixed min-height for mobile responsiveness.
       Desktop alignment handled by grid/flex. */
    /* min-height: 2.4rem; */ /* Removed for mobile */
}

.about-item { /* Added to make .about-item a flex container */
    display: flex;
    flex-direction: column;
}

.about-item ul {
    list-style: none; /* Changed from disc for cleaner look */
    padding-left: 0;
}
.about-item ul li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 8px;
    /* Removed fixed min-height for mobile responsiveness.
       Desktop alignment handled by grid/flex. */
    /* min-height: 10.2rem; */ /* Removed for mobile */
    flex-grow: 0; /* Prevent li from growing, ul will handle growth */
}
.about-item ul li::before {
    content: '✓'; /* Checkmark */
    color: #28a745; /* Green for checkmarks */
    position: absolute;
    left: 0;
    font-weight: bold;
    /* Ensure consistent alignment of the bullet character itself */
    width: 20px; /* Define a width for the bullet container */
    text-align: center; /* Center the bullet within this container */
}

@media (min-width: 769px) { /* Apply when .about-content is likely multi-column */
    .about-item h4 + p {
        /* Ensures paragraphs before lists have a consistent minimum height, aligning the start of ULs. */
        /* Value based on approx 3 lines: 1.05rem font-size * 1.7 line-height * 3 lines */
        min-height: 5.355rem;
    }

    .about-item ul {
        /* Make the UL grow to fill available vertical space in its .about-item parent */
        flex-grow: 1;
        /* Turn the UL into a flex container for its LI children */
        display: flex;
        flex-direction: column;
    }
    .about-item ul li {
        /* Distribute space equally among LIs within the UL. Overrides global flex-grow: 0 for LIs on desktop. */
        flex: 1; /* shorthand for flex-grow: 1, flex-shrink: 1, flex-basis: 0% */
    }
}

.visual-timeline {
    margin-top: 40px;
    background-color: #ffffff; /* Changed to white */
    padding: 30px;
    border: 1px solid #B8CCE0; /* Darker light blue border */
    border-radius: 8px;
}

.visual-timeline h4 {
    margin-bottom: 20px;
    color: #343a40;
    text-align: center;
    font-size: 1.5rem;
}

.visual-timeline ul {
    list-style: none;
    padding: 0;
}

.visual-timeline ul li {
    margin-bottom: 15px;
    padding-left: 25px;
    position: relative;
    font-size: 1.05rem;
}

.visual-timeline ul li::before {
    /* content: '🗓️'; */ /* Calendar emoji - REMOVED to use Font Awesome icons via JS */
    /* position: absolute; */
    /* left: 0; */
    /* top: 0; */
    display: none; /* Ensure the emoji is hidden */
}

.visual-timeline ul li i.fas { /* Styling for the new Font Awesome icons */
    margin-right: 10px; /* Space between icon and text */
    color: #17a2b8; /* Secondary accent for timeline icons */
    width: 20px; /* Ensure icons align nicely if text wraps */
    text-align: center;
}

.visual-timeline ul li .highlight-inline-logo {
    max-height: 1.1em; /* Adjust to match text size, e.g., 1em or 1.1em */
    margin-right: 0.4em; /* Space between logo and the company/institution name */
    vertical-align: middle; /* Aligns logo nicely with the text */
    position: relative; /* Allows for fine-tuning with 'top' if needed */
    top: -1px; /* Slight vertical adjustment if necessary */
}

/* Specific styling for JMU and CompTIA logos in the highlights list to make them larger */
.visual-timeline ul li .highlight-inline-logo.comptia-logo-highlight {
    max-height: 2.2em; /* Increased size - adjust as needed */
    margin-right: 0.4em; /* Increased horizontal space next to the logo */
    top: -0.24em; /* Fine-tuned upward shift for CompTIA logo */
}

.visual-timeline ul li .highlight-inline-logo.jmu-logo-highlight {
    max-height: 2.2em; /* Increased size - adjust as needed */
    margin-right: 0.4em; /* Increased horizontal space next to the logo */
    top: -0.18em; /* Fine-tuned upward shift for JMU logo */
}

/* Styling for bullet points within experience descriptions in the highlights list */
.visual-timeline ul li span ul {
    list-style-type: disc; /* Or 'circle', 'square' */
    padding-left: 55px;    /* Increased indentation for bullets to sit more under the description */
    margin-top: 8px;       /* Space between the job title/dates and the bullet list */
    margin-bottom: 8px;    /* Space after the bullet list */
}
.visual-timeline ul li span ul li {
    padding-left: 0; /* Reset padding from parent li if any was inherited */
}

/* Styling for the company description paragraph within highlights */
.visual-timeline ul li > span > p:first-of-type {
    max-width: 90%;     /* Makes the paragraph narrower than the full width */
    padding-left: 40px;   /* Indent paragraph to align with following list bullets */
    margin-top: 6px;      /* Slightly increased space between the title and this paragraph */
    margin-bottom: 14px;  /* Slightly increased space before the bulleted list that follows */
    line-height: 1.6;     /* Improves readability */
    /* font-size: 0.98rem; /* Optional: if you want slightly smaller text */
}

/* Styling for the education minor text */
.visual-timeline ul li .education-minor {
    display: block;      /* Ensures it respects the <br> and takes its own line */
    font-size: 0.88em;   /* Makes the minor text a bit smaller than the main degree */
    font-style: italic;  /* Common styling for minors or secondary information */
    color: #555;         /* Keeps the muted color */
    margin-top: 0.2em;   /* Adjusts space above the minor for better flow */
    line-height: 1.45;   /* Improves readability and spacing of the minor line itself */
}

/* Style for the first education item to create a visual separation */
.visual-timeline ul li.first-education-item-separator {
    border-top: 1px solid #c1c5c9; /* Darker top border */
    padding-top: 25px;             /* Space between the border and the item's content */
}

/* Styling for the new section headers within the highlights list */
.visual-timeline ul li.highlight-section-header {
    padding-left: 0; /* Remove default li padding if any */
    margin-bottom: 15px; /* Space after the header before list items */
    margin-top: 25px;    /* Space before this header */
    list-style-type: none; /* Ensure no bullet point for header li */
}

/* No top margin for the very first header in the list */
.visual-timeline ul li.highlight-section-header:first-child {
    margin-top: 0;
}

.visual-timeline ul li.highlight-section-header h5 {
    font-size: 1.25rem; /* Adjust size as needed */
    color: #343a40;
    font-weight: 600;
    margin: 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #007bff; /* Accent underline */
    display: inline-block; /* Underline only spans the text */
}

/* Contact Section specific padding adjustment */
.contact-section {
    margin-top: 0; /* Removed margin-top to allow gradients to meet */
    padding-top: 50px; /* Adjusted padding to manage space after About section */
    padding-bottom: 5px; /* Increased from 50px (original 80px) to add more space before footer */
    /* background-image removed, will use section's solid color */
}

/* Contact Section */
.contact-section p:first-of-type {
    margin-bottom: 40px;
    font-size: 1.15rem; /* Slightly adjusted */
    color: #40464c; /* Darker text */
    text-align: center;
}

#contact-form {
    max-width: 700px;
    margin: 0 auto 30px auto; /* Reduced bottom margin */
    background-color: #ffffff; /* Changed to white */
    padding: 30px 20px; /* More responsive padding: 30px top/bottom, 20px left/right */
    border-radius: 10px; 
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500; 
    color: #40464c; /* Darker label text */
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px; 
    border: 1px solid #B2C8E0; /* Darker light blue border for inputs */
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: var(--heading-color, #253544); /* Use a neutral dark color for border */
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(37, 53, 68, 0.25); /* Neutral shadow glow */
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

#contact-form button {
    display: block;
    width: auto; /* Fit content or set specific width */
    margin: 0 auto; /* Center button */
}

#form-status {
    margin-top: 15px; /* Reduced top margin */
    font-weight: 500;
    text-align: center;
}

.contact-links {
    text-align: center;
    margin-top: 25px; /* Reduced top margin */
}

.contact-links p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #40464c; /* Darker text */
}

.contact-links a {
    margin: 0 15px;
    color: #007bff;
    text-decoration: none;
    font-size: 1.8rem; /* Larger icons */
    transition: color 0.3s ease;
}

.contact-links a:hover {
    color: #0056b3;
}

/* Footer */
footer {
    background: #222a35; /* Slightly darker footer */
    color: #bdc3c7; /* Light grey text */
    text-align: center;
    padding: 30px 0;
}

footer p {
    margin-bottom: 8px;
    font-size: 0.95rem;
    text-align: center; /* Ensures text within footer paragraphs is centered */
}

footer a {
    color: #ecf0f1; /* Even lighter for links */
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #3498db; /* Softer blue for footer links hover */
    text-decoration: underline;
}

footer .disclaimer {
    font-size: 0.8rem; /* Smaller font size for the disclaimer */
    color: #a0a0a0;    /* Lighter text color */
    margin-top: 10px;  /* Some space above the disclaimer */
}

/* --- Interests Page: Ensure section titles stack above content --- */
/* Targets the .container div directly inside #nerdy-stuff and #hobbies */
#nerdy-stuff > .container,
#hobbies > .container {
    display: flex;          /* Establish flex context, may override other display properties */
    flex-direction: column; /* Ensure children (h2 and content div) stack vertically */
    /* background-color: #e6f7ff; */ /* Moved to #hobbies section selector */
    align-items: stretch;   /* Default, but ensures children can take full width if they want */
}

/* Interests Page Specific Styles */
/* General Hobby Subsection Styling */
.hobby-subsection { /* Enhanced to be card-like */
    background-color: #F5FAFF; /* Very light off-white blue, consistent */
    padding: 30px;             /* All-around padding */
    border-radius: 8px;
    margin-bottom: 40px;       /* Adjusted margin */
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    border: 1px solid #B8CCE0; /* Consistent border */
}
 
.hobby-subsection:last-child {
    /* border-bottom: none; */ /* No longer needed with full border */
    margin-bottom: 0;
}

.hobby-subsection h3 {
    color: #17a2b8; /* Secondary accent for hobby titles */
    font-size: 1.9rem; /* Subsection title size */
    margin-top: 0; /* Remove top margin if card has padding */
    margin-bottom: 30px; /* Adjusted margin for better separation inside the card */
    padding-bottom: 15px; /* Space for the underline */
    text-align: center;   /* Center the text */
    position: relative;   /* Required for the ::after pseudo-element */
    /* border-bottom: 2px solid #007bff; */ /* Remove direct border, will use ::after */
    /* display: inline-block; */ /* Remove, as we want it to be block and centered */
}

/* Nerdy Stuff Content Styling - To improve readability and act as a container */
#nerdy-stuff-content { 
    /* padding: 10px 0; */ /* Replaced by more comprehensive padding */
    background-color: #F5FAFF; /* Very light off-white blue, consistent with project cards */
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px; /* Space below the H2 title */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #B8CCE0; /* Consistent border */
}

#nerdy-stuff-content p {
    margin-bottom: 1.5em; /* Increases space between paragraphs */
    line-height: 1.75;    /* Slightly increases line height for better readability within paragraphs */
}
#nerdy-stuff-content p:last-child {
    margin-bottom: 0;
}

.hobby-subsection h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px; /* Slightly smaller underline than main H2s */
    height: 3px; /* Slightly thinner underline */
    background-color: #17a2b8; /* Secondary accent for hobby title underlines */
}

.hobby-subsection p {
    margin-bottom: 15px; /* Standard paragraph spacing */
    line-height: 1.7;
}

/* Astrophotography YouTube Video Gallery */
.youtube-video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Responsive columns */
    gap: 25px; /* Space between videos */
    margin-top: 25px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: #000; /* Fallback for iframe loading */
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Dungeons & Dragons Character Spotlight */
.character-spotlight {
    background-color: #F5FAFF; /* Very light off-white blue for character spotlight */
    padding: 25px;
    border-radius: 8px;
    margin-top: 25px;
    border: 1px solid #B8CCE0; /* Darker light blue border */
}

.character-spotlight h4 {
    color: #17a2b8; /* Secondary accent for character spotlight title */
    margin-bottom: 12px;
    font-size: 1.5rem; 
}

.character-spotlight ul {
    list-style-type: disc;
    margin-left: 25px; /* Indent list */
    margin-bottom: 18px; 
}

.character-spotlight details {
    margin-top: 20px;
}

.character-spotlight summary {
    font-weight: 600; /* Bolder summary */
    cursor: pointer;
    padding: 12px 15px;
    background-color: #D0E0F0; /* Darker light blue summary background */
    border-radius: 5px;
    margin-bottom: 0; /* Remove bottom margin if content div has top border */
    transition: background-color 0.2s ease;
    display: block; /* Make it block to take full width */
}

.character-spotlight summary:hover {
    background-color: #C0D6EF; /* Darker light blue hover */
}

.character-spotlight summary::marker { /* Or list-style-type: none; and add custom marker */
    color: #17a2b8; /* Secondary accent for summary marker */
}

.collapsible-story-content {
    padding: 20px; 
    border: 1px solid #B8CCE0; /* Darker light blue border */
    border-top: none; /* Summary acts as top border */
    border-radius: 0 0 5px 5px;
    background-color: #F5FAFF; /* Very light off-white blue for content */
}

.collapsible-story-content h5 {
    margin-top: 18px;
    margin-bottom: 8px;
    color: #333;
    font-size: 1.2rem;
}
.collapsible-story-content h5:first-child {
    margin-top: 0;
}

.collapsible-story-content p {
    margin-bottom: 12px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-section { padding: 100px 0 60px; }
    .hero-section h2 { font-size: 1.7rem; }
    .cta-buttons .button { padding: 12px 25px; font-size: 1rem; }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: row; /* Logo and Nav (with toggle) on same line */
        justify-content: space-between; /* Logo left, Nav (toggle) right */
        align-items: center;
        padding-top: 0; /* Remove potential extra padding from container if any */
        padding-bottom: 0; /* Keep padding minimal */
    }
    header {
        padding: 0.5rem 0; /* Reduce header's overall top/bottom padding */
    }

    header .logo h1 {
        font-size: 1.7rem; /* Reduce logo font size */
    }
    header .logo .tagline {
        font-size: 0.8rem; /* Reduce tagline font size */
        margin-top: 0;     /* Adjust tagline position slightly */
    }

    .nav-toggle {
        display: block; /* Show hamburger button */
    }

    header nav {
        /* The nav element itself. It will contain the toggle. */
        /* No specific positioning needed if ul is absolute to header */
        display: flex; /* To align toggle button if other controls were added */
        align-items: center;
    }

    header nav ul {
        display: none; /* Hide menu by default */
        position: absolute;
        top: 100%; /* Position below the header bar */
        left: 0;
        right: 0; 
        background-color: #F5FAFF; /* Very light off-white blue mobile menu */
        box-shadow: 0 5px 10px rgba(0,0,0,0.08);
        z-index: 1000; /* Below toggle, above page content */
        flex-direction: column;
        width: 100%;
        padding: 10px 0; /* Padding inside the dropdown */
        margin-top: 0; /* Reset margin from desktop */
    }

    header nav ul.menu-open {
        display: flex; /* Show menu when .menu-open class is added */
    }

    header nav ul li {
        margin: 0; /* Reset horizontal margins */
        width: 100%; /* List items take full width */
    }
    header nav ul li a {
        display: block;
        padding: 12px 20px; /* Ample padding for touch targets */
        font-size: 1rem;   /* Clear font size for mobile menu */
        text-align: center;
        border-bottom: 1px solid #D0E0F0; /* Darker light blue separator */
    }
    header nav ul li:last-child a {
        border-bottom: none;
    }
    header nav ul li a:hover,
    header nav ul li a.active {
        background-color: #007bff; /* Clearer active/hover for mobile */
        color: #fff;
    }

    h2 { font-size: 2.1rem; }
    .project-grid, .skills-grid, .about-content {
        grid-template-columns: 1fr;
    }
    .cta-buttons .button { display: block; width: 80%; margin: 10px auto; }
    #contact-form { padding: 30px 20px; }

    .carousel-button {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    .carousel-button.prev { left: 10px; } /* Increased space for tablet */
    .carousel-button.next { right: 10px; } /* Increased space for tablet */
    .carousel-button:hover { background-color: rgba(0, 0, 0, 0.85); }
    
    .carousel-slides {
        height: auto; /* Allow height to adjust to content on mobile */
    }
    .carousel-slide {
        min-height: auto; /* Allow height to adjust to content on mobile */
        height: auto; /* Override desktop height: 100% */
        overflow-y: visible; /* Override desktop overflow-y: auto */
        padding: 20px 30px; /* Adjust padding for smaller screens */
    }
}

@media (max-width: 575px) { /* Extra small devices (portrait phones, less than 576px) */
    .skill-category h4 {
        min-height: auto; /* Allow height to adjust if text wraps */
    }
}

@media (max-width: 480px) {
    body { font-size: 15px; }
    header {
        padding: 0.25rem 0; /* Further reduce header's overall top/bottom padding */
    }
    header .logo h1 { font-size: 1.6rem; }
    header .logo .tagline { font-size: 0.8rem; }
    h2 { font-size: 1.8rem; margin-bottom: 30px; }
    .hero-section h2 { font-size: 1.5rem; }
    .button { padding: 10px 20px; font-size: 0.95rem; }

    header nav ul li a {
        padding: 10px 15px; /* Adjust padding for very small screens */
        font-size: 0.9rem;
    }

    .project-card { padding: 25px 20px; }
    .skill-category { padding: 20px; }
    .skill-category h4 {
        font-size: 1.1rem;
        min-height: auto; /* Ensure it doesn't stay fixed height */
    }
    .skill-category ul li { font-size: 0.9rem; padding: 6px 10px; }

    .carousel-button {
        width: 30px;
        height: 30px;
        font-size: 0.9rem; /* Adjust arrow size if needed */
    }
    .carousel-button.prev { left: 8px; } /* Increased space for mobile */
    .carousel-button.next { right: 8px; } /* Increased space for mobile */
    .carousel-slide { padding: 15px 20px; /* Further reduce padding */ }
}
/* For slightly larger screens, we can increase horizontal padding of the form if desired */
@media (min-width: 576px) { /* Small devices (landscape phones, 576px and up) */
    #contact-form {
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (min-width: 768px) { /* Medium devices (tablets, 768px and up) */
    #contact-form {
        padding: 40px; /* Restore original padding for larger screens */
    }
}

/* Timeline Page Specific Title */
.timeline-page-title {
    font-size: 1.8rem; /* Default size */
    text-align: center;
    margin: 0;
    padding: 0.5rem 0;
}

.timeline-page-title a {
    color: #007bff; /* Match main site logo color */
    font-weight: 700;
}

/* Timeline Page Navigation */
.timeline-nav {
    background-color: #EBF4FF; /* Slightly darker very light blue for timeline nav */
    padding: 0.5rem 0;
    border-bottom: 1px solid #B8CCE0; /* Darker light blue border */
    text-align: center; /* Center links for mobile */
}

.timeline-nav .container a {
    color: #2a2a2a;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 5px;
    transition: color 0.3s ease, background-color 0.3s ease;
    font-size: 0.95rem;
    margin: 5px 5px; /* Spacing between links, allow wrapping */
    display: inline-block; /* Allow margin and padding */
}

.timeline-nav .container a:hover {
    color: #004c99;
    background-color: #C0D6EF; /* Darker light blue hover */
}

/* Responsive adjustments for timeline-nav and timeline-page-title */
@media (max-width: 768px) {
    .timeline-page-title {
        font-size: 1.6rem;
    }
    .timeline-nav .container a {
        display: block; /* Stack links vertically */
        margin: 8px auto; /* Center them and add vertical space */
        width: 80%; /* Give them some width */
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .timeline-page-title {
        font-size: 1.4rem;
    }
    .timeline-nav .container a {
        font-size: 0.9rem;
    }
}

/* Specific Section Backgrounds for other pages */
/* Interests Page - Nerdy Stuff Section */
#nerdy-stuff { 
    /* background-image removed, will use section's solid color */
    padding-top: 80px; /* Keep original top padding */
    padding-bottom: 30px; /* Reduced bottom padding */
}

/* Interests Page - Hobbies Section */
#hobbies {
    /* background-image removed, will use section's solid color */
    padding-top: 30px; /* Reduced top padding */
    padding-bottom: 80px; /* Keep original bottom padding */
}

/* Timeline Page - Experience and Education Sections */
#experience,
#education { /* These are top-level sections on timeline.html */
    /* background-image removed, will use section's solid color */
}
/* Error Page - Error Section */
.error-section { /* Class used on error.html */
    /* background-image removed, will use section's solid color */
}
 
/* --- Dark Mode Styles --- */
.dark-mode {
    background-color: #0f0f0f; /* Even darker gray for body */
    color: #e0e0e0; /* Light gray text */
    /* Override CSS Variables for Dark Mode Theme Toggle Icon */
    --card-bg-color: #1e1e1e; /* Dark mode card background */
    --card-bg-color-subtle: #242424; /* Slightly lighter dark card background */
    --border-color-light: #333333; /* Dark mode light border */
    --border-color: #444444; /* Dark mode standard border */
    --icon-fill-color-default: #ccc;    /* Dark mode: Default icon color */
    --icon-fill-color-animated: gold;   /* Dark mode: Fill color during animation peak */
}

.dark-mode .container {} /* No specific change needed for container itself */

.dark-mode h1, .dark-mode h2, .dark-mode h3, .dark-mode h4, .dark-mode h5, .dark-mode h6 {
    color: #f5f5f5; /* Lighter headings for dark mode */
}

.dark-mode h2::after {
    background-color: #3395ff; /* Brighter blue for accent */
}

/* Header & Navigation Dark Mode */
.dark-mode header {
    background: #1e1e1e; /* Dark background for header */
    color: #e0e0e0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3); /* Darker shadow */
    border-bottom: 1px solid #333333;
}

.dark-mode header .logo h1 {
    color: #3395ff; /* Brighter blue for logo */
}

.dark-mode header .logo .tagline {
    color: #20c9d6; /* Brighter teal for tagline */
}

.dark-mode header nav ul li a {
    color: #e0e0e0;
}

.dark-mode header nav ul li a:hover,
.dark-mode header nav ul li a.active {
    color: #ffffff;
    background-color: #0056b3; /* Darker blue, but text is white */
}
.dark-mode a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--background-color, #0f0f0f), 0 0 0 4px var(--text-color, #e0e0e0); /* Neutral light ring for dark mode */
    border-radius: 3px;
}

.dark-mode .theme-toggle-button {
    color: var(--icon-fill-color-default); /* Uses dark mode variable for icon color */
    border-color: transparent; /* Make border transparent in dark mode */
}

.dark-mode .theme-toggle-button:hover {
    background-color: #333;
    color: #3395ff; /* Icon fill color on hover for dark mode */
    /* -webkit-text-stroke-color: var(--icon-outline-color); */ /* Outline remains defined by variable */
    border-color: transparent; /* Make border transparent on hover in dark mode */
    transform: scale(1.1); /* Slightly enlarge the button in dark mode */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); /* Add a subtle shadow in dark mode */
}
.dark-mode .theme-toggle-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--background-color, #0f0f0f), 0 0 0 4px var(--text-color, #e0e0e0), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/*.dark-mode .hamburger-icon, /* This line was correct, the one below is for the theme toggle icon */
.dark-mode .hamburger-icon::before,
.dark-mode .hamburger-icon::after {
    background-color: #e0e0e0; /* Light hamburger lines */
}
.dark-mode .nav-toggle[aria-expanded="true"] .hamburger-icon { background-color: transparent; }
.dark-mode .nav-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--background-color, #0f0f0f), 0 0 0 4px var(--text-color, #e0e0e0);
}

/* Sections General Dark Mode */
.dark-mode section {
    background-color: transparent; /* Allow body background to show through or use specific overrides */
    background-image: none !important; /* Remove light mode gradients */
}

.dark-mode section:nth-child(even) {
    background-color: #161616; /* Darker base for even sections */
}

/* Specific Section Backgrounds Dark Mode */
.dark-mode .hero-section {
    /* background-image: linear-gradient(to bottom, #161616, #0f0f0f), url('../images/hero-bg.jpg'); */
    background-color: #161616; /* Specific dark background for hero */
}
.dark-mode .hero-section h2 { color: #f0f0f0; }

.dark-mode .projects-section {
    background-image: linear-gradient(to bottom, #0f0f0f, #161616);
    background-color: #131313; /* Darker fallback */
}
.dark-mode .skills-section {
    /* background-image: linear-gradient(to bottom, #161616, #1c1c1c); */
    background-color: #161616; /* Consistent dark section background */
}

.dark-mode .about-section {
    /* background-image: linear-gradient(to bottom, #1c1c1c, #161616); */
    background-color: #1c1c1c; /* Slightly different dark section background */
}
.dark-mode .about-content { /* Dark mode for the about-content box */
    background-color: var(--card-bg-color, #1f1f1f); /* Use variable */
    box-shadow: 0 4px 12px rgba(0,0,0,0.25); /* More pronounced shadow for dark mode */
    border-color: var(--border-color, #444444);
}

.dark-mode .contact-section {
    /* background-image: linear-gradient(to bottom, #161616, #0f0f0f); */
    background-color: #161616; /* Consistent dark section background */
}

.dark-mode #nerdy-stuff {
    background-image: linear-gradient(to bottom, #0f0f0f, #161616);
    background-color: #131313; /* Darker fallback */
}
.dark-mode #hobbies {
    background-image: linear-gradient(to bottom, #161616, #1c1c1c);
    background-color: #191919; /* Darker fallback */
}
.dark-mode #experience, .dark-mode #education { /* Timeline page sections */
    background-image: linear-gradient(to bottom, #141414, #181818); /* Darker to match new timeline nav */
    background-color: #161616; /* Darker fallback */
}
.dark-mode #education { /* Override for Education to flow from Experience */
    background-image: linear-gradient(to bottom, #181818, #141414);
}
.dark-mode .error-section {
    background-image: linear-gradient(to bottom, #161616, #0f0f0f); /* Darker, same as new hero dark */
    background-color: #131313; /* Darker fallback */
}
/* Ensure blog listing section also gets a dark background */
.dark-mode .blog-listing-section {
    background-color: #131313; /* Consistent with other main sections */
}


.dark-mode #nerdy-stuff-content p {
    /* Ensures dark mode text remains readable with new spacing */
    color: #e0e0e0; 
}

/* Buttons Dark Mode */
.dark-mode .button {
    background: #3395ff;
    color: #0a0a0a; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Neutral dark shadow */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Faint white outline */
}
.dark-mode .button:hover {
    background: #1f70c7;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4); /* Slightly more pronounced neutral dark shadow on hover */
    border-color: rgba(255, 255, 255, 0.4); /* Slightly more visible outline on hover */
}
.dark-mode .button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--background-color, #0f0f0f), 0 0 0 4px var(--text-color, #e0e0e0);
    border-color: var(--text-color, #e0e0e0); /* Make border more prominent on focus */
}

/* Carousel Dark Mode */
.dark-mode .carousel-container {
    background: var(--card-bg-color-subtle, #2a2a2a); /* Use variable */
    border: 1px solid #333333;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.dark-mode .carousel-slide h3 { color: #3395ff; }
.dark-mode .carousel-slide p,
.dark-mode .carousel-slide .project-category,
.dark-mode .carousel-slide .project-technologies { color: #cccccc; }

.dark-mode .carousel-button { background-color: rgba(255, 255, 255, 0.1); color: #e0e0e0; }
.dark-mode .carousel-button:hover { background-color: rgba(255, 255, 255, 0.2); }
.dark-mode .carousel-dot { background-color: #555; }
.dark-mode .carousel-dot.active { background-color: #3395ff; }

/* Dark Mode for New Project Metrics */
.dark-mode .project-metrics { background-color: rgba(255,255,255,0.04); border-color: #383e45; }
.dark-mode .metric-item { border-bottom-color: #383e45; }
.dark-mode .metric-label { color: #a0aec0; } /* Lighter grey for labels */
.dark-mode .metric-label i { color: #4299e1; } /* Brighter blue for icons */
.dark-mode .metric-value.time-saved-per-use { color: #48bb78; } /* Brighter green */
.dark-mode .metric-value.frequency-of-use { color: #4299e1; } /* Brighter blue */
.dark-mode .metric-item.annual-savings .metric-label i { color: #ecc94b; } /* Brighter gold */
.dark-mode .metric-value.annual-hours-saved { color: #f56565; } /* Brighter red */
.dark-mode .metric-note.compounding-note { color: #a0aec0; }
.dark-mode .metric-note.compounding-note i { color: #a0aec0; }
.dark-mode .project-rationale { color: #aeb7c3; } /* Lighter grey for dark mode rationale text */
.dark-mode .project-rationale strong { color: #c8d0d8; }
.dark-mode .project-rationale p { color: #aeb7c3; }
.dark-mode .project-rationale ul.rationale-list { color: #aeb7c3; }

/* Project Cards Dark Mode */
.dark-mode .project-card {
    background: var(--card-bg-color-subtle, #242424); /* Use variable */
    border: 1px solid #333333;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.dark-mode .project-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}
.dark-mode .project-card h3 { color: #3395ff; }
.dark-mode .project-card strong { color: #f0f0f0; }
.dark-mode .project-link-btn:first-of-type { background-color: #333; color: #f0f0f0; } /* GitHub button */
.dark-mode .project-link-btn:first-of-type:hover { background-color: #444; }
.dark-mode .project-link-btn:last-of-type { background-color: #444; color: #3395ff; } /* Demo button */
.dark-mode .project-link-btn:last-of-type:hover { background-color: #555; color: #1f70c7; }

/* Skills Section Dark Mode */
.dark-mode .skill-category {
    background: var(--card-bg-color-subtle, #242424); /* Use variable */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.dark-mode .skill-category h4 { color: #f0f0f0; }
.dark-mode .skill-category h4 i { color: #20c9d6; } /* Brighter teal */
.dark-mode .skill-category ul li { background-color: #333; color: #e0e0e0; }

/* About Section Dark Mode (already has .about-content styled) */
.dark-mode .about-item h4 { color: #3395ff; }
.dark-mode .about-item ul li::before { color: #28a745; } /* Keep checkmark green */
.dark-mode .visual-timeline { background: #2a2a2a; border: 1px solid #383838; }
.dark-mode .visual-timeline h4 { color: #f0f0f0; }
.dark-mode .visual-timeline ul li i.fas { color: #20c9d6; }
.dark-mode .visual-timeline ul li.highlight-section-header h5 { color: #f0f0f0; border-bottom: 2px solid #3395ff; }
.dark-mode .visual-timeline ul li.first-education-item-separator { border-top: 1px solid #444; }

/* Contact Section Dark Mode */
.dark-mode .contact-section p:first-of-type { color: #cccccc; }
.dark-mode #contact-form { background: var(--card-bg-color-subtle, #242424); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }
.dark-mode .form-group label { color: #cccccc; }
.dark-mode .form-group input[type="text"],
.dark-mode .form-group input[type="email"],
.dark-mode .form-group textarea {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #444;
}
.dark-mode .form-group input[type="text"]:focus,
.dark-mode .form-group input[type="email"]:focus,
.dark-mode .form-group textarea:focus {
    border-color: var(--text-color, #e0e0e0); /* Light border for focus */
    box-shadow: 0 0 0 0.2rem rgba(224, 224, 224, 0.25); /* Light neutral glow */
    background-color: #202020; /* Slightly different focus background */
}
.dark-mode .contact-links p { color: #cccccc; }
.dark-mode .contact-links a { color: #3395ff; }
.dark-mode .contact-links a:hover { color: #1f70c7; }

/* Footer Dark Mode */
.dark-mode footer { background: #0a0a0a; color: #aaaaaa; }
.dark-mode footer a { color: #cccccc; }
.dark-mode footer a:hover { color: #3395ff; }

/* Interests Page Dark Mode */
.dark-mode footer .disclaimer {
    color: #777; /* Adjust disclaimer color for dark mode */
}

.dark-mode #nerdy-stuff-content {
    background-color: var(--card-bg-color-subtle, #242424); /* Use variable */
    border-color: #333333;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.dark-mode #nerdy-stuff-content p {
    color: #e0e0e0; /* Ensure text color is appropriate */
}

.dark-mode .hobby-subsection h3 { color: #20c9d6; }
.dark-mode .hobby-subsection h3::after { background-color: #20c9d6; }
.dark-mode .hobby-subsection {
    background-color: var(--card-bg-color-subtle, #2a2a2a); /* Use variable */
    border-color: #383838;     /* Darker border */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.dark-mode .character-spotlight { background-color: var(--dark-card-bg, #222222); border: 1px solid #333333; } /* Made slightly darker than hobby-subsection */
.dark-mode .character-spotlight h4 { color: #20c9d6; }
.dark-mode .character-spotlight summary { background-color: #333; color: #e0e0e0; }
.dark-mode .character-spotlight summary:hover { background-color: #444; }
.dark-mode .character-spotlight summary::marker { color: #20c9d6; }
.dark-mode .collapsible-story-content { border: 1px solid #383838; border-top: none; background-color: var(--card-bg-color-subtle, #2a2a2a); }
.dark-mode .collapsible-story-content h5 { color: #f0f0f0; }

/* Timeline Page Nav Dark Mode (and other specific dark mode styles) */
.dark-mode .timeline-page-title a { color: #3395ff; }
.dark-mode .timeline-nav { background-color: #141414; border-bottom: 1px solid #2b2b2b; } /* Darker nav background */
.dark-mode .timeline-nav .container a { color: #e0e0e0; }
.dark-mode .timeline-nav .container a:hover { color: #ffffff; background-color: #0056b3; }

/* Ensure mobile menu background is dark */
.dark-mode header nav ul {
    background-color: #1e1e1e;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); /* Even softer shadow for dark mode mobile menu */
}
.dark-mode header nav ul li a {
    border-bottom: 1px solid #1a1a1a; /* Subtle darker border, less "sticking out" */
}
.dark-mode header nav ul li a:hover,
.dark-mode header nav ul li a.active {
    background-color: #0056b3; /* Consistent with desktop active/hover */
    color: #fff;
}