/* Les interfaces restent entières, lisibles et consultables en grand. */
button.screen {
  display: block;
  width: 100%;
  padding: 0;
  color: var(--ink);
  text-align: left;
  cursor: zoom-in;
}
.screen-top { gap: 5px; padding: 11px 15px; }
.screen-top .screen-title { flex: 1; min-width: 0; font-size: .75rem; }
.screen-top .screen-expand {
  display: inline-flex; flex-shrink: 0; align-items: center; gap: 6px;
  margin-left: 12px; padding: 5px 8px; border: 1px solid #dce1eb; border-radius: 5px;
  background: white; color: var(--ink); font-size: .75rem; font-weight: 600; letter-spacing: 0;
  transition: background .2s, border-color .2s;
}
.screen:hover .screen-expand, .screen:focus-visible .screen-expand { background: #edf0f7; border-color: #a5b1c7; }
main[data-page="accueil"] .hero-grid {
  max-width: 1480px;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr);
  gap: 34px;
  padding-top: 84px;
  padding-bottom: 88px;
}
main[data-page="accueil"] .hero-copy h1 { font-size: clamp(44px, 4.75vw, 70px); letter-spacing: -.045em; }
main[data-page="accueil"] .screen-stack { width: calc(100% + 12px); max-width: none; padding-bottom: 140px; }
main[data-page="accueil"] .screen-stack .small-screen { width: 86%; right: -8px; }
/* Keep interface text on the pixel grid: nested perspective, rotation and
   fractional drift resample these already reduced screenshots continuously. */
#main[data-page="accueil"] .hero .visual,
#main[data-page="accueil"] .screen-stack,
#main[data-page="accueil"] .screen-stack > .screenfig,
#main[data-page="accueil"] .screen-stack .small-screen {
  perspective: none;
  transform: none;
  translate: none;
  animation: none;
}
.preview-dialog {
  position: fixed; inset: 0; width: min(96vw, 1900px); height: calc(100dvh - 40px); max-width: none; max-height: none;
  margin: auto; padding: 0; overflow: hidden; border: 1px solid #ffffff40; border-radius: 16px;
  background: #f0f3f8; color: var(--ink); box-shadow: 0 35px 100px #0007;
}
.preview-dialog::backdrop { background: #080f20dc; backdrop-filter: blur(8px); }
.preview-shell { display: flex; flex-direction: column; height: 100%; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 17px 22px; border-bottom: 1px solid #dce1e9; background: white; }
.preview-toolbar h2 { font-size: 16px; line-height: 1.5; letter-spacing: .02em; font-weight: 700; }
.preview-controls { display: flex; align-items: center; flex-shrink: 0; gap: 10px; }
.preview-controls button { min-height: 42px; padding: 9px 14px; border: 1px solid #ccd4e1; border-radius: 7px; background: white; color: var(--ink); font-size: 14px; font-weight: 600; }
.preview-controls button:hover { background: #edf0f7; }
.preview-controls .preview-close { background: var(--navy); color: white; border-color: var(--navy); }
.preview-controls .preview-close:hover { background: #30476e; }
.preview-controls .preview-close span { margin-left: 10px; font-size: 18px; line-height: 1; }
.preview-stage { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 20px; overscroll-behavior: contain; }
.preview-stage img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 8px 30px #16264a1a; }
.preview-dialog.is-zoomed .preview-stage { display: block; }
.preview-dialog.is-zoomed .preview-stage img { width: var(--original-width); max-width: none; max-height: none; }
.preview-hint { padding: 10px 20px; border-top: 1px solid #dce1e9; text-align: center; background: white; color: var(--muted); font-size: 13px; }
.preview-error { margin: auto; text-align: center; font-size: 16px; }
@media (min-width: 851px) and (max-width: 1100px) {
  main[data-page="accueil"] .hero-grid { gap: 28px; }
  main[data-page="accueil"] .hero-copy h1 { font-size: 46px; }
}
@media (max-width: 850px) {
  main[data-page="accueil"] .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 38px; padding-top: 48px; padding-bottom: 54px; }
  main[data-page="accueil"] .hero-copy h1 { font-size: clamp(40px, 7.5vw, 60px); }
  main[data-page="accueil"] .screen-stack { width: calc(100% - 10px); padding-bottom: 130px; margin: 10px 0 0; }
  main[data-page="accueil"] .screen-stack .small-screen { right: -10px; }
  .preview-dialog { width: calc(100vw - 20px); height: calc(100dvh - 20px); border-radius: 12px; }
  .preview-toolbar { padding: 13px 15px; }
  .preview-stage { padding: 10px; }
}
@media (max-width: 540px) {
  main[data-page="accueil"] .screen-stack { padding-bottom: 95px; }
  .screen-top { padding: 8px 10px; }
  .screen-top > i { display: none; }
  .screen-top .screen-title { margin-left: 0; font-size: .6875rem; }
  .screen-top .screen-expand { font-size: .6875rem; margin-left: 5px; padding: 5px; }
  .preview-toolbar h2 { width: 100%; font-size: 14px; }
  .preview-controls { width: 100%; justify-content: space-between; }
  .preview-controls button { padding: 8px 12px; }
  .preview-hint { font-size: 12px; padding: 9px 12px; }
}
