/*
====================================================================
GLOBAL STYLES & RESETS (2040 Edition)
- Embracing modern CSS features and cleaner defaults.
====================================================================
*/

/* CSS Variables for a dynamic, maintainable design system */
:root {
    /* Colors */
    --clr-primary-900: #0a0a0a; /* Deep charcoal/near black for background */
    --clr-primary-800: #1a1a1a;
    --clr-primary-700: #2a2a2a;
    --clr-accent-blue: #007bff; /* Core interactive blue */
    --clr-accent-blue-dark: #0056b3;
    --clr-accent-blue-darker: #004085;
    --clr-accent-gold: #ffd700; /* Highlight gold */
    --clr-text-light: #e0e0e0; /* Light text for dark backgrounds */
    --clr-text-dark: #333; /* Dark text for light backgrounds */
    --clr-bg-light: #f8f8f8; /* Light section background */
    --clr-bg-medium: #e8e8e8; /* Medium section background */
    --clr-border: #444; /* Subtle border for dark elements */
    --clr-shadow-dark: rgba(0, 0, 0, 0.4);
    --clr-shadow-light: rgba(0, 0, 0, 0.15);

    /* Typography */
    --font-heading: 'Orbitron', sans-serif; /* Futuristic heading font */
    --font-body: 'Inter', sans-serif; /* Clean, modern body font */
    --fs-h1: clamp(3rem, 7vw + 1rem, 5.5rem); /* Responsive fluid typography */
    --fs-h2: clamp(2rem, 5vw + 1rem, 3.5rem);
    --fs-h3: clamp(1.4rem, 3vw + 1rem, 2.2rem);
    --fs-h4: clamp(1.1rem, 2vw + 1rem, 1.6rem);
    --fs-body-large: clamp(1rem, 1.5vw + 0.5rem, 1.4rem);
    --fs-body-medium: clamp(0.9rem, 1.2vw + 0.3rem, 1.1rem);
    --fs-body-small: clamp(0.8rem, 1vw + 0.2rem, 1rem);

    /* Spacing */
    --space-xs: 0.5rem; /* 8px */
    --space-sm: 1rem; /* 16px */
    --space-md: 1.5rem; /* 24px */
    --space-lg: 2rem; /* 32px */
    --space-xl: 3rem; /* 48px */
    --section-padding: var(--space-xl) 0; /* Default section padding */
    --container-max-width: 1400px;
    --menu-width: 300px; /* Define a consistent menu width for push effect */
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Adjust for header height */
    overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Universal box-sizing for consistent layout calculations */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--clr-text-dark); /* Default text color set to dark grey for general readability on light backgrounds */
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--clr-bg-light); /* Default background for sections below hero */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 0 !important;
}


/* Container for consistent content width (global setting) */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Headings with fluid typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.5em;
    line-height: 1.2;
    color: inherit;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Subtle default text shadow */
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease, transform 0.2s ease;
}

/*
====================================================================
HEADER SECTION STYLES (Simplified for horizontal menu, always visible)
====================================================================
*/
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--clr-primary-900); /* Darker, more prominent header */
    padding: var(--space-xs) 0; /* Slightly reduced vertical padding */
    z-index: 1000;
    box-shadow: 0 4px 10px var(--clr-shadow-dark); /* Deeper shadow */
}

.main-header .container {
    display: flex;
    justify-content: space-between; /* Space logo and nav */
    align-items: center;
    padding: 0 var(--space-md); /* Consistent horizontal padding */
}

.main-header .logo {
    font-size: var(--fs-h3);
    font-weight: 700;
    color: var(--clr-text-light);
    letter-spacing: 2px; /* More prominent */
    text-transform: uppercase;
    text-shadow: 0 0 5px var(--clr-accent-blue); /* Subtle glow effect */
    white-space: nowrap; /* Ensure logo text stays on one line */
}

.menu-toggle {
    display: none; /* Force hide if HTML still contains it */
}


/* Main Navigation (Horizontal Desktop, Wrapping Mobile) */
.main-nav {
    position: static; /* No longer fixed or off-canvas */
    width: auto;
    height: auto;
    background-color: transparent;
    padding-top: 0;
    z-index: auto;
    box-shadow: none;
    display: block; /* Always visible */
}

.main-nav ul {
    display: flex; /* Horizontal on desktop */
    flex-direction: row; /* Horizontal */
    gap: var(--space-lg); /* Space out links */
    align-items: center; /* Center vertically */
    padding: 0;
    background-color: transparent;
}

