/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Playfair+Display:wght@400;700;900&display=swap');

/* --- Import CSS Variables --- */
@import 'variables.css';

/* --- Additional Style Variables --- */
:root {
    /* Animation Speeds */
    --hover-transition: 0.2s;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    --header-height: 70px;
    --transition-speed: 0.3s;
    --border-radius: 8px; 
}

/* --- Dark Mode Variables & Styles --- */
/* Note: Main dark mode colors are now defined in variables.css for vintage Dartmouth theme */

/* Dark mode global styles */
body.dark-mode {
    /* Apply smooth transition when switching modes */
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

/* Style overrides for specific elements in dark mode - IMPORTANT: Force navbar color */
html body.dark-mode .main-header {
    background-color: rgba(24, 26, 27, 0.95) !important; /* Updated navbar color #181A1B */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #404040 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

html body.dark-mode .main-header.scrolled {
    background-color: rgba(24, 26, 27, 0.98) !important; /* More solid navbar when scrolled */
    border-bottom-color: #7df0c2 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7) !important;
}

/* Additional fallback for header styling */
body.dark-mode header.main-header,
body.dark-mode .main-header,
.dark-mode .main-header {
    background: rgba(24, 26, 27, 0.95) !important; /* Updated navbar color #181A1B */
    background-color: rgba(24, 26, 27, 0.95) !important;
}

body.dark-mode .logo {
    color: var(--color-primary);
    transition: color 0.3s;
}

body.dark-mode .logo:hover {
    color: var(--color-secondary);
    text-shadow: var(--vintage-text-shadow);
}

body.dark-mode .main-nav a {
    color: var(--color-text);
    transition: color 0.3s, text-shadow 0.3s, background-color 0.3s;
}

body.dark-mode .main-nav a.active {
    color: var(--color-primary);
    text-shadow: var(--vintage-text-shadow);
}

body.dark-mode .main-nav a:hover, 
body.dark-mode .main-nav a:focus {
    color: var(--color-primary);
    text-shadow: var(--vintage-text-shadow);
    background-color: rgba(144, 238, 144, 0.05); /* Light green tint */
}

body.dark-mode .main-nav a::after {
    background-color: var(--color-primary);
    box-shadow: var(--vintage-box-shadow);
}

body.dark-mode .btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border-color: var(--color-primary);
    box-shadow: var(var(--vintage-box-shadow));
    transition: all 0.3s ease;
}

body.dark-mode .btn-primary:hover,
body.dark-mode .btn-primary:focus {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: var(var(--vintage-box-shadow));
    transform: translateY(-2px);
}

body.dark-mode .btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-text-light);
    border-color: var(--color-secondary);
    box-shadow: var(var(--vintage-box-shadow));
    transition: all 0.3s ease;
}

body.dark-mode .btn-secondary:hover,
body.dark-mode .btn-secondary:focus {
    background-color: transparent;
    color: var(--color-secondary);
    border-color: var(--color-secondary);
    transform: translateY(-2px);
}

body.dark-mode #scroll-to-top {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    box-shadow: var(--vintage-box-shadow);
    transition: all 0.3s ease;
}

body.dark-mode #scroll-to-top:hover,
body.dark-mode #scroll-to-top:focus {
    background-color: var(--color-secondary);
    box-shadow: var(--vintage-box-shadow);
    transform: translateY(-3px);
}

body.dark-mode #scroll-to-top:active {
    background-color: var(--color-secondary);
    transform: translateY(0);
}

body.dark-mode .placeholder {
    background-color: var(--color-hero-bg);
    border-color: var(--color-border);
    color: var(--color-text);
}

body.dark-mode .timeline::before {
    background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary));
    box-shadow: var(--vintage-box-shadow);
}

body.dark-mode .timeline-node::after {
    background-color: var(--color-background);
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-background), var(--vintage-box-shadow);
    transition: all 0.3s ease;
}

body.dark-mode .timeline-node:hover::after {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 4px var(--color-background), var(var(--vintage-box-shadow));
    transform: scale(1.1);
}

body.dark-mode .timeline-content {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

body.dark-mode .timeline-content:hover {
    border-color: var(--color-secondary);
    box-shadow: var(var(--vintage-box-shadow));
    transform: translateY(-5px);
}

body.dark-mode .timeline-content h3 {
    color: var(--color-primary);
    text-shadow: var(var(--vintage-text-shadow));
}

body.dark-mode .timeline-content a:hover h3, 
body.dark-mode .timeline-content a:focus h3 {
    color: var(--color-secondary);
    text-shadow: var(var(--vintage-text-shadow));
}

body.dark-mode .timeline-content p {
    color: var(--color-text);
}

body.dark-mode .resource-list li {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

body.dark-mode .resource-list li:hover {
    border-color: var(--color-primary);
    box-shadow: var(var(--vintage-box-shadow));
    transform: translateY(-3px);
}

body.dark-mode .resource-list a {
    color: var(--color-primary);
    text-shadow: var(var(--vintage-text-shadow));
    transition: all 0.3s ease;
}

body.dark-mode .resource-list a:hover {
    color: var(--color-secondary);
    text-shadow: var(var(--vintage-text-shadow));
    text-decoration-color: var(--color-secondary);
}

body.dark-mode .resource-list p {
    color: var(--color-text);
}

body.dark-mode dl dt {
    color: var(--color-primary);
    text-shadow: var(var(--vintage-text-shadow));
}

body.dark-mode dl dd {
    border-left: 3px solid var(--color-secondary);
    box-shadow: var(var(--vintage-box-shadow));
}

body.dark-mode .main-footer {
    background-color: rgba(10, 10, 22, 0.9);
    color: var(--color-text);
    border-top: 1px solid var(--color-border);
}

/* --- Theme Toggle Button Styles --- */
#theme-toggle {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
    transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
    line-height: 1;
}

/* Additional dark mode enhancements */
body.dark-mode h1, 
body.dark-mode h2 {
    color: var(--color-text);
    text-shadow: var(--vintage-text-shadow);
}

body.dark-mode .hero-section {
    background-color: var(--color-hero-bg);
    border-bottom: 1px solid var(--color-border);
}

body.dark-mode .highlight-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

body.dark-mode .highlight-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(var(--vintage-box-shadow));
    transform: translateY(-5px);
}

body.dark-mode .highlight-card h3 {
    color: var(--color-primary);
    text-shadow: var(var(--vintage-text-shadow));
}

body.dark-mode a {
    color: var(--color-primary);
    transition: all 0.2s ease;
}

body.dark-mode a:hover,
body.dark-mode a:focus {
    color: var(--color-secondary);
    text-shadow: var(var(--vintage-text-shadow));
}

/* Neon border effect for selected elements */
body.dark-mode .main-footer::before,
body.dark-mode .hero-section::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(144, 238, 144, 0.3) 20%, 
        rgba(222, 184, 135, 0.3) 50%,
        rgba(144, 238, 144, 0.3) 80%,
        transparent 100%);
}

body.dark-mode .hero-section::after {
    bottom: 0;
}

body.dark-mode .main-footer::before {
    top: 0;
}

/* Mobile responsiveness for dark mode */
@media (max-width: 768px) {
    body.dark-mode .main-nav {
        background-color: var(--color-card-bg);
        border-left: 1px solid var(--color-border);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    body.dark-mode #mobile-theme-toggle {
        background-color: rgba(144, 238, 144, 0.1);
        box-shadow: var(var(--vintage-box-shadow));
    }
    
    body.dark-mode #mobile-theme-toggle:hover {
        background-color: rgba(144, 238, 144, 0.2);
        box-shadow: var(var(--vintage-box-shadow));
    }
}

/* Add this to ensure all transitions remain smooth */
* {
    transition-property: background-color, color, border-color, box-shadow, transform, opacity, text-shadow;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* --- Base & Reset Styles --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem; 
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-background); /* Updated */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    color: var(--color-primary); /* Updated */
}

h1 {
    font-size: clamp(2.8rem, 6vw, 4.5rem); 
    font-weight: 900;
    letter-spacing: -0.5px;
}

h2 {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    margin-top: 3rem;
}

h3 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700; 
    color: var(--color-primary); /* Updated */
    margin-top: 2.5rem;
}

p {
    margin-bottom: 1.5rem;
    max-width: 70ch; 
}

a {
    color: var(--color-primary); /* Updated */
    text-decoration: none;
    font-weight: 600; 
    transition: color var(--transition-speed) ease, text-decoration-color var(--transition-speed) ease;
    text-decoration: underline;
    text-decoration-color: transparent; 
    text-underline-offset: 4px; 
}

