/* ============================================
   WAB. — Page APPLICATIONS SUR MESURE
   Reprend les jetons de style.css : aucune couleur
   ni police en dur, tout vient des variables.
   ============================================ */

/* ── HERO ── */
.app-hero {
    padding: clamp(140px, 22vh, 220px) 0 clamp(48px, 7vw, 96px);
}

.app-hero__label {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: clamp(20px, 3vw, 36px);
    opacity: 0;
}

.app-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5.4vw, 4.6rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.06;
    color: var(--text);
    max-width: 1200px;
}

/* Le masque qui laisse glisser chaque ligne du titre */
.app-hero__line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
}

.app-hero__line-inner {
    display: block;
    transform: translateY(112%);
}

.app-hero__intro {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.65;
    color: var(--text-muted);
    max-width: 62ch;
    margin-top: clamp(24px, 3.5vw, 44px);
    opacity: 0;
}

.app-hero__meta {
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: var(--text-muted);
    margin-top: clamp(20px, 3vw, 36px);
    opacity: 0;
}

/* ── Ossature commune des sections ── */
.app-section {
    padding: clamp(56px, 8vw, 120px) 0;
    border-top: 1px dashed var(--border-strong);
}

.app-section__title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.2vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text);
    max-width: 24ch;
}

.app-section__lead {
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 68ch;
    margin-top: clamp(18px, 2.5vw, 28px);
}

/* ── Principes de conception ── */
.app-principles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(38px, 5vw, 64px) clamp(28px, 4vw, 56px);
    margin-top: clamp(40px, 6vw, 72px);
}

/* Le numéro tient la marge gauche et le texte s'aligne à sa droite :
   sur petit écran, les cinq blocs se lisent comme une liste numérotée
   plutôt que comme cinq paragraphes empilés. */
.app-principle {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: clamp(14px, 2vw, 20px);
    padding-top: clamp(16px, 2.2vw, 22px);
    border-top: 1px dashed var(--border);
}

.app-principle__idx {
    grid-row: 1 / span 2;
    font-family: var(--font-display);
    font-size: clamp(0.72rem, 1vw, 0.8rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.7;
    color: var(--accent-text);
}

.app-principle__title {
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 10px;
    text-wrap: balance;
    grid-column: 2;
}

.app-principle__desc {
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    line-height: 1.7;
    color: var(--text-muted);
    grid-column: 2;
}

/* ── Modules de l'exemple ── */
.app-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(28px, 4vw, 56px);
    margin-top: clamp(40px, 6vw, 72px);
}

.app-module__name {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-text);
    padding-top: clamp(16px, 2vw, 24px);
    border-top: 1px dashed var(--border);
    margin-bottom: 14px;
}

.app-module__desc {
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    line-height: 1.7;
    color: var(--text-muted);
}

/* ── La planche ──────────────────────────────────────────────
   Trois figures annotées, à des échelles et des positions
   différentes, posées sur un papier millimétré très pâle.
   Reprend l'esthétique de document technique déjà employée
   sur le projet Géotechnologie.
   ──────────────────────────────────────────────────────────── */
.app-section--plate {
    padding-bottom: 0;
}

.app-plate {
    position: relative;
    margin-top: clamp(40px, 6vw, 80px);
    padding: clamp(60px, 7vw, 120px) 0 clamp(56px, 8vw, 120px);
    border-top: 1px dashed var(--border-strong);
    border-bottom: 1px dashed var(--border-strong);
    overflow: clip;
    /* Le quadrillage : deux traits d'un pour cent d'encre */
    background-image:
        linear-gradient(to right, color-mix(in srgb, var(--text) 4%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in srgb, var(--text) 4%, transparent) 1px, transparent 1px);
    background-size: 34px 34px;
    background-position: center top;
}

.app-plate__inner {
    --gutter: clamp(24px, 4vw, 60px);
    /* Aligne la planche sur la marge du .container au-delà de 1400 px */
    --edge: max(var(--gutter), calc((100% - 1400px) / 2 + var(--gutter)));
    padding: 0 var(--edge);
    display: grid;
    gap: clamp(52px, 8vw, 88px);
}

.app-shot {
    position: relative;
    min-width: 0;
}

/* Le filigrane : le mot de la question, posé derrière son annotation.
   Derrière la capture il n'en dépassait qu'un fragment, qui se lisait
   comme un défaut. Ici le mot est entier ; seuls les plus longs
   sortent latéralement, comme le filigrane de la page Réalisations. */
