:root {
  --ink: #302a22;
  --ink-soft: #6d6459;
  --paper: #faf6ec;
  --paper-dark: #efe8d8;
  --rice: #4c6b52;
  --red: #b8583d;
  --mustard: #c79a47;
  --sidebar: #262a27;
  --line: rgba(67, 59, 47, 0.14);
  --shadow: 0 16px 38px rgba(63, 52, 34, 0.08);
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans Thai", "Manrope", sans-serif;
  line-height: 1.55;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.eyebrow {
  color: var(--red);
  font-family: Manrope, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.btn, .primary-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.btn.primary, .primary-btn {
  background: var(--rice);
  color: #f9f3e8;
  box-shadow: 0 5px 0 #36513c;
}
.btn.ghost, .ghost-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  background: var(--sidebar);
  color: #f6f0e4;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: Manrope, sans-serif;
  font-weight: 750;
  font-size: 14px;
}
.brand small { display: block; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: #aeb8a9; }
.brand em { color: var(--red); font-style: normal; }
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 50% 50% 42% 42%;
  background: var(--red);
  position: relative;
}
.logo-mark::before, .logo-mark::after {
  content: "";
  position: absolute; top: 5px; width: 14px; height: 8px;
  border: 2px solid #fcebd2; border-bottom: 0; border-radius: 14px 14px 0 0;
}
.logo-mark::before { left: -3px; transform: rotate(-24deg); }
.logo-mark::after { right: -3px; transform: rotate(24deg); }
.bar-nav { display: flex; gap: 14px; font-size: 13px; }
.bar-nav a { text-decoration: none; color: #acb4aa; }
.bar-nav a.on, .bar-home { color: #fff8e8; text-decoration: none; }

.hub { max-width: 1100px; margin: 0 auto; padding: 42px 22px 72px; }
.hub h1 { font-family: Manrope, sans-serif; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.05em; margin: 0 0 10px; }
.lead { color: var(--ink-soft); max-width: 640px; }
.now-note { color: var(--rice); font-weight: 700; }
.series-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; margin-top: 28px; }
.series-card { background: #fffdf6; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.series-visual { position: relative; background: var(--sidebar); }
.series-poster { display: block; position: relative; aspect-ratio: 3/4; background: var(--sidebar); }
.series-poster img { width: 100%; height: 100%; object-fit: cover; }
.tape {
  position: absolute; top: 14px; right: 12px; z-index: 3;
  background: rgba(248,235,205,.9); color: #665e52;
  font: 800 9px/1 Manrope, sans-serif; letter-spacing: .1em;
  padding: 6px 8px; transform: rotate(2deg);
}
.cover-rail {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-height: 120px;
  padding: 12px 0;
  background: #221f1a;
  border-top: 1px solid rgba(255, 248, 232, .08);
}
.cover-rail-track {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  width: max-content;
  max-width: none;
  gap: 8px;
  padding: 0 12px;
  animation: studio-cover-slide 28s linear infinite;
  will-change: transform;
}
.cover-rail:hover .cover-rail-track,
.cover-rail.is-paused .cover-rail-track {
  animation-play-state: paused;
}
.cover-chip {
  flex: 0 0 72px !important;
  width: 72px;
  height: 96px;
  position: relative;
  display: grid !important;
  grid-template: 96px / 72px;
  border-radius: 7px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0,0,0,.28);
  outline: 1px solid rgba(255,248,232,.28);
  outline-offset: -1px;
  background: #3a342c;
  white-space: nowrap;
}
.cover-chip img,
.cover-chip span {
  grid-area: 1 / 1;
}
.cover-chip img {
  width: 72px;
  height: 96px;
  max-width: none !important;
  object-fit: cover;
  pointer-events: none;
  display: block;
}
.cover-chip span {
  position: relative;
  align-self: end;
  justify-self: stretch;
  padding: 10px 4px 5px;
  background: linear-gradient(transparent, rgba(12,14,10,.88));
  color: #fff8e8;
  font: 800 9px/1 Manrope, sans-serif;
  letter-spacing: .04em;
  text-align: center;
}
.cover-chip.live { outline-color: rgba(199, 154, 71, .9); }
.cover-chip.showing { outline-color: rgba(232, 176, 138, .7); }
.cover-chip.upcoming, .cover-chip.next { opacity: .85; }
@keyframes studio-cover-slide {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
@media (max-width: 640px) {
  .cover-rail { min-height: 128px; }
  .cover-chip {
    flex-basis: 78px !important;
    width: 78px;
    height: 104px;
    grid-template: 104px / 78px;
  }
  .cover-chip img { width: 78px; height: 104px; }
}
.series-body { padding: 16px 18px 20px; }
.series-body h2 { margin: 0 0 6px; font-size: 18px; }
.kicker { color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.meta { color: #8e877b; font-size: 12px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.soon-slot { display: block; }
.is-soon { opacity: 1; }
.is-soon .series-body { opacity: .92; }

.film-hero { position: relative; min-height: 72vh; color: #fbf5e9; background: #1d211d; }
.film-hero img { width: 100%; height: 72vh; object-fit: cover; object-position: center 60%; opacity: .78; }
.film-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(29,33,29,.92) 0%, rgba(29,33,29,.45) 55%, transparent 80%);
}
.film-hero-copy { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px 8vw 56px; max-width: 760px; }
.film-hero h1 { font-family: Manrope, sans-serif; font-size: clamp(28px, 5vw, 48px); line-height: 1.08; margin: 8px 0 12px; }
.logline { color: #ded8c9; max-width: 520px; }
.hero-chips, .hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-chips span, .hero-chip {
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08);
  padding: 5px 9px; border-radius: 999px; font-size: 11px;
}

.follow-strip, .next-banner, .episodes, .about-film, .ep-page { max-width: 1180px; margin: 0 auto; padding: 36px 22px; }
.follow-strip, .next-banner, .about-film, .ep-page {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center;
}
.follow-strip { background: #f1ece1; border-block: 1px solid var(--line); max-width: none; padding-inline: 8vw; }
.follow-actions { display: grid; gap: 8px; justify-items: start; }
.follow-count { color: var(--ink-soft); font-size: 13px; }
.next-banner { background: #fffdf6; border: 1px solid var(--line); border-radius: 10px; margin-top: 28px; overflow: hidden; padding: 0; }
.next-banner img { height: 220px; width: 100%; object-fit: cover; }
.next-banner > div { padding: 22px; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 18px; }
.episodes { display: block; }
.poster-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.poster { position: relative; display: block; border-radius: 8px; overflow: hidden; text-decoration: none; background: #1d211d; aspect-ratio: 3/4; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster.upcoming, .poster.next { filter: saturate(.85); }
.poster.upcoming img { opacity: .62; }
.badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--rice); color: #fff8e8; font-size: 10px; font-weight: 800;
  padding: 4px 7px; border-radius: 999px;
}
.poster.next .badge, .badge.next { background: var(--red); }
.poster.upcoming .badge, .badge.upcoming { background: #5c564c; }
.poster-meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 10px;
  background: linear-gradient(transparent, rgba(20,22,18,.88));
  color: #fff8e8; font-size: 12px;
}
.poster-meta strong { display: block; font-size: 11px; color: #e8b08a; }
.about-film img { border-radius: 8px; height: 280px; width: 100%; object-fit: cover; }
.facts { display: flex; gap: 10px; flex-wrap: wrap; padding: 0; list-style: none; }
.facts li { border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; font-size: 12px; }

.ep-cover { position: relative; border-radius: 10px; overflow: hidden; background: #1d211d; }
.ep-cover img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.play-btn, .clip-soon {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: rgba(20,22,18,.72); color: #fff8e8; border: 1px solid rgba(255,255,255,.3);
  padding: 10px 16px; border-radius: 999px; font-weight: 750;
}
.hook { font-size: 20px; font-weight: 800; }
.lesson { color: var(--rice); font-weight: 700; }
.follow-box { background: #f1ece1; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.ep-switch { display: flex; justify-content: space-between; margin-top: 18px; }
.poster.live .badge { background: var(--rice); }
.poster-play {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20,22,18,.62); color: #fff8e8; font-size: 14px;
  border: 1px solid rgba(255,255,255,.35);
}
.play-stack {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; width: calc(100% - 24px); max-width: 220px;
}
.play-stack .play-btn { position: static; transform: none; width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 8px; }
.clip-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.ico { width: 16px; height: 16px; display: block; flex-shrink: 0; }
.clip-links .btn, .follow-actions .btn.ghost { align-items: center; gap: 8px; }
.clip-links .btn-youtube .ico, .follow-actions .btn-youtube .ico { color: #e11d2a; }
.clip-links .btn-tiktok .ico, .follow-actions .btn-tiktok .ico { color: #111; }
.play-btn .ico { color: #fff8e8; }
.clip-modal { border: 0; border-radius: 12px; padding: 16px; width: min(420px, 96vw); background: #111; color: #fff; }
.clip-frame { aspect-ratio: 16/9; background: #000; }
.clip-frame.is-short { aspect-ratio: 9/16; max-height: 78vh; margin: 0 auto; }
.clip-frame iframe, .clip-frame video { width: 100%; height: 100%; border: 0; }

@media (max-width: 900px) {
  .follow-strip, .next-banner, .about-film, .ep-page { grid-template-columns: 1fr; }
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .film-hero img { height: 62vh; }
}
