/* -----------------------------------------------------------
   1. CORE VARIABLES (60-30-10 RULE)
----------------------------------------------------------- */
:root {
    /* 60% - The Void */
    --bg-main: #050507;      /* Deepest Black */
    --bg-sec: #0a0a0c;       /* Slightly lighter for sections */

    /* 30% - Structure */
    --card-bg: #131316;      /* Dark Graphite */
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover: #1c1c21;
    --text-main: #e0e0e0;
    --text-muted: #888890;

    /* 10% - Accent */
    --accent: #9d4edd;
    --accent-glow: rgba(157, 78, 221, 0.5);
    --accent-dim: rgba(157, 78, 221, 0.1);

    /* Typography */
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing & Radius */
    --radius-lg: 24px;
    --radius-sm: 12px;
    --nav-height: 80px;
    --max-width: 1100px;
}

/* -----------------------------------------------------------
   2. RESET & GLOBAL ELEMENTS
----------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind everything */
    pointer-events: none;
}

/* Scroll Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* -----------------------------------------------------------
   3. TYPOGRAPHY
----------------------------------------------------------- */
.title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 40px;
}

.section-subtitle {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.text-gradient {
    background: linear-gradient(120deg, #fff, #999);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highlight {
    color: #fff;
    font-weight: 500;
}

/* -----------------------------------------------------------
   4. NAVIGATION (Glassmorphism + Mono)
----------------------------------------------------------- */
#desktop-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: var(--nav-height);
    background: rgba(5, 5, 7, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}

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

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

/* The "Let's Chat" button in nav */
.btn-nav {
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--card-border);
}
.btn-nav:hover {
    border-color: var(--accent);
    color: var(--accent) !important;
}

/* Mobile Nav */
#hamburger-nav { display: none; }
@media (max-width: 900px) {
    #desktop-nav { display: none; }
    #hamburger-nav { display: flex; justify-content: space-between; padding: 20px; position: sticky; top: 0; z-index: 100; background: rgba(5, 5, 7, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--card-border); }
    .hamburger-icon { display: flex; flex-direction: column; gap: 6px; cursor: pointer; z-index: 101; }
    .hamburger-icon span { width: 30px; height: 2px; background: white; transition: 0.3s; }
    
    /* Hamburger Animation */
    .hamburger-icon.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .hamburger-icon.open span:nth-child(2) { opacity: 0; }
    .hamburger-icon.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    .menu-links { position: absolute; top: 100%; right: 0; background: var(--card-bg); width: 100%; padding: 20px; border-bottom: 1px solid var(--card-border); max-height: 0; overflow: hidden; transition: 0.3s ease-in-out; }
    .menu-links.open { max-height: 350px; }
    .menu-links li { margin-bottom: 16px; text-align: center; }
    .menu-links li a { display: block; padding: 10px; font-family: var(--font-mono); font-size: 1.1rem; }
}

/* -----------------------------------------------------------
   5. HERO SECTION (Visual Impact)
----------------------------------------------------------- */
section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 120px 24px 80px;
}

#profile {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 48px;
    min-height: 90vh;
    position: relative; /* Context for parallax */
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(157, 78, 221, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(157, 78, 221, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(157, 78, 221, 0); }
    100% { box-shadow: 0 0 0 0 rgba(157, 78, 221, 0); }
}

.hero-ctas {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

/* Button Systems */
.btn-pill {
    padding: 14px 28px;
    border-radius: 50px;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-pill.primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    box-shadow: 0 0 20px -5px var(--accent-glow);
}
.btn-pill.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px -5px var(--accent-glow);
}

.btn-pill.secondary {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
}
.btn-pill.secondary:hover {
    border-color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

/* Metrics */
.hero-metrics {
    display: flex;
    gap: 32px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--card-border);
}

.metric-item { display: flex; flex-direction: column; }
.metric-number { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: #fff; }
.metric-label { font-size: 0.85rem; color: var(--text-muted); }

/* Hero Image with Glow */
.hero-photo-container { position: relative; perspective: 1000px; }
.hero-glow {
    position: absolute;
    inset: 10%;
    background: var(--accent);
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0;
}
.hero-img {
    position: relative;
    width: 100%;
    max-width: 400px;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    z-index: 1;
    transform: rotate(3deg);
    transition: transform 0.1s ease-out; /* Fast response for JS parallax */
    will-change: transform;
}

/* -----------------------------------------------------------
   6. BENTO GRID (The About Section)
----------------------------------------------------------- */
.bento-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* 60/40 Split */
    grid-template-rows: auto auto;
    gap: 24px;
}

