:root {
  color-scheme: dark;
}

html {
  scroll-padding-top: var(--nav-h, 60px);
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a,
button,
[tabindex] {
  -webkit-tap-highlight-color: rgba(255, 95, 174, 0.2);
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #ff8bc5;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  padding: 9px 14px;
  color: #111;
  background: #ff8bc5;
  font-size: 13px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

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

.nav-episodes {
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
}

.nav-ep {
  scroll-snap-align: start;
}

.c-val a {
  color: inherit;
  text-decoration-color: rgba(255, 95, 174, 0.45);
  text-underline-offset: 3px;
}

.sales-cta {
  padding: 0 48px 72px;
  background: var(--dark-2, #181818);
}

.sales-cta-inner {
  max-width: 1184px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid rgba(255, 95, 174, 0.24);
  background:
    linear-gradient(110deg, rgba(255, 95, 174, 0.1), transparent 62%),
    #141414;
}

.sales-cta-label {
  margin-bottom: 7px;
  color: #ff5fae;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.sales-cta h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 400;
  line-height: 1.3;
}

.sales-cta p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
}

.sales-cta-link {
  flex-shrink: 0;
  padding: 13px 22px;
  color: #111;
  background: #ff5fae;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

img {
  max-width: 100%;
}

.gallery-item {
  display: block;
  border: 0;
  background: var(--dark-3, #1e1e1e);
  color: inherit;
  font: inherit;
  padding: 0;
  width: 100%;
}

.lb-close,
.lb-prev,
.lb-next {
  border: 0;
  background: transparent;
  font-family: inherit;
}

.video-fallback {
  display: block;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: right;
  text-decoration-color: rgba(255, 95, 174, 0.5);
  text-underline-offset: 4px;
}

.video-fallback:hover {
  color: #ff8bc5;
}

.trailer-external-card {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 95, 174, 0.18);
  background: #000;
  color: #fff;
  text-decoration: none;
}

.trailer-external-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: filter 0.25s ease, transform 0.35s ease;
}

.trailer-external-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent 48%);
}

.trailer-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 68px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #ff0033;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-size: 20px;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.trailer-external-label {
  position: absolute;
  right: 18px;
  bottom: 15px;
  left: 18px;
  z-index: 1;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.trailer-external-card:hover img {
  filter: brightness(0.78);
  transform: scale(1.02);
}

