/* Wider-screen refinements (27 September 2026): the demo player follows familiar web video players, and the
   sidebar shows the porch scene (since 29 September 2026). Loads after mobile.css; phone rules there keep their own player. */

/* Sidebar: the porch scene from the About dialog (29 September 2026). */
.sidebar-art img { height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-md); mix-blend-mode: normal; box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(0, 80, 140, 0.10); }
.sidebar-art p { margin-top: 10px; }

/* Poster play button on the demo intro, on every screen size. */
.demo-intro .demo-poster-play { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; padding: 0; border: 0; border-radius: var(--radius-circle); background: var(--blue); color: var(--white); box-shadow: 0 8px 22px rgba(0, 103, 177, 0.3); cursor: pointer; transition: transform 0.15s ease, background-color 0.15s ease; }
.demo-intro .demo-poster-play:hover { background: var(--blue-hover); transform: scale(1.06); }
.demo-intro .demo-poster-play .icon { width: 28px; height: 28px; margin-left: 3px; }
.demo-intro .demo-poster-play .icon path { fill: currentColor; }

/* The video-style track is drawn for wider screens; phones keep the native bar styled in mobile.css. */
.demo-track,
.demo-hover { display: none; }

@media (min-width: 701px) {
  /* One control bar: progress on top, transport and time on the left, replay on the right. */
  .demo-controls { display: grid; grid-template-columns: auto auto auto auto minmax(0, 1fr) auto; grid-template-areas: "seek seek seek seek seek seek" "back main next time . restart" "note note note note note note"; align-items: center; column-gap: 2px; row-gap: 0; padding: 0 14px 10px; background: var(--white); border-top: 1px solid var(--blue-tint); }
  .demo-controls > #demo-playback-controls,
  .demo-controls .demo-control-row,
  .demo-controls .demo-buttons { display: contents; }
  .demo-control-row > div:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  /* Progress bar: slim until hovered, with moment markers and a preview label. */
  .demo-progress { grid-area: seek; position: relative; height: 22px; margin: 0 0 2px; }
  .demo-track { display: block; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: var(--radius-xs); background: var(--line); transition: height 0.12s ease, top 0.12s ease; pointer-events: none; }
  .demo-track-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--progress, 0%); border-radius: inherit; background: var(--blue); }
  .demo-track > i { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--white); }
  .demo-track-thumb { position: absolute; top: 50%; left: var(--progress, 0%); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: var(--radius-circle); background: var(--blue); box-shadow: 0 1px 4px rgba(0, 60, 110, 0.3); transform: scale(0); transition: transform 0.12s ease; }
  .demo-progress:hover .demo-track,
  .demo-progress:focus-within .demo-track { top: 8px; height: 6px; }
  .demo-progress:hover .demo-track-thumb,
  .demo-progress:focus-within .demo-track-thumb { transform: scale(1); }
  .demo-progress input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
  .demo-progress:has(input:focus-visible) .demo-track { box-shadow: 0 0 0 3px rgba(0, 103, 177, 0.25); }
  .demo-hover:not([hidden]) { display: block; position: absolute; bottom: calc(100% + 2px); transform: translateX(-50%); padding: 4px 9px; border-radius: var(--radius-xs); background: rgba(24, 38, 52, 0.9); color: var(--white); font-size: var(--text-xs); font-weight: 500; line-height: 1.4; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }

  /* Icon buttons, the same weight as a video player's. */
  .demo-controls .demo-buttons .btn { position: relative; display: grid; place-items: center; gap: 0; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: var(--radius-circle); background: none; box-shadow: none; color: var(--ink); }
  .demo-controls .demo-buttons .btn:hover:not(:disabled) { background: var(--soft); color: var(--blue); }
  .demo-controls .demo-buttons .btn:disabled { opacity: 0.35; }
  .demo-controls .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .demo-controls .demo-main { grid-area: main; }
  .demo-controls .demo-step[data-action="demo-back"] { grid-area: back; }
  .demo-controls .demo-step[data-action="demo-next"] { grid-area: next; }
  .demo-controls .demo-restart { grid-area: restart; }
  .demo-controls .demo-buttons .icon { display: block; width: 21px; height: 21px; stroke-width: 1.8; }
  .demo-controls .demo-main .icon { width: 24px; height: 24px; }
  .demo-controls .icon-play path,
  .demo-controls .icon-skipBack path,
  .demo-controls .icon-skipForward path { fill: currentColor; }
  .demo-controls .icon-pause { stroke-width: 3; }

  /* Tooltips above the buttons, as on YouTube. */
  .demo-controls .demo-buttons .btn[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 4px 9px; border-radius: var(--radius-xs); background: rgba(24, 38, 52, 0.9); color: var(--white); font-size: var(--text-xs); font-weight: 500; line-height: 1.4; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.1s ease; }
  /* The replay tooltip opens leftwards so it stays inside the card (a centred one made the card scroll sideways). */
  .demo-controls .demo-buttons .demo-restart[data-tip]::after { left: auto; right: 0; transform: none; }
  .demo-controls .demo-buttons .btn[data-tip]:hover::after,
  .demo-controls .demo-buttons .btn[data-tip]:focus-visible::after { opacity: 1; transition-delay: 0.3s; }
  .demo-controls .demo-buttons .btn:disabled::after { display: none; }

  /* Time and moment, like "0:23 / 1:52 • Chapter". */
  .demo-controls .demo-time-row { grid-area: time; display: flex; align-items: baseline; gap: 0; margin: 0 0 0 10px; }
  #demo-time { font-size: var(--text-base); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
  #demo-moment { font-size: var(--text-base); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
  #demo-moment::before { content: "\2022"; margin: 0 8px; color: #9ab3c4; }

  /* Fine print under the bar: side by side when there is room, stacked when not. */
  .demo-controls .demo-fineprint { grid-area: note; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 18px; margin-top: 4px; }
  .demo-controls .demo-disclosure,
  .demo-controls .demo-service-note { margin: 0; font-size: var(--text-sm); line-height: 1.5; color: var(--muted); }
  .demo-controls .demo-live-link { min-height: 0; padding: 0; font-size: var(--text-sm); line-height: 1.5; white-space: nowrap; }
}

@media (min-width: 701px) and (prefers-reduced-motion: reduce) {
  .demo-track,
  .demo-track-thumb,
  .demo-controls .demo-buttons .btn[data-tip]::after,
  .demo-intro .demo-poster-play { transition: none; }
}

/* A dialog receives focus so keyboard users start inside it; the dialog itself needs no focus ring. */
.modal[tabindex]:focus,
.modal[tabindex]:focus-visible { outline: none; }

/* A finished demo offers Replay on the main button, so the second replay control is hidden (27 September 2026 review). */
.demo-controls .btn[hidden] { display: none !important; }

/* Shorter laptop screens: keep the profile card in view by dropping the sidebar caption, then the artwork (27 September 2026 review). */
@media (min-width: 701px) and (max-height: 860px) {
  .sidebar-art p { display: none; }
}
@media (min-width: 701px) and (max-height: 780px) {
  .sidebar-art { display: none; }
}