.main-nav li {
    width: auto; /* Allow items to size naturally */
    text-align: center;
    margin-bottom: 0;
    position: relative;
    display: block;
    height: auto;
    overflow: visible;
    background-color: transparent;
}

.main-nav a {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--fs-body-medium);
    color: var(--clr-text-light);
    border-radius: 6px;
    display: block;
    text-align: center;
    min-height: auto;
    line-height: 1.2;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap; /* Prevent individual link text from wrapping */
}

.main-nav a:hover,
.main-nav a:focus {
    background-color: var(--clr-accent-blue);
    color: var(--clr-text-light);
    outline: none;
    transform: translateY(-2px); /* Subtle lift on hover */
}

.main-nav a.active-nav {
    background-color: var(--clr-accent-blue-dark); /* Darker blue for active state */
    /* MODIFIED: Removed properties that disabled clicking */
    /* cursor: default; */ /* REMOVED */
    /* pointer-events: none; */ /* REMOVED */
    font-weight: 700;
    color: var(--clr-accent-gold); /* Active color */
}

/* Removed Dropdown Menus styles as they are no longer in use */


/*
====================================================================
HERO SECTION STYLES
====================================================================
*/
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px; /* Ensure visibility on smaller screens */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 0 !important;
    box-sizing: border-box;
    color: var(--clr-text-light);
}

/* Video Background Styling */
.video-background {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -1;
    transform: translate(-50%, -50%);
    object-fit: cover;
    filter: brightness(0.4); /* Darker overlay for better text contrast */
    pointer-events: none; /* Prevents video from interfering with clicks */
    user-select: none; /* Prevents text selection on video */
}

/* Content Overlay Styling */
.content-overlay {
    position: relative;
    z-index: 1;
    padding: var(--space-xl) var(--space-lg); /* More generous padding */
    background-color: rgba(0, 0, 0, 0.65); /* Slightly more opaque for text contrast */
    border-radius: 12px; /* Smoother rounded corners */
    max-width: 1000px;
    box-shadow: 0 8px 30px var(--clr-shadow-dark); /* Deeper, more diffused shadow */
    backdrop-filter: blur(5px); /* Modern frosted glass effect */
    -webkit-backdrop-filter: blur(5px);
}

/* Hero Text Styling */
.hero-section h1 {
    font-size: var(--fs-h1);
    margin-bottom: var(--space-sm);
    line-height: 1.1;
    text-shadow: 0 0 15px rgba(0, 123, 255, 0.7); /* Sci-fi glow */
    font-weight: 700;
}

.hero-section .patent-text {
    font-size: var(--fs-h4);
    font-weight: 500;
    margin-top: 0;
    margin-bottom: var(--space-md);
    letter-spacing: 3px; /* More impactful */
    color: var(--clr-accent-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    text-transform: uppercase;
}

.hero-section .tagline {
    font-size: var(--fs-body-large);
    margin-bottom: var(--space-xl);
    line-height: 1.5;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 400;
}

/*
====================================================================
CALL-TO-ACTION BUTTON STYLES (Professional Enhancements)
====================================================================
*/
.btn {
    display: inline-block;
    background-color: var(--clr-accent-blue);
    color: var(--clr-text-light);
    padding: 16px 32px;
    text-decoration: none;
    border-radius: 10px; /* Slightly more rounded */
    font-size: var(--fs-body-medium);
    font-weight: 600;
    letter-spacing: 0.8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 6px 18px rgba(0, 123, 255, 0.4);
    position: relative;
    overflow: hidden;
    text-align: center;
    white-space: nowrap; /* Prevent button text wrapping */
}

.btn:hover {
    background-color: var(--clr-accent-blue-dark);
    transform: translateY(-4px) scale(1.02); /* More pronounced lift and slight scale */
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.55);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
    background-color: var(--clr-accent-blue-darker);
}

.btn:focus {
    outline: none;
    border-color: var(--clr-accent-gold);
    box-shadow: 0 0 0 5px rgba(255, 215, 0, 0.5), 0 0 15px rgba(255, 215, 0, 0.3); /* Stronger glow */
    transform: translateY(-2px);
}

/* Secondary Button Style */
.btn.secondary-btn {
    background-color: var(--clr-primary-700); /* Darker, more muted */
    color: var(--clr-text-light);
    box-shadow: 0 6px 18px rgba(108, 117, 125, 0.2);
    border: 2px solid var(--clr-border);
}

