/* --- style.css --- */

/* 1. IMPORTS & VARIABLES */
:root {
    --bg-color: #111111;         /* Very dark gray background */
    --card-bg: #1a1a1a;          /* Slightly lighter for cards */
    --text-main: #e5e5e5;        /* Off-white text */
    --text-muted: #888888;       /* Muted gray for secondary text */
    --accent: #ffffff;           /* White accent for high contrast */
    --border-color: #333333;     /* Subtle borders */
    
    /* Fonts */
    --font-code: 'JetBrains Mono', monospace; /* CS/Tech feel */
    --font-body: 'Inter', sans-serif;         /* Clean minimalist feel */
    --nav-height: 70px;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    max-width: 100vw; /* Hard stop for all elements */
    overflow-wrap: break-word; /* Forces long text to stay in bounds */
    word-wrap: break-word;
}

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

/* 2. TYPOGRAPHY */
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

h1, h2, h3, .logo, .nav-links, .job-title, .project-tech, .btn {
    font-family: var(--font-code);
}

/* 3. LAYOUT UTILITIES */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

section { padding: 100px 0; }

.section-title {
    font-size: 2rem;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
    letter-spacing: -1px;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background: var(--text-muted);
    bottom: -10px;
    left: 0;
}

/* 4. NAVIGATION
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(17, 17, 17, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
} */

.proj-content p, .proj-content li {
            color: #b0b0b0;
        }

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(17, 17, 17, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Remove the hardcoded height and padding here; handled by nav */
}
.project-page-wrapper {
    padding-top: 30px; /* Adjust this value based on your navbar height */
    padding-bottom: 60px;
}

/* Add a margin to your container so the fixed nav doesn't cover your content */
body {
    padding-top: 80px; /* Adjust based on your navbar height */
}

/* .nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
} */

/* .nav-content { display: flex; justify-content: space-between; align-items: center; height: 70px; } */
.logo { font-weight: 700; font-size: 1.2rem; color: var(--text-main); letter-spacing: -1px; }
.nav-links { display: flex; gap: 30px; font-size: 0.9rem; }
.nav-links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset:5px; text-decoration-color: var(--text-muted); }

/* 5. HERO SECTION */
.hero {
    min-height: 100vh; /* Changed from height: 100vh */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;    /* Account for fixed nav */
    padding-bottom: 60px; /* Ensure space before "About Me" */
}
.hero-content { display: flex; align-items: center; gap: 60px; flex-wrap: wrap-reverse; justify-content: center; }
.hero-text { max-width: 600px; }
.hero-text h1 { font-size: 3rem; line-height: 1.1; margin-bottom: 25px; letter-spacing: -2px; }
.hero-text h2 { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 20px; font-weight: 400; }
.hero-text p { color: var(--text-muted); margin-bottom: 35px; font-size: 1.05rem; font-weight: 300; }

/* Buttons */
.btn { display: inline-block; padding: 12px 28px; background: var(--text-main); color: var(--bg-color); font-weight: 600; border-radius: 2px; font-size: 0.9rem; border: 1px solid var(--text-main); }
.btn:hover { background: transparent; color: var(--text-main); }

.btn-outline { background: transparent; color: var(--text-main); border: none; margin-left: 10px; }
.btn-outline:hover { border-color: var(--text-main); }

/* Profile Image */
.profile-img-container { width: 280px; height: 280px; border-radius: 50%; overflow: hidden; filter: grayscale(100%); border: 1px solid var(--border-color); transition: 0.5s; }
.profile-img-container:hover { filter: grayscale(0%); border-color: var(--text-main); }
.profile-img-container img { width: 100%; height: 100%; object-fit: cover; }

/* 6. EXPERIENCE TIMELINE */
.timeline { position: relative; max-width: 800px; margin: 0 auto; border-left: 1px solid var(--border-color); padding-left: 30px; }
.timeline-item { position: relative; margin-bottom: 50px; }
.timeline-item::before { content: ''; position: absolute; left: -35px; top: 5px; width: 9px; height: 9px; background: var(--bg-color); border: 2px solid var(--text-muted); border-radius: 50%; }

