* {
  box-sizing: border-box;
}

:root {
  --page-bg: #000;
  --line: #222;
  --top-bg: #ff4a1c;
  --nav-fg: #fff;
  --nav-dim: rgba(255, 255, 255, 0.85);
  --nav-on: #000;
  --nav-on-bg: #fff;
  --nav-track: #000;
  --nav-line: rgba(255, 255, 255, 0.22);
  --nav-shadow: rgba(255, 255, 255, 0.12);
  color-scheme: dark;
}

html,
body {
  margin: 0;
  background: var(--page-bg);
  color: #fff;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  scrollbar-width: thin;
  scrollbar-color: #333 #000;
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background-color: #000;
}

::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 10px;
}

ul,
dl,
dt,
dd {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 목록 */
.short-list {
  width: 100%;
  margin: 0 auto;
  padding: 20px 40px 80px;
}

/* 탭 — 숏폼비서 만들기 화면의 홍보 종류 필터와 같은 모양 */
.short-list .sl-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 0;
  background: var(--page-bg);
  /* 화면 양 끝까지 배경을 채우고, 붙었을 때만 아래 선 */
  box-shadow: 0 0 0 100vmax var(--page-bg);
  clip-path: inset(0 -100vmax -1px);
  transition: box-shadow 0.2s ease;
}

.short-list .sl-tabs.is-stuck {
  box-shadow: 0 0 0 100vmax var(--page-bg), 0 1px 0 100vmax var(--line);
}

.short-list .sl-tabs:empty {
  display: none;
}

.short-list .sl-tabs button {
  height: 40px;
  padding: 0 18px;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #111;
  color: #ddd;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.short-list .sl-tabs button span {
  margin-left: 3px;
  font-weight: 400;
  opacity: 0.6;
}

.short-list .sl-tabs button:hover {
  border-color: #555;
  color: #fff;
  transform: translateY(-1px);
}

.short-list .sl-tabs button.on {
  font-weight: 600;
  color: #ff4a1c;
  border-color: #ff4a1c;
  background: rgba(255, 74, 28, 0.14);
}

.short-list .sl-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 40px 28px;
  width: 100%;
}

.short-list .sl-grid > li {
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}

.short-list .sl-grid > li > div {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  border: 1px solid #1c1c1c;
  background: #111;
  overflow: hidden;
  cursor: pointer;
}

.short-list .sl-grid > li > div > a {
  display: block;
  width: 100%;
  height: 100%;
}

.short-list .sl-grid > li > div img,
.short-list .sl-grid > li > div video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.short-list .sl-grid > li > div video {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.short-list .sl-grid > li > div video.is-playing {
  opacity: 1;
}

.short-list .sl-grid > li > div .sl-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 11px;
  letter-spacing: -0.2px;
  color: #fff;
  background: #ff4a1c;
}

.short-list .sl-grid > li > div .sl-time {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 11px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
}

.short-list .sl-grid > li > dl {
  padding: 18px 0 0;
  text-align: center;
}

.short-list .sl-grid > li > dl > dt {
  font-weight: 600;
  font-size: 17px;
  line-height: 22px;
  letter-spacing: -0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.short-list .sl-grid > li > dl > dd {
  margin-top: 4px;
  font-size: 13px;
  line-height: 18px;
  color: #777;
  letter-spacing: -0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.short-list .sl-empty {
  padding: 80px 0;
  text-align: center;
  font-size: 15px;
  color: #888;
}

/* 플레이어 */
.sl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}

.sl-lightbox[hidden] {
  display: none !important;
}

.sl-lb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
}

.sl-lb-stage video {
  display: block;
  height: min(86vh, 960px);
  max-width: 92vw;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  background: #000;
  object-fit: contain;
}

.sl-lb-caption {
  text-align: center;
  color: #fff;
}

.sl-lb-caption strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.sl-lb-caption span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.sl-lb-close,
.sl-lb-arrow {
  position: fixed;
  z-index: 100010;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.sl-lb-close {
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 44px;
  text-align: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.sl-lb-close:hover {
  color: #ff4a1c;
}

.sl-lb-arrow {
  top: 50%;
  width: 64px;
  height: 64px;
  margin-top: -32px;
  border-radius: 999px;
  opacity: 0.7;
}

.sl-lb-arrow:hover {
  opacity: 1;
}

.sl-lb-arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
}

.sl-lb-prev {
  left: 16px;
}

.sl-lb-prev::before {
  transform: translate(-30%, -50%) rotate(-135deg);
}

.sl-lb-next {
  right: 16px;
}

.sl-lb-next::before {
  transform: translate(-70%, -50%) rotate(45deg);
}

/* 커서 (detail과 같은 diprism v2) */
#cursor {
  position: fixed;
  z-index: 99999999;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform;
  mix-blend-mode: difference;
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  #cursor {
    display: block;
  }

  .cursor__circle {
    width: 34px;
    height: 34px;
    margin-top: -50%;
    margin-left: -50%;
    border-radius: 50%;
    border: solid 1px #fff;
    transition:
      opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1),
      background-color 0.3s cubic-bezier(0.25, 1, 0.5, 1),
      border-color 0.3s cubic-bezier(0.25, 1, 0.5, 1),
      width 0.3s cubic-bezier(0.25, 1, 0.5, 1),
      height 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  }

  #cursor.arrow .cursor__circle {
    width: 84px;
    height: 84px;
    background-color: #fff;
    border-color: #fff;
  }

  #cursor.arrow::after {
    content: "Play";
    position: absolute;
    left: -50%;
    top: -50%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    font-weight: 300;
    color: #000;
  }

  #cursor.is-hidden {
    opacity: 0;
    visibility: hidden;
  }
}

