/* ==========================================================================
   GLOBAL CONFIGURATION & VARIABLES
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-main: #fcfbf9;
    --text-dark: #2f2f2f;
    --text-light: #555;
    --text-white: #ffffff;

    /* Timeline Gradient Colors */
    --timeline-start: #e8efe4;
    --timeline-end: #747f64;
}

/* CSS Reset & Defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Custom cursor implementation via JS */
    font-family: 'Syne', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: 'Syne', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

p {
    font: 'Syne' 1em sans-serif;
    line-height: 1.6;
    text-align: justify;
}

/* Ensure strong and bold tags inherit the correct custom font */
strong,
b {
    font-family: 'Syne', sans-serif;

    /* Use 500 for a medium, elegant thickness, or 700 for a standard bold. 
       This prevents the browser from generating a distorted 'faux-bold' */
    font-weight: 700;

    /* Optional: slightly adjust letter spacing if the letters touch each other */
    letter-spacing: 0.5px;
}

/* ==========================================================================
   GLOBAL CONTAINERS (Layout widths)
   ========================================================================== */

.profile-top,
.profile-bottom,
.timeline-layout {
    width: min(1400px, calc(100% - 120px));
    margin-inline: auto;
}

/* ==========================================================================
   PAPER TEXTURE EFFECT (Noise Filter)
   ========================================================================== */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;

    /* SVG Base64 Noise generation for paper grain effect */
    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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");

    opacity: 0.04;
    pointer-events: none;
    /* Ensures the texture doesn't block clicks */
    z-index: 9999;
}

/* ==========================================================================
   CUSTOM CURSOR
   ========================================================================== */

.cursor {
    position: fixed;
    top: 0;
    left: 0;

    width: 20px;
    height: 20px;

    border: 1.5px solid var(--text-dark);
    border-radius: 50%;

    pointer-events: none;
    z-index: 10000;

    transform: translate(-50%, -50%);

    transition:
        width 0.3s ease,
        height 0.3s ease,
        background-color 0.3s ease;
}

/* Cursor style when hovering links and interactive elements */
.cursor.hovered {
    width: 45px;
    height: 45px;
    background-color: rgba(26, 26, 26, 0.06);
}

/* ==========================================================================
   HERO SECTION (Fullscreen intro)
   ========================================================================== */