a:hover,
a:focus {
    color: var(--color-secondary); /* Updated - Use Wine for hover */
    text-decoration-color: var(--color-secondary); /* Updated */
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style-position: outside; 
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

/* --- Utility Classes --- */
.container {
    width: 90%;
    max-width: 1240px; 
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.text-center {
    text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Class for elements needing scroll animation */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* --- Header --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9); /* Updated: Slightly transparent White */
    backdrop-filter: blur(8px);
    transition: background-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease, height var(--transition-speed) ease, border-color var(--transition-speed) ease;
    height: var(--header-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid transparent; /* Updated transition */
}

.main-header.scrolled {
    background-color: #FFFFFF; /* Updated - Pure White for contrast when scrolled */
    box-shadow: var(--shadow-sm);
    border-bottom-color: var(--color-border); /* Updated */
}

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

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
    display: inline-block;
}
.logo:hover {
    color: var(--color-secondary);
    text-decoration: none;
    transform: translateY(-1px);
}

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

.main-nav li {
    margin-left: 2.5rem; 
}

.main-nav a {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--color-text);
    text-decoration: none;
    padding: 0.5rem 0.3rem;
    position: relative;
    transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease;
    border-radius: 4px;
}

.main-nav a.active {
    color: var(--color-primary); /* Updated */
    font-weight: 700;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px; 
    left: 0;
    background-color: var(--color-secondary); /* Updated - Wine Underline */
    transform-origin: bottom right;
    transition: transform var(--transition-speed) cubic-bezier(0.23, 1, 0.32, 1); 
}

.main-nav a:hover::after,
.main-nav a:focus::after,
.main-nav a.active::after { 
    transform: scaleX(1);
    transform-origin: bottom left;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--color-primary);
    text-decoration: none; 
    background-color: var(--color-hero-bg);
}


/* --- Main Content Area --- */
main {
    padding-top: calc(var(--header-height) + 4rem); 
    padding-bottom: 5rem;
    min-height: calc(100vh - var(--header-height) - 60px); 
}

/* Add subtle section differentiation */
main > section:not(.hero-section) {
    padding: 5rem 0; /* Standard vertical padding for sections */
}

/* Example of alternating background - apply class if needed */
/*
.section-bg-alt {
     background-color: var(--color-hero-bg); 
     border-top: 1px solid var(--color-border);
     border-bottom: 1px solid var(--color-border);
}
*/

/* --- Footer --- */
.main-footer {
    background-color: var(--color-text);
    color: var(--color-text-light);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.9rem;
    position: relative;
    min-height: 60px;
    width: 100%;
    clear: both;
}

.footer-container {
    opacity: 0.8;
    padding: 10px;
}

@media (max-width: 768px) {
    .main-footer {
        padding: 15px 0;
        min-height: 50px;
        height: auto;
    }
    
    .footer-container {
        padding: 5px 10px;
    }
    
    main {
        padding-bottom: 60px; /* Ensure space for footer */
    }
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    text-decoration: none;
    padding: 0.9rem 2.2rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-primary); /* Updated - Emerald */
    color: var(--color-text-light); /* Updated - Cream */
    border-color: var(--color-primary); /* Updated */
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #00382d; /* Darker Emerald */
    border-color: #00382d; 
    color: var(--color-text-light); /* Updated */
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--color-secondary); /* Updated - Wine */
    color: var(--color-text-light); /* Updated - Cream */
    border-color: var(--color-secondary); /* Updated */
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #7a0c36; /* Darker Wine */
    border-color: #7a0c36;
    color: var(--color-text-light); /* Updated */
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

/* --- Scroll-to-Top Button --- */
#scroll-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: var(--color-primary); /* Updated - Emerald */
    color: var(--color-text-light); /* Updated - Cream */
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.6rem; 
    line-height: 50px; 
    text-align: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease, transform var(--transition-speed) cubic-bezier(0.23, 1, 0.32, 1), background-color var(--transition-speed) ease;
    z-index: 999;
    box-shadow: var(--shadow-md);
}

#scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

#scroll-to-top:hover,
#scroll-to-top:focus {
    background-color: var(--color-secondary);
    transform: scale(1.1) translateY(-2px); 
    outline: none;
    box-shadow: var(--shadow-lg);
}

#scroll-to-top:active {
    transform: scale(0.95) translateY(0);
    background-color: #7a0c36;
    box-shadow: var(--shadow-md);
}

/* --- Placeholder Styles --- */
.placeholder {
    border: 2px dashed var(--color-border); /* Updated */
    padding: 2.5rem;
    margin: 2.5rem 0;
    background-color: #F5F2ED; /* Updated - Tinted Cream */
    color: #888;
    text-align: center;
    font-style: italic;
    border-radius: var(--border-radius);
}
.placeholder p:last-child {
    margin-bottom: 0;
}

/* --- Basic Content Page Layout --- */
.content-page {
    max-width: 850px; 
    margin-left: auto;
    margin-right: auto;
}

.content-page h2 {
    margin-bottom: 1.5rem;
    text-align: left !important; /* Changed from center to left */
}

.back-to-roadmap {
    display: inline-block;
    margin-top: 1rem; 
    margin-bottom: 2rem;
    font-weight: 600;
    color: var(--color-secondary); /* Updated - Wine */
    position: relative; 
    padding-left: 1.8em; 
    text-decoration: none; 
}
.back-to-roadmap::before {
    content: '\2190'; 
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3em; 
    transition: transform var(--transition-speed) ease;
}

.back-to-roadmap:hover,
.back-to-roadmap:focus {
    color: var(--color-primary); /* Updated - Emerald Hover */
    text-decoration: none;
}
.back-to-roadmap:hover::before,
.back-to-roadmap:focus::before {
     transform: translateY(-50%) translateX(-5px); 
}

/* --- Homepage Specific Styles --- */
.hero-section {
    /* Single-layer background: pull section up under the fixed header and
       add equivalent top padding so layout stays unchanged */
    margin-top: calc(-1 * (var(--header-height) + 4rem));
    padding: calc(6rem + var(--header-height) + 4rem) 0 6rem;
    text-align: center;
    background-color: var(--color-hero-bg); /* Updated */
    background-image:
        radial-gradient(circle at 50% 35%, rgba(0, 77, 64, 0.03) 0%, transparent 55%),
        radial-gradient(circle at 50% 65%, rgba(162, 62, 72, 0.03) 0%, transparent 55%);
    border-bottom: 1px solid var(--color-border); /* Updated */
}

.hero-section h1 {
    margin-bottom: 1rem;
}

.hero-section p {
    max-width: 650px;
    margin: 0 auto 2.5rem;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--color-text);
    opacity: 0.9;
}

.highlights-section {
    padding: 5rem 0;
}

.highlights-section h2 {
    text-align: center;
    margin-bottom: 4rem;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 2.5rem;
}

.highlight-card {
    background: var(--color-card-bg); /* Updated - White */
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border: 1px solid var(--color-border); /* Updated */
}

.highlight-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.highlight-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.6rem; 
    color: var(--color-primary); /* Updated */
}

.highlight-card p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
}

.highlight-card .btn {
    margin-top: auto; 
}

/* --- Roadmap Page Specific Styles --- */
.roadmap-container {
    position: relative;
    max-width: 900px; 
    margin: 3rem auto;
    padding: 3rem 0; /* Reverted padding */
    /* background-color: var(--color-hero-bg); -- REVERTED */
    /* border-radius: var(--border-radius); -- REVERTED */
    /* border: 1px solid var(--color-border); -- REVERTED */
}

/* Roadmap hero */
.roadmap-hero { text-align: center; margin: 2rem auto 1rem; max-width: 900px; }
.roadmap-hero h2 { margin: 0 0 .5rem 0; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.15; text-align: center !important; }
.roadmap-page .content-page .roadmap-hero h2 { text-align: center !important; }
.roadmap-hero .subtitle { margin: 0 auto; max-width: 800px; opacity: .9; }

/* Quick nav chips */
.roadmap-chips { display:flex; flex-wrap:wrap; gap:.5rem; justify-content:center; margin: 0 auto 1.5rem; }
.roadmap-chips .chip { 
    display:inline-flex; align-items:center; gap:.4rem; padding:.4rem .7rem; 
    border:1px solid var(--color-border); border-radius:999px; background: var(--color-card-bg);
    color: var(--color-primary); text-decoration:none; font-weight:600; font-size:.9rem;
    transition: transform .2s ease, border-color .2s ease, color .2s ease;
}
.roadmap-chips .chip:hover { transform: translateY(-1px); border-color: var(--color-secondary); color: var(--color-secondary); }
body.dark-mode .roadmap-chips .chip { background: var(--color-card-bg); border-color: var(--color-border); color: var(--color-primary); }
body.dark-mode .roadmap-chips .chip:hover { border-color: var(--color-secondary); color: var(--color-secondary); }

