/* ==========================================================================
   NASA HUNCH AI PLANT LAB - SYSTEM STYLESHEET
   Fonts: Montserrat (Headers) & Open Sans (Body)
   ========================================================================== */

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat-VariableFont_wght.ttf') format('truetype-variations'),
         url('fonts/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/Montserrat-Italic-VariableFont_wght.ttf') format('truetype-variations'),
         url('fonts/Montserrat-Italic-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans-VariableFont_wdth,wght.ttf') format('truetype-variations'),
         url('fonts/OpenSans-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans-Italic-VariableFont_wdth,wght.ttf') format('truetype-variations'),
         url('fonts/OpenSans-Italic-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 300 800;
    font-style: italic;
    font-display: swap;
}

:root {
    --bg-dark: #080C14;
    --bg-surface: #0D131F;
    --card-bg: rgba(15, 23, 42, 0.65);
    --card-border: rgba(34, 197, 94, 0.3);
    --accent-green: #22C55E;
    --accent-green-glow: rgba(34, 197, 94, 0.15);
    --accent-purple: #8B5CF6;
    --accent-cyan: #00E5FF;
    --accent-danger: #EF4444;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

html {
    /* Keeps anchor targets clear of the sticky header (70px bar + breathing room) */
    scroll-padding-top: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    /* "clip" (not "hidden") so the page can't scroll sideways without turning <body>
       into a scroll container, which would break the sticky header. */
    overflow-x: clip;
    background-image:
        radial-gradient(circle at 15% 15%, rgba(34, 197, 94, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.15) 0%, transparent 45%);
    background-attachment: fixed;

    
}

/* Typography & Headers */
h1, h2, h3, h4, .section-title, .logo, .nav-links a, .btn, .badge, .status-badge {
    font-family: var(--font-heading);
}

.text-green { color: var(--accent-green); font-weight: 600; }
.text-danger, .text-alert { color: var(--accent-danger); font-weight: 600; }

/* Layout Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 12, 20, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* The blur lives on a pseudo-element instead of <header> itself. A backdrop-filter on
   <header> turns it into the containing block for position:fixed children, which
   pins the mobile menu drawer to the header instead of the screen. */
header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent-green);
}

/* Hamburger Toggle Button */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.hamburger, .hamburger::before, .hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    transition: transform 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

/* Hamburger Active Transform */
.menu-toggle.active .hamburger {
    background-color: transparent;
}

.menu-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
    background-color: var(--accent-green);
}

.menu-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
    background-color: var(--accent-green);
}



/* Hero Section */
.hero {
    padding: 6rem 0 4rem;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

.hero-title span {
    color: var(--accent-green);
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Buttons & Badges */
.btn {
    padding: 0.85rem 1.75rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-green);
    color: #000;
    border: none;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--accent-green);
    color: #fff;
}

.badge {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-purple {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.15);
}

.badge-inline {
    margin-bottom: 0.5rem;
    display: inline-block;
}

.status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.status-badge.healthy { 
    background: rgba(34, 197, 94, 0.2); 
    color: var(--accent-green); 
    border: 1px solid var(--accent-green); 
}

.status-badge.alert { 
    background: rgba(239, 68, 68, 0.2); 
    color: var(--accent-danger); 
    border: 1px solid var(--accent-danger); 
}

/* Card System */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; 
    left: 0;
    width: 8px; 
    height: 8px;
    border-top: 2px solid var(--accent-green);
    border-left: 2px solid var(--accent-green);
    border-top-left-radius: 16px;
}

.card-header-flex, .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 1.3rem;
    max-width: 70%;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Placeholders & Media */