/* 반응형 */
@media all and (max-width: 479px) {
  .short-list {
    padding: 16px 16px 60px;
  }

  .short-list .sl-tabs {
    flex-wrap: nowrap;
    gap: 5px;
    margin-bottom: 20px;
    padding: 10px 0;
  }

  .short-list .sl-tabs button {
    flex: 1 1 auto;
    min-width: 0;
    height: 36px;
    padding: 0 5px;
    font-size: clamp(12px, 3.4vw, 13px);
  }

  .short-list .sl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 12px;
  }

  .short-list .sl-grid > li > dl {
    padding-top: 12px;
  }

  .short-list .sl-grid > li > dl > dt {
    font-size: 15px;
  }

  .short-list .sl-grid > li > dl > dd {
    font-size: 12px;
  }

  .sl-lb-stage video {
    height: auto;
    width: 100vw;
    max-width: 100vw;
    max-height: 82vh;
    border-radius: 0;
  }

  .sl-lb-close {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: 10px;
  }

  .sl-lb-arrow {
    width: 48px;
    height: 48px;
    margin-top: -24px;
    background: rgba(0, 0, 0, 0.35);
  }

  .sl-lb-prev {
    left: 6px;
  }

  .sl-lb-next {
    right: 6px;
  }
}

@media all and (min-width: 480px) and (max-width: 767px) {
  .short-list {
    padding: 16px 24px 60px;
  }

  .short-list .sl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 20px;
  }
}

@media all and (min-width: 768px) and (max-width: 991px) {
  .short-list {
    padding: 20px 28px 70px;
  }

  .short-list .sl-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px 24px;
  }
}

@media all and (min-width: 992px) and (max-width: 1439px) {
  .short-list {
    padding: 20px 32px 70px;
  }

  .short-list .sl-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media all and (min-width: 1440px) and (max-width: 1919px) {
  .short-list .sl-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* 맨 위로 버튼 */
.btn-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.btn-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.btn-top svg {
  display: block;
  width: 100%;
  height: 100%;
}

.btn-top rect {
  fill: var(--top-bg);
}

@media all and (max-width: 479px) {
  .btn-top {
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    width: 46px;
    height: 46px;
  }
}

/* 포트폴리오 종류 이동 (웹사이트 · 상세페이지 · 숏폼) */
.site-nav {
  display: flex;
  gap: 4px;
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 50;
  transform: translateX(-50%);
  width: min(540px, calc(100% - 32px));
  padding: 5px;
  border: 1px solid var(--nav-line);
  border-radius: 999px;
  background: var(--nav-track);
}

.site-nav a {
  display: flex;
  flex: 1 1 0;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--nav-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-nav a:hover {
  color: #fff;
}

.site-nav a.on {
  color: var(--nav-on);
  background: var(--nav-on-bg);
}

/* 메뉴 바탕: 첨부 이미지처럼 어두운 바탕에 보라·마젠타·크림슨·주황 빛, 올리면 천천히 흐름 */
.site-nav {
  background-color: #0a0606;
  background-image: linear-gradient(100deg, #0a0606 0%, #1c0808 16%, #3a0c0c 30%, #560f10 44%, #5e0d12 56%, #400a0d 68%, #1e0707 82%, #0a0606 100%);
  background-size: 260% 100%;
  background-position: 0% 50%;
  transition: background-position 1.4s cubic-bezier(0.33, 0, 0.2, 1);
}

.site-nav:hover {
  background-position: 100% 50%;
}

.site-nav a {
  background: transparent;
}

.site-nav a.on {
  background: var(--nav-on-bg, #fff);
}

@media (prefers-reduced-motion: reduce) {
  .site-nav {
    transition: none;
  }
}

.site-nav a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* 아래 고정 메뉴에 가리지 않게 · 크게 보기 화면에서는 숨김 */
body:has(.site-nav) {
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

body:has(#lightbox:not([hidden])) .site-nav {
  display: none;
}

/* 좁은 화면: 맨 위로 버튼을 아래 메뉴 위로 */
@media all and (max-width: 767px) {
  .btn-top {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  }
}

@media all and (max-width: 479px) {
  .site-nav {
    gap: 2px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    padding: 4px;
  }

  .site-nav a {
    padding: 10px 0;
    font-size: 15px;
  }
}
