/* ========================================
   PORTFOLIO — LOÏCA ANDRIAMONTA
   Typographies :
   - Bricolage Grotesque : titres
   - Archivo Narrow : texte courant
======================================== */


/* ========================================
   1. VARIABLES
======================================== */

:root {
    --color-bg: #f8f7f4;
    --color-text: #242424;
    --color-muted: #77736d;
    --color-border: #c9c7c1;
    --color-accent: #e7e4dc;
    --color-white: #ffffff;

    --font-heading: "Bricolage Grotesque", sans-serif;
    --font-main: "Archivo Narrow", sans-serif;

    --page-padding: 24px;
    --transition: 0.3s ease;
}


/* ========================================
   2. RESET
======================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-margin-top: 60px;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fit;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

ul,
ol {
    list-style: none;
}


/* ========================================
   3. TYPOGRAPHIE
======================================== */

/* Titres principaux */

h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.section-title {
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: 1.1;
}

/* Grand titre des pages */

.page-title {
    font-size: clamp(42px, 10vw, 150px);
    line-height: 0.75;
    letter-spacing: -0.055em;
    overflow-wrap: break-word;
}

/* Titres de sections */

.section-title {
    margin-bottom: 22px;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.025em;
    text-transform: uppercase;
}

/* Titres des cartes */

.project-info h3,
.portfolio-item h2,
.experience-item h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

/* Texte courant */

p,
li,
dt,
dd,
label,
input,
textarea,
button,
.site-nav,
.site-footer {
    font-family: var(--font-main);
}

p {
    line-height: 1.5;
}

.small {
    font-size: 13px;
}

.muted {
    color: var(--color-muted);
}

.text-link {
    display: inline-block;
    width: fit-content;
    margin-top: 22px;
    padding-bottom: 4px;
    border-bottom: 1px solid currentColor;
    font-size: 16px;
    transition: opacity var(--transition);
}

.text-link-big {
    font-size: clamp(48px, 8vh, 100px);
    font-family: var(--font-heading);
    border-bottom: 0px;
}

.text-link:hover {
    opacity: 0.55;
}


/* ========================================
   4. HEADER ET NAVIGATION
======================================== */

.site-header {
    top: 0;
    position: sticky;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px var(--page-padding);
    background: var(--color-bg);
    z-index: 100;
}

.site-logo {
    height: 0;
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 24px;
    align-items: center;
}

.site-nav a {
    color: var(--color-muted);
    font-size: 16px;
    transition: color var(--transition);
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 5px;
}


/* ========================================
   5. STRUCTURE GÉNÉRALE
======================================== */

.page {
    padding: 0 var(--page-padding);
}

.section {
    padding: 36px 0;
    border-bottom: none;
}

.section:last-child {
    border-bottom: none;
}

.center-link {
    display: flex;
    justify-content: center;
    padding: 28px 0;
}


/* ========================================
   6. LANDING PAGE — HERO
======================================== */

.hero {
    display: grid;
    min-height: 360px;
    border-bottom: 1px solid var(--color-border);
}

.hero-intro {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 36px 32px 36px 0;
    height: 55vh;
    align-items: flex-end;
}

.hero-intro .page-title {
    margin-top: 12px;
    margin-left: 12px;
}

.hero-description {
    max-width: 50vw;
    margin-top: 24px;
    font-size: 19px;
    line-height: 1.4;
}

.hero-visual {
    min-height: 300px;
    height: 90vh;
    overflow: hidden;
    border-left: 1px solid var(--color-border);
    background: var(--color-accent);
}

.hero-visual img {
    transition: transform 0.6s ease;
}

.hero-visual:hover img {
    transform: scale(1.025);
}


/* ========================================
   7. GRILLE DE PROJETS
======================================== */

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
}

.project-card {
    min-width: 0;
    overflow: hidden;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.project-image {
    display: block;
    aspect-ratio: 1.5 / 1;
    overflow: hidden;
}

.project-image img {
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.035);
}

.project-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
}

.project-info h3 {
    margin-bottom: 5px;
}

