.demo-runtime {
  min-height: 100vh;
  background: var(--shell-bg);
  color: var(--text);
}

.skip-to-content {
  position: fixed;
  z-index: 20;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  transform: translateY(-150%);
}

.skip-to-content:focus { transform: translateY(0); }

.demo-runtime__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(calc(100% - 2rem), var(--container));
  min-height: 4.5rem;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.demo-runtime__brand,
.demo-runtime__site-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--heading);
  font-weight: 800;
  text-decoration: none;
  transition: color var(--transition), transform var(--transition);
}

.demo-runtime__brand { gap: 0.65rem; }
.demo-runtime__brand img { width: 2rem; height: 2rem; object-fit: contain; }
.demo-runtime__brand:hover,
.demo-runtime__site-link:hover { color: var(--accent-strong); transform: translateY(-2px); }
.demo-runtime__brand:focus-visible,
.demo-runtime__site-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.demo-overview {
  display: grid;
  gap: 2.25rem;
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
  padding: 1.5rem 0;
}

.demo-overview__hero { display: grid; gap: 1.5rem; align-items: center; }
.demo-overview__copy { display: grid; gap: 0.95rem; }
.demo-overview__side { display: grid; gap: 0.95rem; }
.demo-overview__demo-details { display: grid; gap: 0.95rem; }
.demo-overview__title { max-width: 14ch; margin: 0; font-size: clamp(2rem, 7vw, 3.8rem); line-height: 1.02; }
.demo-overview__lead { max-width: 42rem; margin: 0; color: var(--muted); font-size: 1.03rem; line-height: 1.65; }
.demo-overview__version { width: fit-content; margin: 0; color: var(--accent-strong); font-size: 0.82rem; font-weight: 850; }
.demo-overview__actions,
.demo-state__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.demo-overview__actions form,
.demo-state__actions form { margin: 0; }
.demo-overview__actions .button,
.demo-state .button { min-height: 2.75rem; }
.demo-overview__actions .button { padding: 0 1.25rem; }
.demo-overview__privacy,
.demo-overview__warning { max-width: 42rem; margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.demo-overview__warning { color: var(--text); }

.demo-overview__preview { margin: 0; }
.demo-overview__preview-link { display: block; overflow: hidden; border-radius: var(--radius-lg); background: var(--quiet-surface); cursor: zoom-in; }
.demo-overview__preview-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.demo-overview__preview img { display: block; width: 100%; height: auto; }

.demo-lightbox { position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; padding: 1.75rem; background: rgba(2, 4, 6, 0.88); backdrop-filter: blur(12px); }
.demo-lightbox:target,
.demo-lightbox.is-open { display: flex; }
.demo-lightbox__backdrop { position: fixed; inset: 0; z-index: 40; cursor: zoom-out; }
.demo-lightbox__close { position: fixed; top: 1.125rem; right: 1.125rem; z-index: 41; display: grid; width: 2.75rem; height: 2.75rem; place-items: center; color: #f3f4f6; font-size: 1rem; font-weight: 800; line-height: 1; text-decoration: none; }
.demo-lightbox__close:hover,
.demo-lightbox__close:focus-visible { color: var(--accent); }
.demo-lightbox__image-link { position: relative; z-index: 41; display: inline-flex; width: fit-content; max-width: 94vw; cursor: zoom-out; }
.demo-lightbox__image-link img { width: auto; max-width: min(94vw, 1440px); height: auto; max-height: 88vh; border: 0; border-radius: var(--radius-lg); object-fit: contain; }

.demo-overview__features { max-width: 42rem; padding-top: 0.5rem; }
.demo-overview__features-intro h2 { max-width: 15ch; margin: 0; color: var(--heading); font-size: clamp(1.65rem, 5vw, 2.4rem); line-height: 1.08; }
.demo-overview__features-intro > p { max-width: 33rem; margin: 0.8rem 0 0; color: var(--muted); line-height: 1.6; }
.demo-overview__feature-list { display: grid; margin: 0; padding: 0; list-style: none; }
.demo-overview__feature-list li { padding: 1.1rem 0; border-top: 1px solid var(--border); }
.demo-overview__feature-list strong { color: var(--heading); font-size: 1rem; line-height: 1.25; }
.demo-overview__feature-list p { margin: 0.32rem 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.demo-state { display: grid; place-items: center; width: min(calc(100% - 2rem), 46rem); min-height: calc(100vh - 4.5rem); margin: 0 auto; padding: 2rem 0; }
.demo-state__panel { display: grid; gap: 1rem; width: 100%; padding: clamp(1.25rem, 5vw, 2.25rem); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.demo-state__panel h1 { margin: 0; font-size: clamp(1.75rem, 6vw, 2.6rem); }
.demo-state__panel p { max-width: 38rem; margin: 0; color: var(--muted); }
.demo-state__label { color: var(--accent-strong) !important; font-size: 0.78rem; font-weight: 850; text-transform: uppercase; }

button[aria-busy="true"] { cursor: wait; opacity: 0.78; transform: none; }

@media (min-width: 760px) {
  .demo-overview { padding-top: 3rem; }
  .demo-overview__hero { grid-template-columns: minmax(0, 0.92fr) minmax(22rem, 1.08fr); grid-template-areas: "title ." "copy side"; column-gap: 2rem; row-gap: 0.95rem; align-items: start; }
  .demo-overview__title { grid-area: title; }
  .demo-overview__copy { grid-area: copy; }
  .demo-overview__side { grid-area: side; align-self: start; margin-top: -3rem; }
}

@media (max-width: 480px) {
  .demo-runtime__site-link { font-size: 0.82rem; }
  .demo-overview__actions,
  .demo-overview__actions form,
  .demo-overview__actions .button,
  .demo-state__actions,
  .demo-state__actions form,
  .demo-state__actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-runtime__brand,
  .demo-runtime__site-link { transition: none; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-status-theme]) .demo-runtime { background: #111213; }
}
