/* ==================================
    :root Variables
===================================== */
:root {
    --dark-grey:   #121212;
    --grey:        #1e1e1f;
    --light-grey:  #323232;
    --blue-alice:  #F0F8FF;
    --light-blue:  #ADD8E6;
    --strong-blue: #00BBFA;

    --space-small:  0.5rem;
    --space-medium: 1.5rem;
    --space-large:  2rem;

    --radius-card:    16px;
    --radius-section: 20px;
    --transition-base: 0.25s ease;
}

/* ==================================
    Reset & Global
===================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    background-color: var(--dark-grey);
    font-family: 'Lora', Georgia, serif;
    scroll-behavior: smooth;
}

body { font-size: 16px; color: var(--blue-alice); }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--blue-alice);
}

/* ==================================
    Layout
===================================== */
.page-content {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.section-content {
    background-color: var(--grey);
    border-radius: var(--radius-section);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--light-grey);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.section-content h2 { font-size: var(--space-large); }
.section-content h3 { font-size: var(--space-medium); }
.section-content h4 { font-size: 1.05rem; }

.section-content p {
    color: var(--blue-alice);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}


/* ==================================
    Gradient bars
    .gradient-bar       → wide 55%  (after h2 main title)
    .gradient-bar.sub   → short 50px (after h3 sub-titles)
===================================== */
.gradient-bar {
    border: none;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-alice) 0%, var(--light-blue) 50%, var(--strong-blue) 100%);
    margin-bottom: 1.5rem;
    margin-left: 0;
    border-radius: 0 20px 0 20px;
    width: 55%;
}

.gradient-bar.sub {
    width: 50px;
    border-radius: 20px;
}

/* ==================================
    Article fade-in
===================================== */
article { animation: articleFadeIn 0.3s ease both; }

@keyframes articleFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* ==================================
    Social Links