.job-header { margin-bottom: 10px; }
.job-title { font-size: 1.3rem; font-weight: 700; color: var(--text-main); }
.job-company { color: var(--text-muted); font-size: 1rem; margin-top: 5px; display: block; }
.job-date { font-family: var(--font-code); font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; text-transform: uppercase; }

.job-desc ul { margin-top: 15px; list-style: none; color: #b0b0b0; }
.job-desc li { margin-bottom: 8px; padding-left: 15px; position: relative; }
.job-desc li::before { content: '>'; position: absolute; left: 0; color: var(--text-muted); font-family: var(--font-code); font-size: 0.8rem; }

/* 7. PROJECTS GRID */
.projects-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); 
    gap: 20px; 
    align-items: stretch; 
}

/* 2. Turn the wrapper into a flex container that fills the stretched grid cell */
.projects-grid .reveal {
    display: flex;
    height: auto; 
    width: 100%;
}

.project-card {
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    padding: 30px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease-out, border-color 0.2s ease-out;
    will-change: transform;
}

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

.project-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.project-title { font-size: 1.1rem; font-weight: 700; }
.folder-icon { color: var(--text-muted); font-size: 1.2rem; }
.project-tech { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 20px; }
.project-desc { color: #b0b0b0; font-size: 0.95rem; line-height: 1.7; }

/* 8. SKILLS */

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    column-gap: 80px; /* Space between the two columns */
    row-gap: 25px;    /* Space between rows */
    width: 100%;
}

.skill-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.skill-name {
    font-family: var(--font-code);
    font-size: 0.95rem;
    color: var(--text-main);
    min-width: 110px; /* Ensures all bars start at same point */
    font-weight: 600;
}

/* The Grey Background Track */
.skill-bar-track {
    flex-grow: 1; /* Fills the rest of the space */
    height: 14px;
    background-color: #333; /* Dark grey track */
    border-radius: 7px;     /* Rounded pill shape */
    overflow: hidden;       /* Ensures inner bar stays rounded */
    margin-left: 15px;      /* Space between text and bar */
}

/* The White/Filled part */
.skill-bar-fill {
    height: 100%;
    background-color: var(--text-main); /* Uses your text color (off-white) */
    border-radius: 7px;
    /* Optional: Add a subtle transition if you want them to grow */
    transition: width 1s ease-in-out;
}

/* Mobile: Switch to 1 column */
@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
    }
    /* 1. Move logo slightly right */
    .logo {
        margin-left: 15px;
    }

    /* 2. Prevent navbar from overlapping the profile picture */
    .hero {
        padding-top: 120px; /* Increased from 60px to push content down */
    }

    /* Existing mobile rules */
    .hero-text h1 { font-size: 2.2rem; }
    .nav-links { display: none; } 
    .hero-content { flex-direction: column-reverse; text-align: center; }

    .modal-window { 
        padding: 20px; /* Reduces padding to give text more room */
        width: 95%;    /* Prevent modal from touching screen edges */
    } 
    
    .timeline { 
        padding-left: 25px; 
        margin-right: 15px; 
    } 
    
    .timeline-item::before { 
        left: -30px; 
    }

    .hero-text .btn {
        display: block;
        width: max-content;
        margin: 0 auto 20px auto; /* Centers the button and adds space below it */
    }

    .hero-text .social-links {
        width: 100%;
        justify-content: center;
    }
}

/* 9. EDUCATION */
.education-item { border-left: 2px solid var(--border-color); padding-left: 20px; margin-bottom: 30px; }
.uni-name { font-weight: bold; color: var(--text-main); font-family: var(--font-code); }
.degree { color: var(--text-muted); margin-top: 5px; }

/* 10. FOOTER */
footer { text-align: center; padding: 60px 0; border-top: 1px solid var(--border-color); margin-top: 50px; color: var(--text-muted); font-family: var(--font-code); font-size: 0.85rem; }
.social-links { margin-top: 20px; display: flex; justify-content: center; gap: 25px; }
.social-links a { font-size: 1.4rem; color: var(--text-muted); }
.social-links a:hover { color: var(--text-main); }

/* 11. ANIMATIONS */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
    filter: blur(4px);
}
.reveal.active { opacity: 1; transform: translateY(0); filter: blur(0); }
.projects-grid .project-card:nth-child(2) { transition-delay: 100ms; }
.projects-grid .project-card:nth-child(3) { transition-delay: 200ms; }
.projects-grid .project-card:nth-child(4) { transition-delay: 300ms; }
.projects-grid .project-card:nth-child(5) { transition-delay: 400ms; }

