/* Aperçu interactif : un cadre et une seule démo active. */
.page-home .demo-showcase {
  padding-inline: max(var(--gutter),calc((100% - var(--max))/2));
  background: var(--paper);
}

.demo-home-overview {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: stretch;
  gap: clamp(36px, 5vw, 72px);
  row-gap: 20px;
}

.demo-home-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.demo-home-copy .section-title {
  margin-inline: 0;
  margin-bottom: 24px;
}

.demo-home-copy > p {
  color: var(--muted);
  line-height: 1.85;
  max-width: none;
}

.demo-home-cta {
  margin-top: 28px;
}

.demo-home-details .btn-secondary:is(:hover, :focus-visible) {
  background: #93b4ff0f;
  border-color: var(--accent-light);
  color: var(--text);
}

.demo-home-note {
  grid-column: 1 / -1;
  max-width: none;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.demo-home-preview {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  text-decoration: none;
  color: var(--accent-light);
  transition: border-color .2s;
}

.demo-home-preview:is(:hover, :focus-visible) {
  border-color: var(--accent-light);
}

.demo-home-window {
  min-height: 38px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.demo-home-visual {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.demo-home-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.demo-home-preview-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  padding: 12px 18px;
  font-size: 11px;
}

.demo-home-details {
  display: none;
}

.demo-gallery {
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: var(--panel-gradient);
}

.demo-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}

.demo-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.demo-categories button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #10111440;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.demo-categories button:enabled:is(:hover, :focus-visible) {
  border-color: var(--accent-light);
  color: var(--text);
}

.demo-categories button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--button-gradient);
  color: var(--button-ink);
}

.demo-categories button[aria-pressed="true"]:is(:hover,:focus-visible) {
  color: var(--button-ink);
}

.demo-categories button:disabled {
  opacity: .55;
  cursor: default;
}

.demo-categories svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-controls[hidden], .demo-stage[hidden], .demo-instructions[hidden] {
  display: none;
}

.demo-instructions {
  max-width: 52ch;
  margin-inline: auto;
  padding: 0 20px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.demo-open-row {
  display: flex;
  justify-content: center;
  padding: 0 24px 24px;
}

.demo-devices {
  display: flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10111440;
}

.demo-devices button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.demo-devices button:hover {
  background: #ffffff07;
  color: var(--text);
}

.demo-devices button[aria-pressed="true"] {
  background: #ffffff12;
  color: var(--text);
}

.demo-devices svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.demo-caption {
  padding: 30px 32px 0;
  text-align: center;
}

.demo-sector {
  color: var(--accent-light);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .13em;
  margin-bottom: 8px;
  margin-inline: auto;
}

.demo-caption h3 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 450;
  margin-bottom: 10px;
}

.demo-description {
  color: var(--muted);
  font-size: 14px;
  max-width: 62ch;
  margin-inline: auto;
}

.demo-open {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-light);
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0 1px;
  background-position: 0 calc(50% + .7em);
}

.demo-open:is(:hover, :focus-visible) {
  background-size: 100% 1px;
}

.demo-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 16px 28px 20px;
  overflow: hidden;
  background: radial-gradient(ellipse at center,#93b4ff0a,transparent 70%);
}

.demo-frame-space {
  min-width: 0;
  max-width: 100%;
  width: var(--frame-width,100%);
  height: var(--frame-height,600px);
}

.demo-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--device-width,1296px);
  height: var(--device-height,600px);
  transform: scale(var(--preview-scale,1));
  transform-origin: top left;
  border: 8px solid #11151c;
  border-radius: 16px;
  overflow: hidden;
  background: #11151c;
  box-shadow: 0 16px 40px #0003;
}

.demo-browser {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid #ffffff15;
}

.demo-browser-dots {
  display: flex;
  gap: 6px;
}

.demo-browser-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #707886;
}

.demo-screen {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 0 0 8px 8px;
  /* Force la découpe de la surface native de l’iframe dans Chromium. */
  mask-image: linear-gradient(#fff, #fff);
  background: #11151c;
}

#demo-preview {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color-scheme: light;
}

.demo-phone-speaker {
  display: none;
}

.demo-stage[data-device="mobile"] .demo-frame {
  border-width: 9px;
  border-radius: 38px;
}

.demo-stage[data-device="mobile"] .demo-browser {
  display: none;
}

.demo-stage[data-device="mobile"] .demo-screen {
  border-radius: 29px;
}

.demo-stage[data-device="mobile"] .demo-phone-speaker {
  display: block;
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 66px;
  height: 5px;
  border-radius: 5px;
  background: #11151c;
  pointer-events: none;
}

.demo-loading {
  position: absolute;
  max-width: none;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  pointer-events: none;
  font-size: 14px;
}

.demo-loading[hidden] {
  display: none;
}

.demo-gallery-footer {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 32px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.demo-gallery-footer p {
  color: var(--muted);
  font-size: 11px;
}

.demo-gallery-footer .demo-simulation-note {
  max-width: 92ch;
  font-size: 12px;
  line-height: 1.75;
}

.demo-afterword {
  max-width: none;
  margin-top: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.demo-afterword a {
  display: inline-block;
  color: var(--accent-light);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 calc(50% + .7em);
}

.demo-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (min-width:1001px) {
  .page-home [data-demo-home-preview], .page-home .demo-afterword {
    display: none;
  }
}

@media (max-width:1000px) {
  .demo-home-intro-break {
    display: none;
  }
  .demo-home-overview {
    display: block;
    margin-bottom: 32px;
    text-align: center;
  }
  .demo-home-copy {
    align-items: center;
  }
  .demo-home-copy .section-title {
    margin-inline: auto;
    margin-bottom: 22px;
  }
  .demo-home-preview, .demo-home-cta {
    display: none;
  }
  .demo-home-note {
    margin-top: 14px;
  }
  .demo-home-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    max-width: 52ch;
    margin: 24px auto 0;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
    padding: 24px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
  }
  .demo-home-details .btn-secondary {
    min-width: 0;
    max-width: 100%;
    gap: 12px;
    font-size: 13px;
    padding-inline: 16px;
  }
  .demo-afterword a {
    display: table;
    margin: 12px auto 0;
  }
}

@media (max-width:760px) {
  .demo-home-copy > p {
    margin-inline: auto;
    font-size: 15px;
  }
  .demo-gallery {
    border-radius: 20px;
  }
  .demo-controls {
    padding: 16px 12px;
  }
  .demo-caption {
    padding: 24px 20px 0;
  }
  .demo-caption h3 {
    font-size: 30px;
  }
  .demo-description {
    font-size: 13px;
  }
  .demo-open {
    gap: 12px;
  }
  .demo-stage {
    padding: 14px 12px 16px;
  }
  .demo-gallery-footer {
    padding: 14px 18px;
  }
  .demo-gallery-footer p {
    font-size: 10px;
  }
  .demo-afterword {
    font-size: 13px;
    line-height: 1.8;
  }
}