.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary)); /* Updated - Wine to Emerald */
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(162, 62, 72, 0.4); /* Updated - Wine glow */
}

.timeline-node {
    position: relative;
    margin-bottom: 5rem; 
    width: 50%;
    padding: 15px 50px; 
    box-sizing: border-box;
}

.timeline-node:nth-child(odd) {
    left: 0;
    padding-right: 65px; 
}

.timeline-node:nth-child(even) {
    left: 50%;
    padding-left: 65px; 
}

.timeline-node::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: var(--color-background);
    border: 5px solid var(--color-primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 0 4px var(--color-background);
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.timeline-node:nth-child(odd)::after {
    right: -12px;
}

.timeline-node:nth-child(even)::after {
    left: -12px;
}

.timeline-node:hover::after {
     border-color: var(--color-secondary); /* Updated - Wine border on hover */
     transform: scale(1.25);
}

.timeline-content {
    padding: 2.5rem; /* Increased padding */
    background-color: var(--color-card-bg); /* Updated - White */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    position: relative;
    border: 1px solid var(--color-border); /* Updated */
    transition: box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.timeline-content:hover {
     box-shadow: var(--shadow-lg);
     transform: translateY(-8px) scale(1.02);
     border-color: var(--color-secondary);
}

/* Subtle accent bar on hover */
.timeline-content::before { content:''; position:absolute; left:0; top:0; height:100%; width:0; background: linear-gradient(to bottom, var(--color-secondary), transparent); border-radius: var(--border-radius) 0 0 var(--border-radius); transition: width .25s ease; }
.timeline-content:hover::before { width:6px; }

.timeline-content h3 {
    margin-top: 0;
    font-size: 1.4rem;
    color: var(--color-primary); /* Updated */
    margin-bottom: 0.5rem;
    transition: color var(--transition-speed) ease;
}
.timeline-content h3 i { margin-right: .5rem; color: currentColor; }

.timeline-content p { 
    font-size: 0.95rem;
    margin-bottom: 0;
    color: #555; 
    line-height: 1.5;
}

.timeline-content a {
    display: block; 
    color: inherit; 
    text-decoration: none;
    outline: none; 
}
.timeline-content a:hover,
.timeline-content a:focus {
    text-decoration: none; 
    color: inherit;
}
.timeline-content a:hover h3,
.timeline-content a:focus h3 {
    color: var(--color-secondary); /* Updated - Wine hover */
}

/* --- Resources Page Specific Styles --- */
.resource-list {
    list-style: none;
    padding-left: 0;
}

.resource-list li {
    background-color: var(--color-card-bg); /* Updated */
    border: 1px solid var(--color-border); /* Updated */
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.resource-list li:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.resource-list a {
    font-size: 1.1rem;
    font-weight: 700; 
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-primary); /* Updated */
    text-decoration: none;
}
.resource-list a:hover {
    color: var(--color-secondary); /* Updated */
    text-decoration: underline;
    text-decoration-color: var(--color-secondary); /* Updated */
}

.resource-list p {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: var(--color-text);
    line-height: 1.6;
}

/* Glossary Styles */
dl {
    margin-top: 2rem;
}

dt { /* Term */
    font-weight: 700;
    color: var(--color-primary); /* Updated */
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

dd { /* Definition */
    margin-left: 0; 
    margin-bottom: 1rem;
    padding-left: 1.5rem; 
    border-left: 3px solid var(--color-secondary); /* Updated - Wine */
}

/* --- Mobile Navigation Menu --- */
.hamburger-menu {
    display: none;
    cursor: pointer;
    width: 25px;
    height: 20px;
    position: relative;
    z-index: 1001;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .hamburger-menu {
        display: flex !important;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        margin-top: 1px; /* Fine-tune vertical alignment */
    }
    
    /* Hide the desktop theme toggle on mobile */
    #theme-toggle {
        display: none !important;
    }
    
    .header-container {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 20px;
        min-height: var(--header-height);
        position: relative;
        width: 100%;
    }
    
    .logo {
        font-size: 1.4rem;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
    }
    
    .hamburger-menu span {
        display: block;
        position: absolute;
        height: 3px; /* Thicker for more premium look */
        width: 100%;
        background: var(--color-primary);
        border-radius: 6px; /* More rounded for elegance */
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
        transition: .35s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smoother vintage transition */
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    }
    
    .hamburger-menu span:nth-child(1) {
        top: 0;
    }
    
    .hamburger-menu span:nth-child(2),
    .hamburger-menu span:nth-child(3) {
        top: 10px; /* Slightly more spacing for elegance */
    }
    
    .hamburger-menu span:nth-child(4) {
        top: 20px; /* Adjusted for better proportions */
    }
    
    .hamburger-menu.open span:nth-child(1),
    .hamburger-menu.open span:nth-child(4) {
        top: 10px; /* Adjusted to match new center position */
        width: 0%;
        left: 50%;
    }
    
    .hamburger-menu.open span:nth-child(2) {
        transform: rotate(45deg);
    }
    
    .hamburger-menu.open span:nth-child(3) {
        transform: rotate(-45deg);
    }
    
    body.dark-mode .hamburger-menu span {
        background: var(--color-primary);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Enhanced shadow for dark mode */
    }
    
    /* Vintage-style hover effect for hamburger menu */
    .hamburger-menu:hover span {
        background: var(--color-secondary);
        transform: scale(1.05);
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .hamburger-menu:hover {
        transform: translateY(-50%) scale(1.1);
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    /* Fix chapter titles alignment */
    .content-page h1,
    .content-page h2,
    .content-page h3,
    .content-page h4,
    .content-page h5,
    .content-page h6,
    .content-page .content-block h1,
    .content-page .content-block h2,
    .content-page .content-block h3,
    .content-page .content-block h4,
    .content-page .content-block h5,
    .content-page .content-block h6 {
        text-align: left !important;
    }
    /* Allow About page to opt into centered headings */
    .about-page .content-page h1,
    .about-page .content-page h2,
    .about-page .content-page h3,
    .about-page .content-page h4,
    .about-page .content-page h5,
    .about-page .content-page h6,
    .about-page .content-page .content-block h1,
    .about-page .content-page .content-block h2,
    .about-page .content-page .content-block h3,
    .about-page .content-page .content-block h4,
    .about-page .content-page .content-block h5,
    .about-page .content-page .content-block h6 {
        text-align: center !important;
    }
    
    /* Keep specific elements centered */
    .hero-section h1,
    .hero-section h2,
    .hero-section h3,
    .hero-section p,
    .highlights-section h2,
    .text-center {
        text-align: center !important;
    }
}

/* --- Mobile Theme Toggle Button --- */
.mobile-theme-toggle {
    display: none; /* Hidden by default on desktop */
}

#mobile-theme-toggle {
    background: none;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 1rem; /* Smaller, more refined */
    cursor: pointer;
    padding: 0.4rem 0.8rem; /* More compact padding */
    border-radius: calc(var(--border-radius) + 2px); /* Slightly more rounded */
    transition: all var(--transition-speed) ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px; /* Ensure good touch target */
    min-height: 44px; /* Standard mobile touch target */
    font-weight: 500; /* Medium weight for better readability */
}

#mobile-theme-toggle:hover,
#mobile-theme-toggle:focus {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    transform: scale(1.02); /* More subtle scaling */
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

body.dark-mode #mobile-theme-toggle {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

body.dark-mode #mobile-theme-toggle:hover,
body.dark-mode #mobile-theme-toggle:focus {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); /* Enhanced shadow for dark mode */
}

@media (max-width: 768px) {
    /* Show the mobile theme toggle only on mobile */
    .mobile-theme-toggle {
        display: block;
    }
    
    /* Hide the desktop theme toggle on mobile */
    #theme-toggle {
        display: none !important;
    }
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) { /* Tablet */
    .container {
        max-width: 960px;
    }
    .main-nav li {
        margin-left: 1.5rem; 
    }
    .main-nav a {
        font-size: 1rem;
    }
}

@media (max-width: 768px) { /* Mobile */
    :root {
        --header-height: 65px; /* Adjust mobile header */
    }

    body {
        font-size: 0.98rem; 
    }

    .container {
        width: 95%;
    }

    main {
        padding-top: calc(var(--header-height) + 2rem);
        padding-bottom: 3rem;
    }

    .main-header {
        height: var(--header-height);
    }

    /* Hero retains single-layer background on mobile; spacing already handled
       by margin-top and padding on .hero-section */

    .logo {
        font-size: 1.4rem;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
    }
    
    /* Mobile navigation */
    .hamburger-menu {
        display: block; /* Show on mobile */
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--color-card-bg);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 80px 20px 30px;
        transition: right 0.3s ease-in-out;
        overflow-y: auto;
    }
    
    body.nav-open .main-nav {
        right: 0;
    }
    
    body.nav-open {
        overflow: hidden; /* Prevent scrolling when nav is open */
    }
    
    body.dark-mode .main-nav {
        background-color: var(--color-card-bg);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    }

    .main-nav ul {
        flex-direction: column;
    }
    
    .main-nav li {
        margin-left: 0;
        margin-bottom: 1.5rem;
        width: 100%;
    }
    
    .main-nav a {
        display: block;
        padding: 12px;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--color-border);
    }
    
    /* Move theme toggle in mobile menu */
    .mobile-theme-toggle {
        margin-top: 15px; /* Slightly reduced margin */
        text-align: center;
        padding: 0 12px; /* Add side padding to match nav links */
    }
    
    /* Overlay when mobile nav is open */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s;
    }
    
    body.nav-open .nav-overlay {
        opacity: 1;
        visibility: visible;
    }

    h1 { font-size: clamp(2.2rem, 8vw, 3rem); } 
    h2 { font-size: clamp(1.8rem, 6vw, 2.2rem); } 
    h3 { font-size: clamp(1.4rem, 5vw, 1.8rem); } 

    /* Rest of mobile styles */
    .hero-section {
        margin-top: 0 !important;
        padding: calc(var(--header-height) + 4rem) 20px 4rem !important;
        background-attachment: scroll !important;
    }
    
    .hero-section h1 {
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
        padding-top: 1rem !important;
        font-size: clamp(1.8rem, 7vw, 2.5rem) !important;
        line-height: 1.1 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .hero-section .container {
        padding-top: 0 !important;
    }
    
     .hero-section p {
        font-size: 1.05rem;
    }

    .highlights-section {
        padding: 3rem 0;
    }
    .highlights-grid {
        grid-template-columns: 1fr; /* Stack cards on mobile */
        gap: 1.5rem;
    }
    .highlight-card {
        padding: 2rem;
    }

    #scroll-to-top {
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 1.4rem;
        bottom: 15px;
        right: 15px;
    }
    
    /* Roadmap mobile adjustments */
    .roadmap-container {
        margin: 2rem auto;
        padding: 2rem 0;
    }
     .timeline::before {
        left: 35px; /* Adjust line position */
        transform: translateX(0);
    }
    .timeline-node {
        width: 100%;
        padding-left: 75px; /* Adjust space for icon/line */
        padding-right: 15px;
        text-align: left !important; 
        left: 0 !important; 
        margin-bottom: 3rem;
        padding-top: 5px; /* Adjust top padding */
         padding-bottom: 5px;
    }
     .timeline-node:nth-child(odd),
     .timeline-node:nth-child(even) {
         left: 0; 
         text-align: left;
         padding-right: 15px; /* Reset padding */
         padding-left: 75px; /* Consistent padding */
     }
    .timeline-node::after {
        left: 23px; /* Adjust circle position */
        right: auto;
        transform: translateX(0);
        width: 20px;
        height: 20px;
        border-width: 4px;
        box-shadow: 0 0 0 3px var(--color-background);
        top: 18px; /* Readjust alignment */
    }
     .timeline-content {
         padding: 1.5rem;
     }
      .timeline-content h3 {
        font-size: 1.25rem;
    }
} 

