/**************************************
 GLOBAL
**************************************/
body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;

    scroll-behavior: smooth;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Background image applied to the body */
body {
    background-image: url("images/background.jpg");
    background-repeat: repeat;      /* tile the image */
    background-size: auto;          /* keep original size */
    background-position: top left;  /* start tiling from top-left */
    background-attachment: scroll;   /* stays fixed while scrolling */
    background-color: #eee;         /* fallback color */
}

body::-webkit-scrollbar,
html::-webkit-scrollbar {
    display: none;
}

html {
    overflow-y: scroll;
}

/* Background overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;

    /* Change this to adjust brightness/tint */
    background: rgba(255, 255, 255, 0.55); /* lighter */
    /* example darker: rgba(0, 0, 0, 0.3); */

    /* or use a gradient */
    /* background: linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.2)); */
    
    z-index: -1;
}

/**************************************
 HERO VIDEO SECTION
**************************************/
#hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

#hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;

    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
}

/* Title + Subheading */
.hero-text h1,
.hero-text h3 {
    margin: 0;
    padding: 0;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 600;
    letter-spacing: 2px;
}

.hero-text h3 {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-style: italic;
    color: #ddd;
    letter-spacing: 1px;
}

/**************************************
 NAVIGATION BAR
**************************************/

#main-nav,
#main-nav .nav-inner {
    box-sizing: border-box;
}

#main-nav {
    width: 100%;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    /* start as normal flow */
    position: relative;
    top: 0;
    z-index: 1000;

    transition: all 0.4s ease;
}

/* Inner container maintains your 100% layout */
#main-nav .nav-inner {
    width: 100%;
    padding: 0 40px;

    display: flex;
    align-items: center;
    position: relative; /* Needed for absolute nav-right */
}

/* Hover styling */
#main-nav span {
    margin: 0 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

#main-nav span:hover {
    color: #66b3ff;
}

/* LEFT NAV (Home button) */
#main-nav .nav-left {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    visibility: hidden;
}

#main-nav.sticky .nav-left {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
}

/* RIGHT NAV (centered initially, slides right on sticky) */
#main-nav .nav-right {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.6s ease;
}

#main-nav.sticky .nav-right {
    transform: translateX(20vw);
}

/* STICKY STATE */
#main-nav.sticky {
    position: fixed; /* pinned to top */
    top: 0;
    backdrop-filter: blur(8px);
    justify-content: space-between;
}

/**************************************
 ABOUT ME PREVIEW
**************************************/
.section {
    padding: 120px 10%;
    padding-bottom: 60px;
    background: #ddd;
}

.about-container {
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: 1300px;
    margin: auto;
    margin-top: 5vh;
}

.about-photo {
    width: 300px;
    height: 300px;
    margin-right: 10px;
    margin-top: 80px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
}

.about-text h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 10px;
    margin-top: 80px;
}

.about-text p {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    max-width: 1200px;
    line-height: 1.6;
}

#about {
    scroll-margin-top: 80px; /* match or slightly less than navbar height + desired spacing */
}

/**************************************
 MORE BUTTON
**************************************/
.more-button {
    display: inline-block;
    margin-top: 20px;
    font-size: 1.3rem;
    color: #0077cc;
    text-decoration: none;
    font-weight: bold;

    transition: color 0.3s ease;
}

.more-button .arrow {
    opacity: 0;
    margin-left: 5px;
    transition: opacity 0.3s ease, margin-left 0.3s ease;
}

.more-button:hover {
    text-decoration: underline;
}

.more-button:hover .arrow {
    opacity: 1;
    margin-left: 12px;
}

/**************************************
 FULL ABOUT CONTENT
**************************************/
#about-full {
    padding: 80px 12vw;
    background: #eee;
}

.about-article {
    max-width: 1150px;
    margin: auto;
    color: #222;
    line-height: 1.75;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
}

.about-article h1 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 50px;
}

/**************************************
 ABOUT PAGE NAVBAR (Fixed Back Button)
**************************************/
#about-nav {
    width: 100%;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: fixed; /* always at top */
    top: 0;
    z-index: 1000;

    backdrop-filter: blur(8px);
}

/* Use same structure as main nav */
#about-nav .nav-inner {
    width: 100%;
    padding: 0 40px;

    display: flex;
    align-items: center;
    position: relative;
}

/* BACK BUTTON (matches main nav-left sticky state position) */
#about-nav .nav-left {
    opacity: 1;               /* always visible */
    visibility: visible;      /* always shown */
    transform: translateX(0); /* same resting position as sticky main nav */
}

/* Back button styling */
#about-nav .back-button {
    font-size: 1rem;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

#about-nav .back-button:hover {
    color: #66b3ff;
}

/**************************************
 INLINE FLOAT IMAGES
**************************************/
.float-img {
    width: 100%;
    margin: 0;
}

