:root {
    /* --- The Neo Palette --- */
    --neo-crimson: #B01E2E;       /* Accent / Buttons */
    --neo-crimson-hover: #8a1623; /* Darker Red for hover states */
    
    --eng-charcoal: #2D2D2D;      /* Headings / Borders / Navbar Text */
    --tungsten-gray: #5F6368;     /* Body Text */
    
    --ind-silver: #F2F4F6;        /* Page Background */
    --pure-white: #FFFFFF;        /* Card / Section Backgrounds */

    /* Shadows for depth on light backgrounds */
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--ind-silver);
    color: var(--tungsten-gray);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--eng-charcoal);
    font-weight: 700;
    margin-top: 0;
}

/* The "Highlight" is now your Crimson Red */
.highlight {
    color: var(--neo-crimson);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

/* Navbar - Clean White with Charcoal Text */
.navbar {
    background: var(--pure-white);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid #E5E7EB;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px 0; /* Keep the padding */
}

.navbar .container {
    display: flex;
    flex-direction: column; /* Stack Logo on top of Links */
    align-items: center;    /* Center everything horizontally */
    justify-content: center;
}

/* Add space between the centered Logo and the Links */
.navbar .nav-links {
    margin-top: 15px;
    width: 100%;
    justify-content: center; /* Ensure links are centered in the row */
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--eng-charcoal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logo img {
    height: 55px;  /* Bumped up slightly for a centered "Hero" look */
    width: auto;
    object-fit: contain;
    margin-right: 0; /* REMOVE the margin-right: 12px; */
    margin-bottom: 5px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--eng-charcoal);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--neo-crimson);
}

/* Buttons - The Crimson Power Move */
.btn-primary {
    background-color: var(--neo-crimson);
    color: var(--pure-white);
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-primary:hover {
    background-color: var(--neo-crimson-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--eng-charcoal);
    border: 2px solid var(--eng-charcoal);
    padding: 10px 22px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--eng-charcoal);
    color: var(--pure-white);
}

/* Hero Section - White Background for Cleanliness */
.hero {
    text-align: center;
    padding: 120px 20px;
    background-color: var(--pure-white);
    border-bottom: 1px solid #E5E7EB;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.cta-group {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Cards (Expertise) */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background: var(--pure-white);
    padding: 30px;
    border-radius: 8px;
    border-top: 4px solid var(--neo-crimson); /* The "Engineered" accent */
    box-shadow: var(--shadow-card);
}

.card h3 {
    margin-bottom: 10px;
}

/* Project Section - Dark Contrast Strip */
/* We invert the colors here to make the case study pop */
.dark-mode {
    background-color: var(--eng-charcoal);
    color: var(--ind-silver);
}

.dark-mode h2, .dark-mode h3, .dark-mode strong {
    color: var(--pure-white);
}

.dark-mode p, .dark-mode li {
    color: #D1D5DB; /* Light gray for readability on dark */
}

.project-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.stat-box {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1); /* Glass effect on dark */
    padding: 15px 20px;
    border-left: 3px solid var(--neo-crimson);
    margin-right: 20px;
    margin-top: 20px;
    border-radius: 0 4px 4px 0;
}

.stat-box strong {
    display: block;
    font-size: 1.8rem;
    color: var(--neo-crimson);
}

/* Image Placeholder */
.image-placeholder {
    width: 100%;
    height: 300px;
    background: #404040;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #555;
    border-radius: 8px;
    color: #888;
}

/* Form */
.form-box {
    max-width: 600px;
    margin: 0 auto;
    background: var(--pure-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    border: 1px solid #E5E7EB;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--eng-charcoal);
    font-weight: 600;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--ind-silver); /* Light gray input background */
    border: 1px solid #D1D5DB;
    color: var(--eng-charcoal);
    border-radius: 4px;
    font-family: inherit;
    box-sizing: border-box; /* Fixes padding width issues */
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--neo-crimson); /* Active state */
    background: var(--pure-white);
}

/* Footer */
footer {
    background-color: var(--eng-charcoal);
    color: var(--tungsten-gray);
    text-align: center;
    padding: 40px 0;
    margin-top: auto;
}

footer p {
    color: #9CA3AF;
    font-size: 0.9rem;
}

#form-response {
    margin-top: 15px;
    font-weight: bold;
    min-height: 1.5em; /* Prevents layout jump when text appears */
    transition: color 0.3s ease;
}

/* Optional: smoother button transition */
.btn-primary:disabled {
    background-color: #94a3b8; /* Grey out the button when disabled */
    transform: none; /* Stop hover effects */
}

/* --- Fix for Navbar Button Conflict --- */

/* 1. Force the text to be WHITE, overriding the navbar's charcoal color */
.nav-links .btn-primary {
    color: #FFFFFF !important; 
}

/* 2. On Hover, keep the text WHITE (don't let it turn red) */
.nav-links .btn-primary:hover {
    color: #FFFFFF !important;
    background-color: var(--neo-crimson-hover); /* Darker red background */
}

/* --- Slideshow & Media --- */

