/* ============================================================
   WEGAM — Couche mobile
   Objectif : une experience pensee pour le telephone, pas une
   reduction du desktop. Chargee apres les autres feuilles.
   ============================================================ */

/* ---------- Header compact ---------- */
@media (max-width: 820px) {
  html,
  body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }

  :root {
    --wg-bar-h: 46px;
    --wg-bar-m: 12px;
    --wg-bar: calc(var(--wg-bar-h) + 2 * var(--wg-bar-m));
  }

  .wegam-logo {
    left: calc(var(--wg-bar-m) + 12px);
    bottom: calc(var(--wg-bar-m) + var(--wg-bar-h) * 0.22);
    width: min(158px, 46vw);
  }

  .wegam-menu-btn,
  body.pg-light .wegam-menu-btn:not(.is-open) {
    right: calc(var(--wg-bar-m) + 12px);
    bottom: calc(var(--wg-bar-m) + (var(--wg-bar-h) - 18px) / 2);
    width: 34px;
    height: 18px;
  }

  .wegam-burger {
    width: 34px;
    height: 18px;
  }

  .wegam-burger i {
    height: 6px !important;
    margin-top: -3px;
  }

  .wegam-burger i:nth-child(1) { transform: translateY(-6px); }
  .wegam-burger i:nth-child(2) { transform: translateY(6px); }

  .wegam-scrim {
    left: var(--wg-bar-m);
    right: var(--wg-bar-m);
    bottom: var(--wg-bar-m);
    height: var(--wg-bar-h);
    border-radius: 10px;
  }

  /* ---------- Menu plein ecran ---------- */
  .wegam-menu__inner { padding: 0 20px; }

  .wegam-menu__eyebrow {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    margin-bottom: 1.4rem;
  }

  .wegam-menu__label {
    font-size: clamp(1.75rem, 8.2vw, 3rem);
    letter-spacing: -0.03em;
  }

  .wegam-menu__link { gap: 0.7rem; }

  .wegam-menu__num { font-size: 0.62rem; }

  .wegam-menu__footer {
    font-size: 0.56rem;
    gap: 0.6rem;
    flex-wrap: wrap;
  }
}

/* ---------- Accueil mobile dedie ---------- */
.wg-mob { display: none; }