.hero {
    height: 100vh;
    width: 100%;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.image-container {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-image {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;

    /* Simple fade-in animation */
    animation: heroFade 3s ease forwards;
}

@keyframes heroFade {
    to {
        opacity: 1;
    }
}

.hero-content {
    position: relative;
    z-index: 5;
}

.hero h1 {
    font-size: clamp(4rem, 9vw, 8rem);
    letter-spacing: -4px;
    font-weight: 700;
    color: rgb(182, 181, 178);
}

/* Scroll down indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;

    transform: translateX(-50%);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;

    text-decoration: none;
    color: rgb(182, 181, 178);

    font-size: 0.75rem;
    letter-spacing: 3px;
    font-weight: 600;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: rgb(182, 181, 178);
}

/* ==========================================================================
   PROFILE SECTION
   ========================================================================== */

.profile-section {
    background: #f7f7f5;
    padding: 140px 0;
    color: #2b2b2b;

    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Global image style inside profile to make them uniform and grayscale */
.profile-section img {
    display: block;
    object-fit: cover;
    filter: grayscale(100%);
}

/* --- Profile Top Section --- */

.profile-top {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 90px;
    align-items: start;
    margin-bottom: 220px;
}

.profile-top-img img {
    width: 100%;
    height: 620px;
}

.profile-top-text {
    align-self: center;
}

.profile-top-text h2 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 2.5vw, 3.5rem);
    line-height: 0.95;
    margin-bottom: 40px;
    letter-spacing: -3px;
}

.profile-top-text p {
    text-align: justify;
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 35px;
    color: var(--text-light);
}

.profile-top-text strong {
    color: #222;
    font-weight: 700;
}

/* --- Dynamic Text Rotator --- */

.rotator-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rotator-static {
    font-size: 1.2rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.rotator-dark-phrase {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 2.5vw, 3.5rem);
    line-height: 1;
    font-weight: 700;
    letter-spacing: -2px;
    min-height: 70px;
    color: #aeadad;

    transition:
        opacity 0.5s ease,
        transform 0.5s ease;
}

/* --- Profile Bottom Section (4-Column Layout) --- */

.profile-bottom {
    display: grid;
    grid-template-columns: 1.3fr 1.7fr 1.2fr 0.8fr;
    gap: 40px;
    align-items: stretch;
}

/* ==========================================================================
   QUICK CONTACT LINK (Below Profile)
   ========================================================================== */

.quick-contact-wrapper {
    margin-top: 80px;
    text-align: center;
}

.quick-contact-link {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 2px solid var(--timeline-end);
    padding-bottom: 4px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.quick-contact-link:hover {
    color: var(--timeline-end);
    border-color: var(--text-dark);
}

.grid-col {
    display: flex;
    flex-direction: column;
}

/* Column behaviors */
.col-stacked-text {
    justify-content: space-between;
}

.col-text-image {
    justify-content: space-between;
}

/* Text blocks formatting inside the grid */
.text-block h3 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(1.5rem, 1.5vw, 2.5rem);
    line-height: 0.95;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.text-block p {
    font-family: 'Syne', sans-serif;
    text-align: justify;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-light);
}

.text-block strong {
    color: #222;
}

.col-stacked-text .text-block:first-child {
    margin-bottom: 40px;
}

/* Specific image sizes for the asymmetrical grid */
.img-bottom {
    margin-top: auto;
    height: 350px;
    width: 45%;
    align-self: flex-end;
}

.img-tall {
    height: 100%;
    height: 700px;
    width: 100%;
}

.img-top {
    height: 350px;
    width: 100%;
}

/* ==========================================================================
   TIMELINE SECTION (Projects)
   ========================================================================== */

.timeline-section {
    padding: 120px 0 140px 0;
}

/* --- Layout configuration --- */
.timeline-layout {
    display: flex;
    gap: 60px;
    /* Reduced gap slightly to maximize timeline space */
}

/* Main timeline wrapper taking more horizontal space */
.timeline-container {
    flex: 0 0 75%;
    /* Increased from 69% to save space */
    position: relative;
}



/* The vertical gradient line connecting projects */
.timeline-track {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 15px;
    /* Aligned with the center of the timeline dots */
    width: 2px;

    /* * Apply a linear gradient starting from the top and going to the bottom.
     * Uses the custom CSS variables defined in the :root pseudo-class.
     * var(--timeline-start) is the light green, var(--timeline-end) is the dark green.
     */
    background: linear-gradient(to bottom, var(--timeline-start), var(--timeline-end));

    border-radius: 4px;
    z-index: 1;
    /* Keep it behind the dots */
}

/* Main wrapper defining the left padding for the line */
/* Main wrapper defining the left padding for the line */
.timeline-item {
    position: relative;
    padding-left: 60px;
    padding-bottom: 200px;

    /* Elevate the entire item above the timeline-track (which has z-index: 1) */
    z-index: 2;

    /* Animation properties */
    opacity: 0;
    /* Starts completely transparent */
    transform: translateY(80px);
    /* Starts pushed down */

    /* Smoothly transition opacity and position */
    transition:
        opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Hardware acceleration hints for better performance */
    will-change: opacity, transform;
}

/* 
 * Reset the opacity and transform properties when the element 
 * enters the viewport and receives the 'is-visible' class from JS.
 * This triggers the CSS transition defined in .timeline-item.
 */
.timeline-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* The indicator dot on the line */
.timeline-dot {
    position: absolute;
    left: 5px;
    top: 8px;
    width: 22px;
    height: 22px;
    background-color: #454545;
    border: 4px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #e5e7eb;
    z-index: 999;
    /* Ensures the dot stays above the timeline track */
}

/* Main title and year wrapper */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.timeline-header h2 {
    font-size: 1.5rem;
    color: #111111;
    margin: 0;
    font-weight: 700;
}

/* Year/Location pill */
.timeline-year {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111111;
    padding: 6px 14px;
}

/* =========================================
   Sub-projects Grid Layout
   ========================================= */

/* Use CSS Grid to place the two subprojects side by side */
.subprojects-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two equal columns */
    gap: 50px;
    /* Space between the two columns */
    margin-top: 50px;
    margin-bottom: 20px;
}

