/* 1. GLOBAL VARIABLES & RESET */
:root {
    --bg-color: #0a0a0a;
    --text-color: #a0a0a0;
    --accent-color: #e6a323; /* Industrial yellow/orange */
    --border-color: #333333;
}

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

/* 2. BASE TYPOGRAPHY */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace; /* Classic terminal feel */
    line-height: 1.6;
    padding: 2rem;
}

a {
    color: var(--text-color);
    text-decoration: none;
}

a:hover {
    color: var(--accent-color);
}

h1, h2 {
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-weight: normal;
}

/* 3. HEADER LAYOUT */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 3rem;
}

nav a {
    margin-left: 2rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* 4. THE PROJECT GRID */
main {
    max-width: 1200px;
    margin: 0 auto;
}

section {
    margin-bottom: 4rem;
}

.project-grid {
    display: grid;
    /* This automatically creates columns that fit the screen width */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    background-color: #111;
    transition: border-color 0.3s ease;
}

.project-card:hover {
    border-color: var(--accent-color);
}

.project-card img {
    width: 100%;
    height: auto;
    display: block;
    background-color: #222; /* Acts as a placeholder box before images load */
    aspect-ratio: 1 / 1; /* Forces a perfect square shape */
    object-fit: cover;
}

.project-card p {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--accent-color);
}

/* 5. FOOTER */
footer {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 4rem;
    font-size: 0.85rem;
    color: #555;
}

/* 6. THE LAB HOVER EFFECTS */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.lab-card {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    background-color: #111;
}

/* The bounding box that holds both images */

.image-stack {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4; /* <-- CHANGE THIS LINE (try 9 / 16 if it's really tall) */
    background-color: #222;
    overflow: hidden;
}

/* Apply to both images so they overlap perfectly */
.img-top, .img-bottom {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Styling for the broken image text before you add real files */
    color: #555; 
    text-align: center;
    line-height: 200px; 
}

/* The top image gets a transition timer for a smooth fade */
.img-top {
    background-color: #2a2a2a; /* Slightly lighter gray so you can see the change */
    transition: opacity 0.4s ease;
    z-index: 2; /* Forces this image to the front */
}

/* When the mouse hovers over the card, the top image opacity drops to zero */
.lab-card:hover .img-top {
    opacity: 0;
}

.lab-card p {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-color);
}
