:root {
  --bg: #141210;
  --card: #211e1a;
  --text: #f4efe6;
  --muted: #a89f93;
  --line: rgba(244, 239, 230, 0.12);
  --accent: #e7b089;
  --moss: #9dccb4;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "WenQuanYi Micro Hei", "Droid Sans Fallback", sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Songti SC", "Noto Serif SC", "WenQuanYi Micro Hei", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 480px at 8% -10%, rgba(231, 176, 137, 0.16), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(157, 204, 180, 0.08), transparent 46%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

body.player-open { overflow: hidden; }

img { max-width: 100%; }

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: inherit; }

:focus { outline: none; }

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

::selection {
  background: #e7b089;
  color: #1a140f;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 20;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header { padding: 36px 0 18px; }

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.mark {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
}

.eyebrow, .kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.3rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.lede {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
}

#count {
  display: inline-block;
  margin-left: 0.4em;
  color: var(--text);
}

.filter-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(20, 18, 16, 0.92);
  border-bottom: 1px solid transparent;
  border-top: 1px solid transparent;
}

.filter-bar.is-stuck {
  border-bottom-color: var(--line);
}

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

#filters {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
}

#filters::-webkit-scrollbar { display: none; }

.filter-btn {
  flex: 0 0 auto;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0 14px;
}

.filter-btn[aria-pressed="true"] {
  background: var(--text);
  color: #1a140f;
  border-color: var(--text);
}

.feed-entry { flex: 0 0 auto; white-space: nowrap; }

main { flex: 1; padding: 22px 0 48px; }

.status { color: var(--muted); }

.status[hidden] { display: none; }

.category-block { margin: 8px 0 34px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 14px;
}

.section-head h2, .banner h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.section-copy, .banner p { margin: 6px 0 0; color: var(--muted); }

.dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  transform: translateY(-1px);
}

.banner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  gap: 0;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #1b1815;
}

.banner img {
  width: 100%;
  height: 100%;
  min-height: 200px;
  object-fit: cover;
  display: block;
}

.banner-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 22px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 16px;
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.card.is-current .card-link { border-color: var(--accent); }

@media (hover: hover) {
  .card-link:hover {
    transform: translateY(-2px);
    border-color: rgba(244, 239, 230, 0.32);
    box-shadow: var(--shadow);
  }
}

.card-media {
  position: relative;
  background: #2a2521;
  aspect-ratio: 16 / 10;
}

.card[data-aspect="9:16"] .card-media { aspect-ratio: 3 / 4; }

.card[data-aspect="2:3"] .card-media { aspect-ratio: 2 / 3; }

.card[data-aspect="16:9"] .card-media { aspect-ratio: 16 / 9; }

.card[data-aspect="3:2"] .card-media { aspect-ratio: 3 / 2; }

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card[data-aspect="9:16"] .card-media img { object-position: center 16%; }

.play-disc {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(244, 239, 230, 0.45);
  background: rgba(16, 13, 11, 0.55);
  transform: translate(-50%, -50%);
}

.play-disc svg { width: 16px; height: 16px; margin-left: 2px; }

.badge {
  position: absolute;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(12, 10, 8, 0.72);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.badge-aspect { top: 10px; right: 10px; }
.badge-aspect.is-portrait { color: #f0c2c6; }
.badge-aspect.is-landscape { color: var(--moss); }
.badge-time { left: 10px; bottom: 10px; }

.card-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}

.series-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
}

.card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.btn-primary {
  background: var(--text);
  color: #1a140f;
  border-color: var(--text);
}

.btn-small { min-height: 36px; font-size: 0.92rem; }

.btn[disabled] { opacity: 0.45; cursor: default; }

.btn.is-copied {
  background: var(--moss);
  color: #14211b;
  border-color: var(--moss);
}

#player {
  width: min(1040px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: none;
  border-radius: 22px;
  background: transparent;
  color: var(--text);
  overflow: auto;
}

#player::backdrop { background: rgba(6, 5, 4, 0.78); }

.player-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.9fr);
  align-items: start;
  background: #1b1815;
}

.player-sheet:has(#player-video.is-portrait) {
  grid-template-columns: minmax(200px, 400px) minmax(0, 1fr);
}

.stage {
  position: sticky;
  top: 0;
  background: #070706;
  padding: 16px 16px 12px;
}

#player-video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(70vh, 760px);
  margin: 0 auto;
  background: #000;
}

#player-video.is-landscape { width: 100%; max-height: 62vh; }
#player-video.is-portrait { max-width: min(100%, 400px); }

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 230, 0.28);
  background: rgba(12, 10, 8, 0.72);
}

