/* Styles communs aux pages projets : ouverture (écran d'ordinateur + téléphone) et vitrines de téléphones.
   Chaque bande prend la couleur du projet avec --band (fond), --frame (contour des téléphones) et --ink (texte). */

/* ---------- Ouverture ---------- */
.stage {
  --band: #eef0f6; --frame: #1d2433; --ink: #3b4a6b;
  margin: 0 calc(50% - 50vw); padding: 64px 16px 72px; background: var(--band);
}
.stage .scene { position: relative; max-width: 1000px; margin: 0 auto; padding-right: 9%; }
.stage .browser {
  border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: 0 30px 70px rgba(15, 20, 40, .22), 0 0 0 1px rgba(0, 0, 0, .06);
}
.stage .browser::before {
  content: ""; display: block; height: 26px;
  background:
    radial-gradient(circle, #ff5f57 4px, transparent 4.5px) 14px 50% / 12px 12px no-repeat,
    radial-gradient(circle, #febc2e 4px, transparent 4.5px) 30px 50% / 12px 12px no-repeat,
    radial-gradient(circle, #28c840 4px, transparent 4.5px) 46px 50% / 12px 12px no-repeat,
    #f1f1f4;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .06);
}
.stage .browser img { width: 100%; aspect-ratio: var(--ratio, auto); object-fit: cover; object-position: top; display: block; }
.stage .scene > .phone { position: absolute; right: 0; bottom: -32px; width: 23%; margin: 0; }
.stage figcaption { max-width: 1000px; margin: 56px auto 0; text-align: center; color: var(--ink); font-size: 14px; }

/* ---------- Vitrine de téléphones ---------- */
.showcase {
  --band: #eef0f6; --frame: #1d2433; --ink: #3b4a6b;
  margin: 32px calc(50% - 50vw) 0; padding: 64px 16px; background: var(--band);
}
.showcase .row { max-width: 1000px; margin: 0 auto; display: flex; justify-content: center; align-items: flex-start; gap: clamp(16px, 4vw, 48px); }
.showcase .row > .phone { width: min(220px, 23%); }
.showcase .row > .phone:nth-child(even) { margin-top: 48px; }
.showcase > p { text-align: center; color: var(--ink); font-size: 13px; margin: 28px 0 0; }

/* le téléphone lui-même, partagé par l'ouverture et les vitrines */
.phone {
  padding: min(9px, 2.2vw); border-radius: min(34px, 8vw); background: var(--frame);
  box-shadow: 0 30px 60px rgba(15, 20, 40, .28), 0 0 0 1px rgba(255, 255, 255, .06);
}
.phone img { width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: min(26px, 6vw); display: block; }

@media (max-width: 820px) {
  .stage { padding: 40px 16px 48px; }
  .stage .scene { padding-right: 14%; }
  .stage .scene > .phone { width: 30%; bottom: -20px; }
  .stage figcaption { margin-top: 36px; }
  .showcase .row { flex-wrap: wrap; }
  .showcase .row > .phone { width: 42%; }
}

/* Variante : téléphone à côté de la fenêtre, et non par-dessus (visuels déjà chargés à droite) */
.stage .scene.apart { display: flex; align-items: flex-end; gap: 4%; padding-right: 0; }
.stage .scene.apart > .browser { flex: 1; }
.stage .scene.apart > .phone { position: static; width: 21%; flex: none; margin-bottom: -32px; }

/* ---------- Planche de maquettes : grandes cartes sur une bande de couleur ---------- */
.board {
  --band: #eef0f6; --ink: #3b4a6b;
  margin: 28px calc(50% - 50vw) 0; padding: 56px 16px; background: var(--band);
}
.board .grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.board .wide { grid-column: 1 / -1; }
.board figure { margin: 0; }
.board .zoom { border: 0; border-radius: 14px; background: #fff; box-shadow: 0 24px 50px rgba(15, 20, 40, .14), 0 0 0 1px rgba(15, 20, 40, .05); }
/* barre de fenêtre : les cartes de la planche sont des écrans d'ordinateur */
.board .zoom::before {
  content: ""; display: block; height: 22px;
  background:
    radial-gradient(circle, #ff5f57 3.5px, transparent 4px) 12px 50% / 10px 10px no-repeat,
    radial-gradient(circle, #febc2e 3.5px, transparent 4px) 26px 50% / 10px 10px no-repeat,
    radial-gradient(circle, #28c840 3.5px, transparent 4px) 40px 50% / 10px 10px no-repeat,
    #f1f1f4;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .06);
}
.board .kicker {
  max-width: 1000px; margin: 0 auto 20px; display: flex; gap: 10px; align-items: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
.board .kicker span { background: #fff; border-radius: 999px; padding: 5px 12px; }
.board figcaption { color: var(--ink); }
.board figcaption strong { color: inherit; }
@media (max-width: 820px) {
  .board .grid { grid-template-columns: 1fr; }
  .stage .scene.apart > .phone { width: 26%; margin-bottom: -20px; }
}

/* ---------- Duos : le même écran sur ordinateur et sur mobile ---------- */
.duos {
  --band: #eef0f6; --frame: #1d2433; --ink: #3b4a6b;
  margin: 44px calc(50% - 50vw) 0; padding: 64px 16px; background: var(--band);
  display: grid; gap: 72px;
}
.duo { max-width: 1000px; width: 100%; margin: 0 auto; }
.duo .pair { display: flex; align-items: flex-end; gap: 4%; }
.duo .browser { flex: 1; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 30px 70px rgba(15, 20, 40, .18), 0 0 0 1px rgba(0, 0, 0, .06); }
.duo .browser::before {
  content: ""; display: block; height: 24px;
  background:
    radial-gradient(circle, #ff5f57 4px, transparent 4.5px) 14px 50% / 12px 12px no-repeat,
    radial-gradient(circle, #febc2e 4px, transparent 4.5px) 30px 50% / 12px 12px no-repeat,
    radial-gradient(circle, #28c840 4px, transparent 4.5px) 46px 50% / 12px 12px no-repeat,
    #f1f1f4;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .06);
}
.duo .phone { width: 22%; flex: none; }
/* deux téléphones à côté de l'écran (landing page de Skade) : écran plus grand, téléphones plus petits */
.duo .pair:has(.phone + .phone) { gap: 3%; }
.duo .pair:has(.phone + .phone) .phone { width: 15%; }
.duo .zoom { border: 0; border-radius: 0; background: none; padding: 0; display: block; width: 100%; cursor: zoom-in; }
.duo .phone .zoom { border-radius: min(26px, 6vw); overflow: hidden; }
.duo .phone .zoom img { border-radius: 0; }
.duo figcaption { margin-top: 20px; color: var(--ink); font-size: 15px; }
.duo figcaption strong { color: inherit; }
.duos .note { max-width: 1000px; margin: -40px auto 0; color: var(--ink); font-size: 13px; width: 100%; }
@media (max-width: 820px) {
  .duos { gap: 48px; }
  .duo .phone { width: 30%; }
  .duo .pair:has(.phone + .phone) .phone { width: 22%; }
}

/* une section qui finit par une bande de couleur, suivie d'une autre section de captures : pas de trait gris entre les deux,
   la bande fait déjà la séparation. Avant « Ce que j'ai appris » (section .two), le trait reste, comme sur toutes les pages. */
section:has(> .duos:last-child, > .showcase:last-child, > .board:last-child):has(+ section:not(.two)) { border-bottom: 0; padding-bottom: 0; }

/* ---------- Apparition douce au défilement (apparition.js) ---------- */
/* « translate » plutôt que « transform » : les blocs qui ont déjà leur propre rotation ou décalage les gardent */
.rv { opacity: 0; translate: 0 16px; transition: opacity .8s ease, translate 1s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; translate: none; }

/* ---------- Départ vers une autre page (apparition.js) : la page se fond dans le fond de la suivante ---------- */
html.leaving body::after { content: ""; position: fixed; inset: 0; z-index: 9999; background: var(--leave-bg, var(--bg)); animation: leave-fade .3s ease both; }
@keyframes leave-fade { from { opacity: 0; } to { opacity: 1; } }

/* coréen : on ne coupe jamais un mot en fin de ligne, seulement entre les mots */
body { word-break: keep-all; overflow-wrap: break-word; }

/* ---------- Barre du haut : pastilles en verre dépoli (glassmorphism) ---------- */
/* « body > header » : plus précis que le style de chaque page, donc c'est celui-ci qui s'applique */
body > header { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 0; overflow-x: clip; }   /* clip : le voile ne fait pas déborder la page sur le côté */
/* pastilles en verre dépoli derrière le logo et « Tous les projets », seulement sur tablette et téléphone
   (sur ordinateur, la barre reste transparente, sans pastille) */
@media (max-width: 820px) {
body > header .logo, body > header .back { position: relative; isolation: isolate; }
/* voile flou aux bords diffus : il s'estompe vers l'extérieur au lieu d'avoir un contour net */
body > header .logo::before, body > header .back::before {
  content: ""; position: absolute; inset: -14px -30px; z-index: -1; pointer-events: none;
  background: color-mix(in srgb, var(--bg) var(--veil, 35%), transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  --fade: radial-gradient(farthest-side, #000 62%, transparent);
  -webkit-mask-image: var(--fade);
  mask-image: var(--fade);
}
body > header .logo { height: 44px; padding: 5px 14px; box-sizing: border-box; }
body > header .back { padding: 10px 16px; --veil: 75%; }   /* voile plus marqué : lisible même sur les bandes sombres */
}
body > header .back { color: var(--text); }

/* tablette et téléphone : logo collé à gauche, aligné sur le texte */
@media (max-width: 820px) { body > header .logo { padding-left: 0; padding-right: 0; } }

/* ---------- Sur téléphone ---------- */
@media (max-width: 600px) {
  /* listes « Ce que j'ai fait » / « Ce que j'ai appris » : l'étiquette au-dessus du texte, toute la largeur pour lire */
  body .done li { grid-template-columns: 1fr; gap: 2px; }
  /* moins d'espace entre les sections */
  body section { padding: 40px 0; }
  /* bas de page : « Tous les projets » est déjà dans la barre du haut, on garde seulement le projet suivant */
  body .next { justify-content: flex-end; }
  body .next a[href*="index.html"] { display: none; }
}

/* ---------- Barre de progression de lecture ---------- */
/* Le trait en dégradé en haut de l'écran se remplit au fil du défilement.
   Navigateurs qui ne savent pas le faire : la barre reste pleine, comme avant. */
@supports (animation-timeline: scroll()) {
  body::before { transform-origin: left; animation: lecture linear both; animation-timeline: scroll(); }
  @keyframes lecture { from { transform: scaleX(0); } }
}

/* ---------- Version PDF : Imprimer → Enregistrer en PDF ---------- */
/* A4 paysage : la page garde la mise en page ordinateur (deux colonnes) et se lit bien à l'écran */
@page { size: A4 landscape; margin: 12mm 14mm; }
@media print {
  /* garder les fonds de couleur des bandes (le navigateur les enlève sinon) */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* rien ne reste caché par l'apparition au défilement, rien ne bouge */
  .rv { opacity: 1 !important; translate: none !important; transition: none !important; }
  /* ce qui ne sert qu'à l'écran : liseré, lien retour, vidéo, fenêtre d'agrandissement, bas de page */
  /* (la barre du haut aussi : le contact est rappelé en bas de la dernière page) */
  body::before, body > header, .video, #zoom, .next { display: none !important; }
  /* les bandes de couleur restent dans la page au lieu de déborder sur les bords */
  .stage, .showcase, .board, .duos { margin-left: 0; margin-right: 0; border-radius: 14px; }
  main { max-width: none; padding: 0; }
  .intro { padding: 0 0 20px; }
  html body .intro h1 { font-size: 56px; }
  html body .summary { font-size: 16px; margin-bottom: 20px; }
  html body .meta { grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
  html body .meta dd { font-size: 13px; }
  section { padding: 28px 0; }
  .zoom { cursor: default; }
  .zoom:hover img { transform: none; }
  /* sauts de page : on ne coupe pas une image, une ligne de liste ou un titre de son texte */
  figure, .phone, .duo, .gallery figure, .done li, .intro, section.two { break-inside: avoid; }
  h1, h2, .label, .sub { break-after: avoid; }
  .stage { break-after: page; }
  /* toujours la mise en page ordinateur, même si la feuille est moins large que l'écran
     (« html body » : plus précis que les règles téléphone de chaque page) */
  html body .intro { grid-template-columns: 1fr 2fr; gap: 40px; }
  html body .two { grid-template-columns: 1fr 2fr; gap: 40px; }
  html body .compare-wrap, html body .shots { grid-template-columns: 2.4fr 1fr; }
  html body .gallery { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  html body .gallery.phones { grid-template-columns: repeat(5, 1fr); }
  html body .board .grid { grid-template-columns: 1fr 1fr; }
  html body .done li { grid-template-columns: 70px 1fr; gap: 16px; }
  html body .showcase .row { flex-wrap: nowrap; }
  html body .showcase .row > .phone { width: min(170px, 20%); }
  html body .duo .phone { width: 22%; }
  html body .duos { gap: 40px; padding: 40px 32px; }
  html body .duo { max-width: 760px; }
  /* avant / après (Ouipharma) : côte à côte, captures coupées au haut de l'écran */
  html body .pair { grid-template-columns: 1fr auto 1fr; gap: 16px; }
  html body .arrow { display: inline; }
  html body .pair:not(.phones) .zoom { aspect-ratio: 16 / 10; }
  html body .pair:not(.phones) .zoom img { height: 100%; object-fit: cover; object-position: top; }
  html body .pair.phones { grid-template-columns: 180px auto 180px; justify-content: center; }
  .cmp { break-inside: avoid; }

  /* Dotworld : les cinq modèles de CV sur une ligne, captures coupées plus courtes, sans le bouton « Voir la page entière » */
  html body .cvs { grid-template-columns: repeat(5, 1fr); }
  html body .shots.even { grid-template-columns: 1fr 1fr; }
  html body .shot.scroll { max-height: 400px; }
  .shot.scroll .more { display: none; }

  /* première page : le titre et l'ouverture tiennent ensemble */
  html body .stage { padding: 24px 16px 36px; }
  html body .stage .scene { max-width: 400px; padding-right: 9%; }
  html body .stage .scene > .phone { width: 23%; bottom: -24px; }
  html body .stage figcaption { margin-top: 26px; font-size: 12px; }
  html body .showcase { padding: 40px 16px; }

  /* contact en bas de la dernière page */
  main::after {
    content: "jessica-thielemans.com  ·  jt.jessicathi@gmail.com  ·  github.com/JessicaThi";
    display: block; margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line);
    font-family: var(--mono); font-size: 11px; color: var(--muted);
  }
}
