/* Portfolio - Khalil Bouaouina */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    font-family: Inter, sans-serif;
    background-color: #FAFAFA;
    color: #41495a;
    line-height: 1.65;
}

h1, h2, h3, h4 {
    color: #03224C;
    line-height: 1.25;
    margin: 0;
}

p {
    margin: 0 0 1em;
}

a {
    color: #03224C;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

strong {
    color: #03224C;
    font-weight: 600;
}

em {
    color: #5b6473;
    font-style: italic;
}



/* Boutons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.92em;
    font-weight: 600;
    padding: 0.6em 1.2em;
    border-radius: 2em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: #03224C;
    color: white;
}

.btn-primary:hover {
    background-color: #0a3263;
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(3, 34, 76, 0.15);
}

.btn-ghost {
    background-color: white;
    color: #03224C;
    border-color: #d7dbe4;
}

.btn-ghost:hover {
    background-color: #eef2f8;
    transform: translateY(-3px);
}



/* Barre de navigation */

header {
    position: sticky;
    top: 14px;
    z-index: 50;
    padding: 0 16px;
}

header nav {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid #e7e9ef;
    border-radius: 2em;
    box-shadow: 0 1px 2px rgba(3, 34, 76, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px 8px 18px;
    gap: 12px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #03224C;
}

.nav-mono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #03224C;
    color: white;
    font-weight: 700;
    font-size: 0.9em;
}

.nav-name {
    font-size: 0.95em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 18px;
}

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

.nav-links a {
    display: inline-block;
    color: #5b6473;
    font-size: 0.9em;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 2em;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
    color: #03224C;
    background-color: #f3f5f8;
}

.nav-links a.is-active {
    color: #03224C;
    background-color: #eef2f8;
    font-weight: 600;
}

.nav-cta {
    padding: 0.5em 1.1em;
    font-size: 0.85em;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    /* supprime le rectangle gris/bleu affiché par défaut au tap sur mobile */
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background-color: #03224C;
    border-radius: 2px;
    transition: 0.25s;
}



/* Sections */

.section {
    padding: 80px 20px;
}

/* Le contenu reste centré et borné (1000px), quel que soit le fond de la section. */
.section > * {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Alternance automatique des fonds : une <section> sur deux (les paires) en gris,
   les autres (impaires) sur le fond clair du body. Modulaire : ajouter ou retirer
   une section réajuste toute l'alternance, sans classe à gérer à la main. */
main .section:nth-of-type(even) {
    background-color: #f3f5f8;
    border-top: 1px solid #e7e9ef;
    border-bottom: 1px solid #e7e9ef;
}

.section-head {
    max-width: 760px;
    margin: 0 auto 32px;
    text-align: center;
}

.section-title {
    font-size: 1.55em;
    font-weight: 700;
    margin-bottom: 0.4em;
}

.section-lead {
    color: #5b6473;
    font-size: 0.96em;
    margin: 0;
}



/* Profil / présentation */

.section-hero {
    padding-top: 60px;
}

#hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 44px;
    align-items: center;
}

.hero-portrait {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 4px 14px rgba(3, 34, 76, 0.07);
}

.hero-eyebrow {
    color: #5b6473;
    margin: 0 0 0.2em;
    font-size: 1em;
}

.hero-name {
    font-size: 2.7em;
    font-weight: 800;
    margin: 0 0 0.3em;
}

.hero-role {
    font-weight: 600;
    color: #03224C;
    margin: 0 0 1em;
}

.hero-pitch {
    color: #41495a;
    max-width: 60ch;
}

.hero-contacts {
    list-style: none;
    margin: 1.2em 0 1.5em;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 26px;
}

.hero-contacts li {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 0.9em;
    color: #5b6473;
}

.hero-contacts i {
    color: #03224C;
    font-style: normal;
    width: 1.1em;
    text-align: center;
}

.hero-contacts a {
    color: #41495a;
}

.hero-contacts a:hover {
    color: #03224C;
    text-decoration: underline;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}



/* Expérience (stage) */

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

.stage-card {
    padding: 24px;
}

.stage-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.stage-card-head h3 {
    font-size: 1.12em;
}

.stage-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.stage-emoji {
    font-size: 1.7em;
    line-height: 1;
}

.stage-card p {
    font-size: 0.92em;
    margin-bottom: 0.7em;
}

.stage-card p:last-child {
    margin-bottom: 0;
}

.tech-env {
    margin-top: 34px;
    text-align: center;
}

.tech-env-title {
    font-size: 1em;
    color: #5b6473;
    font-weight: 600;
    margin-bottom: 16px;
}

.pill-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: white;
    border: 1px solid #e7e9ef;
    border-radius: 2em;
    padding: 8px 16px;
    font-size: 0.88em;
    font-weight: 500;
    color: #41495a;
    box-shadow: 0 1px 2px rgba(3, 34, 76, 0.04);
}