/* Additional responsive adjustments for very small screens */
@media (max-width: 480px) {
    .hero-section {
        margin-top: 0 !important;
        padding: calc(var(--header-height) + 3rem) 15px 3rem !important;
    }
    
    .hero-section h1 {
        margin-top: 0 !important;
        padding-top: 0.5rem !important;
        font-size: clamp(1.6rem, 8vw, 2.2rem) !important;
        line-height: 1.2 !important;
    }
    
    .roadmap-hero { margin-top: 1rem; }
    .roadmap-hero h2 { font-size: clamp(1.6rem, 5vw, 2rem); }
    .roadmap-hero .subtitle { font-size: .98rem; }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .highlight-card {
        padding: 1.5rem;
    }
    
    .container {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Ensure touch targets are at least 44px for accessibility */
    .main-nav a,
    .btn,
    .timeline-content a,
    .resource-list a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
} 

/* --- Additional Responsive Adjustments --- */

/* Images, embeds and media responsiveness */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Table responsive styles */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Responsive forms */
input, select, textarea {
    max-width: 100%;
}

/* Improved touch target sizes on mobile */
@media (max-width: 768px) {
    button,
    input[type="button"],
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 16px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    textarea,
    select {
        padding: 10px;
        font-size: 16px; /* Prevent auto-zoom on iOS */
    }
    
    /* Improved mobile spacing */
    main > section {
        padding: 3rem 0;
    }
    
    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 1rem;
    }
    
    .content-page {
        padding: 0 10px;
    }
    
    /* Ensure content doesn't overflow horizontally */
    .container {
        overflow-x: hidden;
    }
}

/* Print styles for better printing */
@media print {
    header,
    footer,
    nav,
    .no-print,
    #scroll-to-top {
        display: none !important;
    }
    
    body {
        background-color: #fff !important;
        font-size: 12pt;
        color: #000 !important;
    }
    
    a {
        color: #000 !important;
        text-decoration: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
    
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: #000 !important;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }
} 

/* --- No JavaScript Fallbacks --- */
.no-js .animate-on-scroll {
    opacity: 1;
    transform: none;
}

.no-js .hamburger-menu {
    display: none !important;
}

.no-js .main-nav {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    background-color: transparent;
    box-shadow: none;
    display: block;
    overflow: visible;
}

@media (max-width: 768px) {
    .no-js .main-nav ul {
        display: block;
        text-align: center;
        margin-top: 15px;
    }
    
    .no-js .main-nav li {
        display: inline-block;
        margin: 0 10px;
    }
    
    .no-js .header-container {
        flex-direction: column;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .no-js .main-header {
        height: auto;
    }
} 

/* Additional dark mode animations */
@keyframes vintagePulse {
    0% {
        box-shadow: 0 0 5px rgba(144, 238, 144, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(144, 238, 144, 0.4), 0 0 5px rgba(222, 184, 135, 0.3);
    }
    100% {
        box-shadow: 0 0 10px rgba(144, 238, 144, 0.3);
    }
}

@keyframes textvintagePulse {
    0% {
        text-shadow: 0 0 2px rgba(144, 238, 144, 0.2);
    }
    50% {
        text-shadow: 0 0 8px rgba(144, 238, 144, 0.4);
    }
    100% {
        text-shadow: 0 0 4px rgba(144, 238, 144, 0.3);
    }
}

/* Additional dark mode hover effects and animations */
body.dark-mode .highlight-card h3,
body.dark-mode .timeline-content h3 {
    transition: color 0.3s, text-shadow 0.3s;
}

body.dark-mode .highlight-card:hover h3,
body.dark-mode .timeline-content:hover h3 {
    color: var(--color-secondary);
    text-shadow: var(var(--vintage-text-shadow));
}

/* Neon border animation for cards in dark mode */
body.dark-mode .highlight-card::before,
body.dark-mode .timeline-content::before,
body.dark-mode .resource-list li::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, 
        rgba(144, 238, 144, 0) 0%, 
        rgba(144, 238, 144, 0.1) 50%, 
        rgba(222, 184, 135, 0.1) 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.dark-mode .highlight-card:hover::before,
body.dark-mode .timeline-content:hover::before,
body.dark-mode .resource-list li:hover::before {
    opacity: 1;
}

/* Animated underline for links in dark mode */
body.dark-mode a:not(.btn):not(.logo) {
    position: relative;
    text-decoration: none;
}

body.dark-mode a:not(.btn):not(.logo)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    box-shadow: var(var(--vintage-text-shadow));
    transition: width 0.3s ease;
}

body.dark-mode a:not(.btn):not(.logo):hover::after,
body.dark-mode a:not(.btn):not(.logo):focus::after {
    width: 100%;
}

/* Enhanced dark mode button animation */
body.dark-mode .btn {
    overflow: hidden;
    position: relative;
    z-index: 1;
}

body.dark-mode .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(144, 238, 144, 0.2) 0%, 
        rgba(222, 184, 135, 0.2) 100%);
    z-index: -1;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