.app-shot__mark {
    position: absolute;
    top: -0.16em;
    left: -0.04em;
    z-index: 0;
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 8vw, 5.6rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 0.82;
    white-space: nowrap;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--text) 5%, transparent);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Figures ── */
.app-figure {
    position: relative;
    margin: 0;
}

.app-figure__zoom {
    position: relative;
    display: block;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    cursor: zoom-in;
    transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 36px -18px rgba(0, 0, 0, 0.2);
}

.app-figure__zoom:hover,
.app-figure__zoom:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), 0 26px 54px -20px rgba(0, 0, 0, 0.26);
}

.app-figure__zoom img {
    display: block;
    width: 100%;
    height: auto;
}

/* Repères d'angle, comme les traits de coupe d'une planche imprimée */
.app-figure__corner {
    position: absolute;
    width: 9px;
    height: 9px;
    border: 1px solid var(--accent);
    pointer-events: none;
}
.app-figure__corner--tl { top: -1px;    left: -1px;    border-right: 0; border-bottom: 0; }
.app-figure__corner--tr { top: -1px;    right: -1px;   border-left: 0;  border-bottom: 0; }
.app-figure__corner--bl { bottom: -1px; left: -1px;    border-right: 0; border-top: 0; }
.app-figure__corner--br { bottom: -1px; right: -1px;   border-left: 0;  border-top: 0; }

.app-figure figcaption {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.03em;
    color: var(--text-subtle);
    margin-top: 10px;
}

.app-figure__hint {
    color: var(--accent-text);
    white-space: nowrap;
}

/* ── Annotation ── */
.app-shot__note {
    position: relative;
    z-index: 1;
    margin-top: clamp(18px, 2.5vw, 28px);
    padding-top: clamp(14px, 2vw, 20px);
    border-top: 1px dashed var(--border-strong);
    max-width: 62ch;
}

.app-shot__idx {
    position: relative;
    z-index: 1;
    display: block;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--accent-text);
    margin-bottom: 10px;
}

.app-shot__q {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.9vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.22;
    color: var(--text);
    text-wrap: balance;
}

.app-shot__p {
    position: relative;
    z-index: 1;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    line-height: 1.7;
    color: var(--text-muted);
    margin-top: clamp(12px, 1.6vw, 16px);
}

.app-shot__gain {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: clamp(0.8rem, 1.05vw, 0.92rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.45;
    color: var(--accent-text);
    margin-top: clamp(14px, 2vw, 20px);
}

/* ── Au-delà de 900 px : la planche se compose ──
   Trois échelles, trois ancrages horizontaux, et une figure
   qui remonte dans la rangée précédente. */
@media (min-width: 901px) {
    .app-plate__inner {
        grid-template-columns: repeat(12, 1fr);
        column-gap: clamp(20px, 2.6vw, 44px);
        row-gap: clamp(64px, 8vw, 104px);
    }

    /* 01 et 02 partagent la rangée : la cascade se fait vers le bas,
       jamais vers le haut — une marge négative sortirait de la planche
       et se ferait rogner par le « clip ». */
    .app-shot--1 {
        grid-column: 1 / 8;
        grid-row: 1;
    }

    /* 02 — format réduit à droite, décalé plus bas */
    .app-shot--2 {
        grid-column: 8 / -1;
        grid-row: 1;
        margin-top: clamp(72px, 10vw, 168px);
    }

    /* 03 — grand format, sort par le bord droit */
    .app-shot--3 {
        grid-column: 3 / -1;
        grid-row: 2;
        margin-right: calc(-1 * var(--edge));
        padding-right: 0;
    }
    .app-shot--3 .app-shot__note {
        margin-right: var(--edge);
    }
    .app-shot--3 .app-figure figcaption {
        margin-right: var(--edge);
    }
}

/* ── Visionneuse plein écran ──
   L'image entière est visible d'emblée, quelle que soit la taille de
   l'écran. Un toucher la passe à sa taille native dans un cadre que
   l'on fait défiler, pour lire le détail de l'interface. */
.app-lightbox {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(56px, 8vw, 72px) clamp(12px, 3vw, 48px) clamp(52px, 7vw, 64px);
    background: color-mix(in srgb, var(--gray-1200) 90%, transparent);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
}

.app-lightbox[hidden] {
    display: none;
}

/* Le cadre : centre l'image, et défile une fois l'image agrandie.
   Hauteur et largeur fermes : sans elles, le « max-height: 100% » de
   l'image ne se résout pas et l'image dépasse la fenêtre. */
.app-lightbox__frame {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.app-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border: 1px solid color-mix(in srgb, var(--white) 18%, transparent);
    cursor: zoom-in;
}

/* Agrandie : taille native, le cadre prend le relais du défilement */
.app-lightbox.is-zoomed .app-lightbox__frame {
    align-items: flex-start;
    justify-content: flex-start;
}

.app-lightbox.is-zoomed .app-lightbox__img {
    max-width: none;
    max-height: none;
    width: 1280px;
    flex: none;
    cursor: zoom-out;
}

.app-lightbox__close {
    position: absolute;
    top: clamp(12px, 2.5vw, 28px);
    right: clamp(12px, 2.5vw, 28px);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white);
    background: none;
    border: 1px solid color-mix(in srgb, var(--white) 35%, transparent);
    border-radius: 3px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.25s var(--ease);
}

