/* --- CSS Variables --- */
:root {
    /* Palette retained */
    --bg-main: #0a0a0a;          /* Deepest Black */
    --bg-card: rgba(30, 30, 30, 0.4); /* Glass Effect Base */
    
    /* Text */
    --text-main: #EAE5D8;        /* Champagne */
    --text-muted: #9ca3af;       /* Cool Grey */
    
    /* Accents */
    --accent-gold: #D4AF37;      
    --accent-gold-glow: rgba(212, 175, 55, 0.4); 
    --accent-emerald: #1F3623;
    
    /* Functional */
    --font-heading: 'Playfair Display', serif; 
    --font-body: 'Inter', sans-serif;          
    --font-mono: 'Fira Code', monospace;       
    
    --transition: all 0.3s ease-in-out;
    --glass-border: 1px solid rgba(212, 175, 55, 0.15);
    --glass-blur: blur(12px);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    
    /* Cyber-grid background */
    background-image: 
        linear-gradient(rgba(212, 175, 55, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* --- Typography --- */
h1 {
    font-family: var(--font-heading);
    font-weight: 700;
}

h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 3rem;
    display: inline-block;
    background: linear-gradient(to right, var(--text-main), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h3 {
    font-family: var(--font-body); 
    font-weight: 600;
    letter-spacing: -0.5px;
}

.overline {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.5rem;
}

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

ul { list-style: none; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 25px;
}

.section-padding { padding: 100px 0; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(31, 54, 35, 0.3); /* Low opacity emerald */
    color: var(--accent-gold);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid var(--accent-gold);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--accent-gold);
    color: #000;
    box-shadow: 0 0 15px var(--accent-gold-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    margin-left: 15px;
}

.btn-outline:hover {
    border-color: var(--accent-gold);
    color: #000;
}

/* --- Glassmorphism Nav --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.85); 
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 700;
}

.logo span { color: var(--accent-gold); }

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

.nav-links a {
    font-family: var(--font-mono); 
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-gold);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0; height: 1px;
    bottom: -5px; left: 0;
    background-color: var(--accent-gold);
    transition: width 0.3s;
}

.nav-links a:hover::after { width: 100%; }

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-main);
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    background: radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 50%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(145deg, #fff 10%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.typewriter {
    font-family: var(--font-mono);
    color: var(--accent-gold);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: inline-block;
    background: rgba(212, 175, 55, 0.1);
    padding: 4px 12px;
    border-radius: 4px; 
}

/* Circular Profile */
.hero-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-image-wrapper::before {
    content: '';
    position: absolute;
    width: 370px;
    height: 370px;
    border-radius: 50%;
    border: 1px dashed rgba(212, 175, 55, 0.3);
    animation: rotate 20s linear infinite;
}

@keyframes rotate { 100% { transform: rotate(360deg); } }

.profile-img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.15); 
    filter: grayscale(30%) contrast(110%);
    transition: var(--transition);
    z-index: 1;
}

.profile-img:hover {
    filter: grayscale(0%);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.3);
    transform: scale(1.02);
}

/* --- Cards --- */
.card-style {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    padding: 2rem;
    transition: var(--transition);
}

.card-style:hover {
    border-color: var(--accent-gold);
    transform: translateY(-5px);
    background: rgba(40, 40, 40, 0.6);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

/* --- About Section & Socials --- */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-main);
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    cursor: default;
    transition: var(--transition);
}

.skill-tag:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.about-socials {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.about-socials a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    color: var(--text-muted);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.03);
}

.about-socials a:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 0 15px var(--accent-gold-glow);
    transform: translateY(-3px);
}

.about-socials i { font-size: 1.2rem; }

/* --- Gold Logo Standardization --- */
.logo-container {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.theme-logo {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    display: block;
    /* Force image to Gold */
    filter: grayscale(100%) sepia(100%) saturate(600%) hue-rotate(5deg) brightness(150%) contrast(100%);
    opacity: 1; transition: var(--transition);
}

/* Specific override for the black TCET logo */
.theme-logo[src*="TCET.png"] {
    filter: invert(100%) sepia(100%) saturate(600%) hue-rotate(5deg) brightness(150%) contrast(100%);
}

/* Specific fix for the Black UCD Logo */
.theme-logo[src*="UCD"] {
    filter: invert(100%) sepia(100%) saturate(600%) hue-rotate(5deg) brightness(150%) contrast(100%);
}

/* --- Experience --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    border-left: 2px solid rgba(255,255,255,0.1);
    padding-left: 40px;
}

.timeline-item { margin-bottom: 3.5rem; position: relative; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -46px; 
    top: 5px;
    width: 10px; height: 10px;
    background: var(--bg-main);
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 10px var(--accent-gold);
    border-radius: 50%;
}

.job-role {
    font-size: 1.3rem;
    color: var(--text-main);
    font-weight: 600;
}

.job-company {
    font-family: var(--font-mono);
    color: var(--accent-gold);
    font-size: 0.9rem;
}

.job-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

.job-details li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.job-details li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-gold);
    font-family: var(--font-mono);
    font-weight: 700;
}

/* --- Projects --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-preview {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.project-preview img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    filter: grayscale(100%);
}

.project-card:hover .project-preview img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

.project-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }

.project-title {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.project-icons a {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-left: 10px;
}

.project-icons a:hover { color: var(--accent-gold); }

.project-tech {
    margin-top: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-gold);
    word-spacing: 5px;
}

/* --- PROJECT GALLERY MODAL (Lightbox) --- */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: hidden;
    background-color: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0; transition: opacity 0.3s ease;
}