.project-info p {
    color: var(--color-muted);
    font-size: 15px;
}

.project-info>span {
    flex-shrink: 0;
    color: var(--color-muted);
    font-size: 14px;
}

.project-categories {
    display: flex;
    justify-content: space-around;
}

.project-category {
    width: 20vw;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.presentation {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.presentation-text {
    max-width: 34vw;
    padding-top: 75px;
}

/* ========================================
   8. PAGE PORTFOLIO
======================================== */

.portfolio-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    padding: 48px 0;
}

.portfolio-heading .page-title {
    margin-top: 12px;
}

.portfolio-heading>p {
    max-width: 280px;
    font-size: 17px;
}


.portfolio-item {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 4fr;
    align-items: center;
    gap: 24px;
    padding: 18px 0;
    border-bottom: 1px solid var(--color-border);
}


.portfolio-number {
    color: var(--color-muted);
    font-size: 15px;
}

.portfolio-item-description {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
}

.portfolio-item h2 {
    margin-bottom: 6px;
}

.portfolio-item p {
    margin-top: 3px;
    color: var(--color-muted);
    font-size: 15px;
}

.portfolio-thumbnail {
    display: block;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: var(--color-accent);
}

.portfolio-thumbnail img {
    transition: transform 0.5s ease;
}

.portfolio-thumbnail:hover img {
    transform: scale(1.035);
}


/* ========================================
   9. PAGE À PROPOS
======================================== */

.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 48px 0;
}

.about-layout .page-title {
    margin-top: 12px;
}

.about-intro {
    max-width: 520px;
    font-family: var(--font-main);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.about-copy {
    max-width: 500px;
    margin-top: 24px;
    color: var(--color-muted);
    font-size: 18px;
    line-height: 1.6;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.contact-layout>p {
    max-width: 340px;
    font-size: 18px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.contact-details a {
    border-bottom: 1px solid var(--color-border);
    font-size: 18px;
    transition: opacity var(--transition);
}

.contact-details a:hover {
    opacity: 0.55;
}


/* ========================================
   10. EXPÉRIENCES
======================================== */

.experience-list {
    border-top: 1px solid var(--color-border);
}

.experience-item {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    align-items: start;
    gap: 24px;
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
}

.experience-item>span {
    color: var(--color-muted);
    font-size: 15px;
}

.experience-item h3 {
    margin-bottom: 5px;
}

.experience-item p {
    color: var(--color-muted);
    font-size: 15px;
    line-height: 1.5;
}


/* ========================================
   11. PAGE DÉTAIL PROJET
======================================== */

.project-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 48px;
    padding: 48px 0;
}

.project-header .page-title {
    margin-top: 12px;
}

.project-meta {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-content: start;
    gap: 0 18px;
}

.project-meta dt,
.project-meta dd {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.project-meta dt {
    color: var(--color-muted);
    font-size: 14px;
    text-transform: uppercase;
}

.project-meta dd {
    font-size: 16px;
}

.project-cover {
    width: 100%;
    aspect-ratio: 1.7 / 1;
    overflow: hidden;
    background: var(--color-accent);
}

.project-cover img {
    transition: transform 0.5s ease;
}

.project-cover:hover img {
    transform: scale(1.02);
}

.project-content {
    max-width: 760px;
    padding: 48px 0;
}

.project-content h2 {
    margin-bottom: 20px;
    font-size: 32px;
    letter-spacing: -0.04em;
}

.project-content p {
    max-width: 600px;
    margin-bottom: 18px;
    color: var(--color-muted);
    font-size: 18px;
    line-height: 1.65;
}


/* ========================================
   12. GALERIE DU PROJET
======================================== */

.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}

.gallery-image {
    overflow: hidden;
}

.gallery-image img {
    transition: transform 0.5s ease;
    object-fit: contain;
    height: auto;
}

.gallery-image:hover img {
    transform: scale(1.025);
}

.gallery-image:first-child {
    grid-column: 1 / -1;
}


/* ========================================
   13. FOOTER
======================================== */

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px var(--page-padding);
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--color-text);
}