@media (max-width: 820px) {
  .wg-mob {
    display: block;
    position: relative;
    z-index: 2;
    background: #0d0d0d;
    color: #f2f0eb;
    padding-bottom: calc(var(--wg-bar) + 18px);
  }

  /* On coupe la scene WebGL et ses sections : elles ne sont pas
     exploitables sur un ecran de telephone. */
  #main,
  .c-bg,
  #wg-env,
  .header,
  .wg-grid,
  .wg-wipe,
  .lil-gui,
  .wegam-slogan,
  .wegam-position,
  .wegam-nav {
    display: none !important;
  }

  html:has(body) { overflow-x: hidden; }

  .wm-hero {
    min-height: 88svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding: 74px 20px 40px;
  }

  .wm-kicker {
    margin: 0 0 22px;
    font-family: 'Morseo', Arial, sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #9a9a94;
  }

  .wm-mark {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 0 26px;
  }

  .wm-title {
    margin: 0;
    font-family: 'Druk Wide', 'Arial Black', sans-serif;
    font-weight: 700;
    font-size: clamp(1.9rem, 9.6vw, 2.8rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
    text-transform: uppercase;
  }

  .wm-title em {
    font-style: normal;
    color: #fb0301;
  }

  .wm-title--accent {
    margin-top: 0.16em;
    color: #fb0301;
  }

  .wm-sub {
    margin: 22px 0 0;
    max-width: 34ch;
    font-family: 'Morseo', Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(242, 240, 235, 0.72);
  }

  .wm-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
  }

  .wm-cta {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 50px;
    padding: 0 18px;
    border: 1px solid rgba(242, 240, 235, 0.28);
    border-radius: 10px;
    color: #f2f0eb;
    font-family: 'Morseo', Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
  }

  .wm-cta--red {
    background: #fb0301;
    border-color: #fb0301;
    color: #fff;
  }

  .wm-cta span { font-size: 1rem; }

  /* ---------- Projets ---------- */
  .wm-sec {
    padding: 0 20px;
    margin-top: 64px;
  }

  .wm-sec__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(242, 240, 235, 0.18);
  }

  .wm-sec__title {
    margin: 0;
    font-family: 'Druk Wide', 'Arial Black', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 7.4vw, 2rem);
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
  }

  .wm-sec__title span { color: #fb0301; }

  .wm-sec__link {
    flex: none;
    font-family: 'Morseo', Arial, sans-serif;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #9a9a94;
    text-decoration: none;
  }

  .wm-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
  }

  .wm-card {
    display: block;
    border: 1px solid rgba(242, 240, 235, 0.16);
    border-radius: 12px;
    background: #050505;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
  }

  .wm-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #111;
  }

  .wm-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .wm-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0) 55%);
  }

  .wm-card__body {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px 14px;
  }

  .wm-card__name {
    margin: 0;
    font-family: 'Druk Wide', 'Arial Black', sans-serif;
    font-weight: 700;
    font-size: clamp(1.05rem, 5.4vw, 1.5rem);
    line-height: 0.98;
    letter-spacing: -0.02em;
    text-transform: uppercase;
  }

  .wm-card__cat {
    flex: none;
    max-width: 46%;
    text-align: right;
    font-family: 'Morseo', Arial, sans-serif;
    font-size: 0.52rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.4;
    text-transform: uppercase;
    color: #fb0301;
  }

  /* ---------- Studio / contact ---------- */
  .wm-studio {
    margin-top: 64px;
    padding: 34px 20px 38px;
    background: #fb0301;
    color: #fff;
  }

  .wm-studio__kicker {
    margin: 0 0 14px;
    font-family: 'Morseo', Arial, sans-serif;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
  }

  .wm-studio__text {
    margin: 0;
    font-family: 'Druk Wide', 'Arial Black', sans-serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 6.8vw, 1.9rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    text-transform: uppercase;
  }

  .wm-studio__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding-bottom: 4px;
    border-bottom: 2px solid #fff;
    color: #fff;
    font-family: 'Morseo', Arial, sans-serif;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
  }

  .wm-contact {
    padding: 36px 20px 8px;
  }

  .wm-contact__mail {
    display: block;
    font-family: 'Druk Wide', 'Arial Black', sans-serif;
    font-weight: 700;
    font-size: clamp(1.05rem, 5.6vw, 1.6rem);
    letter-spacing: -0.02em;
    color: #f2f0eb;
    text-decoration: none;
    word-break: break-word;
  }

  .wm-contact__note {
    margin: 12px 0 0;
    font-family: 'Morseo', Arial, sans-serif;
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(242, 240, 235, 0.66);
  }
}