.pill i {
    font-size: 1.15em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pill img {
    font-size: 1.15em;
    width: 1.15em;
    height: 1.15em;
}

.pill img.tech-svg {
    width: auto;
}

/* Figure / trace */
.trace-figure {
    margin: 40px auto 0;
    max-width: 860px;
    text-align: center;
}

.trace-img-btn {
    display: block;
    width: 100%;
    padding: 10px;
    cursor: zoom-in;
    background-color: white;
    border: 1px solid #e7e9ef;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(3, 34, 76, 0.04);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.trace-img-btn:hover {
    box-shadow: 0 4px 14px rgba(3, 34, 76, 0.07);
    transform: translateY(-3px);
}

.trace-img-btn img {
    border-radius: 8px;
    width: 100%;
}

.trace-figure figcaption {
    margin-top: 12px;
    font-size: 0.85em;
    color: #5b6473;
}

/* Carte d'expérience (CV) */
#xp-card {
    display: flex;
    gap: 20px;
    padding: 24px 26px;
    background-color: white;
    border: 1px solid #e7e9ef;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(3, 34, 76, 0.04);
}

.xp-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex: none;
    margin-top: 3px;
}

.xp-body {
    flex: 1;
    min-width: 0;
}

.xp-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 14px;
}

.xp-head h3 {
    font-size: 1.12em;
}

.xp-dates {
    font-size: 0.82em;
    color: #5b6473;
    font-weight: 500;
}

.xp-org {
    font-size: 0.88em;
    color: #03224C;
    font-weight: 600;
    margin: 3px 0 12px;
}

.xp-desc {
    font-size: 0.93em;
    margin: 0 0 12px;
}

.xp-points {
    margin: 0 0 16px;
    padding-left: 1.1em;
}

.xp-points li {
    font-size: 0.91em;
    margin-bottom: 0.35em;
}

.xp-points li::marker {
    color: #03224C;
}

#xp-card .pill-list {
    justify-content: flex-start;
}



/* Rangée de pastilles (utilisée dans les modales projet) */

.mission-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 14px;
}



/* Projets */

#projets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.projet-card {
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    background-color: white;
    border: 1px solid #e7e9ef;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(3, 34, 76, 0.04);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.projet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 14px rgba(3, 34, 76, 0.07);
}

.projet-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top;
    background-color: #eef2f8;
    border-bottom: 1px solid #e7e9ef;
}

.projet-body {
    padding: 16px 18px 18px;
}

.projet-type {
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #5b6473;
}

.projet-title {
    display: block;
    color: #03224C;
    font-size: 1.1em;
    font-weight: 700;
    margin: 4px 0 8px;
}

.projet-techs {
    font-size: 0.8em;
    color: #5b6473;
}



/* Compétences techniques */

#technos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.techno-group {
    padding: 0;
}

.techno-group h3 {
    font-size: 0.95em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #03224C;
}

.techno-group h3::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background-color: #03224C;
}

.techno-items {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

/* Pastilles interactives : plates au repos, elles se soulèvent au survol.
   Une seule règle, utilisée par les compétences ET la carte d'expérience. */
.pill-interactive {
    box-shadow: none;
    transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.2s ease;
}

.pill-interactive:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(3, 34, 76, 0.07);
    border-color: #d7dbe4;
}



/* Contact */

#contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 26px 16px;
    background-color: white;
    border: 1px solid #e7e9ef;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(3, 34, 76, 0.04);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 14px rgba(3, 34, 76, 0.07);
}

.contact-ic {
    font-size: 1.7em;
    color: #03224C;
    height: 1.7em;
    line-height: 1.7em;
}

.contact-label {
    font-weight: 700;
    color: #03224C;
    font-size: 0.95em;
}

.contact-value {
    font-size: 0.82em;
    color: #5b6473;
    word-break: break-word;
}



/* Pied de page */

footer {
    background-color: #03224C;
    color: #cdd7e6;
    text-align: center;
    padding: 34px 20px;
}

footer p {
    margin: 0;
}

footer p:first-child {
    color: white;
    font-weight: 600;
}

footer p:last-child {
    font-size: 0.82em;
    margin-top: 6px;
    opacity: 0.8;
}



/* Modal */

#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background-color: rgba(3, 34, 76, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
}

#modal-dialog {
    position: relative;
    background-color: white;
    border-radius: 20px;
    max-width: 760px;
    width: 100%;
    box-shadow: 0 18px 50px rgba(3, 34, 76, 0.18);
    animation: modalAppear 0.28s cubic-bezier(0.2, 0.8, 0.25, 1);
    margin: auto;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

#modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e7e9ef;
    background-color: white;
    color: #5b6473;
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

#modal-close:hover {
    background-color: #f3f5f8;
    color: #03224C;
}

#modal-content {
    padding: 34px 34px 36px;
}

.m-head {
    margin-bottom: 18px;
    padding-right: 30px;
}

.m-num {
    font-size: 0.74em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #03224C;
}

.m-title {
    font-size: 1.5em;
    font-weight: 800;
    margin: 4px 0 6px;
}

.m-block {
    margin-bottom: 22px;
}

.m-block h4 {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #5b6473;
    margin-bottom: 10px;
}

.m-block p {
    font-size: 0.94em;
    margin: 0 0 0.7em;
}

/* Traces dans la modale */
.m-traces {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.m-trace {
    margin: 0;
}

.m-trace button {
    display: block;
    width: 100%;
    padding: 6px;
    cursor: zoom-in;
    background-color: #FAFAFA;
    border: 1px solid #e7e9ef;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.m-trace button:hover {
    box-shadow: 0 4px 14px rgba(3, 34, 76, 0.07);
    transform: translateY(-3px);
}

.m-trace img {
    border-radius: 6px;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: top;
}

.m-trace figcaption {
    font-size: 0.76em;
    color: #5b6473;
    margin-top: 6px;
}

/* Modale projet */
.p-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top;
    border-radius: 12px;
    border: 1px solid #e7e9ef;
    margin-bottom: 18px;
}

/* Liens du projet (dépôt, démo…) */
.projet-liens {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Espace entre la galerie de captures et les liens */
.m-traces + .projet-liens {
    margin-top: 12px;
}

.lien-projet {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: white;
    border: 1px solid #d7dbe4;
    border-radius: 2em;
    padding: 8px 16px;
    font-size: 0.88em;
    font-weight: 600;
    color: #03224C;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.2s ease;
}

.lien-projet:hover {
    background-color: #eef2f8;
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(3, 34, 76, 0.07);
}



/* Lightbox : agrandir une image */

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background-color: rgba(3, 34, 76, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
}

#lightbox img {
    max-width: 95%;
    max-height: 92vh;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(3, 34, 76, 0.18);
}

#lightbox-close {
    position: absolute;
    top: 18px;
    right: 24px;
    background: none;
    border: 0;
    color: white;
    font-size: 2.6em;
    line-height: 1;
    cursor: pointer;
}



/* Utilitaires */

.is-hidden {
    display: none !important;
}

body.no-scroll {
    overflow: hidden;
}

/* Contenu réservé aux lecteurs d'écran (masqué visuellement) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Lien d'évitement : caché, sauf quand il reçoit le focus au clavier */
.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    background-color: #03224C;
    color: white;
    padding: 0.6em 1em;
    border-radius: 0.5em;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 16px;
}

/* Indicateur de focus clavier, net et cohérent sur tous les éléments interactifs */
a:focus-visible,
button:focus-visible,
.projet-card:focus-visible,
[data-zoom]:focus-visible {
    outline: 3px solid #03224C;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Sur fond marine (footer) ou superposition sombre, un focus clair */
footer a:focus-visible,
#modal-overlay button:focus-visible,
#lightbox button:focus-visible {
    outline-color: white;
}



/* Responsive */

@media (max-width: 980px) {

    #projets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 860px) {

    .nav-name {
        display: none;
    }

    .stage-grid, #projets-grid, #technos-grid {
        grid-template-columns: 1fr;
    }

    #contact-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    #hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
        justify-items: center;
    }

    .hero-pitch {
        margin-inline: auto;
    }

    .hero-contacts, .hero-actions {
        justify-content: center;
    }

    .hero-name {
        font-size: 2.2em;
    }

    .section-title {
        font-size: 1.35em;
    }

    #xp-card {
        flex-direction: column;
        gap: 14px;
    }
}

@media (max-width: 720px) {

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        background-color: white;
        border: 1px solid #e7e9ef;
        border-radius: 14px;
        padding: 14px;
        box-shadow: 0 4px 14px rgba(3, 34, 76, 0.07);
    }

    header.nav-open .nav-menu {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .nav-links a {
        padding: 10px 12px;
    }

    .nav-cta {
        text-align: center;
        justify-content: center;
    }

    #modal-content {
        padding: 28px 20px 30px;
    }

    .section {
        padding: 60px 18px;
    }
}

@media (max-width: 480px) {

    #contact-cards {
        grid-template-columns: 1fr;
    }

    .hero-portrait {
        width: 150px;
        height: 150px;
    }
}

@media (prefers-reduced-motion: reduce) {

    * {
        scroll-behavior: auto !important;
        animation: none !important;
        transition: none !important;
    }
}