/* ========================================
   14. ACCESSIBILITÉ
======================================== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 4px;
}

::selection {
    color: var(--color-bg);
    background: var(--color-text);
}


/* ========================================
   15. RESPONSIVE — TABLETTES
======================================== */

@media (max-width: 900px) {
    :root {
        --page-padding: 20px;
    }

    .portfolio-item {
        grid-template-columns: minmax(120px, 1fr) 2fr;
        gap: 16px;
    }

    .about-layout {
        gap: 28px;
    }

    .project-header {
        gap: 28px;
    }

    .experience-item {
        grid-template-columns: 90px 1fr 1fr;
        gap: 16px;
    }
}


/* ========================================
   16. RESPONSIVE — MOBILES
======================================== */

@media (max-width: 600px) {
    :root {
        --page-padding: 16px;
    }

    body {
        font-size: 15px;
    }

    /* Navigation */

    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .site-nav {
        justify-content: flex-start;
        gap: 12px 20px;
    }

    .site-nav a {
        font-size: 15px;
    }

    /* Titres */

    .page-title {
        font-size: clamp(42px, 12vw, 64px);
    }

    .section-title {
        font-size: 17px;
    }

    /* Landing page */

    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-intro {
        min-height: 300px;
        padding: 28px 0;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-end;
    }

    .hero-description {
        font-size: 17px;
    }

    .hero-visual {
        min-height: 230px;
        border-top: 1px solid var(--color-border);
        border-left: none;
    }

    /* Projets */

    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-image {
        aspect-ratio: 1.35 / 1;
    }

    .project-info {
        padding: 14px;
    }

    /* Portfolio */

    .portfolio-heading {
        align-items: flex-start;
        flex-direction: column;
        padding: 32px 0;
    }

    .portfolio-heading>p {
        font-size: 16px;
    }

    .portfolio-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 16px 0;
    }

    .portfolio-number {
        padding-top: 4px;
    }

    .portfolio-item h2 {
        font-size: 21px;
    }

    .portfolio-thumbnail {
        aspect-ratio: 1.5 / 1;
        margin-top: 6px;
    }

    /* À propos */

    .about-layout {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 32px 0;
    }

    .about-intro {
        font-size: 26px;
    }

    .about-copy {
        font-size: 16px;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .contact-layout>p {
        font-size: 16px;
    }

    .contact-details a {
        font-size: 17px;
    }

    /* Expériences */

    .experience-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 18px 0;
    }

    .experience-item p:last-child {
        margin-top: 4px;
    }

    /* Détail projet */

    .project-header {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 32px 0;
    }

    .project-meta {
        grid-template-columns: 80px 1fr;
    }

    .project-cover {
        aspect-ratio: 1.15 / 1;
    }

    .project-content {
        padding: 32px 0;
    }

    .project-content h2 {
        font-size: 27px;
    }

    .project-content p {
        font-size: 16px;
    }

    .project-gallery {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .gallery-image,
    .gallery-image:first-child {
        grid-column: auto;
    }

    /* Footer */

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding-top: 20px;
        padding-bottom: 20px;
    }
}


/* ========================================
   17. RÉDUCTION DES ANIMATIONS
======================================== */

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ========================================
   18. FORMULAIRE DE CONTACT
======================================== */


/* ========================================
   FORMULAIRE DE CONTACT
======================================== */

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
    margin-top: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.form-group label {
    font-family: var(--font-main);
    font-size: 15px;
    color: var(--color-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 0;
    outline: none;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 17px;
    transition: border-color var(--transition),
        background var(--transition);
}

.form-group input {
    height: 48px;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-text);
    background: var(--color-white);
}

/* Bouton d'envoi */

.contact-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: 8px;
    padding: 13px 24px;
    border: 1px solid var(--color-text);
    border-radius: 0;
    background: var(--color-text);
    color: var(--color-bg);
    font-family: var(--font-main);
    font-size: 16px;
    transition: background var(--transition),
        color var(--transition);
}

.contact-form button:hover {
    background: transparent;
    color: var(--color-text);
}

/* Responsive mobile */

