/* ==========================================================================
   MADHAV'S PORTFOLIO: VINTAGE TECH / RETRO-FLAT THEME
   ========================================================================== */

/* ROOT VARIABLES
*/
:root {
    /* The core retro color palette */
    --paper: #E8DCC4;
    /* Classic warm vintage paper */
    --retro-red: #D26050;
    /* Punchy retro terracotta */
    --retro-blue: #3A5A78;
    /* Deep vintage navy */

    /* Text colors */
    --text-dark: #2B2B2B;
    --text-light: #F4EBE1;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
    /* typing effect */
}

/* GLOBAL RESET 
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Ensures borders/padding don't increase the total width of elements */
}

/* BASE BODY STYLES*/
body {
    background-color: var(--paper);
    color: var(--text-dark);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* Makes text look sharper on Mac displays */
    overflow-x: hidden;
    /* Prevents horizontal scrolling if an element pushes too far right */
}

/* THE GLOBAL GRAIN OVERLAY
   an invisible pseudo-element (::after) that covers the entire screen with SVG noise.
*/
body::after {
    content: "";
    /* Required for ::after to render */
    position: fixed;
    /* Locks the noise to the camera, so it stays when you scroll */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;

    /* SVG math to generate random fractal noise */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");

    opacity: 0.2;
    /* grain intensity. */
    mix-blend-mode: multiply;
    /* Makes the grain "burn" into the colors beneath it*/

    pointer-events: none;
    /* Allows mouse clicks to pass THROUGH the grain to hit buttons */
    z-index: 9999;
    /* Forces the grain to sit on top of all other HTML elements */
}

/*    NAVBAR */

.retro-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Update this background color to match your specific retro background */
    background-color: #f4f1ea;
    border-bottom: 3px solid #e63946;
    /* Retro Red border */
    z-index: 1000;
    padding: 15px 0;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    font-family: var(--font-mono, 'Courier New', monospace);
    font-weight: 800;
    font-size: 1.5rem;
    color: #1d3557;
    /* Dark blue/black */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #1d3557;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #e63946;
    /* Hover turns red */
}

/* 
   PROJECT SKILL TAGS
   */
.project-skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    margin-top: -5px;
}

.project-skill-tag {
    background-color: #1d3557;
    /* Retro dark blue background */
    color: #f4f1ea;
    /* Cream text */
    padding: 4px 10px;
    font-size: 0.8rem;
    font-family: var(--font-mono, 'Courier New', monospace);
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}


.nav-btn {
    border: 2px solid #1d3557;
    padding: 5px 15px;
    border-radius: 4px;
}

.nav-btn:hover {
    background-color: #D26050;
    color: #f4f1ea !important;
}

/* Push the body down so the hero text isn't hidden behind the fixed navbar */
body {
    padding-top: 80px;
}

/* TYPOGRAPHY & LINKS
*/
a {
    color: var(--retro-red);
    text-decoration: none;
    font-weight: 700;
    transition: opacity 0.2s;
    /* Smooth fade when hovering */
}

a:hover {
    opacity: 0.7;
}

h1,
h2,
h3 {
    font-weight: 700;
    margin-bottom: 20px;
}

/* LAYOUT & COLOR BLOCK SECTIONS
*/
.container {
    max-width: 1100px;
    /* Limits how wide the content can stretch on large monitors */
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
    border-bottom: 2px solid var(--text-dark);
}

section:last-of-type {
    border-bottom: none;
    /* Removes the line from the very last section */
}

.hero {
    background-color: var(--paper);
    color: var(--text-dark);
}

#skills {
    background-color: var(--retro-red);
    color: var(--text-light);
}

#projects {
    background-color: var(--retro-blue);
    color: var(--text-light);
}

/* HERO SECTION
*/
.hero-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--text-dark);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
}

.hero h1 {
    font-size: 3.5rem;
    letter-spacing: -1.5px;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* UI COMPONENTS
*/

/* The Main Button */
.btn {
    display: inline-block;
    background-color: var(--retro-red);
    color: var(--text-light);
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid var(--text-dark);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.8);
    transition: all 0.1s ease;
}

.btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
}

/* The Project Cards */
.project-card {
    background-color: var(--paper);
    color: var(--text-dark);
    padding: 30px;
    border-radius: 4px;
    margin-bottom: 25px;
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--text-dark);
    transition: transform 0.2s ease;
}

.project-card h3 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.project-card p {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1rem;
}

.project-links a {
    font-size: 0.95rem;
    font-weight: 800;
    margin-right: 20px;
    text-transform: uppercase;
}

/* The Skill Tags */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    background-color: transparent;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    border: 2px solid var(--text-light);
}

/* FOOTER
*/
footer {
    background-color: var(--paper);
    padding: 50px 0;
    text-align: center;
    color: var(--text-dark);
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 15px;
}


/* ANIMATIONS (The Typing Effect)
*/
.typing-container {
    font-family: var(--font-mono);
    color: var(--retro-red);
    font-size: 1.5rem;
    margin-bottom: 30px;
    display: inline-block;
    border-right: 3px solid var(--retro-red);
    /* The blinking cursor */
    white-space: nowrap;
    overflow: hidden;
    animation: blinkCursor 0.75s step-end infinite;
    /* Triggers the keyframe below forever */
    min-height: 2.6rem;
}

/* Tells the cursor border to switch between invisible and red */
@keyframes blinkCursor {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--retro-red);
    }
}

/* MOBILE RESPONSIVENESS
   If the screen is smaller than 768px,
   stack things vertically instead of horizontally.
*/
/* Hide hamburger icon on desktop screens */
@media (min-width: 769px) {
    .hamburger {
        display: none;
    }
}

/* ==========================================================================
   MOBILE LAYOUT & HAMBURGER MENU (Max Width: 768px)
   ========================================================================== */
@media (max-width: 768px) {

    /* Stack the image and text vertically */
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .hero-text {
        width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .hero-text h2,
    .hero-text .typing-container {
        font-size: 1.5rem;
        white-space: normal;
        border-right: none;
        min-height: auto;
    }

    .hero-text p {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    /* HAMBURGER ICON STYLING */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
    }

    .hamburger span {
        width: 28px;
        height: 3px;
        background-color: #1d3557;
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    /* SLIDE-DOWN MOBILE MENU */
    .nav-links {
        position: absolute;
        top: 100%;
        left: -100%;
        width: 100%;
        background-color: #f4f1ea;
        flex-direction: column;
        padding: 20px 0;
        border-bottom: 3px solid #e63946;
        transition: left 0.3s ease;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        left: 0;
    }

    body {
        padding-top: 80px;
    }
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    /* Only animate opacity and transform so the GPU handles it smoothly */
    transition: opacity 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: opacity, transform;
    /* Warns the browser to prep for animation */
}

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

.reveal.delay-1 {
    transition-delay: 0.1s;
}

.reveal.delay-2 {
    transition-delay: 0.2s;
}

.reveal.delay-3 {
    transition-delay: 0.3s;
}

/* ==========================================================================
   EXPERIENCE TIMELINE
   ========================================================================== */
.timeline {
    border-left: 4px solid #e63946;
    padding-left: 30px;
    margin-left: 20px;
    position: relative;
    max-width: 900px;
}

.timeline-item {
    margin-bottom: 45px;
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -38px;
    top: 5px;
    width: 12px;
    height: 12px;
    background-color: #f4f1ea;
    border: 4px solid #1d3557;
}

.timeline-date {
    font-family: var(--font-mono, 'Courier New', monospace);
    font-size: 0.95rem;
    color: #e63946;
    margin-bottom: 8px;
    font-weight: 700;
}

.timeline-item h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: #1d3557;
}

.timeline-item .company {
    font-weight: 400;
    opacity: 0.75;
}

.timeline-item ul {
    padding-left: 20px;
    margin: 0;
    color: #2b2b2b;
}

.timeline-item li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* GLOBAL OVERFLOW SAFETY */
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Removed the 'html' tag from this block to restore native scrolling */