/* Individual sub-project card styling */
.subproject-content {
    display: flex;
    flex-direction: column;
}

/* Sub-project title */
.subproject-header h3 {
    font-size: 1.25rem;
    color: #222222;
    margin: 0 0 15px 0;
}

/* Sub-project paragraph */
.subproject-content p {
    line-height: 1.6;
    text-align: justify;
    flex-grow: 1;
    /* Pushes the image to the bottom if text heights differ */
    margin-bottom: 20px;
}

/* --- Badges / Skills tags --- */

.badges {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* Space between multiple badges */
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 30px;
}

/* New custom badge colors based on your specifications */
.badge-sceno {
    background-color: #747f64;
    color: white;
}

.badge-montage {
    background-color: #cb7885;
    color: #ffffff;
    /* Dark text for better readability on light bg */
}

.badge-commi {
    background-color: #5c757a;
    color: white;
}

.badge-model {
    background-color: #c8c198;
    color: #ffffff;
}

/* =========================================
   Images inside sub-projects
   ========================================= */

.timeline-visuals {
    width: 100%;
    overflow: hidden;
}

.timeline-visuals img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Margin for the optional global image at the bottom */
.global-visual {
    margin-top: 30px;
}

/* ==========================================================================
   STICKY SIDEBAR (Menu/Summary)
   ========================================================================== */

/* Reduced width to let the main timeline breathe */
.sticky-sidebar {
    flex: 0 0 20%;
    /* Decreased from 25% */
    position: sticky;
    top: 80px;
    height: max-content;
}

.sidebar-grid {
    display: grid;
    grid-template-columns: repeat(2, 0.5fr);
    gap: 15px;
}

.sidebar-block {
    position: relative;
    aspect-ratio: 1 / 1;
    /* Keep them as perfect squares */
    border: 1px solid rgba(26, 26, 26, 0.12);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;

    transition:
        border-color 0.4s ease,
        background-color 0.4s ease;
}

.block-title {
    position: relative;
    z-index: 5;
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-dark);
    padding: 4px;
    /* Added minor padding inside the square */

    transition: color 0.3s ease;
}

.block-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;

    transition: opacity 0.4s ease;
}

/* Hover effects for squares */
.sidebar-block:hover {
    border-color: var(--timeline-end);
}

.sidebar-block:hover .block-bg-image {
    opacity: 1;
}

.sidebar-block:hover .block-title {
    color: white;
}

.contact-menu-block {
    grid-column: span 2;
    width: calc(50% - 7.5px);
    justify-self: center;
}

/* ==========================================================================
   CONTACT SECTION (Footer area)
   ========================================================================== */

.contact-section {
    padding: 100px 0;
    border-top: 1px solid rgba(26, 26, 26, 0.05);
    background-color: #747f64;
}

.contact-container {
    text-align: center;
    width: 100%;
}

.contact-container h2 {
    font-size: clamp(2rem, 3vw, 3.5rem);
    letter-spacing: -2px;
    margin-bottom: 50px;
    color: white;
}

/* Flexbox to align the 3 contact items nicely */
.contact-details {
    display: flex;
    justify-content: center;
    gap: 80px;
    flex-wrap: wrap;
    /* Allows wrapping on smaller screens */
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 2px solid var(--timeline-end);
    padding-bottom: 4px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* Target the anchor links inside contact items specifically */
.contact-item a:hover {
    /* The !important flag forces the browser to remove the underline, 
       overriding any default browser styles or previous CSS rules */
    text-decoration: none !important;
}

.contact-item strong {
    font-size: 1.2rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-item p {
    margin: 0;
    text-align: center;
}

.contact-item a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Hover effect for phone and email links */
.contact-item a:hover {
    color: #a0a0a0;
    text-decoration: underline;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
    padding: 50px 5%;
    text-align: center;
    font-size: 0.8rem;
    background-color: #747f64;
}



/* ==========================================================================
   MOBILE MENU STYLES (Added for < 768px functionality)
   ========================================================================== */

/* Hamburger button fixed top-left */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10001;
    background: var(--bg-main);
    border: 1px solid var(--text-dark);
    /* Changed from 50% to 4px for a modern, subtle rounded corner */
    border-radius: 4px;
    width: 50px;
    height: 50px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: none;

    /* Remove default border applied by the browser */
    border: none;
    /* Remove the default blue outline on focus */
    outline: none;
    /* Ensure no background interference */
    background: transparent;
    /* Ensure pointer cursor on hover */
    cursor: pointer;
}

/* Hamburger lines styling */
.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background-color: var(--text-dark);
    transition: 0.3s;
}