@media (max-width: 600px) {
    .contact-form {
        margin-top: 16px;
        gap: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
    }

    .contact-form button {
        width: 100%;
    }
}


/* ========================================
   19. BANDEAU DE LOGOS DÉFILANTS
======================================== */


/* ========================================
   19. BANDEAU DE LOGOS DÉFILANTS
======================================== */

.logo-section {
    padding: 48px 0;
    overflow: hidden;
}

.logo-section .section-title {
    margin-bottom: 32px;
}

/* Conteneur du slider */

.logo-slider {
    width: 100%;
    overflow: hidden;
}

/* Piste animée */

.logo-track {
    display: flex;
    width: max-content;
    animation: logo-scroll 35s linear infinite;
    will-change: transform;
}

/* Groupes de logos */

.logo-group {
    display: flex;
    flex-shrink: 0;
    align-items: center;
}

/* Chaque logo */

.logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    padding: 10px;
}

/* Images des logos */

.logo-item img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.85;
    transition: opacity var(--transition),
        filter var(--transition);
}

.logo-item img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* Animation en boucle continue */

@keyframes logo-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* Pause au survol */
/*
.logo-slider:hover .logo-track {
    animation-play-state: paused;
}
*/
/* Responsive : tablette et mobile */

@media (max-width: 600px) {

    .logo-section {
        padding: 32px 0;
    }

    .logo-section .section-title {
        margin-bottom: 24px;
    }

    .logo-item {
        width: 130px;
        height: 75px;
        padding: 15px 25px;
    }

    .logo-track {
        animation-duration: 20s;
    }
}

/* Accessibilité : réduction des animations */

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

    .logo-track {
        animation: none;
    }

}

/* =========================================================
   POPUP
========================================================= */

body.no-scroll {
    overflow: hidden;
}

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);

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

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;

    z-index: 9999;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    width: 100%;
    height: 100%;

    background: white;

    overflow: hidden;

    display: flex;
    flex-direction: column;

    transform: scale(0.85);
    opacity: 0;

    transition:
        transform 0.35s ease,
        opacity 0.35s ease;
}

.popup-overlay.show .popup-content {
    transform: scale(1);
    opacity: 1;
}

.popup-overlay.hide .popup-content {
    transform: scale(0.85);
    opacity: 0;
}

#contact-popup .popup-content {
    width: auto;
    height: auto;
    border-radius: 10px;

    .popup-header {
        padding: 0px 10px;
        border-bottom: 1px solid #999;
    }

    .contact-popup-body {
        padding: 20px;
        margin: 0px 30px;
    }
}



/* =========================================================
   POPUP HEADER
========================================================= */

.popup-header {
    position: sticky;
    top: 0;

    background: white;

    padding: 15px 20px;

    display: flex;
    justify-content: flex-end;

    z-index: 10;

    flex-shrink: 0;
}

.close-popup {
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

/* =========================================================
   POPUP BODY
========================================================= */

.popup-body {
    flex: 1;
    overflow-y: auto;

    padding: 20px;

    display: flex;
    gap: 40px;
}

.popup-body section {
    padding: 10px;
}

.popup-body .content {
    flex: 3;
}

.popup-body .content-description {
    flex: 1;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
}

.popup-body .content-description .description {
    overflow: auto;

    padding-bottom: 20px;

    p,
    li,
    strong {
        font-size: 15px !important;
        line-height: 1.3;
    }
}

/**
ANIMATION
**/
.arrow-down-link {
    text-decoration: none;
    border-bottom: none;
    font-size: 27px;
    line-height: 0;
    animation: float 1.2s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(6px);
    }
}

.about-text h2 {
    margin: 10px 0px;
}

.about-competence li {
    margin: 5px 0px;
}

.project-icon {
    object-fit: contain;
    width: 50px;
    height: auto;
    margin: 0px auto;
}

.project-icon-title {
    font-size: x-large;
}

.image-rotating {
    display: inline;
    width: 80px;
    height: 80px;
    object-fit: contain;

    animation: rotation 3s linear infinite;
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

img.img-flag {
    height: 15px;
    object-fit: contain;
}