.page-demo {
  min-width: 0;
}

/* The gate and the frame toggle with the `hidden` attribute. Author display
   rules (grid/flex on the same elements) would otherwise outweigh the UA's
   [hidden] { display: none } at equal specificity — this rule makes `hidden`
   always win. */
.page-demo [hidden] {
  display: none !important;
}

.demo-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(6.5rem, 9vw, 8rem) clamp(2.75rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 82% 20%, rgba(147, 161, 255, 0.12), transparent 30rem),
    radial-gradient(circle at 16% 80%, rgba(127, 224, 203, 0.08), transparent 26rem),
    var(--bg-deep);
}

.demo-hero-shell {
  position: relative;
  z-index: 1;
  max-width: 52rem;
}

.demo-back {
  margin-bottom: 1.7rem;
  display: inline-flex;
  gap: 0.45rem;
}

.demo-lede {
  max-width: 44rem;
  color: var(--text-soft);
  margin-top: 1rem;
}

.demo-replay-badge {
  display: inline-flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-top: 1.6rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(147, 161, 255, 0.1);
  color: var(--violet-light);
  font-size: 0.92rem;
  font-weight: 600;
  max-width: 44rem;
}

.demo-replay-badge svg {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
}

.demo-replay-note {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 44rem;
}

.section--demo-stage {
  background: var(--bg);
}

/* The stage takes the page's full content width: the embedded app is framed
   at its own window proportions, and its own sign-in screen is the gate. */
.demo-stage-shell {
  max-width: none;
}

/* The real application, framed like the desktop window it is. */
.demo-player {
  display: grid;
  justify-items: center;
  gap: 1rem;
}

/* Sized like the desktop window the app opens in (1280x720, 16:9), capped
   by the viewport so the whole workspace stays visible without scrolling. */
.demo-frame-shell {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 82vh;
  min-height: 28rem;
  border: 1px solid rgba(42, 50, 72, 0.6);
  border-radius: 18px;
  overflow: hidden;
  background: #090c14;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.demo-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #090c14;
}

.demo-frame-note {
  margin: 0;
  max-width: 30rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.demo-end-actions {
  display: grid;
  gap: 0.55rem;
  justify-items: stretch;
}

.demo-frame-actions {
  width: min(22rem, 100%);
}

@media (max-width: 860px) {
  /* Narrow screens: a portrait frame, the shape the sidecar takes beside a
     lesson, instead of a letterboxed 16:9 strip. Tall enough for the app's
     sign-in screen at phone width — crest, card, the NAOMI switch under it
     and the build stamp need about 46rem — so the gate is never cut off at
     the bottom (owner report, 2026-09-04). */
  .demo-frame-shell {
    aspect-ratio: auto;
    height: max(46rem, 78vh);
    min-height: 46rem;
  }
}

/* Landing-page "see it in action" panel (index.html #demo). */
.section--demo-cta {
  border-top: 1px solid var(--line);
}

.demo-cta-panel {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 88% 12%, rgba(127, 224, 203, 0.14), transparent 18rem),
    linear-gradient(160deg, var(--surface-raised), var(--surface));
  box-shadow: var(--shadow);
}

.demo-cta-copy {
  max-width: 40rem;
  min-width: 0;
}

.demo-cta-copy h2 {
  margin: 0.4rem 0 0.7rem;
}

.demo-cta-lede {
  margin: 0;
  color: var(--text-soft);
}

.demo-cta-note {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.demo-cta-button {
  flex: 0 0 auto;
}

@media (max-width: 860px) {
  .demo-cta-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .demo-cta-button {
    justify-content: center;
  }
}

/* ==== NAOMI off: generated light-theme overrides for this stylesheet. Do not edit by hand — run `node sales-web/tools/naomi-off-theme.mjs build` (sales-web/README.md). ==== */

html[data-theme="light"] .demo-frame-shell {
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(15, 26, 46, 0.08);
}

html[data-theme="light"] .demo-frame {
  background: var(--surface);
}

/* ==== end of the generated NAOMI off overrides ==== */