===================================== */
.social-links {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    display: flex;
    gap: 1.5rem;
    z-index: 1000;
    background-color: rgba(18, 18, 18, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.social-links a {
    color: var(--blue-alice);
    text-decoration: none;
    opacity: 0.7;
    transition: color var(--transition-base), transform var(--transition-base), opacity var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover { color: var(--strong-blue); opacity: 1; transform: translateY(-3px); }

/* =======================
    Navbar
======================== */
.navbar {
    float: right;
    width: 60%;
    background: hsla(240, 1%, 17%, .75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 0 20px 0 20px;
    border: 1px solid var(--light-grey);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    z-index: 5;
}

.navbar li { list-style: none; }

/* FIX: flex-wrap nowrap so tabs never go to second line */
.navbar-list {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-around;
    align-items: center;
}

.navbar-link {
    padding: 18px 10px;
    background: transparent;
    border: none;
    color: rgba(240, 248, 255, 0.4);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.navbar-link:hover  { color: rgba(240, 248, 255, 0.7); }
/* FIX: active = only colour change, restoring original behaviour */
.navbar-link.active { color: var(--light-blue); }

/* ==================================
    Profile Section
===================================== */
#myID { display: flex; align-items: center; gap: 1.5rem; }

.profile-icon img {
    background-color: var(--light-grey);
    border-radius: 24px;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-info h1    { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.2rem; }

.profile-info .sub-title {
    font-size: 0.85rem;
    color: rgba(240, 248, 255, 0.5);
    margin-bottom: 0.8rem;
    font-family: 'Montserrat', sans-serif;
}

.job-title {
    display: inline-block;
    background-color: rgba(0, 187, 250, 0.12);
    color: var(--strong-blue);
    padding: 0.3rem 1rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.04em;
    border: 1px solid rgba(0, 187, 250, 0.25);
}

.job-title-break { display: none; }

/* =======================
    Services — FIX: 2×2 on desktop
======================== */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);   /* always 2 cols */
    gap: 16px;
}

.card {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 2px solid var(--light-blue);
    border-right: 2px solid var(--strong-blue);
    border-radius: var(--radius-card);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: background-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover { background-color: rgba(255,255,255,0.06); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }

.card-icon        { width: 38px; height: 38px; opacity: 0.85; }
.card-title       { font-size: 1rem; font-weight: 700; color: var(--blue-alice); font-family: 'Montserrat', sans-serif; }
.card-description { font-size: 0.875rem; color: rgba(240,248,255,0.7); font-family: 'Lora', serif; line-height: 1.65; }

/* =======================
    Resume / Timeline
======================== */
.timeline { margin-bottom: 30px; }

.timeline .title-wrapper { display: flex; align-items: center; gap: 14px; margin-bottom: 25px; }

.icon-box {
    position: relative;
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; justify-content: center; align-items: center;
    background-color: var(--light-grey);
    box-shadow: 0 0 0 7px rgba(50,50,50,0.5);
    z-index: 1; flex-shrink: 0;
}

.timeline-list { font-size: 14px; margin-left: 45px; list-style: none; }

.timeline-item { position: relative; }
.timeline-item:not(:last-child) { margin-bottom: 24px; }

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    top: -25px; left: -30px;
    width: 1px; height: calc(100% + 50px);
    background: var(--light-grey);
}

.timeline-item::after {
    content: '';
    position: absolute;
    top: 5px; left: -33px;
    height: 6px; width: 6px;
    border-radius: 50%;
    background: var(--strong-blue);
    box-shadow: 0 0 0 4px rgba(0,187,250,0.15);
}

.timeline-item-title { font-size: 0.9rem; line-height: 1.4; margin-bottom: 4px; color: var(--blue-alice); }
.timeline-item h5    { font-size: 0.8rem; font-weight: 500; color: rgba(240,248,255,0.55); margin-bottom: 4px; }

.timeline-list span {
    color: var(--strong-blue);
    font-weight: 500; font-size: 0.8rem; line-height: 1.6;
    font-family: 'Montserrat', sans-serif;
}

.timeline-text { color: rgba(240,248,255,0.5); font-weight: 300; line-height: 1.65; font-size: 0.875rem; margin-top: 4px; }

#article-resume h3 { padding-top: 10px; }

/* =======================
    Skills — FIX: mobile colour
======================== */
.skills-list  { display: flex; flex-direction: column; gap: 20px; }
.skill-item   { display: flex; flex-direction: column; }

.skill-info {
    display: flex; justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem; color: var(--blue-alice);
    font-family: 'Montserrat', sans-serif;
}

.skill-name       { font-weight: 400; }
.skill-percentage { font-weight: 300; opacity: 0.65; }

.progress-bar-container {
    width: 100%; height: 6px;
    background-color: rgba(255,255,255,0.07);
    border-radius: 4px; overflow: hidden;
}

/* FIX: solid fallback + explicit background-image for gradient on mobile */
.progress-bar-fill {
    height: 100%;
    background-color: var(--strong-blue);
    background-image: linear-gradient(to right, var(--light-blue), var(--strong-blue));
    border-radius: 4px;
    width: 0%;
    transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

/* =======================
    Portfolio — Bento grid
======================== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 180px;
    gap: 14px;
}

.bento-card {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}

.bento-card.span-2-col { grid-column: span 2; }
.bento-card.span-2-row { grid-row:    span 2; }
.bento-card.span-full  { grid-column: span 3; }

.bento-bg {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem;
    transition: transform 0.4s ease;
}

.bento-card:hover .bento-bg { transform: scale(1.06); }

.bento-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* remplit sans déformer */
    display: block;
}

/* gradient scrim */
.bento-card::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.08) 60%, transparent 100%);
    pointer-events: none;
}

.bento-info {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 16px; z-index: 2;
}

.bento-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }

.bento-tag {
    font-size: 0.6rem; font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.06em; text-transform: uppercase;
    background: rgba(0,187,250,0.18);
    color: var(--strong-blue);
    border: 1px solid rgba(0,187,250,0.3);
    padding: 2px 8px; border-radius: 20px;
}

.bento-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem; font-weight: 700;
    color: var(--blue-alice); margin-bottom: 2px;
}

.bento-desc {
    font-size: 0.78rem; color: rgba(240,248,255,0.6);
    line-height: 1.4; font-family: 'Lora', serif;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease;
}

.bento-card:hover .bento-desc { max-height: 60px; opacity: 1; }

.bento-link {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: 8px;
    font-size: 0.75rem; font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--strong-blue); text-decoration: none;
    opacity: 0; transform: translateY(4px);
    transition: opacity 0.25s ease 0.05s, transform 0.25s ease 0.05s, color 0.2s ease;
}

.bento-link:hover { color: var(--light-blue); }
.bento-card:hover .bento-link { opacity: 1; transform: translateY(0); }