.mobile-side-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px; /* Slightly wider for menu readability */
    height: 100vh;
    background-color: var(--bg-main);
    z-index: 10000;
    transition: left 0.4s ease;
    padding: 80px 20px 20px 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto; /* Allows content scrolling */
}

.mobile-side-menu nav {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Tighter gap to fit all items */
}

.mobile-side-menu nav a {
    font-size: 1.1rem; /* Slightly smaller for better fit */
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
}

/* Class toggled by JS to reveal the menu */
.mobile-side-menu.active {
    left: 0;
}

.menu-divider {
    height: 1px;
    background-color: #ddd;
    margin: 10px 0;
}

/* Close button inside the mobile menu */
.close-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    background: transparent;
    border: none;
    color: var(--text-dark);
    cursor: none;
}

.mobile-side-menu nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-side-menu nav a {
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
}

.solal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 70px;
}

.solal-grid>* {
    min-width: 0;
}

.solal-grid>div {
    min-width: 0;
}

.solal-grid img {
    width: 100%;
    height: auto;
    display: block;
    min-width: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN 
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Above 1600px: Default Layout
   No media query needed here. The base CSS styles apply normally.
   Plenty of space is available on wide screens.
   -------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------
   2. Between 1221px and 1600px: Large Desktop
   Slightly constrained margins (20% total) and slightly reduced sidebar.
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   2. Between 1221px and 1600px: Large Desktop
   Slightly constrained margins (20% total) and slightly reduced sidebar.
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1600px) and (min-width: 1299px) {

    /* Set width to 80% to ensure 20% margin total (10% on each side) */
    .profile-top,
    .profile-bottom,
    .timeline-layout {
        width: 80%;
        margin-inline: auto;
        gap: 40px;
    }


    .timeline-container {
        flex: 1;
    }

    /* Reduce the size of the sidebar container */
    .sidebar-menu,
    .sticky-sidebar {
        width: 200px;
    }

    /* Force the grid to center the blocks and wrap them nicely */
    .sidebar-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    /* Scale down the square blocks */
    .sidebar-block {
        width: 90px;
        height: 90px;
    }

    /* Force the contact block to be a square just like the others */
    .contact-menu-block {
        width: 90px;
        height: 90px;
    }

    /* Shrink the font size inside the blocks so the text doesn't overflow */
    .block-title {
        font-size: 0.6rem;
    }

    /* Slightly scale down the hero title */
    .hero h1 {
        font-size: clamp(3.5rem, 7vw, 6.5rem);
    }

    /* Shrink profile image container slightly */
    .profile-top {
        grid-template-columns: 350px 1fr;
        gap: 60px;
    }
    

    .sticky-sidebar {
        top: 50px;
    }
}


/* --------------------------------------------------------------------------
   3. Between 768px and 1220px: Laptops & Tablets
   Keep the menu, but scale down fonts, grids, and image constraints.
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1298px) and (min-width: 768px) {

    /* Base font adjustment for small screens */
    html {
        font-size: 14px;
    }

    /* Increase width to 90% to provide side margins so the layout breathes */
    .profile-top,
    .profile-bottom,
    .timeline-layout {
        width: 90%;
        margin-inline: auto;
    }

    /* Resize hero title to prevent horizontal overflow */
    .hero h1 {
        font-size: clamp(2.8rem, 6vw, 4.5rem);
    }

    /* Adjust profile top to fit smaller available space */
    .profile-top {
        grid-template-columns: 280px 1fr;
        gap: 40px;
    }

    /* Reduce image size constraints */
    .profile-top-img img {
        height: auto;
        max-height: 500px;
    }

    /* Maintain multi-column profile bottom but reduce gaps */
    .profile-bottom {
        gap: 40px;
    }

    .timeline-container {
        flex: 1;
        /* Keep most of the width for content */
    }

    /* WE KEEP THE SIDEBAR HERE */
    .sidebar-menu,
    .sticky-sidebar {
        display: block;
        flex: 0 0 10%;
        width: 200px;
    }

    .sticky-sidebar {
        top: 30px;
    }

    /* Shrink the sidebar navigation blocks */
    .sidebar-grid {
        gap: 10px;
    }

    .sidebar-block {
        width: 75px;
        /* Noticeably smaller squares */
        height: 75px;
    }

    .contact-menu-block {
        width: calc(50% - 5px);
        /* Adjusted width based on the new gap */
    }

    .block-title {
        font-size: 0.6rem;
        /* Scaled down text to match smaller squares */
    }
}