.playlist-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 10px;
  color: #efe8dc;
}

.playlist-bar p { margin: 0; }

.playlist-controls { display: flex; gap: 8px; }

.player-body { padding: 18px 20px 24px; }

#player-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.subtitle { margin: 6px 0 0; color: var(--muted); }

.meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 16px 0;
}

.meta dt { color: var(--muted); }
.meta dd { margin: 0; }

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

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.actions .file-url { flex: 1 0 100%; margin: 0; }

.file-url {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: break-all;
}

.file-url code { color: var(--text); }

.error {
  margin: 12px 0 0;
  color: #f0b4b0;
}

.prompt { margin-top: 20px; }

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.prompt h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.prompt-text {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.7;
}

.prompt-missing {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.prompt-source,
.prompt-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  word-break: break-word;
}

.segment-links { margin-top: 16px; }

.segment-links p { margin: 0 0 6px; }

.segment-links ol { margin: 0; padding-left: 1.2rem; }

.segment-links a, .inspiration {
  color: var(--accent);
  text-underline-offset: 3px;
}

.inspiration { display: inline-block; margin-top: 14px; }

.site-footer {
  padding: 18px 0 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p { margin: 0; }

.site-footer a { text-decoration: underline; text-underline-offset: 3px; }

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

.noscript { color: var(--muted); }

@media (max-width: 800px) {
  .player-sheet,
  .player-sheet:has(#player-video.is-portrait) { grid-template-columns: 1fr; }
  .stage { position: relative; }
}

@media (max-width: 720px) {
  .header-row { flex-direction: column; align-items: flex-start; }
  .site-header { padding-top: 24px; }
  .banner { grid-template-columns: 1fr; }
  .banner img { min-height: 160px; max-height: 220px; }
  #player {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  #player-video.is-portrait { max-height: 46vh; }
  #player-video.is-landscape { max-height: 42vh; }
  .player-body { padding: 16px 16px 28px; }
}

.feed[hidden] { display: none !important; }

.feed {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
  color: #fff;
}

.feed-scroller {
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background: #000;
}

.feed-scroller::-webkit-scrollbar { display: none; }

.feed-slide {
  position: relative;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  background: #000;
}

.feed-frame {
  position: relative;
  height: 100%;
  width: min(100%, calc(100dvh * 9 / 16));
  background: #000;
}

.feed-slide.is-landscape .feed-frame {
  width: min(100%, 960px);
  height: auto;
  max-height: 100%;
  aspect-ratio: 16 / 9;
}

.feed-slide.is-2x3 .feed-frame {
  width: min(100%, calc(100dvh * 2 / 3));
}

.feed-slide.is-3x2 .feed-frame {
  width: min(100%, 960px);
  height: auto;
  max-height: 100%;
  aspect-ratio: 3 / 2;
}

.feed-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.feed-slide.is-landscape .feed-frame video { object-fit: contain; }

.feed-shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  pointer-events: none;
}

.feed-back,
.feed-count {
  position: absolute;
  z-index: 5;
  top: calc(12px + env(safe-area-inset-top));
}

.feed-back {
  left: 12px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 10, 8, 0.55);
  color: #fff;
}

.feed-count {
  right: 14px;
  margin: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.85rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.feed-meta {
  position: absolute;
  left: 14px;
  right: 84px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 2;
}

.feed-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.feed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feed-chip {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.75rem;
  line-height: 1.4;
}

.feed-actions {
  position: absolute;
  right: 8px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-action {
  width: 58px;
  min-height: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.feed-bubble {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(20, 16, 14, 0.42);
  font-size: 1.35rem;
  line-height: 1;
}

.feed-caption {
  font-size: 0.72rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.feed-caption.is-copied { color: var(--moss); }

.feed-hit {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.feed-pause {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 64px;
  height: 64px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.feed-slide.is-paused .feed-pause { display: grid; }

.feed-sheet[hidden] { display: none !important; }

.feed-sheet {
  position: absolute;
  inset: 0;
  z-index: 6;
}

.feed-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
}

.feed-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(78dvh, 720px);
  overflow: auto;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #1b1815;
  color: var(--text);
}

.feed-sheet-handle {
  width: 42px;
  height: 4px;
  margin: 4px auto 10px;
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.28);
}

.feed-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.feed-sheet-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.feed-prompt-block { margin-top: 14px; }

.feed-prompt-block:first-child { margin-top: 0; }

body.feed-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-link { transition: none; }
  .feed-scroller { scroll-behavior: auto; }
}
