/* --- Variables & Themes --- */
:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --accent: #2563eb; 
    --card-bg: #f8fafc;
    --border: #e2e8f0;
    --nav-bg: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --hover-theme: #dcdcdc;
}

.darkmode {
    --bg: #0f172a;
    --text: #f1f5f9;
    --accent: #38bdf8;
    --card-bg: #1e293b;
    --border: #334155;
    --nav-bg: rgba(15, 23, 42, 0.85);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --hover-theme: rgb(25, 38, 68);
}

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

html { scroll-behavior: smooth; }

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    line-height: 1.6; 
    transition: background 0.3s ease, color 0.3s ease;
}

/* --- Typography --- */
h1, h2, h3 { font-weight: 800; }
.accent-text { color: var(--accent); }
.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.5px; }

/* --- Navigation --- */
nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { 
    text-decoration: none; 
    color: var(--text); 
    font-weight: 500; 
    font-size: 0.9rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* --- Layout Sections --- */
section { 
    padding: 5rem 5%; 
    max-width: 1100px; 
    margin: 0 auto; 
}

.section-title { 
    font-size: 1.8rem; 
    margin-bottom: 2.5rem; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.section-title::after { 
    content: ""; 
    height: 1px; 
    flex: 1; 
    background: var(--border); 
}

/* --- Hero --- */
.hero {
    padding: 8rem 5% 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-text { flex: 1; }
.hero-text h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 1.5rem; }
.hero-text p { font-size: 1.2rem; opacity: 0.8; margin-bottom: 2rem; max-width: 500px; }
.hero-btns { display: flex; gap: 1rem; }

.hero-image { flex-shrink: 0; width: 320px; }
#headshot {
    width: 100%;
    border-radius: 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* --- Cards & Grids --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 20px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover { 
    transform: translateY(-5px); 
    border-color: var(--accent); 
}

.card h3 { 
    margin: 0.5rem 0; 
    font-family: 'JetBrains Mono', monospace; 
    font-size: 1.1rem;
}

.project-card {
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 8px;
}

/* --- Buttons --- */
.btn {
    background: var(--accent);
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn:hover { opacity: 0.9; }

.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    padding: 0;
}

.theme-toggle {
    background: var(--nav-bg);
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    transition-duration: 0.2s;
}

.theme-toggle:hover {
    background: var(--hover-theme);
    transform: scale(1.1);
}

#themeBtn_img {
    display: block;
    margin: auto;
    width: 100%;
}

/* --- Modals --- */
.modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3rem;
    z-index: 2000;
    border-radius: 24px;
    visibility: hidden; 
    opacity: 0;
    transition: all 0.2s ease-out;
    max-width: 450px; 
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.modal.active { visibility: visible; opacity: 1; transform: translate(-50%, -50%) scale(1); }

.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 1500; display: none;
}
.overlay.active { display: block; }

.close-x {
    position: absolute; top: 20px; right: 20px;
    background: none; border: none; color: var(--text);
    font-size: 1.5rem; cursor: pointer;
}

.modal-list { margin: 1.5rem 0; padding-left: 1.2rem; }
.modal-list li { margin-bottom: 0.5rem; }

.right-align {
    display: block;
    margin-left: auto;
}

/* --- Footer --- */
footer { 
    text-align: center; 
    padding: 4rem; 
    border-top: 1px solid var(--border); 
    font-size: 0.9rem;
}

footer p {
    opacity: 0.6;
}

.socials-footer a {
    background-size: cover;
    background-position: center;

    display: inline-block;
    width: 30px;
    height: 30px;
    margin-right: 12px;
    filter: grayscale(100%) brightness(40%);
}

.youtube-social-footer {
    background-image: url('images/youtube-logo.png');
}

.github-social-footer {
    background-image: url('images/github-logo.png');
}

.linkedin-social-footer {
    background-image: url('images/linkedin-logo.png');
}

/* --- Responsive --- */
@media (max-width: 850px) {
    .hero { flex-direction: column; text-align: center; padding-top: 4rem; }
    .hero-text h1 { font-size: 2.5rem; }
    .hero-btns { justify-content: center; }
    .nav-links a { display: none; } /* Simplified for now */
}