@media (max-width: 700px) {
  nav:not(.ep-nav),
  body > nav:first-of-type {
    padding-inline: 16px;
  }

  .nav-brand {
    margin-right: 14px;
  }

  .nav-brand-en {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-episodes {
    position: relative;
    mask-image: linear-gradient(90deg, #000 0%, #000 78%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 78%, transparent 100%);
  }

  .nav-right {
    margin-left: 8px;
  }

  .hero-video-wrap video {
    object-position: 62% center;
  }

  .hero-gradient-bottom {
    height: 82%;
    background: linear-gradient(
      to top,
      rgba(17, 17, 17, 1) 0%,
      rgba(17, 17, 17, 0.88) 32%,
      rgba(17, 17, 17, 0.22) 68%,
      transparent 100%
    );
  }

  .hero-eyebrow {
    white-space: normal !important;
    line-height: 1.65;
  }

  .hero-tagline,
  .about-body,
  .ep-synopsis,
  .person-bio {
    color: rgba(255, 255, 255, 0.72);
  }

  .hero-cta-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .hero-cta-row a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .ep-title {
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .hero-inner {
    padding-top: 38px;
  }

  .c-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .c-role {
    min-width: 0;
  }

  .sales-cta {
    padding: 0 24px 48px;
  }

  .sales-cta-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .hero-content {
    padding-bottom: 40px !important;
  }

  .hero-logo {
    width: 112px;
  }

  .hero-tagline {
    max-width: 330px;
    line-height: 1.8;
  }

  .ep-num-badge {
    flex-wrap: wrap;
  }

  .ep-title {
    font-size: clamp(30px, 9.5vw, 40px);
  }
}

/* Mobile is composed for touch instead of scaling down the desktop layout. */
@media (max-width: 700px) {
  :root {
    --nav-h: 56px;
  }

  nav:not(.ep-nav),
  body > nav:first-of-type {
    height: var(--nav-h);
    padding-inline: 18px;
    background: rgba(14, 14, 14, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .nav-brand {
    margin-right: auto;
  }

  .nav-brand-zh {
    font-size: 16px;
  }

  .nav-brand-en {
    max-width: none;
    font-size: 8px;
    letter-spacing: 0.18em;
  }

  .nav-episodes {
    display: none;
  }

  .nav-right {
    margin-left: 10px;
  }

  .lang-switch {
    min-width: 42px;
    min-height: 34px;
    padding: 7px 9px;
    text-align: center;
  }

  .home-page .hero {
    height: 100svh;
    min-height: 650px;
    max-height: 820px;
  }

  .home-page .hero-video-wrap video {
    object-position: 60% center;
  }

  .home-page .hero-stars {
    opacity: 0.45;
  }

  .home-page .hero-gradient-top {
    height: 34%;
  }

  .home-page .hero-gradient-bottom {
    height: 76%;
    background: linear-gradient(
      to top,
      #111 0%,
      rgba(17, 17, 17, 0.96) 24%,
      rgba(17, 17, 17, 0.66) 52%,
      rgba(17, 17, 17, 0.08) 100%
    );
  }

  .home-page .hero-content {
    padding: 0 20px 30px !important;
  }

  .home-page .hero-eyebrow,
  .home-page .hero-logo,
  .home-page .hero-tagline,
  .home-page .hero-cta-row,
  .home-page .hero-hexagrams {
    opacity: 1;
    animation: none;
    transform: none;
  }

  .home-page .hero-eyebrow {
    max-width: 310px;
    margin-bottom: 11px;
    font-size: 9px;
    letter-spacing: 0.24em;
  }

  .home-page .hero-logo {
    width: 118px;
  }

  .home-page .hero-tagline {
    max-width: 340px;
    margin-top: 12px;
    font-size: 10px;
    line-height: 1.7;
    letter-spacing: 0.18em;
    text-wrap: balance;
  }

  .home-page .hero-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: min(100%, 340px);
    margin-top: 22px;
  }

  .home-page .hero-cta-row a {
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    font-size: 11px;
    letter-spacing: 0.16em;
  }

  .home-page .hero-hexagrams {
    gap: 12px;
    margin-top: 18px;
  }

  .home-page .hex-sym {
    font-size: 18px;
  }

  .home-page .section,
  .home-page .format-inner {
    padding: 48px 20px;
  }

  .home-page .section-label {
    margin-bottom: 24px;
  }

  .home-page .about-grid {
    gap: 30px;
  }

  .home-page .about-headline {
    font-size: 30px;
    line-height: 1.2;
  }

  .home-page .about-body {
    font-size: 14px;
    line-height: 1.85;
  }

  .home-page .about-poster {
    width: min(78vw, 280px);
    max-width: none;
    margin-inline: auto;
    justify-self: center;
  }

  .home-page .poster-frame,
  .home-page .poster-placeholder,
  .home-page .poster-dl {
    width: 100%;
  }

  .home-page .format-card {
    padding: 25px 22px;
  }

  .home-page .producer-card {
    padding: 20px;
  }

  .home-page .prod-photo,
  .home-page .prod-photo img {
    width: 76px;
    height: 100px;
  }

  .home-page .prod-bio {
    font-size: 13px;
    line-height: 1.75;
  }

  .home-page .directors-section {
    padding-block: 48px;
  }

  .home-page .directors-section .section-label,
  .home-page .directors-photo-wrap {
    padding-inline: 20px;
  }

  .home-page .ep-section {
    max-width: none;
    padding-inline: 0;
    overflow: hidden;
  }

  .home-page .ep-section > .section-label {
    margin-inline: 20px;
  }

  .home-page .episodes-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 0 20px 18px;
    scroll-padding-inline: 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
  }

  .home-page .episodes-grid::-webkit-scrollbar {
    display: none;
  }

  .home-page .ep-card {
    flex: 0 0 min(82vw, 330px);
    scroll-snap-align: start;
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .home-page .ep-img {
    aspect-ratio: 4 / 3;
  }

  .home-page .ep-inner {
    padding: 18px;
  }

  .home-page .ep-title-zh,
  .home-page .ep-title-en {
    text-wrap: balance;
  }

  html[lang^="zh"] .home-page .ep-title-en {
    font-size: 11px;
    line-height: 1.4;
  }

  html[lang^="zh"] .home-page .ep-title-zh {
    font-size: 22px;
    line-height: 1.15;
  }

  html[lang^="en"] .home-page .ep-title-en {
    font-size: clamp(19px, 6vw, 24px);
    line-height: 1.12;
  }

  html[lang^="en"] .home-page .ep-title-zh {
    font-size: 13px;
    line-height: 1.4;
  }

  .home-page .ep-synopsis {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .home-page .ep-arrow {
    opacity: 1;
  }

  .home-page .press-section {
    padding: 48px 20px;
  }

  .home-page .press-inner {
    gap: 40px;
  }

  .home-page .press-item {
    align-items: flex-start;
    flex-direction: column;
    padding: 17px 18px;
  }

  .home-page .press-meta {
    text-align: left;
  }

  .home-page .sales-cta {
    padding: 0 20px 48px;
  }

  .home-page .sales-cta-inner {
    padding: 26px 22px;
  }

  .home-page .sales-cta-link {
    width: 100%;
    min-height: 46px;
    text-align: center;
  }

  .home-page .dist-inner {
    padding: 48px 20px;
  }

  .episode-page .hero {
    min-height: 0;
    padding-top: var(--nav-h);
    justify-content: flex-start;
  }

  .episode-page .hero-inner {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 34px 20px 48px;
  }

  .episode-page .hero-left {
    width: 100%;
    margin-bottom: 0;
    padding-right: 0;
  }

  .episode-page .ep-label,
  .episode-page .ep-num-badge,
  .episode-page .ep-title,
  .episode-page .ep-title-en,
  .episode-page .ep-synopsis,
  .episode-page .ep-theme-pills,
  .episode-page .hero-visual {
    opacity: 1;
    animation: none;
    transform: none;
  }

  .episode-page .ep-label {
    margin-bottom: 12px;
    font-size: 9px;
  }

  .episode-page .ep-num-badge {
    margin-bottom: 18px;
  }

  .episode-page .ep-title {
    margin-bottom: 8px;
    font-size: clamp(32px, 10vw, 42px);
    line-height: 1.18;
    text-wrap: balance;
  }

  .episode-page .ep-title-en {
    margin-bottom: 22px;
    font-size: 12px;
    line-height: 1.5;
    text-wrap: balance;
  }

  .episode-page .ep-synopsis {
    max-width: none;
    font-size: 15px;
    line-height: 1.9;
  }

  .episode-page .ep-theme-pills {
    margin-top: 20px;
  }

  .episode-page .ep-pill {
    padding: 5px 9px;
    font-size: 10px;
  }

  .episode-page .hero-visual {
    width: min(68vw, 250px);
    max-width: none;
    margin-inline: auto;
  }

  .episode-page .production,
  .episode-page .gallery {
    padding: 48px 20px;
  }

  .episode-page .company-card,
  .episode-page .person-card {
    padding: 22px;
  }

  .episode-page .person-card {
    flex-direction: column;
    gap: 16px;
  }

  .episode-page .person-photo {
    width: 84px;
    height: 84px;
  }

  .episode-page .person-bio {
    font-size: 13px;
    line-height: 1.78;
  }

  .episode-page .gallery {
    overflow: hidden;
  }

  .episode-page .gallery-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-inline: -20px;
    padding: 0 20px 12px;
    scroll-padding-inline: 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x;
  }

  .episode-page .gallery-grid::-webkit-scrollbar {
    display: none;
  }

  .episode-page .gallery-item {
    flex: 0 0 82vw;
    scroll-snap-align: center;
  }

  .episode-page .ep-video {
    padding: 0 20px 48px;
  }

  .episode-page .video-fallback {
    min-height: 40px;
    margin-top: 8px;
    padding-top: 10px;
    text-align: left;
  }

  .episode-page .trailer-play {
    width: 60px;
    height: 43px;
  }

  .episode-page .trailer-external-label {
    right: 12px;
    bottom: 10px;
    left: 12px;
    font-size: 10px;
  }

  .episode-page .ep-nav {
    grid-template-columns: 1fr 1fr;
  }

  .episode-page .ep-nav-btn {
    min-width: 0;
    padding: 22px 18px;
  }

  .episode-page .ep-nav-btn.prev {
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 0;
  }

  .episode-page .ep-nav-title {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  footer {
    padding: 18px 20px;
  }

  .footer-line {
    line-height: 1.7;
  }

  html[lang^="en"] .home-page .hero-tagline {
    max-width: none;
    font-size: clamp(7px, 2.05vw, 8.5px);
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  html[lang^="zh"] .home-page .hero-tagline {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .entry-page .circle-wrap {
    width: 100%;
    height: auto;
    padding: 30px 20px;
    border: 0;
    background: none;
  }

  .entry-page .fade-in {
    opacity: 1;
    transition: none;
  }

  .entry-page .hexagrams {
    margin-bottom: 22px;
  }

  .entry-page .title-zh {
    margin-bottom: 16px;
    font-size: clamp(54px, 18vw, 68px);
  }

  .entry-page .title-en {
    max-width: 300px;
    line-height: 1.6;
  }

  .entry-page .tagline {
    max-width: none;
    margin-bottom: 36px;
    font-size: clamp(8px, 2.3vw, 9px);
    line-height: 1.5;
    letter-spacing: 0.14em;
    white-space: nowrap;
  }

  .entry-page .lang-row {
    max-width: 340px;
    gap: 10px;
  }

  .entry-page .lang-sep {
    display: none;
  }

  .entry-page .lang-btn {
    min-height: 82px;
    padding: 16px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
  }
}

@media (max-width: 350px) {
  html[lang^="en"] .home-page .hero-tagline {
    max-width: 270px;
    font-size: 8px;
    line-height: 1.65;
    text-align: center;
    white-space: normal;
  }
}

html[lang^="en"] .episode-page .ep-title {
  white-space: nowrap;
  text-wrap: nowrap;
}

html[lang^="en"] .episode-page .ep-title-long {
  font-size: clamp(36px, 4.2vw, 54px);
}

html[lang^="en"] .episode-page .ep-title-medium {
  font-size: clamp(38px, 5vw, 64px);
}

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

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

  .reveal,
  .fade-in,
  .hero-logo,
  .hero-eyebrow,
  .hero-tagline,
  .hero-cta-row,
  .hero-hexagrams,
  .ep-label,
  .ep-num-badge,
  .ep-title,
  .ep-title-en,
  .ep-title-zh,
  .ep-synopsis,
  .ep-theme-pills,
  .hero-visual {
    opacity: 1 !important;
    transform: none !important;
  }
}
