/* Demo page only. Linked from demo.html. Motion is transform/opacity only. */
.page.demo-pg{min-height:0;padding:clamp(24px,4vh,48px) 0 clamp(40px,7vh,72px)}
/* h1 uses the shared inner-page size from b.css; only the gap below is tightened */
.demo-pg h1{margin-bottom:clamp(14px,2.4vh,22px)}

/* whole first screen fits: video width is capped by the viewport height */
.demo-pg .wrap{--vw:max(480px,calc((100svh - 390px)*1.7778 + 20px))}
.dv{width:100%;max-width:var(--vw);margin:0;border:1px solid var(--line);border-radius:var(--r);background:var(--glass);padding:10px;box-shadow:0 30px 80px -30px rgba(0,0,0,.7)}
.dv-stage{position:relative;border-radius:var(--r-sm);overflow:hidden;background:#000;aspect-ratio:1280/720}
.dv-stage video{display:block;width:100%;height:100%;object-fit:contain;background:#000;cursor:pointer}
.dv-stage video:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}

/* controls sit below the picture, never over it */
.dv-bar[hidden],.dv-btn[hidden]{display:none}
.dv-bar{display:flex;align-items:center;gap:14px;padding:12px 4px 2px}
.dv-btn{display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:0 18px 0 14px;border:0;border-radius:999px;background:var(--ink);color:var(--bg);font:500 17px/1 var(--sans);cursor:pointer;flex:none;transition:transform .3s var(--ease)}
.dv-btn:hover{transform:translateY(-1px)}
.dv-btn svg{width:18px;height:18px;flex:none}
.dv-btn .i-pause{display:none}
.dv-btn[data-state="playing"] .i-play{display:none}
.dv-btn[data-state="playing"] .i-pause{display:block}
.dv-fs{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 1px var(--line);padding:0 16px;flex:none}
.dv-fs:hover{box-shadow:inset 0 0 0 1px var(--gold)}
.dv-seek{--p:0%;flex:1 1 auto;min-width:0;height:44px;margin:0;background:transparent;-webkit-appearance:none;appearance:none;cursor:pointer}
.dv-seek::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:linear-gradient(90deg,var(--gold) var(--p),var(--track,rgba(236,229,210,.16)) var(--p))}
.dv-seek::-moz-range-track{height:4px;border-radius:2px;background:var(--track,rgba(236,229,210,.16))}
.dv-seek::-moz-range-progress{height:4px;border-radius:2px;background:var(--gold)}
.dv-seek::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;margin-top:-6px;border-radius:50%;border:0;background:var(--ink)}
.dv-seek::-moz-range-thumb{width:16px;height:16px;border-radius:50%;border:0;background:var(--ink)}
.dv-time{font-family:var(--mono);font-size:14px;color:var(--mut);flex:none;min-width:6.4em;text-align:right}

.dv-meta{display:flex;align-items:flex-start;justify-content:space-between;gap:24px 40px;margin:22px 0 0;width:100%;max-width:var(--vw)}
.dv-meta .txt{max-width:46ch}
.dv-lab{display:flex;flex-wrap:wrap;align-items:flex-start;gap:0 14px;text-wrap:balance;margin-bottom:8px}
.dv-lab span{white-space:nowrap}
.dv-lab::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--gold);flex:none;margin-top:5px}
.dv-cap{font-size:17px;line-height:1.5;color:var(--ink);margin:0}
.demo-pg .btn{flex:none;margin-top:2px;min-height:44px;padding:14px 24px}
.dv-tx{margin:22px 0 0;width:100%;max-width:var(--vw);color:var(--mut);font-size:16px}
.dv-tx summary{cursor:pointer;padding:8px 0;color:var(--mut)}
.dv-tx summary:hover{color:var(--ink)}
.dv-tx p{margin:10px 0;max-width:62ch}

/* wide desktops: film as large as the viewport allows, narrow caption beside it (selectors match b.css specificity; this file loads after it) */
@media (min-width:1100px){
  .page.demo-pg .wrap{--side:340px;display:grid;grid-template-columns:minmax(0,1fr) var(--side);column-gap:48px;align-items:start}
  .demo-pg h1{grid-column:1/-1;max-width:none;width:100%}
  .dv{max-width:none;width:100%;margin:0;grid-column:1}
  .page.demo-pg .dv-meta{grid-column:2;grid-row:2;flex-direction:column;align-items:flex-start;gap:28px;margin:0;max-width:none;padding:10px 0 0;align-self:start;justify-content:flex-start}
  .dv-meta .txt{max-width:none}
  .page.demo-pg .dv-lab{white-space:normal}
  .page.demo-pg .btn{padding:14px 22px;white-space:nowrap}
  .dv-tx{grid-column:1/-1;max-width:62ch;margin:22px 0 0}
}

/* short desktops: size the player by height so the control bar ends above the fold */
@media (min-width:1100px) and (max-height:800px){
  .page.demo-pg{padding-top:20px}
  .demo-pg h1{margin-bottom:12px}
  .page.demo-pg .dv{max-width:calc((100svh - var(--fold,300px))*1.7778)}
}
/* landscape tablets: single column, film fills it */
@media (min-width:721px) and (max-width:1099px){
  .demo-pg .wrap{--vw:none}
}

@media (max-width:720px){
  .page.demo-pg{padding-top:24px}
  .dv{padding:6px;border-radius:var(--r-sm)}
  .dv-stage{border-radius:var(--r-sm)}
  .dv-bar{flex-wrap:wrap;gap:4px 10px;padding:8px 2px 2px}
  .dv-time{order:3;min-width:0;margin-left:0;text-align:left}
  .dv-seek{order:4;flex:1 1 100%;min-width:0;height:44px}
  .dv-fs{margin-left:auto}
  .dv-meta{flex-direction:column;gap:18px;margin-top:18px}
  .dv-cap{font-size:16px}
}
/* short landscape screens (phones turned sideways): film fills the width, caption and button share one row */
@media (orientation:landscape) and (max-height:500px) and (max-width:1099px){
  .demo-pg .wrap{--vw:none}
  .page.demo-pg{padding-top:16px;padding-bottom:32px}
  .demo-pg h1{margin-bottom:12px}
  .dv,.dv-meta,.dv-tx{max-width:none}
  .dv-meta{flex-direction:row;align-items:center;gap:16px 32px;margin-top:16px}
  .dv-meta .txt{flex:1 1 0;max-width:none;min-width:0}
  .dv-lab{display:flex}
  .dv-cap{font-size:16px}
}
@media (prefers-reduced-motion:reduce){.dv-btn{transition:none}.dv-btn:hover{transform:none}}
@media print{.demo-pg .dv{display:none}}
