#open-source { border-bottom: 1px solid var(--border); }
.open-project-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; }
.open-project { display: flex; min-width: 0; flex-direction: column; border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; }
.open-project-visual { display: block; width: 100%; padding: 0; border: 0; background: #101820; }
.open-project-visual img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain; }
.open-project-copy { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 24px; }
.open-project-copy h3 { font-size: 26px; }
.open-project-copy p { margin: 0; font-size: 15px; line-height: 1.8; color: var(--muted); }
.open-project-copy .open-project-meta { font-size: 12px; color: var(--accent); }
.open-project-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: auto; padding-top: 8px; }
.open-project-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; font-weight: 600; }
.open-project-links a:hover, .demo-card p a:hover { color: var(--accent); }
.demo-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 40px 0 20px; scroll-margin-top: 100px; }
.demo-heading h3 { font-size: 22px; }
.demo-heading span { color: var(--muted); font-size: 13px; }
.demo-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 32px 24px; }
.demo-card { min-width: 0; }
.demo-trigger, .platform-cover { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 6px; background: #e8ecef; overflow: hidden; }
.platform-stills { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.platform-stills button { display: block; min-width: 0; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--border-soft); border-radius: 4px; overflow: hidden; background: #e8ecef; }
.platform-stills img { display: block; width: 100%; height: 100%; object-fit: contain; }
.platform-stills button:hover { border-color: var(--accent); }
.demo-poster { display: block; width: 100%; height: 100%; object-fit: contain; background: #111; }
.demo-play { position: absolute; display: grid; place-items: center; width: 54px; height: 54px; top: 50%; left: 50%; transform: translate(-50%,-50%); border-radius: 50%; background: rgba(255,255,255,.95); box-shadow: 0 2px 12px #0003; transition: background 150ms; }
.demo-trigger:hover .demo-play { background: #ffe6d9; }
.demo-duration { position: absolute; bottom: 10px; right: 10px; color: #fff; background: #151b21e6; border-radius: 4px; padding: 2px 7px; font-size: 12px; font-variant-numeric: tabular-nums; }
.demo-card h4 { margin: 16px 0 6px; font-size: 17px; line-height: 1.5; }
.demo-card p { margin: 0; color: var(--muted); font-size: 13px; }
.open-project-visual:focus-visible, .demo-trigger:focus-visible, .platform-cover:focus-visible, .platform-stills button:focus-visible, .demo-close:focus-visible, .open-project-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.demo-dialog { width: min(1100px,calc(100% - 40px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--border); border-radius: 8px; color: var(--fg); background: #fff; overflow-y: auto; }
.demo-dialog::backdrop { background: rgba(10,16,22,.8); }
.demo-dialog-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 24px; background: #fff; }
.demo-dialog-head h2 { font-size: 22px; line-height: 1.45; }
.demo-close { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border-soft); border-radius: 6px; background: #fff; }
.demo-close:hover { background: var(--surface-warm); }
.demo-dialog video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 68dvh; object-fit: contain; background: #080b0d; }
.demo-dialog-foot { padding: 16px 24px; }
.demo-dialog-foot p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.7; }
.demo-dialog-foot .demo-status, .demo-dialog-foot .demo-error { margin-top: 8px; }
.demo-error a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.demo-player { min-width: 0; }
.demo-dialog-foot h3 { margin: 0 0 10px; font-size: 18px; line-height: 1.5; }
.demo-dialog.has-playlist { width: min(1240px,calc(100% - 40px)); }
.has-playlist .demo-dialog-body { display: grid; grid-template-columns: minmax(0,1fr) 340px; align-items: start; }
.demo-playlist { min-width: 0; padding: 0 16px 20px; }
.demo-playlist-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.demo-choice { display: grid; grid-template-columns: 88px minmax(0,1fr); align-items: start; width: 100%; gap: 12px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 6px; background: #fff; color: var(--fg); text-align: left; }
.demo-choice img { display: block; width: 88px; height: 66px; object-fit: contain; border-radius: 3px; background: #111; }
.demo-choice-copy { display: grid; min-width: 0; gap: 6px; }
.demo-choice-title { font-size: 14px; line-height: 1.5; font-weight: 600; }
.demo-choice-summary { color: var(--muted); font-size: 12px; line-height: 1.6; }
.demo-choice-duration { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.demo-choice[aria-pressed="true"] { border-color: var(--accent); background: #fff6f0; }
.demo-choice[aria-pressed="true"] .demo-choice-title { color: var(--accent); }
.demo-choice:hover { border-color: var(--accent); }
.demo-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 920px) {
  .has-playlist .demo-dialog-body { grid-template-columns: 1fr; }
  .demo-playlist { padding: 0 24px 24px; }
  .demo-playlist-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .open-project-grid { gap: 20px; }
  .open-project-copy { padding: 20px; }
  .open-project-copy h3 { font-size: 24px; }
  .demo-grid { gap: 28px 18px; }
  .demo-heading { scroll-margin-top: 140px; }
  .demo-card h4 { font-size: 15px; }
}
@media (max-width: 600px) {
  .open-project-grid, .demo-grid { grid-template-columns: 1fr; gap: 28px; }
  .open-project-copy { padding: 20px; }
  .demo-heading { display: block; margin-top: 32px; }
  .demo-heading span { display: block; margin-top: 8px; }
  .demo-card h4 { font-size: 17px; }
  .demo-dialog, .demo-dialog.has-playlist { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .demo-dialog-head { padding: 12px 16px; gap: 12px; }
  .demo-dialog-head h2 { font-size: 18px; }
  .demo-dialog-foot { padding: 14px 16px; }
  .demo-dialog video { max-height: 60dvh; }
  .demo-playlist { padding: 0 16px 16px; }
  .demo-playlist-list { grid-template-columns: 1fr; }
  .demo-dialog-foot h3 { font-size: 16px; }
}
