/* =========================================
   1. CSS Variables & Base Reset
   ========================================= */
:root {
    /* Color Palette */
    --bg-dark: #111827;      
    --bg-darker: #1f2937;    
    --text-main: #f3f4f6;    
    --text-muted: #9ca3af;   
    --text-dim: #d1d5db;     
    --accent-blue: #60a5fa;  
    --accent-blue-strong: #3b82f6; 
    
    /* Typography */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
    scroll-behavior: smooth; 
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

::selection {
    background-color: var(--accent-blue-strong);
    color: #ffffff;
}

/* =========================================
   2. Global Navigation Architecture
   ========================================= */
.navbar {
    position: fixed; 
    top: 0;
    width: 100%;
    z-index: 50;
    background-color: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(4px); 
    border-bottom: 1px solid var(--bg-darker);
}

.nav-container {
    max-width: 80rem; /* Fixed the typo here */
    margin: 0 auto;
    padding: 0 1rem;
    display: flex; 
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.nav-brand {
    font-weight: bold;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    color: #ffffff;
}

.nav-links {
    display: none; 
}

.nav-link {
    text-decoration: none;
    color: var(--text-dim);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

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

.nav-link.active {
    color: var(--accent-blue);
    font-weight: 600;
}

.mobile-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
}

.mobile-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
}

.mobile-menu {
    display: none; 
    background-color: var(--bg-darker);
    padding: 0.5rem;
}

.mobile-menu.is-open {
    display: block; 
}

.mobile-link {
    display: block;
    text-decoration: none;
    color: var(--text-dim);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.mobile-link.active {
    color: var(--accent-blue);
    font-weight: 500;
}

@media (min-width: 768px) {
    .nav-container { padding: 0 1.5rem; }
    .mobile-toggle { display: none; } 
    .nav-links {
        display: flex; 
        gap: 2rem;
    }
}

/* =========================================
   3. Index / Home Page Styling
   ========================================= */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem 1rem 1rem;
    text-align: center;
}

.hero-content {
    max-width: 56rem;
    width: 100%;
}

.hero-tagline {
    color: var(--accent-blue);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
    margin-bottom: 2rem;
    letter-spacing: -0.025em;
}

.text-highlight {
    color: var(--accent-blue-strong);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 48rem;
    margin: 0 auto 2rem auto;
    line-height: 1.625;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .hero-title { font-size: 3rem; }
    .hero-description { font-size: 1.25rem; }
    .button-group { flex-direction: row; }
}

@media (min-width: 1024px) {
    .hero-title { font-size: 4.5rem; }
}

/* Enhanced Button Styling with Neon Glow */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: #059669; /* Vibrant emerald green */
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: 0 0 15px rgba(5, 150, 105, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background-color: #047857;
    transform: translateY(-2px); /* Slight lift */
    box-shadow: 0 0 25px rgba(5, 150, 105, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: #e5e7eb;
    border: 1px solid #4b5563;
}

.btn-secondary:hover {
    background-color: var(--bg-darker);
}

/* =========================================
   4. About Page Styling
   ========================================= */
.page-container {
    max-width: 56rem;
    margin: 0 auto;
    padding: 8rem 1rem 4rem 1rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: bold;
    color: #ffffff;
    border-bottom: 1px solid var(--bg-darker);
    padding-bottom: 1rem;
    margin-bottom: 3rem;
}

.content-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-card {
    background-color: rgba(31, 41, 55, 0.3);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(55, 65, 81, 0.5);
    color: var(--text-dim);
    font-size: 1.125rem;
    line-height: 1.625;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .section-title { font-size: 2.25rem; }
    .page-container { padding: 8rem 1.5rem 4rem 1.5rem; }
}

/* =========================================
   5. Utility Classes & Animation States
   ========================================= */
.hidden {
    display: none !important;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(3rem); 
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); 
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   6. Projects Page Styling
   ========================================= */
.page-container-wide {
    max-width: 80rem; 
    margin: 0 auto;
    padding: 8rem 1rem 4rem 1rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem; 
}

@media (min-width: 1024px) {
    .projects-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .page-container-wide { 
        padding-left: 2rem; 
        padding-right: 2rem; 
    }
}

.project-card {
    background-color: rgba(31, 41, 55, 0.4);
    border-radius: 0.75rem;
    border: 1px solid rgba(55, 65, 81, 1);
    padding: 2rem;
    /* Added physics transitions */
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.project-card:hover {
    /* Upgraded lift and shadow effects */
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    border-color: #059669; /* Emerald green accent */
}

@media (min-width: 1024px) {
    .project-card.wide { 
        grid-column: span 2 / span 2; 
    }
}

.project-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

@media (min-width: 640px) {
    .project-header { 
        flex-direction: row; 
    }
}

.project-title {
    font-size: 1.875rem;
    font-weight: bold;
    color: #ffffff;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.project-link.primary { color: var(--accent-blue); }
.project-link.primary:hover { color: #93c5fd; }
.project-link.secondary { color: var(--text-muted); }
.project-link.secondary:hover { color: #ffffff; }
.project-link svg { width: 1rem; height: 1rem; margin-left: 0.25rem; }

.project-tags {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    border-left: 2px solid var(--accent-blue-strong);
    padding-left: 0.75rem;
    margin-bottom: 1.5rem;
}

.project-description {
    font-size: 0.875rem;
    color: var(--text-dim);
    line-height: 1.625;
}

.project-description p {
    margin-bottom: 0.75rem;
}

.project-description-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .project-description-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
}

/* =========================================
   7. Contact Page Styling
   ========================================= */
.contact-wrapper {
    display: flex;
    justify-content: center;
    padding: 8rem 1rem 4rem 1rem;
    max-width: 80rem;
    margin: 0 auto;
}

.contact-card {
    width: 100%;
    max-width: 42rem;
    background-color: rgba(31, 41, 55, 0.5);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(55, 65, 81, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 640px) {
    .contact-card { padding: 2.5rem; }
}

.contact-title {
    font-size: 1.875rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.contact-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.625;
}

.contact-info-box {
    background-color: rgba(17, 24, 39, 0.5);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(31, 41, 55, 1);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-info-item {
    display: flex;
    align-items: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.contact-info-item svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    color: var(--accent-blue-strong);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue-strong);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.form-error {
    color: #ef4444; 
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.btn-submit {
    width: 100%;
    background-color: #059669; /* Matches neon green */
    color: #ffffff;
    font-weight: bold;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 15px rgba(5, 150, 105, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.1);
    font-size: 1rem;
}

.btn-submit:hover {
    background-color: #047857;
    box-shadow: 0 0 25px rgba(5, 150, 105, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.contact-footer {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(55, 65, 81, 1);
    display: flex;
    justify-content: center;
}

.footer-link {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-mono);
    transition: color 0.2s ease;
}

.footer-link svg {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.5rem;
    transition: color 0.2s ease;
}

.footer-link:hover, .footer-link:hover svg {
    color: var(--accent-blue-strong);
}