.media-placeholder {
    width: 100%;
    height: 240px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed var(--card-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.media-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cad-img {
    background: rgba(0, 0, 0, 0.2);
}

.hero-media { height: 320px; }
.team-media { height: 300px; margin-bottom: 0; }

/* Lists & Tables */
.section-title {
    font-size: 2.2rem;
    color: var(--accent-green);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}

.overview-section {
    padding: 4rem 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.bullet-list {
    list-style: none;
    margin-top: 1rem;
}

.bullet-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
}

.bullet-list li::before {
    content: "•";
    color: var(--accent-green);
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -0.2rem;
}

.hardware-section { padding-top: 2rem; }

.capabilities-grid {
    padding: 2rem 0 4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.spec-table td {
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.spec-table td:first-child {
    color: var(--accent-green);
    font-weight: 600;
    width: 40%;
}

.spec-table td:last-child {
    color: var(--text-muted);
}

/* Dashboard & Carousel Simulation */
.dashboard-sim { padding: 4rem 0; }

.plant-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1.5rem;
    padding-top: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-green) var(--bg-dark);
}

.plant-card {
    flex: 0 0 calc(33.333% - 1rem);
    min-width: 300px;
    scroll-snap-align: start;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    backdrop-filter: blur(12px);
    list-style: none;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.plant-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-green);
}

.img-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.plant-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.metric {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.6rem;
    border-radius: 6px;
}

.m-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.m-val {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Modal Overlay */
#modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(8, 12, 20, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#modal-overlay.modal-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2.25rem 2rem 2rem;
    width: 90%;
    max-width: 480px;
    position: relative;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 25px var(--accent-green-glow);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

#modal-overlay.modal-hidden .modal-card {
    transform: translateY(-15px);
}

#modal-close {
    position: absolute;
    top: 16px; right: 20px;
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

#modal-close:hover { color: var(--accent-danger); }

#modal-title {
    color: var(--accent-green);
    font-size: 1.2rem;
    font-weight: 700;
}

#modal-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-top: 0.75rem;
}

/* Team Section & GitHub Link */
.team-section {
    padding: 4rem 0 6rem;
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 3rem;
    align-items: center;
}

.team-photo-box {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.team-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.team-info {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.email-sub { font-size: 0.85rem; }

.team-info { overflow-wrap: anywhere; }

.github-link {
    color: var(--accent-green);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.github-link:hover {
    color: var(--accent-cyan);
}

/* Footer */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3rem 0;
    background: var(--bg-surface);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-flex {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-title {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    text-align: center;
}

/* Responsive Layout */
/* Responsive Navigation Breakpoint */
@media (max-width: 850px) {
    .menu-toggle {
        display: flex; /* Flexbox centering guarantees visible icon alignment */
    }

    .nav-links {
        position: fixed;
        top: 71px; /* 70px nav bar + 1px header border */
        right: 0;
        width: 80%;
        max-width: 280px;
        height: calc(100vh - 71px);
        height: calc(100dvh - 71px); /* tracks the phone's collapsing browser toolbar */
        background: rgba(8, 12, 20, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: flex-start;
        padding: 2.5rem 2rem;
        gap: 1.5rem;
        border-left: 1px solid var(--card-border);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
        
        /* Smooth GPU-accelerated drawer translation */
        transform: translateX(100%);
        /* visibility flips after the slide-out finishes, so closing animates too */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
        visibility: hidden;
        pointer-events: none;
        overflow-y: auto; /* Enables vertical scrolling within drawer if screen height is low */
    }

    .nav-links.active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
    }
}

/* Tablet & mobile: stack the two-column layouts into one column.
   minmax(0, 1fr) lets columns shrink below their content's natural width,
   which is what stops long titles/tables from stretching the page sideways. */
@media (max-width: 900px) {
    .hero,
    .overview-section,
    .capabilities-grid,
    .team-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    .hero { padding: 3rem 0 2rem; }
    .overview-section { padding: 2rem 0; }
    .capabilities-grid { padding: 1rem 0 2rem; }
    .team-section { padding: 2rem 0 4rem; }

    .hero-title { font-size: clamp(2rem, 9vw, 3.5rem); }
}

/* Phones */
@media (max-width: 600px) {
    .container { padding: 0 1rem; }
    .card { padding: 1.25rem; }

    .section-title { font-size: 1.6rem; }
    .section-subtitle { margin-bottom: 1.5rem; font-size: 0.95rem; }
    .hero-text p { font-size: 1rem; }

    .hero-cta .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .hero-cta .btn-secondary { padding: 0.85rem 1.75rem; }

    .hero-media,
    .team-media { height: 240px; }

    .card-header-flex {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .dashboard-sim { padding: 2rem 0; }

    /* Show a sliver of the next card so it's obvious the carousel swipes */
    .plant-card {
        flex-basis: 85%;
        min-width: 260px;
    }
}