* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    scroll-behavior: smooth;
    list-style: none;
}

/* HEADER */

header {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5rem;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 3rem;
    z-index: 1000;
}

.logo {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    text-wrap: nowrap;
    transition: 0.3s ease-in-out;
}

.logo:hover {
    transform: scale(1.1);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

li a {
    position: relative;
    color: white;
    font-weight: 300;
}

li a::before {
    position: absolute;
    content: '';
    width: 0;
    left: 0;
    height: 5px;
    top: 25px;
    border-radius: 1rem;
    transition: 0.3s ease-in-out;
    background: linear-gradient(to right, rgb(42, 125, 162), rgb(62, 187, 148));
}

li a:hover::before {
    width: 100%;
}

.visit-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 3rem;
    border: none;
    font-weight: 500;
    font-size: 1rem;
    color: white;
    cursor: pointer;
    text-wrap: nowrap;
    transition: 0.3s ease-in-out;
    background: linear-gradient(to right, rgb(42, 125, 162), rgb(62, 187, 148));
}

.visit-btn:hover {
    background: linear-gradient(to right, rgb(62, 187, 148), rgb(42, 125, 162));
    transform: scale(1.03);
}

#menu-icon {
    font-size: 2rem;
    display: none;
    color: white;
    cursor: pointer;
}

/*  SECTIONS  */

section {
    min-height: 100vh;
    padding: 8rem 12%;
    width: 100%;
    position: relative;
}

/*  ABOUT  */

.about {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4rem;
}

.about .about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5rem;
}

.about img {
    width: 20vw;
    border-radius: 50%;
}

.about .search {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.about h4 {
    font-size: 2rem;
    font-weight: 500;
    opacity: 0.8;
    text-align: center;
    margin: 0;
}

.info-box {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.info-box h3 {
    font-size: 3rem;
    font-weight: 500;
    opacity: 0.8;
}

.info-box span {
    background: linear-gradient(to right, rgb(62, 187, 148), rgb(42, 125, 162));
    background-clip: text;
    color: transparent;
    font-size: 3rem;
}

.btn-group {
    display: flex;
    gap: 1rem;
}

.btn {
    border-radius: 3rem;
    padding: 0.5rem 1.5rem;
    border: 2px solid black;
    cursor: pointer;
    font-weight: 500;
    text-wrap: nowrap;
    transition: 0.2s ease-in-out;
}

.btn:hover {
    background-color: black;
    color: white;
}

.socials {
    display: flex;
    gap: 2rem;
}

.black-link a,
.black-link a:visited,
.black-link a:link,
.black-link a:hover,
.black-link a:active {
    color: black;
}

.socials i {
    color: inherit;
}

.socials i {
    font-size: 2.5rem;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

.socials i:hover {
    transform: scale(1.1);
}

/*  SEARCH SECTION  */

.search-section {
    width: 100%;
    max-width: 780px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* Search bar */
.search-bar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.8);
    border-radius: 3rem;
    padding: 0.75rem 1.4rem;
    gap: 0.8rem;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.search-bar-wrapper:focus-within {
    border-color: rgb(42, 125, 162);
    box-shadow: 0 0 0 4px rgba(0, 157, 255, 0.12);
}

.search-icon {
    color: rgba(0, 0, 0, 0.8);
    font-size: 1.2rem;
    flex-shrink: 0;
}

#search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.2rem;
    font-family: inherit;
    color: #111;
    background: transparent;
}

#search-input::placeholder {
    color: #bbb;
}

.clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 1.2rem;
    padding: 0;
    display: none;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: #333;
}

.clear-btn.visible {
    display: flex;
}

/* Filters row */
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    align-items: flex-start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(0, 0, 0, 0.8);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    border: 1.5px solid #ddd;
    background: #fff;
    border-radius: 2rem;
    padding: 0.3rem 0.9rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    border-color: rgb(42, 125, 162);
    color: rgb(42, 125, 162);
}

.chip.active {
    background: linear-gradient(to right, rgb(42, 125, 162), rgb(62, 187, 148));
    -webkit-background-clip: padding-box;
    background-clip: padding-box;
    border-color: transparent;
    color: #fff;
}

/* Results list */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.results-hint {
    color: #aaa;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.results-hint i {
    color: rgb(42, 125, 162);
}