.btn.secondary-btn:hover {
    background-color: var(--clr-primary-800);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.35);
    border-color: var(--clr-accent-blue); /* Subtle highlight on hover */
}

.btn.secondary-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.1);
    background-color: var(--clr-primary-900);
}

.btn.secondary-btn:focus {
    outline: none;
    border-color: var(--clr-accent-gold);
    box-shadow: 0 0 0 5px rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
}

/* Hero Buttons Container */
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: var(--space-xl);
}

/*
====================================================================
MAIN CONTENT SECTIONS STYLES
====================================================================
*/
.section-padded {
    padding: var(--section-padding);
    text-align: center;
    color: var(--clr-text-dark);
}

.feature-section {
    background-color: var(--clr-bg-light);
}

.feature-section h2 {
    color: var(--clr-primary-800);
    margin-bottom: var(--space-lg);
}

.feature-section p {
    font-size: var(--fs-body-medium);
    margin-bottom: var(--space-sm);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    color: #555; /* Keep a slightly darker gray for light backgrounds */
}

.feature-section ul {
    display: inline-block;
    text-align: left;
    margin-top: var(--space-md);
    list-style: disc;
    padding-left: var(--space-md);
    color: #444;
}

.feature-section ul li {
    font-size: var(--fs-body-medium);
    margin-bottom: 8px;
}

/* --- Systems Overview Section Styling (Cards) --- */
.system-overview-section {
    background-color: var(--clr-bg-medium);
    border-top: 1px solid var(--clr-border);
}
.system-overview-section .sub-headline {
    font-size: var(--fs-body-medium);
    margin-bottom: var(--space-lg);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    color: #666;
}

.systems-grid {
    display: grid; /* Use CSS Grid for robust layout */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adaptive columns */
    gap: var(--space-xl);
    max-width: var(--container-max-width);
    margin: var(--space-xl) auto;
}

.system-card {
    background-color: #fff;
    padding: var(--space-md);
    border-radius: 15px; /* More pronounced rounded corners */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); /* Stronger shadow */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    color: var(--clr-text-dark);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    height: 100%;
    border: 1px solid transparent; /* For hover effect */
    overflow: hidden; /* Ensure content within card is clipped */
}

.system-card:hover {
    transform: translateY(-12px) scale(1.01); /* More dynamic lift */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    border-color: var(--clr-accent-blue); /* Highlight border on hover */
}

.system-card h3 {
    color: var(--clr-accent-blue-dark);
    margin-bottom: var(--space-sm);
    font-size: var(--fs-h4);
}

.system-card h4 {
    color: #555;
    margin-top: var(--space-sm);
    margin-bottom: 8px;
    font-size: var(--fs-body-medium);
}

.system-card ul {
    list-style: disc inside;
    margin-left: 0;
    padding-left: 0;
    margin-bottom: var(--space-sm);
    color: #444;
}

.system-card ul li {
    font-size: var(--fs-body-small);
    margin-bottom: 8px;
}

/* Text content wrapper for consistent height */
.system-card-text-content {
    min-height: 200px; /* Adjusted slightly, depends on content */
    margin-bottom: var(--space-md);
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align text to top */
    flex-grow: 1;
}

/* Styling for media (GIF/image) inside system cards to match carousel */
.system-media {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    align-self: center;
    margin-top: auto;
    line-height: 0;
}

.system-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.system-media img:hover {
    transform: scale(1.05); /* Zoom effect on hover */
}


/* --- IP Patents Section Styling --- */
.ip-section {
    background-color: var(--clr-bg-light);
    border-top: 1px solid var(--clr-border);
}

.patent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.patent-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: var(--space-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.patent-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
    border-color: var(--clr-accent-gold); /* Highlight on hover */
}

.patent-card h4 {
    color: var(--clr-accent-blue-dark);
    margin-bottom: var(--space-sm);
    font-size: var(--fs-body-medium);
    line-height: 1.3;
}

.patent-card p {
    font-size: var(--fs-body-small);
    color: #555;
    line-height: 1.5;
    margin-bottom: 0;
}

/* --- Prototypes Section Styles --- */
#prototypes {
    background-color: var(--clr-bg-medium);
    color: var(--clr-text-dark);
    text-align: center;
    padding: var(--section-padding);
    border-top: 1px solid var(--clr-border);
}

#prototypes h2 {
    margin-bottom: var(--space-md);
    color: var(--clr-primary-800);
}

#prototypes p {
    max-width: 900px;
    margin: 0 auto var(--space-lg) auto;
    line-height: 1.6;
    font-size: var(--fs-body-medium);
}