.app-lightbox__close:hover,
.app-lightbox__close:focus-visible {
    background: color-mix(in srgb, var(--white) 14%, transparent);
}

.app-lightbox__hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(16px, 3vw, 24px);
    text-align: center;
    font-family: var(--font-display);
    font-size: 12px;
    /* Phrase, pas étiquette : interlettrage resserré pour la lecture. */
    letter-spacing: 0.02em;
    color: color-mix(in srgb, var(--white) 78%, transparent);
    pointer-events: none;
}

/* ── Questions fréquentes ──
   Même mécanique que la FAQ de la page Contact (details + « + » qui
   pivote), avec les filets pointillés et l'annotation à filet latéral
   propres à cette page. */
.app-faq {
    margin-top: clamp(40px, 6vw, 72px);
    max-width: 900px;
}

.app-faq__item {
    border-top: 1px dashed var(--border-strong);
}

.app-faq__item:last-child {
    border-bottom: 1px dashed var(--border-strong);
}

.app-faq__item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(16px, 3vw, 32px);
    padding: clamp(20px, 3vw, 30px) 0;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-display);
    font-size: clamp(0.98rem, 1.6vw, 1.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text);
    transition: color 0.3s var(--ease);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.app-faq__item summary::-webkit-details-marker {
    display: none;
}

.app-faq__item summary:hover,
.app-faq__item summary:focus-visible {
    color: var(--accent-text);
}

.app-faq__item[open] summary {
    color: var(--accent-text);
}

.app-faq__icon {
    flex: none;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 1.8vw, 1.55rem);
    font-weight: 500;
    line-height: 1;
    color: var(--accent-text);
    transition: transform 0.4s var(--ease);
}

.app-faq__item[open] .app-faq__icon {
    transform: rotate(45deg);
}

/* La réponse est traitée comme une annotation : filet latéral rose */
.app-faq__a {
    margin: 0 0 clamp(22px, 3vw, 32px);
    padding-left: clamp(16px, 2.2vw, 30px);
    border-left: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    font-size: clamp(0.92rem, 1.2vw, 1.02rem);
    line-height: 1.72;
    color: var(--text-muted);
    max-width: 68ch;
}

/* ── Appel à l'action ──
   Le bloc contact de la page d'accueil, posé sur la trame de cette page :
   filet pointillé en haut et respiration généreuse avant le pied de page. */
.app-cta {
    padding: clamp(56px, 8vw, 110px) 0 clamp(64px, 9vw, 130px);
    border-top: 1px dashed var(--border-strong);
}

/* ── Petits écrans : lecture plus aérée ──
   Un texte plus grand et davantage interligné réduit l'effet « pavé »,
   même si la page s'allonge un peu. */
@media (max-width: 640px) {
    .app-hero {
        padding-top: clamp(116px, 18vh, 160px);
    }

    .app-section__lead {
        font-size: 1rem;
        line-height: 1.75;
    }

    .app-principle__desc,
    .app-shot__p,
    .app-faq__a {
        font-size: 0.95rem;
        line-height: 1.78;
    }

    .app-shot__q,
    .app-principle__title {
        font-size: 1.06rem;
    }

    /* Les principes numérotés : de l'air entre chaque entrée */
    .app-principles {
        gap: 30px;
    }

    /* De l'air entre les figures de la planche */
    .app-plate__inner {
        gap: 68px;
    }
}

/* Sur petit écran chaque ligne du titre se replie en deux :
   `balance` répartit les mots pour éviter un mot orphelin. */
.app-hero__line-inner {
    text-wrap: balance;
}