body.dark-mode .btn:hover::before {
    transform: translateY(0);
}

/* Floating animation for dark mode cards */
@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0);
    }
}

body.dark-mode .timeline-node:nth-child(odd) .timeline-content {
    animation: float 6s ease-in-out infinite;
    animation-delay: 0s;
}

body.dark-mode .timeline-node:nth-child(even) .timeline-content {
    animation: float 6s ease-in-out infinite;
    animation-delay: 3s;
}

body.dark-mode .highlight-card:nth-child(1) {
    animation: float 7s ease-in-out infinite;
    animation-delay: 0s;
}

body.dark-mode .highlight-card:nth-child(2) {
    animation: float 7s ease-in-out infinite;
    animation-delay: 2s;
}

body.dark-mode .highlight-card:nth-child(3) {
    animation: float 7s ease-in-out infinite;
    animation-delay: 4s;
}

/* Glowing cursor effect on text input fields */
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode textarea {
    background-color: rgba(19, 19, 43, 0.8);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    transition: all 0.3s ease;
}

body.dark-mode input[type="text"]:focus,
body.dark-mode input[type="email"]:focus,
body.dark-mode input[type="password"]:focus,
body.dark-mode textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(144, 238, 144, 0.2);
    outline: none;
}

/* Mobile dark mode enhancements */
@media (max-width: 768px) {
    body.dark-mode .hamburger-menu span {
        background-color: var(--color-primary);
        box-shadow: var(var(--vintage-text-shadow));
    }
    
    body.dark-mode .nav-overlay {
        background-color: rgba(10, 10, 22, 0.8);
        backdrop-filter: blur(5px);
    }
    
    /* Keep animations lighter on mobile for performance */
    body.dark-mode .timeline-node:nth-child(odd) .timeline-content,
    body.dark-mode .timeline-node:nth-child(even) .timeline-content,
    body.dark-mode .highlight-card {
        animation: none;
    }
} 

/* Ensure elements have position relative for pseudo-elements */
.highlight-card, 
.timeline-content, 
.resource-list li,
.hero-section,
.main-footer {
    position: relative;
}

/* Make sure z-index is properly set for stacking contexts */
body.dark-mode .highlight-card,
body.dark-mode .timeline-content,
body.dark-mode .resource-list li {
    z-index: 1;
} 

/* --- Light Mode Animation Keyframes --- */
@keyframes lightvintagePulse {
    0% {
        box-shadow: 0 0 5px rgba(0, 77, 64, 0.1);
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 77, 64, 0.2), 0 0 5px rgba(162, 62, 72, 0.15);
    }
    100% {
        box-shadow: 0 0 10px rgba(0, 77, 64, 0.15);
    }
}

@keyframes lightTextvintagePulse {
    0% {
        text-shadow: 0 0 1px rgba(0, 77, 64, 0.1);
    }
    50% {
        text-shadow: 0 0 4px rgba(0, 77, 64, 0.2);
    }
    100% {
        text-shadow: 0 0 2px rgba(0, 77, 64, 0.15);
    }
}

/* --- Light Mode Header Animations --- */
.main-header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(234, 224, 214, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom-color: var(--color-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 0 10px rgba(0, 77, 64, 0.05);
}

.logo {
    color: var(--color-primary);
    text-shadow: var(--light-text-glow-sm);
    transition: color 0.3s, text-shadow 0.3s, transform 0.3s;
}

.logo:hover {
    color: var(--color-secondary);
    text-shadow: var(--light-text-glow-md);
    transform: translateY(-2px);
}

.main-nav a {
    transition: color 0.3s, text-shadow 0.3s, background-color 0.3s, transform 0.3s;
}

.main-nav a.active {
    color: var(--color-primary);
    text-shadow: var(--light-text-glow-sm);
}

.main-nav a:hover, 
.main-nav a:focus {
    color: var(--color-primary);
    text-shadow: var(--light-text-glow-sm);
    transform: translateY(-2px);
}

.main-nav a::after {
    background-color: var(--color-secondary);
    box-shadow: var(--light-accent-glow-sm);
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s;
}

.main-nav a:hover::after,
.main-nav a:focus::after,
.main-nav a.active::after {
    box-shadow: var(--light-accent-glow-md);
}

/* --- Button Animations --- */
.btn {
    overflow: hidden;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(0, 77, 64, 0.1) 0%, 
        rgba(162, 62, 72, 0.1) 100%);
    z-index: -1;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.btn:hover::before {
    transform: translateY(0);
}

.btn-primary {
    box-shadow: var(--light-box-glow-sm);
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    box-shadow: var(--light-box-glow-md);
    transform: translateY(-5px);
}

.btn-secondary {
    box-shadow: var(--light-accent-glow-sm);
    transition: all 0.3s ease;
}

.btn-secondary:hover,
.btn-secondary:focus {
    box-shadow: var(--light-accent-glow-md);
    transform: translateY(-5px);
}

/* --- Scroll-to-Top Button --- */
#scroll-to-top {
    box-shadow: var(--light-box-glow-sm);
    transition: all 0.3s ease;
}

#scroll-to-top:hover,
#scroll-to-top:focus {
    box-shadow: var(--light-accent-glow-md);
    transform: scale(1.15) translateY(-5px);
}

#scroll-to-top:active {
    transform: scale(0.95);
}

/* --- Light Mode Content Animations --- */
h1 {
    animation: lightTextvintagePulse 5s infinite alternate;
}

/* --- Timeline Animations --- */
.timeline::before {
    background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary));
    box-shadow: 0 0 10px rgba(0, 77, 64, 0.15), 0 0 5px rgba(162, 62, 72, 0.1);
    animation: lightvintagePulse var(--glow-pulse-speed) infinite alternate;
}

.timeline-node::after {
    border: 5px solid var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-background), var(--light-box-glow-sm);
    transition: all 0.3s ease;
}

.timeline-node:hover::after {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 4px var(--color-background), var(--light-accent-glow-md);
    transform: scale(1.3);
}

.timeline-content {
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    border-color: var(--color-secondary);
    box-shadow: var(--light-accent-glow-md), var(--shadow-lg);
    transform: translateY(-10px) scale(1.03);
}

.timeline-content h3 {
    color: var(--color-primary);
    text-shadow: var(--light-text-glow-sm);
    transition: all 0.3s ease;
}

.timeline-content a:hover h3, 
.timeline-content a:focus h3 {
    color: var(--color-secondary);
    text-shadow: var(--light-text-glow-md);
}

/* --- Card Animations --- */
.highlight-card {
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.highlight-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, 
        rgba(0, 77, 64, 0) 0%, 
        rgba(0, 77, 64, 0.05) 50%, 
        rgba(162, 62, 72, 0.05) 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.highlight-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--light-box-glow-md), var(--shadow-lg);
    transform: translateY(-10px);
}

.highlight-card:hover::before {
    opacity: 1;
}

.highlight-card h3 {
    color: var(--color-primary);
    text-shadow: var(--light-text-glow-sm);
    transition: all 0.3s ease;
}

.highlight-card:hover h3 {
    color: var(--color-secondary);
    text-shadow: var(--light-text-glow-md);
}

/* --- Resource List Animations --- */
.resource-list li {
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.resource-list li::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, 
        rgba(0, 77, 64, 0) 0%, 
        rgba(0, 77, 64, 0.03) 50%, 
        rgba(162, 62, 72, 0.03) 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.resource-list li:hover {
    border-color: var(--color-primary);
    box-shadow: var(--light-box-glow-md);
    transform: translateY(-5px);
}

.resource-list li:hover::before {
    opacity: 1;
}

.resource-list a {
    color: var(--color-primary);
    text-shadow: var(--light-text-glow-sm);
    transition: all 0.3s ease;
}

.resource-list a:hover {
    color: var(--color-secondary);
    text-shadow: var(--light-text-glow-md);
}

/* --- Link Animations --- */
a:not(.btn):not(.logo) {
    position: relative;
    text-decoration-color: transparent;
    transition: all 0.3s ease;
}

a:not(.btn):not(.logo)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    box-shadow: var(--light-text-glow-sm);
    transition: width 0.3s ease;
}

a:not(.btn):not(.logo):hover::after,
a:not(.btn):not(.logo):focus::after {
    width: 100%;
}

/* --- Glossary Animations --- */
dl dt {
    color: var(--color-primary);
    text-shadow: var(--light-text-glow-sm);
    transition: all 0.3s ease;
}

dl dt:hover {
    color: var(--color-secondary);
    text-shadow: var(--light-text-glow-md);
}