.gallery-modal.show { display: flex; opacity: 1; }

.gallery-close {
    position: absolute; top: 20px; right: 30px;
    color: var(--text-muted); font-size: 3rem; font-weight: bold;
    cursor: pointer; transition: 0.3s; z-index: 2001;
}
.gallery-close:hover { color: var(--accent-gold); }

.gallery-content-wrapper {
    position: relative; max-width: 90%; max-height: 80%;
    display: flex; justify-content: center; align-items: center;
}

.gallery-main-img {
    max-width: 100%; max-height: 80vh;
    border: 1px solid var(--accent-gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.1);
    object-fit: contain; animation: zoomIn 0.3s ease;
}
@keyframes zoomIn { from {transform: scale(0.9); opacity: 0;} to {transform: scale(1); opacity: 1;} }

/* --- Updated Gallery Arrows (Fixed to screen) --- */
.gallery-prev, .gallery-next {
    cursor: pointer; 
    position: absolute; 
    top: 50%;
    transform: translateY(-50%); /* Vertically centered */
    width: auto; 
    padding: 10px 18px; 
    color: var(--accent-gold); 
    font-weight: bold; 
    font-size: 2rem; /* Reduced from 3rem */
    transition: 0.3s ease; 
    user-select: none; 
    background: rgba(0,0,0,0.5); /* Semi-transparent bg */
    border-radius: 4px;
    z-index: 2005; /* High z-index to stay on top */
}

/* Fixed to screen edges */
.gallery-prev { left: 20px; } 
.gallery-next { right: 20px; }

.gallery-prev:hover, .gallery-next:hover { 
    background-color: var(--accent-gold); 
    color: #000; 
}

.gallery-thumbnails {
    display: flex; gap: 10px; margin-top: 20px;
    overflow-x: auto; padding: 10px; max-width: 90%;
}
.gallery-thumb {
    height: 60px; width: 100px; object-fit: cover;
    opacity: 0.5; cursor: pointer; border: 1px solid transparent; transition: 0.3s;
}
.gallery-thumb:hover, .gallery-thumb.active { opacity: 1; border-color: var(--accent-gold); }

/* --- Education & Pubs --- */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.edu-school { font-family: var(--font-heading); font-style: italic; color: var(--text-muted); }
.edu-date { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-gold); margin-top: auto;}

/* --- Contact --- */
#contact {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: linear-gradient(180deg, var(--bg-main) 0%, #151515 100%);
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.contact-item {
    display: flex; align-items: center; gap: 1rem;
    font-family: var(--font-mono);
}

.contact-item i { color: var(--accent-gold); }

/* --- Footer --- */
footer {
    background: #050505;
    padding: 2rem 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #555;
}

/* --- Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-image-wrapper { order: -1; margin-bottom: 2rem; }
    .hero-content h1 { font-size: 3rem; }
    .about-grid { grid-template-columns: 1fr; }
    
    .profile-img { width: 280px; height: 280px; }
    .hero-image-wrapper::before { width: 300px; height: 300px; }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 60px; right: -100%;
        width: 100%; height: calc(100vh - 60px);
        background: var(--bg-main);
        
        /* Layout Setup for Center */
        display: flex; 
        flex-direction: column;
        justify-content: center;
        align-items: center; 
        
        transition: 0.4s;
        border-left: 1px solid rgba(255,255,255,0.1);
        
        /* Increased Gap for better touch targets */
        gap: 2.5rem; 
    }
    
    /* Styles specifically for mobile menu links */
    .nav-links a {
        font-size: 1.5rem; /* Large readable text */
        font-weight: 400;
    }

    .nav-links.active { right: 0; }
    .hamburger { display: block; }
}