.btn-back:hover { border-color: var(--text-main); background: #222; }

/* Mobile */
@media (max-width: 768px) {
    .hero-text h1 { font-size: 2.2rem; }
    .nav-links { display: none; } 
    .hero-content { flex-direction: column-reverse; text-align: center; }
}

/* --- MODAL / POPUP STYLES (CENTERED VERSION) --- */

/* The dark background overlay */
.modal-overlay {
    position: fixed;
    top: 70px; /* Still starts below the header */
    left: 0;
    width: 100%;
    height: calc(100% - 70px);
    background: rgba(0, 0, 0, 0.6); /* Slightly darker for focus */
    backdrop-filter: blur(4px);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    
    /* Flexbox to center the content */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px; /* Gap from edges */
}

/* The actual window */
.modal-window {
    width: 100%;
    max-width: 900px; /* Width of the box */
    max-height: 90%;  /* Don't touch top/bottom edges */
    background: var(--bg-color);
    border: 1px solid var(--border-color); /* Border on all sides now */
    border-radius: 8px; /* Rounded corners */
    
    /* Animation Start State (Slightly lower and invisible) */
    transform: translateY(30px); 
    opacity: 0;
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    overflow-y: auto; /* Scroll inside the box if content is long */
    padding: 40px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Active State (When open) */
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.active .modal-window {
    transform: translateY(0); /* Slide up to center */
    opacity: 1;
}

/* Close Button inside Modal */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
    background: var(--card-bg); /* Little background for button */
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    color: var(--text-main);
    border-color: var(--text-main);
    background: #222;
}

/* Hide the "Return" button from the loaded HTML */
.modal-window .btn-back { display: none; }

/* --- PROJECT PAGE SPECIFIC STYLES --- */

/* The container for the project header */
.proj-header {
    margin-bottom: 45px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 40px;
}

/* The "C++ // SystemC" line */
.tech-stack-line {
    font-family: var(--font-code);
    color: var(--accent);
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 10px;
}

/* Wrapper for the text content */
.proj-content {
    max-width: 100%; 
}

.proj-content h2 {
    margin-top: 45px;
    font-size: 1.8rem;
    color: var(--text-main);
    font-family: var(--font-code);
    border-left: 4px solid var(--text-muted);
    padding-left: 20px;
}

.proj-content h2.first-section {
    margin-top: 0px !important; 
}

/* H3 Styling */
.proj-content h3 {
    font-size: 1.3rem;

    margin-bottom: 15px;
    color: var(--text-main);
}

.proj-content p {
    color: #b0b0b0;
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.8;
}

/* Images inside project page */
figure {
    margin: 50px 0;
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
}

img {
    width: 70%;
    margin: 0 auto;
    height: auto;
    display: block;
    opacity: 0.9;
}

figcaption {
    text-align: center;
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 15px;
}

/* Carousel Container */
.carousel-container {
  max-width: 100%;
  position: relative;
  margin: 20px auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #233554;
}

/* Hide images by default */
.mySlides {
  display: none;
}

.mySlides img {
  vertical-align: middle;
  border-radius: 8px;
}

/* Next & previous buttons */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  margin-top: -22px;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  text-decoration: none;
}

.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
  background-color: rgba(10, 25, 47, 0.8);
  color: #64ffda; /* Using your accent color */
}

/* The dots */
.dot {
  cursor: pointer;
  height: 12px;
  width: 12px;
  margin: 0 4px;
  background-color: #383c3f;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}

.dot.active, .dot:hover {
  background-color: #828994;
}

/* Fading animation */
.fade {
  animation-name: fade;
  animation-duration: 1.5s;
}

@keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

/* Typewriter Cursor Animation */
.cursor {
    font-size: clamp(40px, 8vw, 50px); /* Match your h1 size */
    color: var(--accent-color); /* Usually your #64ffda green */
    animation: blink 1s infinite;
    font-weight: 400;
    margin-left: 5px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.progress-container {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 999;
}
.progress-bar {
  height: 3px;
  background: var(--text-muted);
  width: 0%;
}