@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

* {
    box-sizing: border-box;
    background-color: #111;
    color: white;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Mono', monospace;
    margin: 0;
    padding: 20px;
}

.section-card {
    border: 2px solid #ccc;
    margin-top: 20px;
    padding: 20px;
    min-height: 200px;
}

.experiments-grid {
    display: flex;
    gap: 40px;
    /* Increased spacing */
    flex-wrap: wrap;
    margin-top: 30px;
    justify-content: center;
    /* Center cards if odd number or restricted width */
}

.experiment-card {
    border: 2px solid #333;
    /* Outer solid border */
    padding: 20px;
    flex: 1 1 350px;
    /* Allow growing, start at 350px width */
    min-width: 300px;
    background-color: #050505;
    position: relative;
    border-radius: 10px;
    /* Link styling resets */
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.experiment-card:hover {
    transform: translateY(-5px);
    border-color: #555;
    background-color: #0a0a0a;
}

/* Comms Uplink Styles */
.comms-container {
    background-color: #000;
    border: 1px solid #333;
    padding: 20px;
    font-family: 'Space Mono', monospace;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 5px;
}

.comms-log {
    height: 200px;
    overflow-y: auto;
    border-bottom: 1px solid #333;
    margin-bottom: 15px;
    padding-bottom: 15px;
    color: #00ff00;
    /* Terminal Green */
    font-size: 0.9rem;
}

.comms-message {
    margin-bottom: 5px;
}

.system-message {
    opacity: 0.7;
}

.user-message {
    color: #00ffff;
    /* Cyan for user */
}

.comms-input-area {
    display: flex;
    gap: 10px;
}

.comms-input {
    flex-grow: 1;
    background-color: #111;
    border: 1px solid #555;
    color: #00ff00;
    padding: 10px;
    font-family: 'Space Mono', monospace;
    outline: none;
    transition: border-color 0.2s;
}

.comms-input.full-width {
    width: 100%;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.auth-forms {
    margin-top: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.outline-btn {
    background-color: transparent;
    border: 1px solid #555;
    color: #888;
}

.outline-btn:hover {
    border-color: #00ff00;
    color: #00ff00;
}

.auth-divider {
    text-align: center;
    color: #444;
    margin: 15px 0;
}

.google-btn {
    width: 100%;
    background-color: #1a1a1a;
    border-color: #333;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #333;
    padding-bottom: 10px;
    margin-bottom: 10px;
    color: #00ffff;
    font-size: 0.8rem;
}

.text-btn {
    background: none;
    border: none;
    color: #ff3333;
    font-family: 'Space Mono', monospace;
    cursor: pointer;
    text-decoration: underline;
}

.text-btn:hover {
    color: #ff0000;
}

.comms-input:focus {
    border-color: #00ff00;
}

.comms-send-btn {
    background-color: #003300;
    color: #00ff00;
    border: 1px solid #00ff00;
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    transition: all 0.2s;
}

.comms-send-btn:hover {
    background-color: #00ff00;
    color: #000;
}

.experiment-card::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px dashed #444;
    border-radius: 6px;
    pointer-events: none;
    z-index: 1;
}

/* Content needs to be above the pseudo-element */
.experiment-card>* {
    position: relative;
    z-index: 2;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.1rem;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.experiment-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background-color: transparent;
}

.card-details {
    font-size: 0.9rem;
    line-height: 1.8;
}

.detail-row {
    display: flex;
    margin-bottom: 4px;
}

.detail-label {
    min-width: 140px;
    color: #888;
}

.detail-value {
    color: #ddd;
}

.status-online {
    color: #00ffff;
    /* Cyber cyan */
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.status-warning {
    color: #ffaa00;
}

.status-active {
    color: #00ff00;
}

nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    height: 90px;
    border: 2px solid #ccc;
}

.nav-links {
    display: flex;
    align-items: center;
    padding: 20px;
}

/* Burger Menu - Hidden on Desktop */
.burger-menu {
    display: none;
    /* show only on mobile via media query */
    cursor: pointer;
    padding: 10px;
    /* Reduced from 12px */
    z-index: 1001;
    align-items: center;
    gap: 4px;
    /* Reduced gap */
    font-family: 'Space Mono', monospace;
    color: #00ff00;
    /* locked state matches green spans */
    text-shadow: 0 0 6px rgba(0, 255, 0, 0.7);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.burger-menu .code-arrow {
    font-size: 0.8rem;
    /* Reduced from 0.9rem */
    letter-spacing: 1px;
    color: inherit;
    transition: color 0.3s ease;
    /* Ensure transition exists */
}

.burger-menu .burger-lock {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.burger-menu .burger-lock i {
    position: absolute;
    font-size: 1rem;
    color: inherit;
    /* Inherit green/cyan from parent */
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.burger-menu .lock-closed {
    color: #00ff00 !important;
}

.burger-menu .lock-open {
    opacity: 0;
    transform: translateY(-4px);
    color: #00ffff;
}

.burger-menu.active {
    color: #00ffff;
    /* unlocked cyan */
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.burger-menu.active .code-arrow {
    color: inherit;
}

.burger-menu.active .lock-closed {
    opacity: 0;
    transform: translateY(4px);
}

.burger-menu.active .lock-open {
    opacity: 1;
    transform: translateY(0);
    color: #00ffff;
}

@media (min-width: 769px) {

    /* Force-hide burger on desktop widths */
    .burger-menu {
        display: none !important;
    }
}

nav div button {
    margin-left: 20px;
    border: 1px solid #555;
    background-color: transparent;
    color: #eee;
    font-family: 'Space Mono', monospace;
    /* Match body font */
    font-size: 1rem;
    /* Adjust size */
    padding: 10px 20px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

nav div button a {
    text-decoration: none;
    color: inherit;
}

nav div button a:hover {
    background-color: #eee;
    color: #111;
    border-color: #eee;
}

nav div img {
    width: 120px;
    border: none;
    background-color: transparent;
}

nav div:first-child {
    border: none;
    background-color: transparent;
}

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto auto;
    gap: 20px;
    margin-bottom: 40px;
}

.bento-cell {
    background-color: #080808;
    border: 1px dashed #666;
    border-radius: 20px;
    padding: 50px 25px 25px 25px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.bento-cell:hover {
    border-color: #00ffff;
    transform: translateY(-2px);
}

/* Cell Specific Layouts */

/* Cell 1: Intro (Top Left) */
.bento-intro {
    grid-column: span 2;
    grid-row: span 1;
    grid-row: span 1;
    justify-content: start;
}

.name-container {
    display: flex;
    align-items: baseline;
    margin-bottom: 0px;
    /* H1 has margin */
}

.bento-intro h3 {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 5px 0;
    letter-spacing: 2px;
}

.bento-intro h1 {
    font-size: 2.5rem;
    color: #fff;
    margin: 0 0 15px 0;
    line-height: 1.1;
    text-transform: uppercase;
    text-align: left;
}

/* Cell 2: Photo (Top Right - Large) */
.bento-photo {
    grid-column: span 2;
    grid-row: span 2;
    padding: 0;
    border: none;
    overflow: hidden;
    background: transparent;
}

.bento-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid #333;
}

/* Cell 3: Bio (Middle Left) */
.bento-bio {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-bio p {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Cell 4: Stats (Bottom Left) */
.bento-stats {
    grid-column: span 1;
}

.stat-item {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.download-link {
    color: #00ff00;
    text-decoration: none;
    border: 1px solid #005500;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 5px;
    font-size: 0.8rem;
    text-align: center;
    transition: all 0.2s;
}

.download-link:hover {
    background-color: #00ff00;
    color: #000;
}

/* Cell 5: Tech (Bottom Middle) */
.bento-tech {
    grid-column: span 1;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tags span {
    background-color: #1a1a1a;
    color: #00ffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid #333;
}

/* Cell 6: Personal (Bottom Right - underneath photo if needed, or sidebar)
   For 4 columns:
   Row 1: Intro (2), Photo (2)
   Row 2: Bio (2), Photo (cont.)
   Row 3: Stats (1), Tech (1), Personal (2)
*/
.bento-personal {
    grid-column: span 2;
}

.personal-group {
    margin-bottom: 10px;
}

.group-label {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 3px;
}

/* Common Labels */
.cell-label {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 0.7rem;
    color: #444;
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-intro {
        grid-column: span 2;
    }

    .bento-photo {
        grid-column: span 2;
        grid-row: auto;
        height: 300px;
    }

    .bento-bio {
        grid-column: span 2;
    }

    .bento-stats {
        grid-column: span 1;
    }

    .bento-tech {
        grid-column: span 1;
    }

    .bento-personal {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .bento-grid {
        display: flex;
        flex-direction: column;
    }

    .bento-photo {
        height: 330px;
    }
}

/* Restored Mobile Styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    /* Redesign Nav for Mobile with Burger */
    nav {
        flex-direction: row;
        /* Keep row for logo + burger */
        justify-content: space-between;
        align-items: center;
        height: 70px;
        position: relative;
    }

    /* Hide links by default on mobile */
    .nav-links {
        display: none;
        /* JS will toggle this to flex/block */
        flex-direction: column;
        position: absolute;
        top: 70px;
        /* Below nav bar */
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.95);
        border-bottom: 2px solid #00ff00;
        padding: 20px 0;
        z-index: 1000;
        gap: 15px;
        box-shadow: 0 5px 20px rgba(0, 255, 0, 0.1);
    }

    /* Show links when active */
    .nav-links.active {
        display: flex;
    }

    .burger-menu {
        display: flex;
    }

    nav .nav-links button {
        margin: 0;
        width: 80%;
        text-align: center;
        border-color: #333;
    }

    nav .nav-links button:hover {
        border-color: #00ff00;
        color: #00ff00;
    }

    /* Adjust Grid */
    .experiment-card {
        flex: 1 1 100%;
        /* Full width on mobile */
        min-width: 0;
    }

    .experiments-grid {
        gap: 20px;
    }

    /* Comms Mobile */
    .comms-container {
        padding: 10px;
    }

    .comms-input-area {
        flex-direction: column;
    }

    .comms-send-btn {
        width: 100%;
    }

    #matrix-identity {
        text-align: left;
    }

    .detail-label {
        margin-bottom: 5px;
        /* Add spacing between label and value when stacked */
    }

    .name-container,
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .name-container h1 {
        margin-top: 5px;
        margin-bottom: 10px;
        font-size: 1.8rem;
        /* Prevent wrapping on small screens */
        line-height: 1.2;
    }

    .bento-cell {
        padding: 40px 20px 20px 20px;
        /* Uniform padding for all cells on mobile */
    }
}