.prototype-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-md);
}

.prototype-video-item {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
    background-color: #fff;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.prototype-video-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.prototype-video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin-bottom: var(--space-sm);
}

.prototype-video-item .video-caption {
    margin-top: 0;
    font-size: var(--fs-body-small);
    color: #555;
    text-align: center;
    padding: 0 var(--space-xs);
}

/* --- Vision Section --- */
.vision-section {
    background-color: var(--clr-bg-light);
    border-top: 1px solid var(--clr-border);
}
.vision-section .container p {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.vision-section ul {
    text-align: left;
    list-style: disc;
    padding-left: var(--space-md);
    display: inline-block;
    margin-top: var(--space-md);
    margin-bottom: var(--space-md);
    color: #444;
}
.vision-section ul li {
    font-size: var(--fs-body-medium);
    margin-bottom: 8px;
}

/* --- Carousel Styles --- */
.carousel-container {
    max-width: 900px; /* Slightly larger for modern displays */
    margin: var(--space-xl) auto var(--space-md) auto;
    overflow: hidden;
    border-radius: 15px; /* More rounded */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); /* Stronger shadow */
    aspect-ratio: 16 / 9;
    position: relative;
    background-color: #1a1a1a;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    /* Ensure track is visible and has content */
    display: flex; /* Make sure it's a flex container */
    align-items: center; /* Vertically align items */
    justify-content: center; /* Horizontally align items */
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-image.active-slide {
    opacity: 1;
    z-index: 1;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--clr-text-light);
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    font-size: 1.5em;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 10; /* Above images */
}

.carousel-arrow:hover {
    background-color: var(--clr-accent-blue);
    transform: translateY(-50%) scale(1.05);
}

.prev-arrow {
    left: var(--space-sm);
}

.next-arrow {
    right: var(--space-sm);
}


/* --- About Section --- */
.about-section {
    background-color: var(--clr-bg-medium);
    border-top: 1px solid var(--clr-border);
}

/* Opportunities Section */
.opportunities-section {
    background-color: var(--clr-bg-light);
    border-top: 1px solid var(--clr-border);
}

.about-section h2, .opportunities-section h2 {
    color: var(--clr-primary-800);
    margin-bottom: var(--space-lg);
}

/* Contact Section */
.contact-section {
    background-color: var(--clr-primary-800); /* Dark background for contact */
    color: var(--clr-text-light);
}

.contact-section h2 {
    color: var(--clr-text-light);
    margin-bottom: var(--space-lg);
}

.contact-section p {
    color: var(--clr-text-light);
    font-size: var(--fs-body-medium);
}

.contact-section a {
    color: var(--clr-accent-blue);
    font-weight: bold;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.contact-section a:hover {
    text-decoration: underline;
    color: var(--clr-accent-gold);
}

.social-links {
    margin-top: var(--space-lg);
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.social-links a {
    color: var(--clr-text-light);
    transition: color 0.3s ease, transform 0.2s ease;
}

.social-links a:hover {
    color: var(--clr-accent-blue);
    transform: translateY(-3px) scale(1.1);
}


/* --- PARTNER LOGOS SECTION STYLES --- */
.partner-logos {
    background-color: var(--clr-bg-light);
    border-top: 1px solid var(--clr-border);
}
.partner-logos h2 {
    color: var(--clr-primary-800);
    margin-bottom: var(--space-xl);
}
.partner-logos .logo-list {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg); /* Increased gap */
    margin-top: var(--space-md);
}
.partner-logos .logo-list li {
    flex-basis: 150px; /* Consistent size */
    max-width: 20%;
    text-align: center;
    display: flex; /* For vertical centering of logos */
    align-items: center;
    justify-content: center;
}
.partner-logos .logo-list img {
    max-width: 100%;
    max-height: 80px; /* Slightly smaller for balance */
    width: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}
.partner-logos .logo-list img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05); /* Subtle zoom */
}


/*
====================================================================
FOOTER STYLES
====================================================================
*/
.main-footer {
    background-color: var(--clr-primary-900);
    color: #bbb;
    padding: var(--space-md) 0;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid var(--clr-border);
}

/*
====================================================================
ANIMATIONS
====================================================================
*/

/* Define the fade-in keyframe animation */
@keyframes fadeInSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animation to elements with 'animate-on-load' class */
.animate-on-load {
    opacity: 0;
    animation: fadeInSlideUp 0.8s ease-out forwards;
}

