@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #080a09;
  --bg-soft: #0d100f;
  --surface: #111513;
  --surface-high: #171c19;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f4f2;
  --muted: #929a95;
  --dim: #626a65;
  --accent: #b8ff53;
  --accent-soft: rgba(184, 255, 83, 0.13);
  --accent-warm: #eaffbc;
  --max-width: 1240px;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: #313733 #080a09;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 48% -14%, rgba(110, 140, 81, 0.12), transparent 36rem),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", "Noto Sans KR", sans-serif;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  transform: translateY(-150%);
  border-radius: 999px;
  background: var(--accent);
  color: #0a0d0b;
  padding: 10px 16px;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  width: min(calc(100% - 48px), var(--max-width));
  min-height: 84px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand,
.footer-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid rgba(184, 255, 83, 0.5);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(184, 255, 83, 0.17), rgba(184, 255, 83, 0.02));
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 18px rgba(184, 255, 83, 0.04);
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 10px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-copy strong {
  font-size: 14px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #c9cfcb;
  padding: 8px 13px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: 180ms ease;
}

.icon-link:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transform: translateY(-1px);
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid currentColor;
}

main {
  min-height: 70vh;
}

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  width: min(calc(100% - 48px), var(--max-width));
  min-height: 620px;
  margin: 0 auto;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  position: absolute;
  z-index: -1;
  right: -40px;
  bottom: 22px;
  color: rgba(255, 255, 255, 0.018);
  content: "YF";
  font-size: clamp(16rem, 35vw, 32rem);
  font-weight: 800;
  letter-spacing: -0.13em;
  line-height: 0.74;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  z-index: -2;
  top: 35%;
  left: 54%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: rgba(151, 255, 65, 0.05);
  filter: blur(90px);
  transform: translate(-50%, -50%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 24px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow span {
  width: 24px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(184, 255, 83, 0.7);
}

.hero h1 {
  max-width: 960px;
  margin: 0;
  font-family: "Noto Sans KR", sans-serif;
  font-size: clamp(2.8rem, 7.1vw, 6.8rem);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 1.06;
}

.hero h1 em {
  color: var(--accent-warm);
  font-style: normal;
}

.hero-description {
  margin: 32px 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  line-height: 1.9;
}

.hero-stats {
  display: flex;
  margin-top: 58px;
  gap: 56px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat strong {
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  letter-spacing: -0.04em;
}

.stat span {
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.archive-shell {
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  padding: 112px 0 96px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.section-heading h2 {
  margin: 0;
  font-family: "Noto Sans KR", sans-serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.06em;
}

.section-heading p:last-child {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  text-align: right;
}

.section-kicker {
  margin-bottom: 13px;
}

.toolbar {
  position: sticky;
  z-index: 15;
  top: 14px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  margin-top: 42px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 18, 16, 0.88);
  padding: 10px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
}

.search-box {
  display: flex;
  min-width: 0;
  height: 44px;
  align-items: center;
  gap: 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 0 14px;
}

.search-icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 5px;
  height: 1.5px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.search-box input::placeholder {
  color: #69706c;
}

kbd {
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 6px;
  color: var(--dim);
  padding: 2px 7px;
  font-family: inherit;
  font-size: 10px;
}

.segmented {
  display: flex;
  gap: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 4px;
}

.segment {
  min-width: 76px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 8px 11px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: 160ms ease;
}

.segment:hover {
  color: #fff;
}

.segment.is-active {
  background: var(--accent);
  color: #0b100a;
  box-shadow: 0 4px 16px rgba(184, 255, 83, 0.12);
}

.results-meta {
  display: flex;
  margin: 28px 2px 16px;
  align-items: center;
  gap: 13px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.07em;
}

.results-meta b {
  color: #c6ccc8;
}

.results-line {
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

.film-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.film-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.film-card:hover {
  border-color: rgba(184, 255, 83, 0.22);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 67px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
}

.number-wrap {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.number-wrap span {
  color: var(--dim);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.film-number {
  color: var(--accent);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.film-date {
  color: #a2aaa5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.original-link {
  justify-self: end;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  transition: color 160ms ease;
}

.original-link:hover {
  color: var(--accent);
}

.embed-shell {
  position: relative;
  display: grid;
  min-height: 480px;
  place-items: start center;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(184, 255, 83, 0.025), transparent 38%),
    #0d100e;
  padding: 14px;
}

.embed-placeholder {
  position: absolute;
  inset: 14px;
  display: grid;
  place-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.07);
  border-radius: 15px;
  color: var(--dim);
  text-align: center;
  transition: opacity 240ms ease;
}

.embed-shell.is-ready .embed-placeholder {
  opacity: 0;
  pointer-events: none;
}

.pulse-mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid rgba(184, 255, 83, 0.24);
  border-radius: 50%;
  color: var(--accent);
  font-size: 21px;
  animation: breathe 1.7s ease-in-out infinite;
}

.embed-placeholder p {
  margin: 0;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.embed-placeholder small {
  margin-top: 8px;
  color: #59615c;
  font-size: 9px;
}

.embed-mount {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  justify-content: center;
}

.embed-mount iframe {
  max-width: 100% !important;
  min-height: 660px !important;
  height: 660px !important;
  border-radius: 15px !important;
  opacity: 0;
  transition: opacity 220ms ease;
}

.embed-shell.is-ready .embed-mount iframe {
  opacity: 1;
}

.text-post-media {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 540px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 15px !important;
  background: #fff;
}

.embed-fallback {
  display: grid;
  width: 100%;
  min-height: 360px;
  place-content: center;
  border-radius: 15px;
  background: #121613;
  color: #e8ede9;
  text-align: center;
}

.embed-fallback strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 18px;
}

.embed-fallback span {
  color: var(--muted);
  font-size: 12px;
}

.card-footer {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 0 18px;
}

.media-badge {
  color: var(--dim);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.media-badge.is-video {
  color: var(--accent);
}

.copy-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 0 7px 10px;
  font-size: 10px;
  font-weight: 700;
}

.copy-link:hover {
  color: #fff;
}

.load-zone {
  display: flex;
  min-height: 160px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--dim);
  font-size: 11px;
}

.loader {
  display: flex;
  gap: 4px;
}

.loader i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot 1.1s ease-in-out infinite;
}

.loader i:nth-child(2) {
  animation-delay: 120ms;
}

.loader i:nth-child(3) {
  animation-delay: 240ms;
}

.load-zone.is-complete .loader {
  display: none;
}

.empty-state {
  min-height: 360px;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.empty-state:not([hidden]) {
  display: grid;
}

.empty-state span {
  color: var(--accent);
  font-size: 42px;
}

.empty-state strong {
  margin-top: 12px;
  color: var(--text);
}

.empty-state p {
  margin: 8px 0 0;
  font-size: 12px;
}

footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  width: min(calc(100% - 48px), var(--max-width));
  min-height: 180px;
  margin: 0 auto;
  align-items: center;
  gap: 44px;
  border-top: 1px solid var(--line);
}

.footer-brand strong {
  font-size: 12px;
  letter-spacing: 0.08em;
}

.footer-brand p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.footer-note {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.7;
  text-align: right;
}

.footer-link {
  color: #c5cbc7;
  font-size: 11px;
  font-weight: 700;
}

.footer-link:hover {
  color: var(--accent);
}

.back-to-top {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(17, 21, 19, 0.88);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
  backdrop-filter: blur(12px);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dot {
  0%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 900px) {
  .hero {
    min-height: 560px;
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .film-grid {
    grid-template-columns: 1fr;
    max-width: 640px;
    margin-inline: auto;
  }

  footer {
    grid-template-columns: 1fr auto;
  }

  .footer-note {
    display: none;
  }
}

@media (max-width: 620px) {
  .site-header,
  .hero,
  .archive-shell,
  footer {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .site-header {
    min-height: 70px;
  }

  .desktop-only {
    display: none;
  }

  .icon-link {
    width: 38px;
    justify-content: center;
    padding: 8px;
  }

  .hero {
    min-height: 520px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 13vw, 4.2rem);
  }

  .hero-description br {
    display: none;
  }

  .hero-stats {
    width: 100%;
    margin-top: 44px;
    justify-content: space-between;
    gap: 12px;
  }

  .stat strong {
    font-size: 1rem;
  }

  .stat span {
    font-size: 8px;
  }

  .archive-shell {
    padding: 82px 0 70px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .section-heading p:last-child {
    text-align: left;
  }

  .toolbar {
    position: relative;
    top: auto;
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .search-box {
    grid-column: auto;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
  }

  .film-grid {
    gap: 14px;
  }

  .card-header {
    grid-template-columns: 1fr auto;
    row-gap: 3px;
    padding: 11px 15px;
  }

  .film-date {
    grid-column: 1;
    grid-row: 2;
  }

  .original-link {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .embed-shell {
    min-height: 430px;
    padding: 8px;
  }

  .embed-mount iframe {
    min-height: 620px !important;
    height: 620px !important;
  }

  .embed-placeholder {
    inset: 8px;
  }

  footer {
    min-height: 150px;
    gap: 12px;
  }

  .footer-link {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Gallery redesign: compact PC five-column layout + touch-first mobile layout */
body.modal-open { overflow: hidden; }

.hero { min-height: 500px; }
.archive-shell { max-width: 1360px; }
.section-heading { max-width: 1240px; margin-inline: auto; }
.toolbar, .results-meta { max-width: 1240px; margin-inline: auto; }
.toolbar { margin-top: 34px; }
.results-meta { margin-top: 22px; }

.film-grid {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.film-card.film-tile {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: #111513;
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.film-card.film-tile:hover {
  border-color: rgba(184, 255, 83, 0.38);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  transform: translateY(-4px);
}

.tile-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 0;
  background: #18201a;
  color: inherit;
  cursor: pointer;
  isolation: isolate;
}

.tile-preview::before,
.film-tile.no-thumbnail .tile-preview::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 72% 22%, rgba(184, 255, 83, 0.24), transparent 32%),
    linear-gradient(135deg, #212c20 0%, #111813 48%, #0d110e 100%);
  content: "";
}

.tile-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 420ms cubic-bezier(.2,.7,.2,1), filter 260ms ease;
}

.tile-preview:hover img,
.tile-preview:focus-visible img { transform: scale(1.045); filter: saturate(1.08); }

.tile-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.46), transparent 35%, rgba(0,0,0,.68));
  pointer-events: none;
}

.tile-index {
  position: absolute;
  top: 11px;
  left: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.04em;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}

.tile-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  background: rgba(7,10,8,.46);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transform: translate(-50%, -50%);
  transition: 180ms ease;
  backdrop-filter: blur(8px);
}

.tile-play i {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #fff;
}

.tile-preview:hover .tile-play,
.tile-preview:focus-visible .tile-play {
  border-color: var(--accent);
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.08);
}

.tile-preview:hover .tile-play i,
.tile-preview:focus-visible .tile-play i { border-left-color: #0b100a; }

.tile-hover-label {
  position: absolute;
  right: 11px;
  bottom: 10px;
  color: rgba(255,255,255,.88);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  opacity: 0;
  transform: translateY(4px);
  transition: 180ms ease;
}

.tile-preview:hover .tile-hover-label,
.tile-preview:focus-visible .tile-hover-label { opacity: 1; transform: translateY(0); }

.tile-details { padding: 11px 12px 12px; }
.tile-title-row, .tile-meta-row { display: flex; align-items: center; }
.tile-title-row { gap: 5px; }
.tile-label { color: var(--dim); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.tile-title-row strong { color: var(--accent); font-size: 15px; letter-spacing: -.04em; }
.tile-title-row time { margin-left: auto; color: #89918c; font-size: 9px; font-weight: 700; letter-spacing: .05em; }
.tile-meta-row { justify-content: space-between; margin-top: 9px; }
.tile-type { color: #68716b; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.tile-type.is-video { color: var(--accent); }
.tile-open { border: 0; background: transparent; color: #b9c1bb; cursor: pointer; padding: 0; font-size: 9px; font-weight: 700; }
.tile-open:hover { color: #fff; }

/* preview modal */
.preview-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
.preview-modal.is-open { opacity: 1; pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(16px); }
.modal-panel { position: relative; width: min(1040px, 100%); max-height: min(900px, calc(100vh - 48px)); overflow: auto; border: 1px solid rgba(255,255,255,.13); border-radius: 22px; background: #101411; box-shadow: 0 28px 100px rgba(0,0,0,.65); transform: translateY(12px) scale(.985); transition: transform 220ms ease; }
.preview-modal.is-open .modal-panel { transform: translateY(0) scale(1); }
.modal-close { position: absolute; z-index: 2; top: 16px; right: 18px; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: rgba(7,9,8,.68); color: #fff; cursor: pointer; font-size: 22px; line-height: 1; }
.modal-close:hover { border-color: var(--accent); color: var(--accent); }
.modal-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 24px 60px 20px 26px; }
.modal-kicker { margin: 0 0 6px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.modal-heading h2 { margin: 0; color: #f7faf8; font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: -.07em; }
.modal-date { color: #a5aea8; font-size: 11px; font-weight: 700; letter-spacing: .07em; }
.modal-content { display: grid; grid-template-columns: minmax(260px, .82fr) minmax(320px, 1.18fr); gap: 16px; padding: 18px; }
.modal-poster-wrap, .modal-player { position: relative; overflow: hidden; min-height: 300px; border: 1px solid var(--line); border-radius: 15px; background: #0b0e0c; }
.modal-poster-wrap { display: grid; min-height: 390px; place-items: center; }
.modal-poster { width: 100%; height: 100%; min-height: 390px; object-fit: cover; }
.modal-poster-label { position: absolute; right: 13px; bottom: 12px; display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.8); font-size: 8px; font-weight: 800; letter-spacing: .15em; text-shadow: 0 1px 6px #000; }
.modal-play { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid rgba(255,255,255,.6); border-radius: 50%; font-size: 9px; }
.modal-player { display: flex; min-height: 390px; flex-direction: column; }
.modal-player-top { display: flex; min-height: 38px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: #89918b; padding: 0 12px; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.modal-player iframe { width: 100%; min-height: 450px; flex: 1; border: 0; background: #fff; }
.modal-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 14px 20px 16px; }
.modal-code { color: var(--dim); font-size: 9px; letter-spacing: .08em; }
.modal-original { color: var(--accent); font-size: 10px; font-weight: 800; }
.modal-original:hover { color: #efffcf; }

@media (max-width: 1100px) {
  .film-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .film-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal-content { grid-template-columns: 1fr; }
  .modal-poster-wrap { min-height: 280px; max-height: 420px; }
  .modal-poster { min-height: 280px; }
}

@media (max-width: 620px) {
  .hero { min-height: 470px; }
  .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .film-card.film-tile { border-radius: 13px; }
  .tile-preview { aspect-ratio: 1 / 1.08; }
  .tile-index { top: 8px; left: 9px; font-size: 12px; }
  .tile-play { width: 34px; height: 34px; }
  .tile-play i { border-top-width: 5px; border-bottom-width: 5px; border-left-width: 8px; }
  .tile-details { padding: 9px 9px 10px; }
  .tile-title-row strong { font-size: 13px; }
  .tile-title-row time { font-size: 8px; }
  .tile-meta-row { margin-top: 7px; }
  .tile-open { font-size: 8px; }
  .preview-modal { padding: 10px; }
  .modal-panel { max-height: calc(100vh - 20px); border-radius: 17px; }
  .modal-heading { padding: 19px 52px 15px 17px; }
  .modal-content { padding: 10px; }
  .modal-poster-wrap { min-height: 230px; }
  .modal-poster { min-height: 230px; }
  .modal-player { min-height: 430px; }
  .modal-player iframe { min-height: 390px; }
  .modal-footer { padding-inline: 13px; }
  .modal-code { max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* video-only archive and single-column preview */
.toolbar { grid-template-columns: minmax(260px, 1fr) auto; }
.tile-caption {
  margin: 9px 0 0;
  overflow: hidden;
  color: #aab3ab;
  font-size: 10px;
  line-height: 1.48;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.tile-caption[hidden] { display: none; }
.tile-meta-row { margin-top: 10px; }
.preview-modal .modal-panel { width: min(920px, 100%); }
.preview-modal .modal-content { display: block; padding: 18px 20px 0; }
.preview-modal .modal-player { min-height: 0; }
.preview-modal .modal-player iframe {
  display: block;
  width: 100%;
  height: min(68vh, 620px);
  min-height: 460px;
  flex: none;
  border: 0;
  background: #fff;
}
.modal-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
  padding: 16px 18px 18px;
}
.modal-details-top,
.modal-details-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-details-label,
.modal-details-type {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .15em;
}
.modal-details-type { color: #7e8981; }
.modal-caption {
  margin: 13px 0 15px;
  color: #e6ece7;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.modal-caption.is-empty { color: #8e9991; }
.modal-details-meta {
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.modal-details-meta .modal-code,
.modal-details-meta .modal-date-bottom {
  color: #87928a;
  font-size: 10px;
  letter-spacing: .06em;
}
.modal-original {
  display: inline-flex;
  margin-top: 14px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}
@media (max-width: 850px) {
  .toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .preview-modal .modal-player iframe { height: min(64vh, 560px); min-height: 430px; }
}
@media (max-width: 620px) {
  .toolbar { grid-template-columns: 1fr; }
  .tile-caption { margin-top: 7px; font-size: 9px; line-height: 1.42; }
  .tile-meta-row { margin-top: 8px; }
  .preview-modal .modal-content { padding: 10px 10px 0; }
  .preview-modal .modal-player iframe { height: 56vh; min-height: 390px; }
  .modal-details { margin-top: 10px; padding: 14px 13px 15px; }
  .modal-caption { font-size: 12px; line-height: 1.58; }
}
/* Keep the preview modal inside the viewport while preserving the 16:9 player. */
.preview-modal .modal-player iframe {
  height: min(58vh, 560px);
  min-height: 420px;
}

@media (max-width: 850px) {
  .preview-modal .modal-player iframe {
    height: min(56vh, 500px);
    min-height: 390px;
  }
}

@media (max-width: 620px) {
  .preview-modal .modal-player iframe {
    height: min(48vh, 410px);
    min-height: 360px;
  }
}
/* Match the desktop embed frame to the actual Threads video width. */
.preview-modal .modal-player {
  align-items: center;
}
.preview-modal .modal-player-top {
  width: 100%;
}
.preview-modal .modal-player iframe {
  width: min(100%, 640px);
  max-width: 640px;
  margin-inline: auto;
}

@media (max-width: 620px) {
  .preview-modal .modal-player {
    align-items: stretch;
  }
  .preview-modal .modal-player iframe {
    width: 100%;
    max-width: none;
  }
}
/* Crop the fixed-width Threads card at the video edge on desktop. */
@media (min-width: 851px) {
  .preview-modal .modal-player {
    width: min(100%, 640px);
    margin-inline: auto;
  }
  .preview-modal .modal-player iframe {
    width: 861px;
    max-width: none;
    align-self: flex-start;
  }
}
/* Trim the last few pixels of the desktop card so its video edge is the visual edge. */
@media (min-width: 851px) {
  .preview-modal .modal-player {
    width: min(100%, 620px);
  }
}
/* Leave a small breathing margin so the video, caption panel, and close control fit together. */
@media (min-width: 851px) {
  .preview-modal .modal-player iframe {
    height: min(82vh, 760px);
    min-height: 520px;
  }
}
/* Compact the desktop dialog around the cropped video frame, removing side gutters. */
@media (min-width: 851px) {
  .preview-modal .modal-panel {
    width: min(660px, 100%);
  }
}
/* Give the cropped desktop frame enough room for the full 596px video. */
@media (min-width: 851px) {
  .preview-modal .modal-panel {
    width: min(680px, 100%);
  }
}
/* Balance the built-in left/right padding of the cropped Threads card. */
@media (min-width: 851px) {
  .preview-modal .modal-player iframe {
    transform: translateX(-10px);
  }
}