/* ==========================================================================
   Responsive : grand écran, ordinateur portable (1100 px),
   tablette (900 px), puis mobile (640 px)
   ========================================================================== */

/* Ordinateur portable : bouton de recherche réduit à son icône
   ========================================================================== */
@media (max-width: 1100px) {
    .palette-trigger {
        width: 38px;
        padding: 0;
        justify-content: center;
    }

    .palette-trigger__text,
    .palette-trigger .kbd {
        display: none;
    }

    .site-nav__link {
        padding-inline: 0.65rem;
    }
}

/* Tablette : une seule colonne, menu plein écran
   ========================================================================== */
@media (max-width: 900px) {
    .site-header__inner {
        gap: 0.75rem;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: fixed;
        top: var(--header-h);
        right: 0;
        left: 0;
        display: none;
        height: calc(100dvh - var(--header-h));
        padding: 1.5rem var(--gutter) 2rem;
        overflow-y: auto;
        background: var(--bg);
    }

    .is-menu-open .site-nav {
        display: block;
    }

    .site-nav__indicator {
        display: none;
    }

    .site-nav__list {
        flex-direction: column;
        gap: 0;
    }

    .site-nav__link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 0;
        font-size: clamp(1.75rem, 7vw, 2.5rem);
        font-weight: 700;
        letter-spacing: -0.03em;
        color: var(--text);
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    .site-nav__link.is-active {
        color: var(--accent-text);
    }

    .section-header {
        grid-template-columns: minmax(0, 1fr);
    }

    .section-intro {
        max-width: 40rem;
    }

    .hero__body,
    .about__grid,
    .contact__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-card--featured .project-card__inner {
        display: flex;
    }

    .project-card--featured .project-card__media {
        aspect-ratio: 16 / 10;
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .stepper__panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-detail__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Mobile
   ========================================================================== */
@media (max-width: 640px) {
    :root {
        --header-h: 60px;
    }

    .brand__name {
        max-width: 11rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-toggle__text {
        display: none;
    }

    .nav-toggle {
        width: 38px;
        padding: 0;
        justify-content: center;
    }

    .hero {
        min-height: 0;
    }

    .hero__meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero__actions .btn {
        flex: 1 1 auto;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .segmented {
        display: flex;
    }

    .search-field {
        flex-basis: auto;
    }

    .skill-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .skill-tile {
        min-height: 8rem;
        padding: 0.85rem;
    }

    /* Pas de survol sur écran tactile : la description reste masquée */
    .skill-tile__tip {
        display: none;
    }

    .project-grid,
    .detail-pair,
    .contact-form__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .facts__row {
        flex-direction: column;
    }

    .facts__value {
        text-align: left;
    }

    /* Parcours : rail à gauche, date au-dessus de la carte */
    .timeline {
        --rail: 1.5rem;
    }

    .timeline__item {
        grid-template-columns: var(--rail) minmax(0, 1fr);
        gap: 0 0.85rem;
    }

    .timeline__dot {
        grid-row: 1;
        margin-top: 0.35rem;
    }

    .timeline__aside {
        grid-column: 2;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.4rem 0.75rem;
        padding-top: 0;
        margin-bottom: 0.75rem;
    }

    .timeline__type {
        margin-top: 0;
    }

    .timeline__card {
        grid-column: 2;
        padding: 1.25rem;
    }

    .timeline__item:hover .timeline__card {
        transform: none;
    }

    /* Méthode : seuls les numéros restent dans la barre d'étapes */
    .stepper__tab {
        justify-content: center;
        padding-right: 0;
    }

    .stepper__label {
        display: none;
    }

    .stepper__big {
        right: 1rem;
        font-size: 7rem;
    }

    .contact-form__submit {
        width: 100%;
    }

    .modal {
        width: calc(100% - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .modal__panel {
        max-height: calc(100dvh - 1rem);
    }

    .gallery__thumbs {
        display: none;
    }

    .palette {
        margin-top: 0.75rem;
    }

    .palette__foot {
        display: none;
    }

    .site-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .to-top {
        right: 1rem;
        bottom: 1rem;
    }
}
