/* Embedded product demo on a project page: the product's own UI in a browser frame. */
.demo { padding: 0 var(--pad) clamp(80px, 9vw, 160px); }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.demo-head .demo-left, .demo-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.demo-actions { margin-left: auto; }
.demo-actions a, .demo-restart { color: var(--ink); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.demo-actions a:hover, .demo-restart:hover, .demo-actions a:focus-visible, .demo-restart:focus-visible { color: var(--cobalt); }
.demo-lede { max-width: 72ch; margin: 0 0 var(--gap); font-size: var(--t-body); color: var(--muted); line-height: 1.5; }

/* The stage: same soft grey stage as the website previews (.lp-stage), the app floating inside it. */
.demo-stage { --stage-pad: clamp(16px, 2.5vw, 40px); position: relative; padding: var(--stage-pad); background: var(--light); border-radius: var(--radius-in); scroll-margin-top: 16px; }
.demo-stage.is-phone-stage { display: flex; flex-direction: column; align-items: center; }
.demo-stage.is-phone-stage .demo-steps { align-self: stretch; }
.demo-frame { position: relative; border-radius: 12px; overflow: hidden; background: #f6f6f6; box-shadow: 0 24px 60px rgba(10, 16, 60, .16), 0 0 0 1px rgba(0, 0, 0, .06); }

/* Browser chrome, shared look with .lp-chrome: grey bar, three dots, centred mono URL pill. */
.demo-chrome { position: relative; height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 14px; background: #ececef; border-bottom: 1px solid #dedee4; }
.demo-chrome > i { width: 11px; height: 11px; border-radius: 50%; background: #d1d1d8; flex: none; }
.demo-url { position: absolute; left: 50%; transform: translateX(-50%); font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: #6b6b72; background: #fff; padding: 6px 14px; border-radius: 999px; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "Live demo" status pill: right end of the chrome (phone: top-left of the stage). */
.demo-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #141414; color: #fff; font-size: 11px; font-weight: 500; letter-spacing: .04em; white-space: nowrap; }
.demo-live i { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); animation: demo-live 1.6s ease-in-out infinite; }
.demo-live.is-float { position: absolute; z-index: 3; top: var(--stage-pad); left: var(--stage-pad); margin: 0; }

.demo-iframe { display: block; width: 100%; height: calc(100svh - 130px - 2 * var(--stage-pad)); min-height: 560px; border: 0; background: #f6f6f6; }

/* Floating hint, same pill as .lp-hint; fades after the first interaction. */
.demo-hint { position: absolute; left: 50%; bottom: calc(var(--stage-pad) + 18px); transform: translateX(-50%); z-index: 3; margin: 0; pointer-events: none; background: rgba(20, 20, 20, .82); color: #fff; padding: 8px 14px; border-radius: 999px; white-space: nowrap; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.demo-hint.is-gone { opacity: 0; transform: translate(-50%, 6px); }

.demo-phone { display: none; margin-top: 12px; }
@media (max-width: 820px) {
  .demo-stage { --stage-pad: 8px; }
  .demo-iframe { height: 78vh; min-height: 520px; }
  .demo-url { max-width: 52%; }
  .demo-chrome .demo-live { display: none; }
  .demo-phone { display: block; }
}

/* Phone variant (mobile products): an iPhone-like frame instead of browser chrome. */
.demo-frame.is-phone {
  width: min(390px, 100%); padding: 12px; border-radius: 56px;
  background: #0b0b0d; box-shadow: 0 30px 70px rgba(10, 16, 60, .22), inset 0 0 0 2px #2a2a30;
}
.demo-frame.is-phone::before { content: ''; display: block; height: 46px; background: #fff; border-radius: 44px 44px 0 0; } /* status bar: keeps the app clear of the island */
.demo-frame.is-phone .demo-iframe { width: 100%; height: 734px; min-height: 0; border-radius: 0 0 44px 44px; background: #fff; }
.demo-island { position: absolute; z-index: 2; top: 22px; left: 50%; transform: translateX(-50%); width: 110px; height: 32px; border-radius: 20px; background: #0b0b0d; pointer-events: none; }
@media (max-width: 820px) {
  .demo-frame.is-phone { width: 100%; padding: 0; border-radius: 12px; background: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
  .demo-frame.is-phone::before { display: none; }
  .demo-frame.is-phone .demo-iframe { height: 78vh; min-height: 520px; border-radius: 12px; }
  .demo-island { display: none; }
}
@media (prefers-reduced-motion: reduce) { .demo-live i { animation: none; } }

/* Portal tabs above the frame (demo.views). */
.demo-views { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--light); flex-wrap: wrap; }
.demo-views button { display: inline-flex; gap: .45em; align-items: baseline; padding: 8px 14px; border: 0; border-radius: 999px; background: none; font: 500 13px/1.2 var(--sans); color: var(--ink); cursor: pointer; }
.demo-views button span { color: var(--muted); font-weight: 400; }
.demo-views button[aria-selected="true"] { background: var(--ink); color: #fff; }
.demo-views button[aria-selected="true"] span { color: rgba(255, 255, 255, .65); }
/* While the demo fills the screen the site nav steps aside so it never covers the app. */
.nav { transition: opacity .3s, transform .3s; }
html.demo-focus .nav { opacity: 0; pointer-events: none; transform: translateY(-12px); }
@media (max-width: 820px) { .demo-views button span { display: none; } }

/* The phone stage now opens with the steps; the floating pill would sit on top of them. */
.demo-live.is-float { display: none; }

/* Product film: the same stage as the demo, one 16:9 video inside. */
.pj-film { padding-bottom: clamp(48px, 5vw, 88px); }
.pj-film .demo-frame video { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; background: #f6f6f6; }