dl dd {
    border-left: 3px solid var(--color-secondary);
    box-shadow: var(--light-accent-glow-sm);
    transition: all 0.3s ease;
}

dl dd:hover {
    border-left-width: 5px;
    box-shadow: var(--light-accent-glow-md);
    transform: translateX(3px);
}

/* --- Hero Section Animations --- */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 77, 64, 0.2) 20%, 
        rgba(162, 62, 72, 0.2) 50%,
        rgba(0, 77, 64, 0.2) 80%,
        transparent 100%);
}

/* --- Footer Animations --- */
.main-footer {
    position: relative;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 77, 64, 0.2) 20%, 
        rgba(162, 62, 72, 0.2) 50%,
        rgba(0, 77, 64, 0.2) 80%,
        transparent 100%);
}

/* --- Floating Animation --- */
@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0);
    }
}

.timeline-node:nth-child(odd) .timeline-content {
    animation: float 7s ease-in-out infinite;
    animation-delay: 0s;
}

.timeline-node:nth-child(even) .timeline-content {
    animation: float 7s ease-in-out infinite;
    animation-delay: 3.5s;
}

.highlight-card:nth-child(1) {
    animation: float 8s ease-in-out infinite;
    animation-delay: 0s;
}

.highlight-card:nth-child(2) {
    animation: float 8s ease-in-out infinite;
    animation-delay: 2.5s;
}

.highlight-card:nth-child(3) {
    animation: float 8s ease-in-out infinite;
    animation-delay: 5s;
}

/* Form elements animations */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(0, 77, 64, 0.1);
    outline: none;
}

/* Mobile responsiveness for animations */
@media (max-width: 768px) {
    /* Keep animations lighter on mobile for performance */
    .timeline-node:nth-child(odd) .timeline-content,
    .timeline-node:nth-child(even) .timeline-content,
    .highlight-card {
        animation: none;
    }
    
    /* But keep some subtle animations */
    .timeline-content:hover,
    .highlight-card:hover {
        transform: translateY(-5px);
    }
} 

/* --- Additional Light Mode Effects --- */
/* Button ripple effect base styles */
.btn {
    position: relative;
    overflow: hidden;
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    width: 5px;
    height: 5px;
    background: rgba(0, 77, 64, 0.15);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

body.dark-mode .btn-ripple {
    background: rgba(144, 238, 144, 0.15);
}

@keyframes ripple {
    to {
        transform: scale(30);
        opacity: 0;
    }
}

/* Mouse position styles for hover effects */
.highlight-card, 
.timeline-content, 
.resource-list li,
.btn {
    position: relative;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.highlight-card::after,
.timeline-content::after,
.resource-list li::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle at var(--mouse-x) var(--mouse-y),
        rgba(0, 77, 64, 0.1) 0%,
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1;
}

body.dark-mode .highlight-card::after,
body.dark-mode .timeline-content::after,
body.dark-mode .resource-list li::after {
    background: radial-gradient(
        circle at var(--mouse-x) var(--mouse-y),
        rgba(144, 238, 144, 0.1) 0%,
        transparent 40%
    );
}

.highlight-card:hover::after,
.timeline-content:hover::after,
.resource-list li:hover::after {
    opacity: 1;
}

/* Page transition overlay */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

body.dark-mode .page-transition-overlay {
    background-color: var(--color-primary);
}

body.page-transition-active .page-transition-overlay {
    opacity: 0.2;
}

/* Mobile touch animations */
@media (max-width: 768px) {
    /* Enhance tap feedback */
    .btn:active {
        transform: scale(0.97);
    }
    
    .highlight-card:active,
    .timeline-content:active,
    .resource-list li:active {
        transform: scale(0.98);
    }
    
    /* Optimize animations for performance on mobile */
    .timeline-node:nth-child(odd) .timeline-content,
    .timeline-node:nth-child(even) .timeline-content,
    .highlight-card,
    .resource-list li {
        animation: none !important;
        will-change: transform;
    }
    
    /* Custom tap effect for mobile (simplified) */
    a:active, 
    button:active,
    .btn:active {
        transition: transform 0.1s ease;
    }
    
    /* Add touch feedback */
    .tap-highlight {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 77, 64, 0.05);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 0;
    }
    
    body.dark-mode .tap-highlight {
        background-color: rgba(144, 238, 144, 0.05);
    }
}

/* High performance animations with will-change */
.highlight-card,
.timeline-content,
.resource-list li,
.btn {
    will-change: transform, box-shadow;
}