.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: 0.3s;
}
.bento-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

/* Specific Card Layouts */
.timeline-card { grid-row: span 2; }
.edu-card, .status-card { display: flex; align-items: center; gap: 16px; }

.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: #fff;
}
.card-icon { font-size: 2rem; }

/* Timeline Styling inside Bento */
.timeline {
    position: relative;
    padding-left: 16px;
    margin-top: 24px;
    border-left: 1px solid var(--card-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
    padding-left: 24px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 6px;
    width: 9px;
    height: 9px;
    background: var(--bg-main);
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.timeline-item .year { font-family: var(--font-mono); color: var(--accent); font-size: 0.9rem; margin-bottom: 4px; }
.timeline-item .role { font-weight: 500; font-size: 1rem; color: var(--text-main); }

/* -----------------------------------------------------------
   7. SKILLS (Tags)
----------------------------------------------------------- */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.skill-category h3 { font-family: var(--font-mono); color: var(--text-muted); margin-bottom: 16px; }

.tag-container { display: flex; flex-wrap: wrap; gap: 12px; }

.tech-tag {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: 0.2s;
}
.tech-tag:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: #fff;
}

/* -----------------------------------------------------------
   8. PROJECTS (Grid & Cards)
----------------------------------------------------------- */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.work-card {
    group: pointer;
    cursor: pointer;
}

.work-img-wrapper {
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    aspect-ratio: 4/3;
    margin-bottom: 20px;
    background: var(--card-hover);
}

.work-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.work-card:hover img { transform: scale(1.05); }

.work-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
.work-tags span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.work-content h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-main);
    transition: color 0.3s;
}
.work-card:hover .work-content h3 { color: var(--accent); }

.center-btn { text-align: center; margin-top: 48px; }

/* -----------------------------------------------------------
   9. MODAL (Pop-up)
----------------------------------------------------------- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 5, 7, 0.9); /* Dark overlay */
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.open { opacity: 1; }

.modal-content {
    background-color: var(--card-bg);
    margin: auto;
    padding: 0;
    border: 1px solid var(--card-border);
    width: 90%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.close-modal {
    color: #aaa;
    position: absolute;
    top: 20px;
    right: 28px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
}

.modal-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 400px;
}

.modal-text {
    padding: 40px;
}

.modal-text h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 16px;
    color: #fff;
}

.modal-text p {
    color: var(--text-muted);
    line-height: 1.7;
}

@media (max-width: 768px) {
    .modal-body { grid-template-columns: 1fr; }
    .modal-img-container img { height: 250px; min-height: auto; }
}

/* -----------------------------------------------------------
   10. SCROLL TO TOP BUTTON
----------------------------------------------------------- */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 999;
    box-shadow: 0 4px 15px var(--accent-glow);
    color: white;
}

.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.scroll-top-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* -----------------------------------------------------------
   11. FOOTER
----------------------------------------------------------- */
#contact {
    text-align: center;
    padding-top: 100px;
    padding-bottom: 40px;
}

.contact-title { font-size: clamp(2.5rem, 5vw, 4rem); }
.contact-desc { max-width: 600px; margin: 0 auto 40px; color: var(--text-muted); font-size: 1.1rem; }

.big-btn {
    padding: 18px 48px;
    font-size: 1.2rem;
}

footer {
    margin-top: 100px;
    padding-top: 40px;
    border-top: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }

.copyright { color: #555; font-size: 0.8rem; }

/* -----------------------------------------------------------
   12. UTILITIES & ANIMATIONS
----------------------------------------------------------- */
.hidden { opacity: 0; transform: translateY(30px); transition: 0.8s ease; }
.show { opacity: 1; transform: translateY(0); }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* Responsive General */
@media (max-width: 900px) {
    #profile { grid-template-columns: 1fr; text-align: center; gap: 32px; }
    .hero-eyebrow { margin: 0 auto 24px; }
    .hero-ctas { justify-content: center; }
    .hero-metrics { justify-content: center; }
    .hero-photo-container { margin: 40px auto 0; max-width: 300px; }
    
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .timeline-card { grid-row: auto; }
    
    .scroll-top-btn {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}