/* Add delays to make elements appear sequentially (optional but nice) */
.content-overlay h1.animate-on-load {
    animation-delay: 0.5s;
}

.content-overlay p.patent-text.animate-on-load {
    animation-delay: 0.7s;
}

.content-overlay p.tagline.animate-on-load {
    animation-delay: 0.9s;
}

.content-overlay .btn.animate-on-load {
    animation-delay: 1.1s;
}

/*
====================================================================
MODAL (POP-UP) STYLES
====================================================================
*/
.modal {
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* More opaque background for modals */
    display: flex; /* Use flex for centering */
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* This is the class that makes the modal visible */
.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: var(--space-xl); /* More generous padding */
    border-radius: 15px; /* More rounded */
    width: 90%;
    max-width: 900px; /* Slightly wider max-width */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); /* Stronger shadow */
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    text-align: left;
    color: var(--clr-text-dark);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    color: var(--clr-accent-blue-dark);
    font-size: var(--fs-h3);
    margin-bottom: var(--space-md);
}

.modal-content h3 {
    color: #555;
    font-size: var(--fs-h4);
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
}

.modal-content p, .modal-content ul {
    font-size: var(--fs-body-medium);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
    color: #555;
}

.modal-content ul {
    list-style: disc inside;
    padding-left: var(--space-md);
}

.modal-content ul li {
    margin-bottom: 8px;
}

.modal-content .patent-status {
    font-size: var(--fs-body-small);
    color: #777;
    font-style: italic;
    margin-top: var(--space-md);
}

/* The Close Button */
.close-button {
    color: #aaa;
    position: absolute;
    top: var(--space-md);
    right: var(--space-lg);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--clr-accent-blue);
    text-decoration: none;
    outline: none;
    transform: rotate(90deg); /* Subtle spin */
}

/*
====================================================================
Web Application Section Styling
====================================================================
*/
.web-app-section {
    background-color: var(--clr-bg-light);
    padding: var(--section-padding);
    text-align: center;
}

.web-app-section h2 {
    color: var(--clr-primary-800);
    margin-bottom: var(--space-md);
}

.web-app-section .sub-headline {
    color: #666;
    margin-bottom: var(--space-xl);
    font-size: var(--fs-body-medium);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.web-app-features {
    display: grid; /* Use grid for features */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    align-items: start; /* Align items to the start of their grid area */
    max-width: var(--container-max-width);
    margin: 0 auto;
}

.feature-item {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    padding: var(--space-lg);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    height: 100%; /* Ensure cards are same height */
    border: 1px solid transparent;
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--clr-accent-gold); /* Highlight on hover */
}

.feature-item h3 {
    color: var(--clr-accent-blue-dark);
    font-size: var(--fs-h4);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.feature-item h3::before {
    /* For the '+' '📈' etc. icons, if they were custom, otherwise font-awesome is used */
    font-size: 1.2em;
    line-height: 1;
}

.feature-item p {
    color: #555;
    line-height: 1.6;
    margin-bottom: var(--space-md);
    font-size: var(--fs-body-medium);
}

.feature-images {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-md);
}