.float-img img {
    width: 320px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
}

.float-img.right img {
    float: right;
    margin: 10px 0 20px 40px;
}

.float-img.left img {
    float: left;
    margin: 10px 40px 80px 0;
}

/* Ensure layout doesn't break on small screens */
@media (max-width: 800px) {
    .float-img img {
        float: none !important;
        display: block;
        margin: 20px auto;
        width: 90%;
        max-width: 350px;
    }
}

.pfloat-img {
    width: 100%;
    margin: 0;
}

.pfloat-img img {
    width: 260px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
}

.pfloat-img.right img {
    float: right;
    margin: 10px 0 20px 40px;
}

.pfloat-img.left img {
    float: left;
    margin: 10px 40px 20px 0;
}

/* Ensure layout doesn't break on small screens */
@media (max-width: 800px) {
    .pfloat-img img {
        float: none !important;
        display: block;
        margin: 20px auto;
        width: 90%;
        max-width: 350px;
    }
}

/**************************************
PROJECTS SECTION
**************************************/
#projects {
    padding: 60px 6vw;
    background: #eeeeee00;
}

.section-title {
    text-align: center;
    color: rgb(0, 0, 0);
    font-size: 2.5rem;
    margin-bottom: 50px;
}

/* PUZZLE GRID */
.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 80px;
    gap: 20px;
}

/* Non-overlapping mosaic placement */
.p1  { grid-column: 1 / 5;  grid-row: 1 / 5; }
.p2  { grid-column: 5 / 8;  grid-row: 1 / 5; }
.p3  { grid-column: 8 / 13; grid-row: 1 / 6; }

.p4  { grid-column: 1 / 4;  grid-row: 5 / 9; }
.p5  { grid-column: 4 / 8;  grid-row: 5 / 9; }
.p6  { grid-column: 8 / 11; grid-row: 6 / 10; }
.p7  { grid-column: 11 / 13; grid-row: 6 / 10; }

.p8  { grid-column: 1 / 5;  grid-row: 9 / 14; }
.p9  { grid-column: 5 / 8;  grid-row: 9 / 14; }
.p10 { grid-column: 8 / 13; grid-row: 10 / 14; }

/* Card Styling */
.project-card {
    border-radius: 20px;
    overflow: hidden;
    background: #111;
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover zoom */
.project-card:hover {
    transform: scale(1.025);
    box-shadow: 0 15px 40px rgba(0,0,0,0.7);
}

.media-container {
    position: relative;
    flex: 1;
    overflow: hidden;
}

/* Image */
.media-container img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- NEW OVERLAY ---------- */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(190, 190, 190, 0.75);
    backdrop-filter: blur(3px);

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;

    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Overlay text */
.overlay p {
    color: #222;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.4;
}

/* Show overlay on hover */
.project-card:hover .overlay {
    opacity: 1;
}

/* Remove video behavior */
.media-container video {
    display: none;
}

/* Text section */
.project-text {
    padding: 14px 16px;
    background: rgba(51, 51, 51, 0.8);
}

.project-text h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}

/* More link animation */
.more-link {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    transition: text-decoration-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.project-card:hover .more-link {
    text-decoration-color: white;
}

/**************************************
 PROJECT PAGE STYLING
**************************************/
#project-full {
    padding: 80px 12vw;
    background: #eee;
}

.project-article {
    max-width: 1150px;
    margin: auto;
    text-align: center;
    color: #222;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
}

.project-article h1 {
    font-size: 3rem;
    margin-bottom: 40px;
}

.placeholder-msg {
    font-size: 1.4rem;
    color: #444;
    margin-top: 10px;
}

/**************************************
EXPERIENCE SECTION
**************************************/

.experience-wrapper {
    display: flex;
    width: 100%;
    max-width: 90vw;
    margin: 0px 10vw;
    padding: 100px 20px;
    padding-bottom: 0px;
    gap: 50px;
    min-height: 500px;
}

.experience-wrapper .section-title {
    color: #000000;
}

/* LEFT TIMELINE */
.timeline-left {
    width: 25%;
    position: relative;
    padding-left: 30px;
}

.timeline-left::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ddd;
}

.timeline-item {
    margin-bottom: 28px;
    position: relative;
    padding-left: 20px;
    cursor: pointer;
}

.timeline-item .dot {
    position: absolute;
    left: -3px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: #444;
    border-radius: 50%;
}