/* ---------- Page Projets ---------- */
@media (max-width: 820px) {
  .wk-hero {
    min-height: 56svh;
    padding: 0 16px;
  }

  .wk-title {
    font-size: clamp(2.1rem, 10.6vw, 3.4rem);
    line-height: 0.9;
  }

  .wk-filter-slot { margin-top: -2vh; }

  .wk-filterbar {
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent 100%);
    mask-image: linear-gradient(to right, #000 88%, transparent 100%);
  }

  .wk-filterbar {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 1.15rem;
    padding: 14px 18px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .wk-filterbar::-webkit-scrollbar { display: none; }

  .wk-filterbar.is-stuck {
    padding: 16px 18px 14px;
    background: rgba(13, 13, 13, 0.97);
    border-bottom: 1px solid rgba(242, 240, 235, 0.12);
    transform: none !important;
  }

  .wk-filter {
    flex: none;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    padding: 0.1em 0.2em;
  }

  .wk-strip {
    padding: 8px 4vw calc(var(--wg-bar) + 40px);
  }

  .wk-row,
  .wk-row--half {
    position: relative;
    height: auto;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 3vh 0;
  }

  .wk-card,
  .wk-card--half {
    width: 100%;
  }

  .wk-frame {
    padding: 6px 6px 0;
    border-radius: 12px;
  }

  .wk-strip-top,
  .wk-side {
    display: none;
  }

  .wk-media,
  .wk-card--half .wk-media {
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
  }

  .wk-name {
    left: 12px;
    right: 12px;
    bottom: 10px;
    font-size: clamp(1.5rem, 7.6vw, 2.3rem);
    line-height: 0.9;
  }

  .wk-card--half .wk-name {
    font-size: clamp(1.4rem, 7vw, 2rem);
  }

  .wk-strip-bottom {
    padding: 8px 4px 10px;
    font-size: 0.52rem;
    letter-spacing: 0.1em;
    gap: 8px;
  }

  .wk-cat {
    max-width: 62%;
    white-space: normal;
    line-height: 1.35;
  }
}

/* ---------- Studio / Contact : pleine largeur ---------- */
@media (max-width: 820px) {
  .pg { padding: 0 18px; }

  .pg-hero {
    position: relative;
    z-index: 5;
    padding-top: 52px;
  }

  .pg-title { font-size: clamp(1.85rem, 9.1vw, 2.8rem); }

  .pg-lead {
    margin-top: 1.6rem;
    font-size: 1.02rem;
    line-height: 1.5;
  }

  .pg-band {
    margin-left: -18px;
    margin-right: -18px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .pg-contact {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2.4rem;
  }

  .pg-contact__col h3 { margin-bottom: 0.5rem; }

  .pg-contact__col p,
  .pg-contact__col a { font-size: 1rem; }

  .pg-band--cta { padding: 2rem 18px calc(var(--wg-bar) + 26px); }

  .pg-band.pg-contact {
    padding-bottom: calc(var(--wg-bar) + 28px);
  }

  .pg-hero--tall {
    min-height: 0;
    padding: 76px 0 40px;
  }

  /* Studio : on calme nettement la texture rouge pour la lecture */
  .pg-body:not(.pg-light)::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(13, 13, 13, 0.42), rgba(13, 13, 13, 0.6));
  }

  .pg-body .pg { position: relative; z-index: 2; }

  .pg-body .wg-exp__inner,
  .pg-body .wg-sec {
    padding-left: 0;
    padding-right: 0;
  }

  .pg-body .wg-exp__name { font-size: clamp(1.4rem, 8vw, 2.2rem); }

  .pg-body .wg-exp__note { font-size: 0.86rem; line-height: 1.5; }

  .pg-body .wg-foot { padding-bottom: calc(var(--wg-bar) + 40px); }
}

/* ---------- Detail projet ---------- */
@media (max-width: 820px) {
  .pj { padding: 0 16px calc(var(--wg-bar) + 24px); }

  .pj-hero {
    margin-left: -16px;
    margin-right: -16px;
    height: 62svh;
    min-height: 380px;
  }

  .pj-head { padding: 28px 0 8px; }

  .pj-hero__title { font-size: clamp(2.2rem, 12vw, 4rem); }

  .pj-hero__meta {
    gap: 1.1rem 1.8rem;
    margin: 1.4rem 0 1.8rem;
  }

  .pj-study { margin-top: 2.6rem; }

  .pj-study__row {
    display: block;
    padding: 1.1rem 0;
  }

  .pj-gallery { margin-top: 2.4rem; }

  .pj-more__list { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
@media (max-width: 820px) {
  .wg-foot { padding-left: 18px; padding-right: 18px; }

  .wg-foot__grid {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
  }

  .wg-foot__logo { width: min(220px, 62vw); }
}