/* card bg colours */
.bg-blue   { background: linear-gradient(135deg, #0d1b2a, #1b3a5c); }
.bg-teal   { background: linear-gradient(135deg, #0d2626, #0a4040); }
.bg-indigo { background: linear-gradient(135deg, #12102a, #2a2060); }
.bg-slate  { background: linear-gradient(135deg, #1a1a2e, #2e2e4a); }
.bg-dark   { background: linear-gradient(135deg, #1a1a1a, #2e2e2e); }

/* placeholder empty card */
.bento-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100%;
    color: rgba(240,248,255,0.2); gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem; letter-spacing: 0.05em;
}

.bento-empty svg { opacity: 0.3; }

/* =======================
    Contact
======================== */
.mapbox {
    position: relative; height: 250px; width: 100%;
    border-radius: var(--radius-card); margin-bottom: 30px;
    border: 1px solid var(--light-grey); overflow: hidden;
}

.mapbox figure { height: 100%; }

.mapbox iframe { width: 100%; height: 100%; border: none; filter: grayscale(1) invert(1) brightness(0.85); }

.form-input {
    color: var(--blue-alice);
    background: rgba(255,255,255,0.04);
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    padding: 13px 18px;
    border: 1px solid var(--light-grey);
    border-radius: 14px;
    outline: none;
    width: 100%;

    transition: all var(--transition-base);
}

.form-input::placeholder {
    color: rgba(240,248,255,0.25);
}
.form-input:focus {
    border-color: var(--strong-blue);
    box-shadow: 0 0 0 1px var(--strong-blue);
}
.form-input:focus:invalid:not(:placeholder-shown) {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 1px #ff6b6b;
}
.form-input:invalid:not(:placeholder-shown) {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 1px #ff6b6b;
}

textarea.form-input { resize: vertical; min-height: 120px; }

.input-wrapper { display: flex; gap: 16px; margin-bottom: 16px; }

.form-btn {
    width: 25%; margin-left: auto; margin-top: 14px;
    background: var(--strong-blue); color: var(--blue-alice);
    font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 0.85rem;
    display: flex; justify-content: center; align-items: center; gap: 8px;
    padding: 13px 20px; border: none; border-radius: 14px; cursor: pointer;
    transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

.form-btn:hover   { background: #00a8e0; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,187,250,0.3); }
.form-btn:active  { transform: translateY(0); }
.form-btn:disabled { background: var(--light-grey); cursor: not-allowed; transform: none; box-shadow: none; }

        
/* =======================
    Lang Switcher
======================== */
.lang-fab-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; width: 48px; height: 48px; }

.lang-main-btn {
    width: 48px; height: 48px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(18,18,18,0.55);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    color: var(--blue-alice); cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    transition: transform 0.3s ease, background var(--transition-base);
    position: relative; z-index: 2;
    -webkit-tap-highlight-color: transparent; outline: none;
}

.lang-main-btn:hover { background: rgba(0,187,250,0.2); }

.lang-options {
    position: absolute; bottom: 58px; right: 4px;
    display: flex; flex-direction: column; gap: 10px;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 1;
}

.lang-options.active { opacity: 1; visibility: visible; transform: translateY(0); }

.lang-options a {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(30,30,31,0.9); backdrop-filter: blur(10px);
    border: 1px solid var(--light-grey); color: var(--blue-alice);
    text-decoration: none; display: flex; justify-content: center; align-items: center;
    font-size: 0.65rem; font-weight: 700; font-family: 'Montserrat', sans-serif; letter-spacing: 0.05em;
    transition: background var(--transition-base), transform var(--transition-base);
}

.lang-options a:hover { background: var(--strong-blue); transform: scale(1.1); }

/* ==================================
    Responsive
===================================== */
@media (max-width: 900px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .bento-card.span-full,
    .bento-card.span-2-col { grid-column: span 2; }
}

@media (max-width: 768px) {
    .input-wrapper { flex-direction: column; gap: 12px; }
    .form-btn { width: 100%; }

    /* FIX: profile picture minimum size on mobile */
    .profile-icon img { width: 130px; height: 139px; min-width: 90px; }
    .profile-icon     { flex-shrink: 0; }

    /* FIX: navbar tabs smaller on tablet */
    .navbar-link { font-size: 0.78rem; padding: 16px 6px; }

    /* Cards go 1-col on phones */
    .grid-container { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .page-content { max-width: 100%; }

    .job-title-responsive {
        line-height: 1.5;
        text-align: center;
    }

    .job-title-responsive .job-title-separator { display: none; }
    .job-title-responsive .job-title-break { display: block; }

    /* FIX: navbar single line on phone */
    .navbar-link { font-size: 0.7rem; padding: 14px 5px; letter-spacing: 0; }

    .bento-grid       { grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; }
    .bento-card.span-full,
    .bento-card.span-2-col { grid-column: span 2; }
    .bento-card.span-2-row { grid-row: span 1; }
}

@media (max-width: 440px) {
    /* FIX: very small phones */
    .navbar-link { font-size: 0.58rem; padding: 14px 4px; }
    .form-btn { width: 100%; }

    .bento-grid { grid-template-columns: 1fr; grid-auto-rows: 140px; }
    .bento-card.span-full,
    .bento-card.span-2-col,
    .bento-card.span-2-row { grid-column: span 1; grid-row: span 1; }
}
