/* Drive's embedded viewer has a 320 × 300 CSS-pixel minimum. Give it a full
   canvas at the film's aspect ratio, then fit that canvas inside the page. */
.project-player {
  --player-ratio: calc(16 / 9);
  --drive-min-width: 320px;
  --drive-min-height: 300px;
  --canvas-floor: max(var(--drive-min-width), calc(var(--drive-min-height) * var(--player-ratio)));
  position: relative;
  container-type: inline-size;
  width: 100%;
  max-width: calc(74vh * var(--player-ratio));
  max-width: calc(74svh * var(--player-ratio));
  min-height: var(--drive-min-height);
  aspect-ratio: var(--player-ratio);
  margin-inline: auto;
  background: #000;
}
.project-player video {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
/* Native video has no 300px embed minimum: let it use the full aspect box. */
.project-player:has(video) { min-height: 0; }
.project-player[data-orientation="square"] { --player-ratio: 1; }
.project-player[data-orientation="portrait"] { --player-ratio: calc(9 / 16); }
.project-player iframe {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  width: 100%;
  height: 100%;
  transform-origin: top left;
}
@supports (width: 1cqw) and (transform: scale(tan(atan2(1px, 2px)))) {
  .project-player { min-height: 0; }
  .project-player iframe {
    width: max(100%, var(--canvas-floor));
    height: max(100%, calc(var(--canvas-floor) / var(--player-ratio)));
    transform: scale(min(1, tan(atan2(100cqw, var(--canvas-floor)))));
  }
}

#detail {
  --dialog-gap: .75rem;
  width: min(65rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100vh - 2 * var(--dialog-gap));
  max-height: calc(100dvh - 2 * var(--dialog-gap));
  margin: auto;
  padding: 0;
  color: var(--paper);
  background: #151316;
  border: 1px solid #ffffff36;
  border-radius: 24px;
  box-shadow: 0 30px 100px #0009;
  overflow: auto;
  overscroll-behavior: contain;
}
/* Keep the video and trigger anchored while a long clip list unfolds. */
#detail:has(.clip-picker) { margin-block: var(--dialog-gap) auto; }
#detail::backdrop { background: #050505cf; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.dialog-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #191619f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-block: .45rem;
  padding-inline: clamp(1rem, 3vw, 2.4rem) .65rem;
}
.dialog-bar .eyebrow { margin: 0; color: #d2c6cc; }
.dialog-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0 0 2px;
  border: 1px solid #ffffff42;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff16, #ffffff04);
  color: #fff;
  font: 29px/1 Arial, sans-serif;
}
.dialog-art { background: #000; }
.dialog-inner { padding: clamp(1.2rem, 3vw, 2.4rem); }
.dialog-inner h2 { font-size: clamp(30px, 4vw, 50px); line-height: 1.12; margin: 0 0 .75rem; }
.dialog-inner p { color: var(--muted); }
.notice { border-top: 1px solid var(--line); margin-top: 1.35rem; padding-top: 1.1rem; }
.player-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.5rem; }
.drive-link { color: var(--accent); border-bottom: 1px solid #c8617d66; padding-block: .3rem; font-size: .925rem; }
.player-help { font-size: .84rem; margin: 0; max-width: 350px; }

.playlist-icon { display: block; width: 1.4rem; height: 1.4rem; flex: none; }
.package-action, .clip-trigger {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #e9bed27d;
  color: #fff;
  background: radial-gradient(ellipse at 8% -60%, #ffccdb54, transparent 67%),
              linear-gradient(115deg, #663245ec, #3d1c2bea 58%, #271c24f2);
  box-shadow: inset 0 1px 0 #ffffff52, inset 0 -1px 2px #ffffff12, 0 6px 18px #0006;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.package-action::after, .clip-trigger::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 35%, #fff2 49%, transparent 63%);
  transform: translateX(-130%);
}
.package-action {
  position: absolute;
  z-index: 4;
  inset-inline-end: .75rem;
  bottom: .75rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .95rem;
  border-radius: 100px;
  font-size: .9rem;
  font-weight: 650;
}
.clip-picker {
  margin: 0;
  padding: clamp(.65rem, 2vw, 1rem);
  color: var(--paper);
  background: linear-gradient(150deg, #211b20, #141216);
  border-bottom: 1px solid #fff1;
}
.watch-media .clip-picker { border: 1px solid #ffffff24; border-radius: 18px; margin-top: .75rem; }
.clip-trigger {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: clamp(.5rem, 2vw, .9rem);
  border-radius: 17px;
  padding: .55rem .85rem;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.clip-trigger::-webkit-details-marker { display: none; }
.clip-trigger:focus-visible, .clip-option:focus-visible {
  outline: 2px solid #f7d0df;
  outline-offset: -3px;
}
.clip-glyph {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  border: 1px solid #ffe7f045;
  background: linear-gradient(145deg, #fff2, #ffffff04);
  box-shadow: inset 0 1px 0 #fff3;
}
.clip-caption { display: grid; flex: 1; min-width: 0; gap: .13rem; line-height: 1.35; }
.clip-caption strong { font-size: 1rem; font-weight: 650; }
.clip-current { color: #ecd9e2; font-size: .875rem; overflow-wrap: anywhere; text-align: start; }
.clip-position {
  flex: none;
  padding: .25rem .55rem;
  border-radius: 100px;
  border: 1px solid #ffe7f030;
  background: #170e185c;
  color: #ffeaf2;
  font-size: .825rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.clip-chevron {
  width: .62rem;
  height: .62rem;
  flex: none;
  margin-inline: .1rem .25rem;
  border: solid currentColor;
  border-width: 0 1.8px 1.8px 0;
  transform: translateY(-2px) rotate(45deg);
}
.clip-picker[open] .clip-chevron { transform: translateY(2px) rotate(225deg); }
.clip-trigger[aria-expanded="false"] .clip-chevron { transform: translateY(-2px) rotate(45deg); }
.clip-drawer { overflow: hidden; }
.clip-options {
  display: grid;
  gap: .2rem;
  margin-top: .45rem;
  max-height: min(18rem, 38vh);
  max-height: min(18rem, 38svh);
  padding: .3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #986b7f #171417;
  scrollbar-width: thin;
  border: 1px solid #ffffff22;
  border-radius: 14px;
  background: #19161b;
}
.clip-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 46px;
  padding: .55rem .75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #e6dfe3;
  font-size: .94rem;
  line-height: 1.4;
}
.clip-index { color: #bcacb4; font-size: .82rem; font-variant-numeric: tabular-nums; }
.clip-name { flex: 1; min-width: 0; overflow-wrap: anywhere; text-align: start; }
.clip-option[aria-current] {
  color: #fff;
  border-color: #dca8bd56;
  background: linear-gradient(105deg, #633447bd, #44303d80);
}
.clip-option[aria-current] .clip-index { color: #f3d5e2; }
.clip-option[aria-current] .clip-check { width: .5rem; height: .85rem; border: solid #f3cada; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-inline: .3rem; }
@media (hover: hover) {
  .clip-option:hover { background-color: #ffffff0d; }
  .clip-trigger:hover, .work:hover .package-action { border-color: #f6dce9c4; }
}
@keyframes clip-glint { to { transform: translateX(130%); } }
@media (prefers-reduced-motion: no-preference) {
  .clip-chevron { transition: transform .28s var(--ease); }
  .clip-trigger, .package-action, .clip-option { transition: border-color .22s, background-color .22s, box-shadow .22s, transform .22s var(--ease); }
  .clip-trigger:active { transform: scale(.99); }
  .clip-picker[open] .clip-trigger::after, .work:is(:hover, :focus-visible) .package-action::after { animation: clip-glint .62s var(--ease); }
  .work:is(:hover, :focus-visible) .package-action { transform: translateY(-2px); }
}
@media (max-width: 760px), (hover: none) and (max-height: 520px) {
  #detail { --dialog-gap: 6px; width: calc(100% - 2 * var(--dialog-gap)); border-radius: 18px; }
}
@media (max-width: 360px) {
  .clip-trigger { gap: .45rem; padding-inline: .6rem; }
  .clip-glyph { width: 2rem; height: 2rem; }
}

.clip-thumb{width:64px;aspect-ratio:16/9;object-fit:cover;border-radius:6px;flex:none}