.no-results {
    color: #bbb;
    font-size: 1rem;
    padding: 0.5rem 0;
}

/* Individual result card */
.result-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem 1.2rem 1rem 1.4rem;
    background: #fff;
    border: 1.5px solid #eee;
    border-left: 4px solid transparent;
    border-image: linear-gradient(to bottom, rgb(42, 125, 162) rgb(62, 187, 148)) 1;
    border-radius: 0.75rem;
    border-left-color: rgb(42, 125, 162);
    /* fallback */
    transition: transform 0.2s, box-shadow 0.2s;

    /* Entrance animation */
    animation: slideIn 0.22s ease both;
}

/* border-image and border-radius don't mix: use pseudo instead */
.result-card {
    position: relative;
    border: 1.5px solid #eee;
    border-radius: 0.75rem;
    overflow: visible;
}

.result-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0.75rem 0 0 0.75rem;
    background: linear-gradient(to bottom, rgb(42, 125, 162), rgb(62, 187, 148));
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
}

.result-badge {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.6rem;
    border-radius: 2rem;
    color: #fff;
}

.result-badge.experience {
    background: rgb(42, 125, 162);
}

.result-badge.project {
    background: rgb(62, 187, 148);
}

.result-description {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.result-tag {
    font-size: 0.8rem;
    background: #f3f4f6;
    color: #666;
    border-radius: 2rem;
    padding: 0.15rem 0.55rem;
    font-weight: 500;
}

.result-tag.highlight {
    background: rgba(62, 187, 148, 0.12);
    color: rgb(62, 187, 148);
    font-weight: 600;
}

.result-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgb(42, 125, 162);
    transition: gap 0.2s, color 0.2s;
    width: fit-content;
}

.result-link:hover {
    gap: 0.6rem;
    color: rgb(62, 187, 148);
}

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

.title-date .date {
    font-size: 1.5rem;
}

/*  EXPERIENCE  */

.section-title {
    text-align: center;
    font-size: 4rem;
    font-weight: 600;
    margin-bottom: 3rem;
}

.experience-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-card {
    border: 2px solid black;
    border-radius: 3rem;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: baseline;
    justify-content: left;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

.grid-card:hover {
    transform: scale(1.02);
    background-color: black;
    color: white;
}

.project-card:hover h3,
.grid-card:hover h3 {
    color: white;
}

.project-card h3,
.grid-card h3 {
    font-size: 1.5rem;
    color: #444;
}

.grid-card span,
.project-card span {
    font-size: 2rem;
    font-weight: 500;
    background: linear-gradient(to right, rgb(42, 125, 162), rgb(62, 187, 148));
    background-clip: text;
    color: transparent;
}

::-webkit-scrollbar {
    width: 20px;
}

::-webkit-scrollbar-track {
    background-color: rgb(219, 219, 219);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, rgb(42, 125, 162), rgb(62, 187, 148));
}

/*  PROJECTS  */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.5rem;
    border: 2px solid black;
    border-radius: 3rem;
    cursor: pointer;
    transition: 0.3s ease-in-out;
}

.project-card:hover {
    background-color: black;
    color: white;
    transform: translateY(-10px) scale(1.02);
}

.project-card:hover .btn {
    border: 2px solid white;
    color: white;
}

.project-card:hover .btn:hover {
    background-color: white;
    color: black;
}

/*  FOOTER  */

footer {
    height: 10rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

footer ul {
    display: flex;
    align-items: center;
    gap: 3rem;
}

footer ul li a {
    color: black;
    font-weight: 600;
}

.copyright {
    margin-top: 2rem;
}

/*  RESPONSIVENESS  */

@media(max-width:1280px) {
    header {
        padding: 1rem 2rem;
        gap: 2rem;
    }

    .about .about-container {
        gap: 3rem;
    }

    .experience-info {
        flex-direction: column;
    }
}

@media(max-width:768px) {
    header {
        gap: 1rem;
        padding: 1rem;
    }

    header .logo {
        font-size: 1rem;
    }

    header .visit-btn {
        display: none;
    }

    .about-container {
        flex-direction: column;
    }

    .about img {
        width: 60vw;
    }

    .grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .filters-row {
        flex-direction: column;
    }
}

@media(max-width:600px) {
    header #menu-icon {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        margin-top: 1rem;
        width: 100%;
        display: none;
        flex-direction: column;
        text-align: center;
        background: rgba(0, 0, 0, 0.9);
        border-radius: 3rem;
    }

    .nav-links li {
        margin-top: 1.5rem;
        padding: 1rem;
    }

    .nav-links.active {
        display: block;
    }

    header {
        padding: 1rem 5rem;
        gap: 8rem;
    }

    header .logo {
        font-size: 1.5rem;
    }

    .about-container img {
        width: 80vw;
    }

    footer ul {
        gap: 1rem;
    }

    .search-section {
        max-width: 100%;
    }
}

