/* Examples page, built like a video site: a feed of real videos (chip bar + shelves of cards) and a watch page
   (player with a scene chapter bar, title and actions, description, scenes, script, and "Up next"). */
.ex { background: var(--bg-0); }
.ex-index, .ex-detail { padding: 120px 0 56px; }
.ex-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- feed ---------- */
.ex-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 440px); gap: 24px; align-items: end; margin-bottom: 22px; }
.ex-title h1 { margin: 8px 0 8px; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.08; letter-spacing: -0.025em; color: var(--ink); }
.ex-title p { margin: 0; color: var(--ink-2); max-width: 62ch; line-height: 1.55; }
.ex-search { position: relative; }
.ex-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ex-search input { width: 100%; box-sizing: border-box; height: 46px; padding: 0 46px 0 44px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--input-bg); color: var(--input-ink); font: 500 14.5px/1 var(--font-body); transition: border-color 0.15s ease, box-shadow 0.15s ease; -webkit-appearance: none; appearance: none; }
.ex-search input::placeholder { color: var(--input-placeholder); }
.ex-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.ex-search input:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 4px var(--aqua-glow); }
.ex-search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.ex-search-clear:hover { background: var(--surface-2); color: var(--ink); }
.ex-search-clear[hidden] { display: none; }

/* one row of chips, like a video site's filter bar: kind | language | topic (scrolls away with the page) */
.ex-chipbar { display: flex; align-items: center; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 10px var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ex-chipbar::-webkit-scrollbar { display: none; }
.ex-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 9px; border: 0; background: var(--surface-2); color: var(--ink); font: 600 13px/1 var(--font-body); cursor: pointer; white-space: nowrap; transition: background 0.15s ease, color 0.15s ease; }
.ex-chip:hover { background: var(--line); }
.ex-chip .n { font: 600 10.5px/1 var(--font-mono); color: var(--muted); }
.ex-chip.on { background: var(--sidebar); color: #fff; }
.ex-chip.on .n { color: var(--mint); }
.ex-chip.none { opacity: 0.45; }
.ex-chip:focus-visible, .ex-search-clear:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }
.ex-sep { flex: none; width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; }
.ex-count { margin: 6px 0 0; min-height: 1em; font: 500 12px/1.4 var(--font-mono); color: var(--muted); }

.ex-group { margin-top: 30px; }
.ex-group[hidden] { display: none; }
.ex-group-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; font-size: 19px; color: var(--ink); }
.ex-group-title span { font: 500 11.5px/1 var(--font-mono); color: var(--muted); }
.ex-grid { display: grid; gap: 28px 16px; }
.ex-grid-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.ex-grid-tall { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }

.ex-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; border-radius: 14px; }
.ex-thumb { position: relative; border-radius: 12px; overflow: hidden; background: var(--sidebar); }
.ex-grid-wide .ex-thumb { aspect-ratio: 16 / 9; }
.ex-grid-tall .ex-thumb { aspect-ratio: 9 / 16; }
.ex-thumb img, .ex-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-thumb img { transition: transform 0.35s ease; }
.ex-thumb video { opacity: 0; transition: opacity 0.25s ease; }
.ex-card:hover .ex-thumb video.live, .ex-card:focus-visible .ex-thumb video.live { opacity: 1; }
.ex-card:hover .ex-thumb img { transform: scale(1.03); }
.ex-dur { position: absolute; right: 8px; bottom: 8px; font: 600 11.5px/1 var(--font-mono); color: #fff; background: rgba(5, 14, 10, 0.8); padding: 4px 6px; border-radius: 5px; }
.ex-info { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.ex-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--mint); display: grid; place-items: center; flex: none; }
.ex-avatar img { width: 22px; height: 22px; }
.ex-text h3 { margin: 0 0 4px; font-size: 14.5px; line-height: 1.35; font-weight: 600; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ex-by, .ex-line { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.ex-card:hover h3 { color: var(--aqua); }
.ex-card:focus-visible { outline: 2px solid var(--aqua); outline-offset: 4px; }
.ex-grid-tall .ex-info { grid-template-columns: minmax(0, 1fr); }
.ex-grid-tall .ex-avatar { display: none; }   /* tall cards are narrow: the title gets the whole width */

.ex-nores { margin-top: 40px; padding: 36px 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 22px; background: var(--surface); }
.ex-nores[hidden] { display: none; }
.ex-nores h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.ex-nores p { margin: 0 auto 18px; max-width: 46ch; color: var(--ink-2); line-height: 1.55; }
.ex-empty { color: var(--muted); }

/* ---------- watch page ---------- */
.ex-back { display: inline-block; margin-bottom: 14px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.ex-back:hover { color: var(--aqua); }
.ex-watch { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }

.ex-stage { position: relative; border-radius: 16px; overflow: hidden; background: #050c08; }
.ex-stage.wide { aspect-ratio: 16 / 9; }
.ex-stage.tall { height: min(76vh, 760px); min-height: 420px; }
.ex-stage-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(36px) saturate(1.2) brightness(0.55); }
.ex-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.ex-stage.wide video { background: #050c08; }
.ex-stage .svp { position: absolute; inset: 0; }   /* our own player (sv-player.css) fills the stage */

/* the scene chapter bar: one segment per scene of the director's plan */
.ex-chapters { display: flex; gap: 3px; margin-top: 10px; height: 26px; align-items: center; }
.ex-ch { position: relative; flex: 1 1 0; min-width: 6px; height: 6px; padding: 0; border: 0; border-radius: 3px; background: var(--line-strong); cursor: pointer; transition: height 0.15s ease; }
.ex-ch-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--aqua); transform-origin: left center; transform: scaleX(0); }
.ex-ch:hover, .ex-ch:focus-visible, .ex-ch.on { height: 10px; }
.ex-ch:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; }
.ex-ch-tip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); padding: 6px 9px; border-radius: 8px; background: var(--sidebar); color: #fff; font: 600 12px/1.2 var(--font-body); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; opacity: 0; pointer-events: none; transition: opacity 0.15s ease; z-index: 2; }
.ex-ch:hover .ex-ch-tip, .ex-ch:focus-visible .ex-ch-tip { opacity: 1; }
.ex-ch:first-child .ex-ch-tip { left: 0; transform: none; }
.ex-ch:last-child .ex-ch-tip { left: auto; right: 0; transform: none; }

.ex-h1 { margin: 12px 0 12px; font-size: clamp(20px, 2.1vw, 26px); line-height: 1.25; letter-spacing: -0.015em; color: var(--ink); }
.ex-channel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ex-channel .ex-avatar { width: 40px; height: 40px; }
.ex-channel .ex-avatar img { width: 26px; height: 26px; }
.ex-chan-name { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.ex-chan-name b { font-size: 15px; color: var(--ink); }
.ex-chan-name small { font-size: 12.5px; color: var(--muted); }
.ex-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-act { height: 38px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--ink); font: 600 13.5px/1 var(--font-body); cursor: pointer; transition: background 0.15s ease; }
.ex-act:hover { background: var(--line); }
.ex-act-main { background: var(--sidebar); color: #fff; }
.ex-act-main:hover { background: var(--aqua); }
.ex-act:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }

.ex-desc { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.ex-facts { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ex-sum { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.ex-yt { display: inline-block; margin-top: 10px; font-weight: 600; font-size: 14px; color: var(--aqua); text-decoration: none; border-bottom: 1px solid currentColor; }
.ex-more-info { margin-top: 10px; }
.ex-more-info summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink); width: max-content; }
.ex-more-info summary:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; border-radius: 4px; }
.ex-settings { display: grid; margin: 10px 0 0; }
.ex-settings div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ex-settings div:last-child { border-bottom: 0; }
.ex-settings dt { color: var(--muted); font-size: 13px; }
.ex-settings dd { margin: 0; color: var(--ink); font-size: 13.5px; font-weight: 500; }
.ex-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }

.ex-sec { margin-top: 28px; }
.ex-sec h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; font-size: 17px; color: var(--ink); }
.ex-sec h2 span { font: 500 11.5px/1 var(--font-mono); color: var(--muted); }
.ex-scenes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ex-scene { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-radius: 12px; border: 0; cursor: pointer; text-align: left; background: transparent; width: 100%; font: inherit; color: inherit; transition: background 0.15s ease; }
.ex-scene:hover { background: var(--surface-2); }
.ex-scene.on { background: var(--accent-soft); }
.ex-scene:focus-visible { outline: 2px solid var(--aqua); outline-offset: 1px; }
.ex-scene .when { align-self: start; justify-self: start; padding: 4px 7px; border-radius: 6px; background: var(--accent-soft); font: 600 12px/1 var(--font-mono); color: var(--aqua); }
.ex-scene.on .when { background: var(--aqua); color: #fff; }
.ex-scene .what { display: flex; flex-direction: column; gap: 4px; }
.ex-scene .what b { font-size: 14px; color: var(--ink); }
.ex-scene .vo { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.ex-scene .draw { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.ex-script { white-space: pre-wrap; margin: 0; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font: 400 14.5px/1.7 var(--font-body); color: var(--ink); max-height: 360px; overflow: auto; }
.ex-script-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

.ex-next { position: sticky; top: 96px; }
.ex-next h2 { margin: 0 0 12px; font-size: 16px; color: var(--ink); }
.ex-next ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ex-next-item { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; text-decoration: none; color: inherit; border-radius: 10px; }
.ex-next-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--sidebar); }
.ex-next-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ex-next-thumb .ex-dur { right: 6px; bottom: 6px; font-size: 10.5px; }
.ex-next-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ex-next-text b { font-size: 13.5px; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ex-next-text small { font-size: 12px; color: var(--muted); }
.ex-next-item:hover b { color: var(--aqua); }
.ex-next-item:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; }

.ex-cta { padding: 64px 0 96px; text-align: center; }
.ex-cta h2 { margin: 0 0 10px; font-size: clamp(24px, 3.2vw, 36px); color: var(--ink); letter-spacing: -0.02em; }
.ex-cta p { margin: 0 0 22px; color: var(--ink-2); }

@media (max-width: 1100px) {
  .ex-watch { grid-template-columns: minmax(0, 1fr) 320px; }
  .ex-next-item { grid-template-columns: 140px minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .ex-top { grid-template-columns: 1fr; }
  .ex-watch { grid-template-columns: 1fr; }
  .ex-next { position: static; }
  .ex-stage.tall { height: min(80vh, 680px); }
}
@media (max-width: 560px) {
  .ex-index, .ex-detail { padding-top: 96px; }
  .ex-search input { font-size: 16px; }   /* 16px stops iOS zooming into the field */
  .ex-grid-tall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .ex-stage { margin: 0 calc(-1 * var(--gutter)); border-radius: 0; }
  .ex-stage.tall { height: 72vh; min-height: 0; }
  .ex-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .ex-act { padding: 0 10px; white-space: nowrap; }
  .ex-act-main { grid-column: 1 / -1; order: -1; height: 44px; }
  .ex-next-item { grid-template-columns: 128px minmax(0, 1fr); }
  .ex-settings div { grid-template-columns: 96px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ex-search input, .ex-chip, .ex-thumb video, .ex-thumb img, .ex-ch, .ex-ch-tip { transition: none; }
  .ex-card:hover .ex-thumb img { transform: none; }
}

/* "Made by creators": shared videos (js/examples.js shelf, backend-rendered /examples/creators/<slug>) */
.ex-avatar.ex-initial { font: 700 15px/1 var(--font-body); color: var(--sidebar); }
.ex-channel .ex-avatar.ex-initial { font-size: 17px; }
.ex-act-link { display: inline-flex; align-items: center; text-decoration: none; }
.ex-next-more { margin: 12px 0 0; font-size: 14px; }
.ex-next-more a { color: var(--aqua); font-weight: 600; text-decoration: none; }
.ex-next-more a:hover { text-decoration: underline; }
.ex-group-note { margin: -6px 0 14px; font-size: 13px; color: var(--muted); }
.ex-group .ex-grid:empty { display: none; }
.ex-group .ex-grid + .ex-grid { margin-top: 18px; }