/* 1. The Container: Forces a fixed 16:9 Aspect Ratio */
.slideshow-container {
    max-width: 100%;
    position: relative;
    margin: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 2px solid var(--neo-crimson);
    background-color: #000;
    
    /* FORCE 16:9 Aspect Ratio (Like YouTube) */
    aspect-ratio: 4 / 3; 
    /* Fallback height for old browsers */
    height: auto; 
    /*min-height: 400px;*/
}

/* 2. The Slide Wrapper */
.mySlides {
    display: none;
    height: 100%; /* Fill the container */
    width: 100%;
}

/* 3. The Images & Video: Force them to fit the box */
.mySlides img, .mySlides video {
    width: 100%;
    height: 100%;
    
    /* CHANGE THIS to 'contain' to see the full image */
    object-fit: contain; 
    
    background-color: #000; /* Black background for the empty space */
    display: block;
}

/* 4. The Fade Transition */
.fade {
    animation-name: fade;
    animation-duration: 1.0s; /* Smoother, slower fade */
    animation-fill-mode: forwards;
}

@keyframes fade {
    from { opacity: 0.3; } 
    to { opacity: 1; }
}

/* Navigation Buttons (Prev/Next) */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    z-index: 10;
    border: none;      /* Removes default button border */
}
.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}
.prev:hover, .next:hover {
    background-color: var(--neo-crimson); /* Red hover effect */
}

/* Dots */
.numbertext {
    color: #f2f2f2;
    font-size: 12px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
    z-index: 10;
    text-shadow: 1px 1px 2px black;
}

/* --- Team Section --- */

.team-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    align-items: start;
    margin-top: 40px;
    background: var(--pure-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    border-left: 5px solid var(--neo-crimson);
}

.team-image img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    /* Start grayscale, color on hover */
    filter: grayscale(100%); 
    transition: filter 0.3s;
}

.team-image img:hover {
    filter: grayscale(0%);
}

.team-bio h3 {
    margin-top: 0;
    color: var(--eng-charcoal);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* The 'Magna Cum Laude' Badge */
.degree-tag {
    font-size: 0.8rem;
    background: #e5e7eb;
    color: #374151;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    vertical-align: middle;
}

.bio-intro {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--neo-crimson); /* Highlight the intro sentence */
    margin-bottom: 20px;
}

/* Skill Tags (The "Badges") */
.skills-grid {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background-color: var(--ind-silver);
    color: var(--eng-charcoal);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #d1d5db;
}

/* LinkedIn Button */
.linkedin-link {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Space between icon and text */
    margin-top: 5px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0077b5; /* Official LinkedIn Blue */
    text-decoration: none;
    transition: color 0.3s ease;
}

.linkedin-link svg {
    fill: currentColor; /* Icon changes color with text */
}

.linkedin-link:hover {
    color: var(--neo-crimson); /* Turns your brand red on hover */
    text-decoration: underline;
}

/* 1. Center the "Ready to Automate?" Title */
#contact .section-title {
    text-align: center;
    width: 100%;
}

/* 2. Center the Turnstile (CAPTCHA) */
.cf-turnstile {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

/* 3. Center the Submit Button */
#contact-form button[type="submit"] {
    display: block;
    margin: 0 auto; /* Auto margins center block elements */
    width: auto;    /* Let it fit the text, or set a px width */
    min-width: 200px;
}

/* 4. Center the Success/Error Message */
#form-response {
    text-align: center;
    margin-top: 15px;
}

/* --- Accessibility Contrast Fixes --- */

/* Force text in the dark section to be High-Contrast White */
.dark-mode, 
.dark-mode p, 
.dark-mode li, 
.dark-mode h3 {
    color: #ffffff !important; /* Pure white for maximum readability */
}

/* Make the 'Highlight' text brighter in dark mode so it pops */
.dark-mode .highlight {
    color: #ff4d4d !important; /* A brighter, readable red */
}

/* Fix the Stat Boxes (PPM / Accuracy) */
.dark-mode .stat-box {
    background: rgba(255, 255, 255, 0.1); /* Slight white background */
    color: #ffffff !important;
    border: 1px solid #ffffff; /* White border for definition */
}

.dark-mode .stat-box strong {
    color: #ffffff !important; /* Ensure the numbers are white */
}

.dark-mode .stat-box span {
    color: #e0e0e0 !important; /* Slightly off-white for the label */
}

/* =========================================
   MOBILE RESPONSIVENESS (Merged & Corrected)
   ========================================= */

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    /* 1. Stack the Grids (Expertise, Projects, Team) */
    .grid-3, 
    .project-layout, 
    .team-layout {
        grid-template-columns: 1fr; /* Forces single column */
        gap: 30px;
    }

    /* 2. Adjust Font Sizes */
    .hero h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    
    /* 3. Center Team Text on Mobile */
    .team-layout {
        text-align: center;
    }
    
    /* 4. Fix Container Padding */
    .container {
        width: 90%;
        padding: 0 15px;
    }
    
    /* 5. Hide Nav Links (Optional) */
    .nav-links {
        display: none; 
    }
    
    /* 6. Fix Team Image Sizing on Mobile */
    .team-image {
        max-width: 250px;
        margin: 0 auto;
    }

    /* 7. Center Specific Elements (Merged from above) */
    .skills-grid {
        justify-content: center;
    }
    .team-bio h3 {
        justify-content: center;
    }
}