/* ─── LANGUAGE TOGGLE ─── */

/* Shared base for both desktop and mobile toggles */
.lang-toggle,
.lang-toggle-mobile {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

/* Each FR / EN label */
.lang-toggle .lang-option,
.lang-toggle-mobile .lang-option {
    position: relative;
    color: white;
    font-weight: 300;
    font-size: 1rem;
    cursor: pointer;
    /* gradient underline bar — same mechanics as nav li a::before */
    padding-bottom: 2px;
}

.lang-toggle .lang-option::before,
.lang-toggle-mobile .lang-option::before {
    position: absolute;
    content: '';
    width: 0;
    left: 0;
    height: 5px;
    top: 25px;
    border-radius: 1rem;
    transition: 0.3s ease-in-out;
    background: linear-gradient(to right, rgb(42, 125, 162), rgb(62, 187, 148));
}

/* Active language gets the full-width underline */
.lang-toggle .lang-option.active::before,
.lang-toggle-mobile .lang-option.active::before {
    width: 100%;
}

/* Divider — same muted style as nav separators */
.lang-toggle .lang-divider,
.lang-toggle-mobile .lang-divider {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
    font-size: 1rem;
    user-select: none;
    pointer-events: none;
}

/* Mobile nav lang item — hidden on desktop */
.lang-nav-item {
    display: none;
}

@media(max-width: 600px) {

    /* Hide the desktop toggle when mobile menu is active */
    .lang-toggle {
        display: none;
    }

    /* Show the lang item inside the mobile dropdown */
    .lang-nav-item {
        display: block;
        padding-bottom: 1.2rem;
    }

    .lang-toggle-mobile {
        justify-content: center;
    }
}

/* ─── SKILLS SECTION ─── */

.skills {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 8rem;
    gap: 2rem;
}

.skills .search-section {
    max-width: 960px;
    /* wider than about's 780px to accommodate skill groups */
}

/* Full-width filter group for skills */
.filter-group--skills {
    width: 100%;
}

/* Skills grouped container */
#tech-chips {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
}

.skill-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skill-group-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(0, 0, 0, 0.35);
}

.skill-group-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ─── FLOATING SECTION NAV (two buttons) ─── */

.section-nav-group {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    z-index: 999;
}

.nav-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    user-select: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s, opacity 0.22s;
    outline: none;
}

.nav-btn i {
    background: linear-gradient(to bottom, rgb(42, 125, 162), rgb(62, 187, 148));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.nav-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    background: rgba(0, 0, 0, 0.94);
}

#nav-up:hover i {
    transform: translateY(-3px);
}

#nav-down:hover i {
    transform: translateY(3px);
}

.nav-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(62, 187, 148, 0.6);
}

.nav-btn.edge {
    opacity: 0.38;
}

@media(max-width: 600px) {
    .section-nav-group {
        right: 1rem;
        gap: 0.5rem;
    }

    .nav-btn {
        width: 46px;
        height: 46px;
        font-size: 1rem;
    }
}

/* ─── SKILLS FILTER TOGGLE ─── */

.filter-label-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.skills-toggle-btn {
    background: none;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.65rem;
    padding: 0;
    transition: color 0.2s, border-color 0.2s, transform 0.3s ease;
    flex-shrink: 0;
}

.skills-toggle-btn:hover {
    color: rgb(42, 125, 162);
    border-color: rgb(42, 125, 162);
}

.skills-toggle-btn.collapsed i {
    transform: rotate(180deg);
}

#tech-chips {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.3s ease;
    opacity: 1;
    margin-top: 0;
}

#tech-chips.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
}