/* Add prefers-reduced-motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01s !important;
        scroll-behavior: auto !important;
    }
    
    .timeline-node:nth-child(odd) .timeline-content,
    .timeline-node:nth-child(even) .timeline-content,
    .highlight-card:nth-child(1),
    .highlight-card:nth-child(2),
    .highlight-card:nth-child(3) {
        animation: none !important;
    }
    
    h1 {
        animation: none !important;
    }
} 

/* Improved Mobile Responsive Design */
@media (max-width: 768px) { /* Mobile */
    .container {
        padding: 0 20px;
        width: 100%;
        max-width: 100%;
    }
    
    main {
        padding-top: 70px; /* Match header height on mobile */
    }
    
    .main-header {
        padding: 10px 0;
        height: 70px;
    }
    
    .logo {
        font-size: 1.5rem;
        padding: 8px 0;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
    }
    
    .hamburger-menu {
        display: block;
    }
    
    .main-nav {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 75%;
        height: calc(100vh - 70px);
        background-color: var(--color-bg);
        z-index: 1000;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 20px;
        display: block;
        overflow-y: auto;
    }
    
    body.nav-open .main-nav {
        right: 0;
    }
    
    body.nav-open {
        overflow: hidden;
    }
    
    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main-nav li {
        margin: 0;
        width: 100%;
        margin-bottom: 15px;
    }
    
    .main-nav a {
        padding: 10px 0;
        width: 100%;
        display: block;
        text-align: left;
        font-size: 1.1rem;
    }
    
    .mobile-theme-toggle {
        display: flex;
        justify-content: flex-start;
        margin-top: 20px;
    }
    
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    body.nav-open .nav-overlay {
        opacity: 1;
        visibility: visible;
    }
    
    h1 { font-size: clamp(2rem, 7vw, 2.8rem); margin-bottom: 15px; } 
    h2 { font-size: clamp(1.6rem, 6vw, 2rem); margin-bottom: 15px; } 
    h3 { font-size: clamp(1.3rem, 5vw, 1.6rem); margin-bottom: 12px; } 
    
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-section p {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .highlights-section {
        padding: 40px 0;
    }
    
    .highlights-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .highlight-card {
        width: 100%;
        padding: 20px;
        margin-bottom: 0;
    }
    
    #scroll-to-top {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 1.2rem;
        bottom: 20px;
        right: 20px;
    }
    
    /* Improved Roadmap on Mobile */
    .roadmap-container {
        padding: 30px 10px;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-node {
        margin-bottom: 40px;
        padding-left: 50px;
        grid-template-columns: 1fr;
        width: 100%;
        position: relative;
    }
    
    .timeline-node:nth-child(odd),
    .timeline-node:nth-child(even) {
        left: 0;
        text-align: left;
    }
    
    .timeline-node::after {
        left: 10px;
        margin-left: 0;
    }
    
    .timeline-content {
        width: 100%;
        box-sizing: border-box;
    }
    
    .timeline-content h3 {
        font-size: 1.3rem;
    }
    
    /* Improved Button Alignment */
    .btn {
        padding: 10px 20px;
        font-size: 1rem;
        margin: 10px auto;
        display: inline-block;
        text-align: center;
    }
    
    /* Improved Spacing for Content Sections */
    main > section {
        padding: 40px 0;
        margin-bottom: 20px;
    }
    
    /* Better Typography on Mobile */
    p, li, dt, dd {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* Fix for any flex container alignment issues */
    .container {
        flex-direction: column;
        align-items: center;
    }
    
    /* Ensure link targets have enough padding for touch */
    .main-nav a,
    .btn,
    .highlight-card a,
    .timeline-content a,
    .resource-list a {
        padding: 10px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-section h1 {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }
    
    .btn {
        width: 100%;
        margin-top: 15px;
    }
    
    .highlight-card {
        padding: 15px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Ensure touch targets are properly sized */
    a, button, input[type="submit"], 
    .main-nav a, 
    .highlight-card a, 
    .btn, 
    .timeline-content a, 
    .resource-list a {
        min-height: 44px;
        min-width: 44px;
        padding: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Improved Responsiveness for Tables */
@media (max-width: 768px) {
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Improved Form Elements on Mobile */
@media (max-width: 768px) {
    button,
    input[type="button"],
    input[type="reset"],
    input[type="submit"] {
        padding: 12px 20px;
        font-size: 1rem;
        width: 100%;
        margin: 10px 0;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        padding: 12px;
        font-size: 1rem;
        width: 100%;
        margin: 10px 0;
    }
    
    main > section {
        padding: 30px 0;
    }
    
    h1, h2, h3, h4, h5, h6 {
        text-align: center;
    }
    
    .content-page {
        padding: 30px 10px;
    }
    
    .container {
        padding: 0 15px;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Improved Card Sizing on Small Screens */
@media (max-width: 480px) {
    .highlight-card {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .highlight-card h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .highlight-card p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    /* Fix alignment of buttons in cards */
    .highlight-card .btn {
        display: block;
        width: 100%;
        text-align: center;
    }
}

/* Medium Screens (Tablets) */
@media (min-width: 769px) and (max-width: 992px) {
    .container {
        max-width: 95%;
    }
    
    .highlights-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .main-nav a {
        padding: 8px 12px;
        font-size: 0.95rem;
    }
    
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* Fix for any potential Safari mobile issues */
@supports (-webkit-touch-callout: none) {
    .btn, 
    .main-nav a,
    .timeline-content a,
    .resource-list a {
        -webkit-appearance: none;
        appearance: none;
    }
    
    input, 
    textarea, 
    select, 
    button {
        -webkit-appearance: none;
        appearance: none;
        border-radius: 0;
    }
}

/* --- Mobile Responsiveness Comprehensive Fix --- */
@media (max-width: 768px) {
    /* Fix Navigation Layout */
    .main-nav {
        position: fixed;
        top: 0;
        right: -80%;
        width: 80%;
        height: 100vh;
        background-color: var(--color-card-bg);
        z-index: 1000;
        transition: right 0.3s ease;
        padding: 80px 20px 30px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }
    
    body.dark-mode .main-nav {
        background-color: var(--color-card-bg);
    }
    
    body.nav-open .main-nav {
        right: 0;
    }
    
    .main-nav ul {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .main-nav li {
        margin: 0 0 15px 0;
        width: 100%;
    }
    
    .main-nav a {
        display: block;
        width: 100%;
        padding: 12px 15px;
        text-align: left;
        font-size: 1.1rem;
        border-radius: 8px;
    }
    
    .main-nav a::after {
        display: none;
    }
    
    /* Fix Roadmap Layout */
    .roadmap-container {
        margin: 1rem auto;
        padding: 1rem 0;
        width: 100%;
    }
    
    .timeline::before {
        left: 35px;
        transform: none;
    }
    
    .timeline-node {
        width: 100%;
        padding-left: 80px;
        padding-right: 10px;
        left: 0 !important;
        margin-bottom: 30px;
    }
    
    .timeline-node:nth-child(odd),
    .timeline-node:nth-child(even) {
        padding-left: 80px;
        padding-right: 10px;
        text-align: left;
    }
    
    .timeline-node::after {
        left: 23px;
        right: auto;
        margin-left: 0;
    }
    
    .timeline-content {
        width: 100%;
        padding: 20px;
    }
    
    /* Fix Chapter Cards */
    .highlight-card {
        width: 100%;
        margin-bottom: 20px;
        padding: 20px;
    }
    
    .highlight-card h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .highlight-card p {
        margin-bottom: 15px;
    }
    
    .highlight-card .btn {
        display: block;
        width: 100%;
        padding: 10px;
        text-align: center;
    }
    
    /* Improve Button Alignment */
    .btn {
        display: inline-block;
        width: auto;
        min-height: 44px;
        padding: 10px 20px;
        margin: 10px 0;
        font-size: 1rem;
        text-align: center;
    }
    
    /* General Layout Fixes */
    .container {
        width: 100%;
        padding: 0 15px;
        max-width: 100%;
    }
    
    main {
        padding-top: 80px;
    }
    
    main > section {
        padding: 30px 0;
    }
    
    h1, h2, h3, h4, h5, h6 {
        text-align: center;
    }
    
    /* Ensure Interactive Elements Have Proper Touch Targets */
    a, button, 
    input[type="submit"], 
    .timeline-content a,
    .highlight-card a,
    .main-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .highlight-card a.btn,
    .timeline-content a.btn,
    a.btn {
        justify-content: center;
    }
    
    /* Better Touch Experience */
    .main-nav a:active,
    .btn:active,
    .highlight-card:active,
    .timeline-content:active {
        opacity: 0.7;
        transition: opacity 0.1s;
    }
}

/* Fix for smaller mobile devices */
@media (max-width: 480px) {
    .header-container {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 1.4rem;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
    
    .highlight-card,
    .timeline-content {
        padding: 15px;
    }
    
    .timeline-node::after {
        width: 16px;
        height: 16px;
        left: 27px;
    }
    
    .timeline-node {
        padding-left: 65px;
    }
}

/* --- Link Display Fix --- */
.main-nav a,
.highlight-card a,
.timeline-content a,
.resource-list a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
}

.highlight-card .btn,
.timeline-content .btn {
    margin-top: 10px;
}

/* --- Roadmap Chapter Cards Fix --- */
.timeline-content {
    padding: 25px;
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
    text-align: left;
    display: block;
    width: 100%;
}

.timeline-content a {
    display: block;
    color: inherit;
    text-decoration: none;
    width: 100%;
}

.timeline-content h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.4rem;
    color: var(--color-primary);
    text-shadow: none;
    line-height: 1.3;
    text-align: left;
    font-weight: 700;
}

.timeline-content p {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text);
    opacity: 0.9;
    text-align: left;
}

.timeline-content:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.timeline-content:hover h3 {
    color: var(--color-secondary);
}

@media (max-width: 768px) {
    .timeline-content {
        padding: 20px;
        width: 100%;
    }
    
    .timeline-content h3 {
        font-size: 1.2rem;
        margin-bottom: 8px;
        text-align: left;
    }
    
    .timeline-content p {
        font-size: 0.9rem;
        text-align: left;
    }
}

/* Fix for roadmap node styling */
.timeline-node {
    position: relative;
    margin-bottom: 40px;
}

.timeline-node:nth-child(odd) .timeline-content,
.timeline-node:nth-child(even) .timeline-content {
    text-align: left;
}

.timeline-node:last-child {
    margin-bottom: 0;
}

/* --- Chapter Navigation --- */
.chapter-navigation {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    gap: 15px;
}

.chapter-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: var(--color-card-bg);
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.chapter-nav-group {
    display: flex;
    gap: 10px;
}

.chapter-nav-btn:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.chapter-nav-btn i {
    margin-right: 8px;
}

.chapter-nav-btn.next i {
    margin-right: 0;
    margin-left: 8px;
}

.chapter-nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

body.dark-mode .chapter-nav-btn {
    background-color: var(--color-card-bg);
    border-color: var(--color-border);
    color: var(--color-primary);
}

body.dark-mode .chapter-nav-btn:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border-color: var(--color-primary);
    box-shadow: var(var(--vintage-box-shadow));
}

@media (max-width: 768px) {
    .chapter-navigation {
        flex-direction: column;
        gap: 10px;
        margin: 1.5rem 0;
    }
    
    .chapter-nav-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
    
    .chapter-nav-group {
        display: flex;
        gap: 10px;
        width: 100%;
    }
    
    .chapter-nav-group .chapter-nav-btn {
        flex: 1;
    }
}

/* Fix heading alignment on mobile */
@media (max-width: 768px) {
    .content-page h1,
    .content-page h2,
    .content-page h3,
    .content-page h4,
    .content-page h5,
    .content-page h6 {
        text-align: left !important;
    }
    
    .content-block p,
    .content-block ul,
    .content-block ol {
        text-align: left;
    }
    
    /* Only keep these elements centered */
    .hero-section h1,
    .hero-section p,
    .highlights-section h2,
    .text-center {
        text-align: center !important;
    }
    
    /* Override general mobile h1-h6 centering */
    h1, h2, h3, h4, h5, h6 {
        text-align: inherit;
    }
}

/* Additional fix for chapter page content */
.content-page h1, 
.content-page h2, 
.content-page h3, 
.content-page h4, 
.content-page h5, 
.content-page h6, 
.content-block h1, 
.content-block h2, 
.content-block h3, 
.content-block h4, 
.content-block h5, 
.content-block h6 {
    text-align: left;
}

/* Reset any text-align center */
@media (max-width: 768px) {
    .content-page h1,
    .content-page h2,
    .content-page h3,
    .content-page h4,
    .content-page h5,
    .content-page h6 {
        text-align: left !important;
    }
    
    /* Fix for Why This Guide section on homepage */
    .custom-content h3 {
        text-align: center !important;
        margin-bottom: 15px;
    }
    
    .custom-content p {
        text-align: left !important;
        margin-bottom: 15px;
        padding: 0 10px;
    }
}

/* Fix logo and hamburger menu alignment on mobile */
@media (max-width: 768px) {
    .header-container {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 15px;
        width: 100%;
        position: relative;
    }
    
    .logo {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
    }
    
    .hamburger-menu {
        display: block;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        height: 20px;
        width: 25px;
        margin-top: 1px; /* Fine-tune vertical alignment */
    }
    
    /* Ensure normal links in paragraphs look like inline text */
    p a:not(.btn) {
        display: inline;
        padding: 0;
        min-height: 0;
        text-decoration: underline;
        font-weight: 600;
        color: var(--color-primary);
    }
    
    /* Center align specific elements in the About page */
    .about-page h2,
    .about-page h3,
    .team-section h2,
    .team-section h3,
    .connect-section h2,
    .connect-section h3,
    .team-member h3,
    .team-member .role {
        text-align: center !important;
    }
}

/* Improved Mobile Styling */
@media (max-width: 768px) {
    /* 1. Better header alignment */
    .header-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 15px !important;
        position: relative !important;
    }
    
    .logo {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        text-align: center !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
    }
    
    .hamburger-menu {
        display: block !important;
        position: absolute !important;
        right: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 25px !important;
        height: 20px !important;
        margin-top: 1px !important; /* Fine-tune vertical alignment */
    }
    
    /* 2. Resources page links styling */
    .content-block a,
    .interactive-list a,
    p a {
        display: inline !important;
        padding: 0 !important;
        min-height: 0 !important;
        text-decoration: underline !important;
        font-weight: 600 !important;
        color: var(--color-primary) !important;
    }
    
    /* 3. About page center alignment */
    .social-links h3,
    .team-section h3,
    .team-member h4,
    .team-member p {
        text-align: center !important;
    }
    
    /* Fix team member layout on mobile */
    .team-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        max-width: 300px !important;
        margin: 0 auto !important;
    }
    
    /* Fix for pulser elements */
    .pulse-on-hover {
        display: inline-block !important;
    }
}

/* Center alignment for About page elements (both desktop and mobile) */
.social-links h3,
.team-section h3,
.team-member h4,
.team-member p,
.connect-section h2,
.connect-section h3 {
    text-align: center;
}

.team-grid {
    margin: 2rem auto;
}

/* Keep the desktop team grid layout */
@media (min-width: 769px) {
    .team-grid {
        max-width: 1000px;
        margin: 2rem auto;
    }
    
    .team-member {
        text-align: center;
    }
}

/* Improved About page styling */
/* For all screen sizes */
.social-links {
    text-align: center;
}

.social-links h3 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.social-links a {
    display: inline-block;
    margin: 0 10px;
}

.team-section h3 {
    text-align: center;
    margin-bottom: 2rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
}

.team-member {
    text-align: center;
}

.team-member h4,
.team-member p {
    text-align: center;
    margin-bottom: 5px;
}

.team-member img {
    margin: 0 auto 1rem;
    display: block;
}

/* Vision section heading */
#vision h3 {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Connect With Us heading */
.content-block h3 {
    text-align: center !important;
}

/* Replace content-block selector with more specific one */
.about-page .content-block h3 {
    text-align: center !important;
}

/* Improved About page styling */
/* Remove duplicate rules and clean up selectors */

/* Only target elements within about-page */
body.about-page .social-links {
    text-align: center;
}

body.about-page .social-links h3 {
    text-align: center !important;
    margin-bottom: 1.5rem;
}

body.about-page .social-links a {
    display: inline-block;
    margin: 0 10px;
}

body.about-page .team-section h3 {
    text-align: center !important;
    margin-bottom: 2rem;
}

body.about-page .team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
}

body.about-page .team-member {
    text-align: center;
}

body.about-page .team-member h4,
body.about-page .team-member p {
    text-align: center !important;
    margin-bottom: 5px;
}

body.about-page .team-member img {
    margin: 0 auto 1rem;
    display: block;
}

/* Vision section heading */
body.about-page #vision h3 {
    text-align: center !important;
    margin-bottom: 1.5rem;
}

/* Force content page headings to be left-aligned */
.content-page h1,
.content-page h2,
.content-page h3,
.content-page h4,
.content-page h5,
.content-page h6,
.content-page .content-block h1,
.content-page .content-block h2,
.content-page .content-block h3,
.content-page .content-block h4,
.content-page .content-block h5,
.content-page .content-block h6 {
    text-align: left !important;
}

/* Force all content headings to be left-aligned */
.content-page h1,
.content-page h3,
.content-page h4,
.content-page h5,
.content-page h6,
.content-block h1,
.content-block h2,
.content-block h3,
.content-block h4,
.content-block h5,
.content-block h6,
.highlight-text {
    text-align: left !important; 
}

/* Ensure all interactive elements have proper cursor styles */
a, button, .btn, input[type="submit"], [role="button"], .timeline-node,
.timeline-content, .highlight-card, #theme-toggle, #mobile-theme-toggle,
.social-links a, .team-member .social-links a {
    cursor: pointer !important;
}

/* Fix for roadmap cards */
.timeline-content {
    cursor: pointer !important;
}

.timeline-content a {
    cursor: pointer !important;
}

/* Fix for theme toggle buttons */
#theme-toggle, #mobile-theme-toggle {
    cursor: pointer !important;
}

/* Fix for social media links */
.social-links a, .team-member .social-links a {
    cursor: pointer !important;
}

/* Ensure all interactive elements and their children have proper cursor styles */
a, button, .btn, input[type="submit"], [role="button"], .timeline-node,
.timeline-content, .highlight-card, #theme-toggle, #mobile-theme-toggle,
.social-links a, .team-member .social-links a,
/* Add styles for all child elements */
.timeline-content *, .timeline-content a *, .highlight-card *, .highlight-card a *,
.social-links a *, .team-member .social-links a *,
#theme-toggle *, #mobile-theme-toggle * {
    cursor: pointer !important;
}

/* Fix for roadmap cards and their content */
.timeline-content {
    cursor: pointer !important;
}

.timeline-content a {
    cursor: pointer !important;
}

.timeline-content h3,
.timeline-content p {
    cursor: pointer !important;
}

/* Fix for theme toggle buttons and their icons */
#theme-toggle, #mobile-theme-toggle {
    cursor: pointer !important;
}

#theme-toggle i,
#mobile-theme-toggle i {
    cursor: pointer !important;
}

/* Fix for social media links and their icons */
.social-links a, .team-member .social-links a {
    cursor: pointer !important;
}

.social-links a i,
.team-member .social-links a i {
    cursor: pointer !important;
}

/* Fix for social media links and their icons in mentors section */
.team-member .social-links {
    cursor: pointer !important;
}

.team-member .social-links a {
    cursor: pointer !important;
}

.team-member .social-links a i,
.team-member .social-links a i.fa-brands,
.team-member .social-links a i.fa-solid,
.team-member .social-links a i.fa-regular {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.team-member .social-links a * {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Ensure the entire social links container is clickable */
.team-member .social-links a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    text-decoration: none !important;
    pointer-events: auto !important;
}

/* Fix for Font Awesome icons specifically */
.fa-brands,
.fa-solid,
.fa-regular {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* ===== HEADING FIXES ===== */
/* Fix for heading spacing and alignment */
.content-page h1,
.content-page h2,
.content-page h3,
.content-page h4,
.content-page h5,
.content-page h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.content-page h1:first-child,
.content-page h2:first-child {
    margin-top: 0;
}

/* Fix for nested heading hierarchy */
.content-page h1 + h2,
.content-page h2 + h3,
.content-page h3 + h4 {
    margin-top: 1rem;
}

/* Ensure proper text wrapping for long headings */
.content-page h1,
.content-page h2,
.content-page h3 {
    word-wrap: break-word;
    hyphens: auto;
}

/* Fix for heading colors in different themes */
.content-page h1,
.content-page h2,
.content-page h3 {
    color: var(--color-primary);
}

/* Responsive heading sizes */
@media (max-width: 768px) {
    .content-page h1 {
        font-size: 2rem;
    }
    
    .content-page h2 {
        font-size: 1.5rem;
    }
    
    .content-page h3 {
        font-size: 1.25rem;
    }
}