.web-app-screenshot {
    width: 100%;
    max-width: 500px; /* Max width for individual screenshots */
    height: auto;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.web-app-screenshot:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* Specific styling for the image modal content */
.modal-content.image-modal-content {
    background-color: rgba(0,0,0,0.8); /* Darker background for image modal */
    box-shadow: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 98vw; /* Allow larger image modals */
    max-height: 98vh;
    width: auto;
    height: auto;
    border-radius: 15px;
    overflow: hidden; /* Ensure image doesn't break out */
}

#modalImage {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

/* Ensure close button is visible and positioned correctly for image modal */
.modal-content.image-modal-content .close-button {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-md);
    color: var(--clr-text-light);
    text-shadow: 0 0 8px rgba(0,0,0,0.9);
    font-size: 45px; /* Larger close button for images */
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background-color: rgba(0,0,0,0.3); /* Semi-transparent background for button */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

/* Optional: Adjust hover color for close button */
.modal-content.image-modal-content .close-button:hover,
.modal-content.image-modal-content .close-button:focus {
    color: var(--clr-accent-gold);
    background-color: rgba(0,0,0,0.5);
    transform: rotate(180deg);
}

/*
====================================================================
RESPONSIVE DESIGN (Media Queries)
- Adjustments for different screen sizes (phones, tablets, smaller desktops).
- Simplified for direct nav.
====================================================================
*/

/* Tablet / Smaller Desktop: Adjustments */
@media (max-width: 1180px) {
    .container {
        padding: 0 var(--space-lg); /* More padding on larger tablets */
    }

    .systems-grid {
        gap: var(--space-lg);
    }
    .system-card {
        padding: var(--space-md);
    }
    .system-card-text-content {
        min-height: 180px; /* Adjust for potentially less text */
    }

    .patent-grid {
        gap: var(--space-md);
    }

    .web-app-features {
        gap: var(--space-lg);
    }
    .feature-item {
        padding: var(--space-md);
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px; /* Adjust for potentially smaller header on mobile */
    }
    .main-header {
        padding: var(--space-xs) 0; /* Smaller header padding */
    }
    .main-header .logo {
        font-size: var(--fs-h4);
    }
    .main-header .container {
        flex-direction: row;
        justify-content: space-between;
        padding-bottom: 0;
    }
    .main-nav {
        width: auto; /* Allow nav to fit content */
    }
    .main-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-xs);
        padding-top: 0;
    }
    .main-nav li {
        width: auto; /* Let list items size naturally */
    }
    .main-nav a {
        padding: 8px 12px;
        font-size: var(--fs-body-small);
        width: auto;
        text-align: center;
        white-space: nowrap;
    }


    .hero-section {
        min-height: 500px;
        padding-top: 60px; /* Adjust based on new header height */
    }
    .content-overlay {
        padding: var(--space-lg) var(--space-md);
    }
    .hero-section h1 {
        font-size: clamp(2.5rem, 8vw + 1rem, 4rem); /* More aggressive scaling for mobile hero title */
    }
    .hero-section .patent-text {
        font-size: var(--fs-body-medium);
    }
    .hero-section .tagline {
        font-size: var(--fs-body-medium);
    }
    .hero-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: var(--space-sm);
    }
    .btn {
        width: 90%; /* Make buttons wider for easier tapping */
        max-width: 350px; /* Prevent them from becoming too wide */
        margin: 0 auto; /* Center buttons */
        padding: 14px 28px;
        font-size: var(--fs-body-medium);
    }

    .section-padded {
        padding: var(--space-md) 0; /* Further reduced section padding for mobile */
    }

    h2 {
        font-size: clamp(1.8rem, 6vw + 1rem, 2.8rem); /* Scale headings more aggressively */
    }
    p {
        font-size: var(--fs-body-small);
    }
    ul li {
        font-size: var(--fs-body-small);
    }

    .systems-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: var(--space-lg);
        margin: var(--space-lg) auto;
    }
    .system-card {
        padding: var(--space-md);
    }
    .system-card-text-content {
        min-height: auto; /* Allow height to be dynamic on mobile */
    }

    .patent-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: var(--space-md);
    }

    .prototype-video-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: var(--space-md);
    }

    .partner-logos .logo-list {
        gap: var(--space-md);
    }
    .partner-logos .logo-list li {
        flex-basis: 30%; /* Allow 3 per row */
        max-width: 30%;
    }
    .partner-logos .logo-list img {
        max-height: 40px;
    }

    .modal-content {
        padding: var(--space-lg);
        width: 95%;
    }
    .modal-content h2 {
        font-size: var(--fs-h3);
    }
    .modal-content h3 {
        font-size: var(--fs-h4);
    }
    .modal-content p, .modal-content ul {
        font-size: var(--fs-body-small);
    }
    .close-button {
        font-size: 30px;
        top: var(--space-sm);
        right: var(--space-sm);
        width: 40px;
        height: 40px;
    }
    .modal-content.image-modal-content .close-button {
        font-size: 35px;
        width: 45px;
        height: 45px;
    }
}

/* Very Small Mobile Devices (e.g., old phones) */
@media (max-width: 480px) {
    .main-header .logo {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
    }
    .main-nav ul {
        gap: var(--space-xs); /* Even smaller gap if needed */
        justify-content: space-around; /* Distribute space more evenly */
    }
    .main-nav a {
        padding: 6px 10px; /* Even smaller padding */
        font-size: 0.7rem; /* Make font even smaller if needed */
    }

    .hero-section h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }
    .hero-section .patent-text {
        font-size: var(--fs-body-small);
    }
    .hero-section .tagline {
        font-size: var(--fs-body-small);
    }
    .btn {
        font-size: var(--fs-body-small);
        padding: 10px 20px;
    }
    .partner-logos .logo-list li {
        flex-basis: 45%; /* Allow 2 per row */
        max-width: 45%;
    }
    .partner-logos .logo-list img {
        max-height: 30px;
    }
}