/* --------------------------------------------------------------------------
   4. Below 768px: Mobile Devices
   Remove sidebar from flow, convert to sliding hamburger menu, stack content.
   -------------------------------------------------------------------------- */
@media screen and (max-width: 767px) {

    /* Disable custom cursor on touch devices */
    * {
        cursor: auto;
    }

    .cursor {
        display: none;
    }

    /* --- MOBILE MENU (HAMBURGER) --- */

    /* Show and style the hamburger menu button */
    .hamburger-menu,
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 35px;
        height: 25px;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 10001;
        /* Must stay above the sliding sidebar */
        cursor: pointer;
    }

    /* Hamburger lines styling */
    .hamburger-menu span,
    .mobile-menu-btn span {
        width: 100%;
        height: 3px;
        background-color: var(--text-dark);
        transition: all 0.3s linear;
    }

    .timeline-item {
        padding-left: 40px;
    }

    /* Transform the sticky sidebar into a sliding mobile menu */
    .sidebar-menu,
    .sticky-sidebar {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden off-screen by default */
        width: 250px;
        height: 100vh;
        background-color: var(--bg-main);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.4s ease-in-out;
        /* Smooth sliding animation */
        z-index: 10000;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }

    /* Class added via JS to slide the menu into view */
    .sidebar-menu.active,
    .sticky-sidebar.active {
        right: 0;
    }

    /* Ensure the menu blocks are easily tappable on mobile */
    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    /* Increase square size slightly for better touch target on mobile */
    .sidebar-block {
        width: 100px;
        height: 100px;
    }

    .contact-menu-block {
        width: 100px;
        /* Keep uniform size inside mobile layout */
    }

    .block-title {
        font-size: 0.8rem;
        /* Restore readable font size for mobile navigation */
    }

    /* --- MOBILE LAYOUT & STACKING --- */

    /* Stack grid layouts vertically for readability on small screens */
    .profile-top,
    .profile-bottom,
    .timeline-layout {
        width: 90%;
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    /* Mobile typography scaling */
    .hero h1 {
        font-size: 3.2rem;
    }

    .profile-top-text h2 {
        font-size: 2.7rem;
    }

    .text-block h3 {
        font-size: 2.4rem;
    }

    /* Center and resize profile image */
    .profile-top-img img {
        height: auto;
        max-height: 400px;
        width: 100%;
        margin-bottom: 20px;
    }

    /* Reset complex image constraints on small screens to flow naturally */
    .img-tall,
    .img-bottom,
    .img-top {
        width: 100%;
        height: auto;
        min-height: auto;
        max-height: 300px;
        margin-top: 20px;
    }

    .profile-section {
        padding: 100px 0;
    }

    /* Stack timeline elements cleanly */
    .timeline-container {
        flex: 1 1 100%;
        /* Allow timeline to occupy full remaining width */
    }

    .timeline-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .timeline-item>div[style*="display: grid"],
    .timeline-item>div[style*="display: flex"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    .subprojects-container {
        grid-template-columns: 1fr;
        /* Stack subprojects vertically */
        gap: 30px;
    }

    .col-stacked-text .text-block:first-child {
        margin-bottom: 40px;
    }

    .contact-details {
        flex-direction: column;
        /* Stack contact info vertically on mobile */
        gap: 40px;
    }
}
