:root {
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --lime-green: #32CD32;
    --text-color: #f0f0f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #3A2618;
    color: var(--text-color);
    overflow-x: hidden;
    position: relative;
}

.bg-texture {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: -2;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.06"/%3E%3C/svg%3E');
    animation: texturePulse 10s infinite alternate ease-in-out;
    will-change: transform, opacity; /* Hardware acceleration */
}

@keyframes texturePulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.1); opacity: 1; }
}

.glass-nav {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    background: transparent; 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 12px 40px;
    z-index: 100;
    transition: background 0.3s ease;
    overflow: hidden; 
}

.glass-nav::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.1), transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0; 
    pointer-events: none;
    will-change: opacity;
}

.glass-nav:hover::before { opacity: 1; }
.glass-nav:hover { background: rgba(255, 255, 255, 0.02); }

.glass-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 1; 
    transition: color 0.3s ease;
}

.glass-nav a:hover { color: var(--lime-green); }

.hero-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; 
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    position: relative;
    z-index: 1; 
}

#model-container {
    position: absolute;
    top: 60%; 
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw; 
    height: 120vh; 
    max-width: 100vw;
    z-index: -1; 
    pointer-events: none;
    opacity: 0; 
    transition: opacity 2s ease-in-out;
    will-change: opacity;
}

#model-container.loaded { opacity: 1; }

.hero-title {
    font-size: 4.5rem;
    font-weight: 900;
    color: #ffffff; 
    mix-blend-mode: difference; 
    margin-bottom: 10px;
    letter-spacing: -2px;
}

/* --- Brain Fact Annotation --- */
.brain-fact {
    position: absolute;
    top: 15%; 
    left: 62%; 
    
    max-width: 400px; /* Increased width since they are side-by-side now */
    
    display: flex;
    flex-direction: row; /* <--- THIS puts them side-by-side! */
    align-items: center; /* Vertically centers the text with the arrow */
    gap: 15px; /* Adds a nice space between the arrow and the text */
    
    z-index: 10;
    pointer-events: auto; 

    opacity: 0; 
    transition: opacity 2s ease-in-out; /* Matches the exact speed of the brain's fade-in */
}

.brain-arrow {
    flex-shrink: 0; /* Prevents the arrow from getting squished by the text */
    margin: 0; /* Resets any old margins */
    transform: scaleY(-1) rotate(60deg); /* Flips the arrow vertically and rotates it to point left */
    transform-origin: center; /* Ensures the arrow rotates around its center */
}

.brain-fact.loaded {
    opacity: 1;
}

.fact-text {
    font-family: 'Just Another Hand', cursive; 
    font-size: 1.4rem; 
    color: #aaaaaa;
    line-height: 1.2;
    font-weight: 400;
    text-align: left; /* Changed back to left so it reads naturally next to the arrow */
}

.fact-link {
    color: var(--lime-green);
    text-decoration: none;
    font-weight: 200;
    font-size: 0.5rem; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    transition: color 0.3s ease;
}

.fact-link:hover {
    color: #ffffff;
}

.subheading, .body-text {
    color: #ffffff; 
    mix-blend-mode: difference;
}

.subheading {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 20px;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.body-text {
    /* Apply Cedarville Cursive */
    font-family: 'Cedarville Cursive', cursive;
    
    /* Increased size for better readability */
    font-size: 1.4rem; 
    
    font-weight: 300;
    max-width: 600px;
    margin-bottom: 40px;
    color: #dfdfdf;
    mix-blend-mode: difference;
}

.social-links {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    mix-blend-mode: difference;
}

.social-links > a, .mail-icon {
    color: #fff;
    font-size: 1.8rem;
    transition: color 0.3s;
    text-decoration: none;
}

.social-links a:hover { color: var(--lime-green); }

.email-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arrow-container {
    position: absolute;
    top: 100%; 
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    pointer-events: none;
    margin-top: 5px;
}

.handwritten-text {
    font-family: 'Just Another Hand', cursive;
    color: var(--lime-green);
    font-size: 1.8rem;
    margin-top: -5px;
}

section {
    padding: 80px 20px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-align: center;
}

.frosted-container, .frosted-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

.humidify {
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.humidify::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.08), transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    pointer-events: none;
    will-change: opacity;
}

.humidify:hover::before { opacity: 1; }
.humidify:hover { border-color: rgba(255, 255, 255, 0.3); }

.humidify > * {
    position: relative;
    z-index: 1; 
}

.about-container {
    display: flex;
    align-items: center;
    padding: 40px;
    gap: 40px;
}

.square-photo {
    width: 250px; height: 250px;
    object-fit: cover;
    border-radius: 15px;
}

.about-text h2 { text-align: left; margin-bottom: 20px; }
.about-text p { line-height: 1.8; color: #ccc; }

.filter-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 8px 24px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--lime-green);
    color: #000;
    border-color: var(--lime-green);
}

.projects-grid, .experience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 30px;
}

.frosted-card {
    display: flex;
    padding: 24px;
    gap: 20px;
    cursor: pointer;
}

.card-img {
    width: 100px; height: 100px;
    object-fit: cover;
    border-radius: 10px;
}

.card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-info h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card-info p { font-size: 0.9rem; color: #aaa; margin-bottom: 15px; line-height: 1.5; }

.keyword-tag {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--lime-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90%;
    max-width: 650px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 2.5rem;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}
.close-btn:hover { color: #fff; }

#modal-img {
    width: 100%; height: 350px;
    object-fit: cover;
    border-radius: 15px;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.modal-icon { font-size: 1.5rem; color: #fff; }
.modal-icon:hover { color: var(--lime-green); }

footer {
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 60px;
}

@media(max-width: 768px) {
    .hero-title { font-size: 3rem; }
    .glass-nav { gap: 15px; padding: 15px 20px; flex-wrap: wrap; }
    .about-container { flex-direction: column; text-align: center; }
    .projects-grid, .experience-grid { grid-template-columns: 1fr; }
    .arrow-container { display: none; }
    #model-container { width: 100vw; height: 100vw; } 
    .brain-fact {
        display: none; /* Hides the extra fact on small phones to keep the screen clean */
    }
}