@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400&display=swap");

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  background: #fff;
  color: #151515;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.folder-window {
  width: min(1180px, calc(100% - 64px));
  min-height: min(760px, calc(100svh - 80px));
  margin: 40px auto;
  border: 1px solid #d8d8d8;
  background: #fafafa;
}

.folder-toolbar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid #dedede;
  background: #f3f3f3;
}

.folder-toolbar a {
  color: inherit;
  font-size: 16px;
  text-decoration: none;
}

.folder-toolbar h1 {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .04em;
}

.item-count {
  margin-left: auto;
  color: #888;
  font-size: 9px;
  letter-spacing: .06em;
}

.work-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 430px));
  gap: 54px 34px;
  align-items: start;
  padding: 42px;
}

.work-item {
  width: 100%;
  margin: 0;
}

.pinned-item { order: -10; }

.secondary-pinned-item { order: -9; }

.bts-cluster {
  order: 99;
  grid-column: 1 / -1;
  position: relative;
  width: min(310px, 86%);
  height: 140px;
  margin: 54px auto 8px;
}

.bts-photo {
  position: absolute;
  width: 78px;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #555;
  font: 400 9px/1.2 Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
  transition: transform .35s ease;
}

.bts-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.bts-photo-one {
  top: 8px;
  left: 20%;
}

.bts-photo-two {
  right: 18%;
  bottom: 8px;
}

.bts-photo:hover { transform: translateY(-3px); }

.bts-photo span {
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

.bts-photo:focus span,
.bts-photo:active span {
  background: #1677ed;
  color: #fff;
}

.bts-viewer {
  width: min(820px, calc(100vw - 48px));
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.bts-viewer::backdrop { background: rgba(255, 255, 255, .95); }

.bts-viewer img {
  display: block;
  width: 100%;
  max-height: calc(100svh - 56px);
  object-fit: contain;
}

.bts-viewer-close {
  position: fixed;
  top: 18px;
  right: 22px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #151515;
  font: 400 28px/1 Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
}

.poster-item {
  order: 98;
  grid-column: 1 / -1;
  width: min(360px, 100%);
  justify-self: center;
  margin-bottom: 28px;
}

.poster-frame {
  margin: 0;
  background: #eee;
}

.poster-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.video-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f2f2f2;
}

.video-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.local-play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 11px;
  letter-spacing: .08em;
  cursor: pointer;
}

.local-video-frame.is-playing .local-play { display: none; }

.video-frame:hover img { transform: scale(1.008); }

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  letter-spacing: .08em;
}

.work-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding-top: 12px;
  font-size: 10px;
  letter-spacing: .04em;
}

.work-title { text-align: center; }

.work-title h2,
.work-title p {
  margin: 0;
  font-size: inherit;
  font-weight: 400;
}

.work-title p {
  margin-top: 4px;
  color: #777;
}

.watch-link { justify-self: end; }

.hosted-label {
  justify-self: end;
  color: #888;
}

.work-meta a {
  color: inherit;
  text-decoration: none;
}

.work-meta a:hover { text-decoration: underline; }

.credits {
  margin-top: 16px;
  border-top: 1px solid #dedede;
  font-size: 9px;
  letter-spacing: .06em;
}

.credits summary {
  width: max-content;
  padding-top: 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.credits summary::-webkit-details-marker { display: none; }

.credits summary::after {
  content: " +";
}

.credits[open] summary::after { content: " −"; }

.credits-content {
  max-height: 360px;
  overflow-y: auto;
  margin-top: 14px;
  padding: 0 14px 20px 0;
  color: #555;
  scrollbar-width: thin;
}

.credit-section {
  margin-top: 26px;
  padding-top: 12px;
  border-top: 1px solid #dedede;
}

.credit-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.credit-section h3 {
  margin: 0 0 18px;
  color: #151515;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .08em;
}

.credits-content p {
  margin: 0 0 8px;
  line-height: 1.55;
}

.credits-content p span {
  color: #151515;
  font-weight: 400;
}

.credits-content .self-credit {
  margin: 0 0 18px;
  padding: 18px 0;
  border-bottom: 1px solid #dedede;
  color: #555;
}

@media (max-width: 700px) {
  .folder-window {
    width: calc(100% - 24px);
    min-height: calc(100svh - 24px);
    margin: 12px auto;
  }

  .work-list {
    grid-template-columns: 1fr;
    gap: 38px;
    padding: 24px 18px 54px;
  }

  .work-meta {
    grid-template-columns: auto 1fr auto;
    gap: 14px;
  }

  .credits-content { max-height: 300px; }

  .bts-cluster {
    width: 100%;
    height: 128px;
    margin: 40px 0 6px;
  }

  .bts-photo { width: 70px; font-size: 8px; }
  .bts-photo-one { left: 22%; }
  .bts-photo-two { right: 20%; }
}

@media (prefers-reduced-motion: reduce) {
  .video-frame img,
  .bts-photo { transition: none; }
}