.timeline-item .date {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.timeline-item .title {
    font-size: 1rem;
    font-weight: 500;
    color: #111;
}

/* --- TIMELINE ACTIVE / INACTIVE STYLING --- */
.timeline-item {
    transition: opacity 0.25s ease;
    position: relative;
}

/* DOT — now scales from center */
.timeline-item .dot {
    position: absolute;
    left: -3px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: #444;
    border-radius: 50%;
    transition: transform 0.25s ease;
    transform-origin: center center; /* THIS FIXES THE SHIFT */
}

/* TEXT scaling */
.timeline-item .text {
    transition: transform 0.25s ease;
    transform-origin: left center; /* grow outward from the timeline */
}

/* INACTIVE ITEMS */
.timeline-item.inactive {
    opacity: 0.55;
}

/* ACTIVE ITEM */
.timeline-item.active {
    opacity: 1;
}

.timeline-item.active .text {
    transform: scale(1.08);
}

.timeline-item.inactive .text {
    transform: scale(1.00);
}

/* Dot scale on active */
.timeline-item.active .dot {
    transform: scale(1.45); /* adjust size to your liking */
}

.timeline-item.inactive .dot {
    transform: scale(1.0);
}

/* RIGHT POPUP */
.popup {
    width: 25%;
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(10px);
    transition: 0.25s ease;
}

.popup.visible {
    opacity: 1;
    transform: translateY(0);
}

.popup.hidden {
    display: none;
}

.popup h2 {
    margin-top: 0;
    font-size: 1.3rem;
}

.popup ul {
    margin-top: 10px;
}

/* ensure popup is topmost and receives mouse events */
.popup-card {
  z-index: 9999;
  pointer-events: auto;
}

/* make popup transitions smooth (already present, but being explicit) */
.popup-card {
  transition: opacity 0.2s ease, transform 0.18s ease;
}

/* popup always visible now */
#experience-popup {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

/**************************************
SKILLS SECTION
**************************************/
.skills-section {
    padding: 60px 8%;
    padding-top: 70px;
    background: #eeeeee00;  /* dark mode */
    color: #eee;
}

.skills-section .section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 30px;
    color: #000000;
}

.skill-category {
    margin-bottom: 20px;
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #000000;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 20px;
    justify-items: center;
    align-items: center;
}

.skill-icon {
    position: relative;
    width: 120px;
    height: 60px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.skill-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0.85);
    transition: filter 0.3s ease;
}

.skill-icon:hover {
    transform: scale(1.2);
    filter: brightness(1.2);  /* highlight effect */
}

/* Tooltip */
.skill-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;  /* above the icon */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1000;
}

.skill-icon:hover::after {
    opacity: 1;
}

.skill-category-line {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.skill-category-line h3 {
    margin: 0; /* remove default spacing */
    white-space: nowrap;
}

.skill-category-line .line {
    flex-grow: 1;
    height: 1px;
    background: rgba(200, 200, 200, 0.3); /* lightly visible grey line */
}

/**************************************
 FOOTER
**************************************/
#footer {
    width: 100%;
    background: rgba(20, 20, 20, 0.95);
    color: #ddd;
    padding: 15px 40px;
    text-align: center;
    border-top: 1px solid #444;
    font-size: 1rem;
    box-sizing: border-box;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 60px;
}

#footer a {
    color: #4da3ff;
    text-decoration: none;
}

#footer a:hover {
    text-decoration: underline;
    color: #66cfff;
}

#footer i {
    color: white;
    margin-right: 5px;
}


/**************************************
 MAIN CONTENT
**************************************/
.full-content {
    margin-top: 40px;
}


/**************************************
 RESPONSIVE MEDIA QUERIES
**************************************/
@media (max-width: 1024px) {
    .about-container {
        gap: 40px;
    }
}

@media (max-width: 768px) {

    #main-nav {
        padding: 12px 15px;
    }

    #main-nav span {
        margin: 0 10px;
        font-size: 0.95rem;
    }

    #main-nav.sticky .nav-right {
        transform: translateX(25vw);
    }

    .about-container {
        flex-direction: column;
        text-align: center;
    }

    .about-photo {
        width: 200px;
        height: 200px;
    }

    .about-text p {
        max-width: 100%;
    }
}

@media (max-width: 480px) {

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .hero-text h3 {
        font-size: 1.1rem;
    }

    .about-photo {
        width: 160px;
        height: 160px;
    }

    #main-nav span {
        font-size: 0.9rem;
    }
}

/* Tablets */
@media (max-width: 1024px) {
    .about-container {
        gap: 40px;
    }
    .experience-wrapper {
        flex-direction: column;
        margin: 0 20px;
        padding: 50px 10px;
    }
    .timeline-left, .popup {
        width: 100%;
        padding: 0;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .hero-text h1 { font-size: 1.8rem; }
    .hero-text h3 { font-size: 1rem; }
    .about-photo { width: 140px; height: 140px; }
    .timeline-item .title { font-size: 0.85rem; }
    .timeline-item .date { font-size: 0.7rem; }
    .skills-section { padding: 40px 5%; }
    .skill-grid { gap: 12px; }
    .project-card { font-size: 0.85rem; }
}