/* =========================================
   CSS VARIABLES (THEME CONFIGURATION)
   ========================================= */
:root {
    /* -----------------------------------------------------------
     * COLOR PALETTE
     * Change these hex codes to update your site's color scheme.
     * ----------------------------------------------------------- */
    --bg-color: #0c0c0c;
    /* Main background color */
    --text-color: #e0e0e0;
    /* Main text color */
    --accent-color: #333333;
    /* Border color for cards and lines */
    --card-bg: #0c0c0c;
    /* Background for project cards */
    --hover-color: #555555;
    /* Color when hovering over elements */
    --grid-gap: 30px;
    /* Space between grid items */

    /* -----------------------------------------------------------
     * TYPOGRAPHY
     * Change the font names here to update your site's fonts.
     * Make sure you have imported the new fonts in index.html first!
     * ----------------------------------------------------------- */
    /* Headlines and big text */
    --font-heading: 'Instrument Sans', sans-serif;
    /* Body text and paragraphs */
    --font-body: 'DM Mono', monospace;
}


/* =========================================
   RESET & BASE STYLES
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Page Section Animation */
.page-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
    border-radius: 0;
    /* Brutalist - sharp edges */
}

ul {
    list-style: none;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

section {
    padding: 80px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================
   NAVIGATION
   ========================================= */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 40px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    z-index: 1000;
}

.logo {
    font-family: 'DM Mono', monospace;
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #bbb;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 1px;
    color: #bbb;
    opacity: 0.7;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
    color: #fff;
}

/* Mobile Menu */
.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* =========================================
   COMPONENTS
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid var(--text-color);
    background: transparent;
    color: var(--text-color);
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

/* =========================================
   GRID SYSTEM (3 Column Fixed)
   ========================================= */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 Columns Fixed */
    gap: 40px;
    /* Spacing between cards */
}

.project-card {
    background-color: var(--card-bg);
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--accent-color);
    /* Visible by default */
}

.project-card:hover {
    border-color: var(--text-color);
    /* Highlight on hover */
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    /* Consistent aspect ratio */
    overflow: hidden;
    margin-bottom: 20px;
    background-color: var(--card-bg);
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
    opacity: 0.9;
}

.project-card:hover img {
    opacity: 1;
}

.card-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.card-desc {
    font-size: 1rem;
    color: #bbb;
    line-height: 1.5;
}

.card-tags {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border: 1px solid #333;
    color: #888;
    text-transform: uppercase;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    padding: 40px 5%;
    border-top: 1px solid var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 60px;
}

/* =========================================
   ANIMATIONS
   ========================================= */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   HOME HERO (Centered)
   ========================================= */
.home-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0 5% 15vh 5%;
    margin: 0;
    max-width: none;
}

.hero-large {
    text-align: center;
    width: 100%;
    container-type: inline-size;
}

.hero-large h1 {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 11.5cqi;
    /* Reverted scale to fit cleanly edge-to-edge without overflowing */
    text-transform: uppercase;
    letter-spacing: 0em;
    font-weight: 400;
    margin-bottom: 25px;
    line-height: 1;
    color: var(--text-color);
    white-space: nowrap;
}

.hero-large p {
    font-family: 'DM Mono', monospace;
    font-style: normal;
    font-weight: 300;
    font-size: 1.1rem;
    color: #bbb;
    line-height: 1.6;
    letter-spacing: 0.02em;
    text-transform: uppercase;

    /* Center text */
    text-align: center;
    width: auto;
    max-width: 90%;

    /* Center block */
    margin: 15px auto 0 auto;
}

.hero-large p u {
    text-decoration: underline;
    text-underline-position: under;
    text-decoration-thickness: 1px;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 cols on tablet */
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .project-grid {
        grid-template-columns: 1fr;
        /* 1 col on mobile */
    }

    section {
        padding: 60px 5%;
    }

    section {
        padding: 60px 5%;
    }
}

/* =========================================
   TEACHING PAGE STYLES (Refactored from inline)
   ========================================= */
.teaching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
}

.course-card {
    border: 1px solid var(--accent-color);
    padding: 30px;
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    transition: transform 0.3s ease, border-color 0.3s ease;
    /* Match Project Card */
}

.course-card:hover {
    border-color: var(--text-color);
    /* Add missing Lift Effect */
}

.course-semester {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
    font-family: monospace;
    text-transform: uppercase;
}

.course-card h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.course-card p {
    color: #aaa;
    margin-bottom: 20px;
    flex-grow: 1;
}

.resource-link {
    font-size: 0.9rem;
    text-decoration: underline;
    text-decoration-color: #555;
    transition: all 0.3s ease;
}

.resource-link:hover {
    color: #fff;
    text-decoration-color: #fff;
}

/* =========================================
   RESEARCH PAGE STYLES
   ========================================= */
.research-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.research-item {
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 40px;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
}

.research-date {
    font-size: 0.9rem;
    color: #666;
    font-family: monospace;
}

.research-type {
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    margin-top: 5px;
}

.research-content h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 10px;
}

.research-authors {
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 15px;
}

.research-content p {
    color: #aaa;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    transition: color 0.3s ease;
}

.research-content p:hover {
    color: #fff;
}

.research-content p.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    color: #ccc;
}

.research-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.research-keyword {
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #fff;
    border: 1px solid #fff;
    padding: 4px 8px;
}

.read-more {
    text-decoration: underline;
    font-size: 0.9rem;
    color: #fff;
}

@media (max-width: 768px) {
    .research-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* =========================================
   ABOUT PAGE STYLES
   ========================================= */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
    margin-top: 40px;
}

.bio-text {
    font-size: 1.1rem;
    color: #ddd;
}

.bio-text p {
    margin-bottom: 20px;
}

.profile-img {
    width: 100%;
    filter: grayscale(100%);
    transition: filter 0.5s;
}

.profile-img:hover {
    filter: grayscale(0%);
}

.contact-block {
    margin-top: 60px;
    padding-top: 60px;
    border-top: 1px solid var(--accent-color);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.contact-link {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
}

.contact-link:hover {
    text-decoration-color: #fff;
    color: #ccc;
}

@media (max-width: 900px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* =========================================
   SUBTLE GRAIN NOISE EFFECT
   To remove this effect, simply delete or comment out this entire block!
   ========================================= */
body::after {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.12;
    /* Lower opacity as screen mode is much brighter */
    mix-blend-mode: screen;
    /* Screen blends the grain nicely with dark bg */
    pointer-events: none;
    /* Let clicks pass through */
    z-index: 9999;
    /* Put it visually on top of everything */
    animation: grain 1s steps(10) infinite;
}

@keyframes grain {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -5%);
    }

    20% {
        transform: translate(-10%, 5%);
    }

    30% {
        transform: translate(5%, -10%);
    }

    40% {
        transform: translate(-5%, 15%);
    }

    50% {
        transform: translate(-10%, 5%);
    }

    60% {
        transform: translate(10%, 0%);
    }

    70% {
        transform: translate(0%, 10%);
    }

    80% {
        transform: translate(3%, 15%);
    }

    90% {
        transform: translate(-10%, 5%);
    }
}