:root {
  --ink: #102a3a;
  --ink-soft: #405c63;
  --paper: #edf4f2;
  --paper-deep: #dce8e4;
  --wood: #173746;
  --ember: #c4aa3e;
  --olive: #52775f;
  --olive-deep: #345746;
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 45% at 80% -5%, rgba(82, 119, 95, 0.16), transparent 55%),
    radial-gradient(ellipse 70% 40% at 10% 0%, rgba(196, 170, 62, 0.1), transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(237, 244, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(16, 42, 58, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  letter-spacing: -0.02em;
}

.brand img {
  width: 2.75rem;
  height: auto;
}

.count {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.yt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--ember);
  color: #102a3a;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: transform 0.2s var(--ease), background 0.2s ease;
}

.yt-btn:hover {
  background: #9f8931;
  transform: translateY(-1px);
}

.new-hero {
  position: relative;
  overflow: hidden;
  margin: 0.85rem clamp(1rem, 3vw, 2rem) 1.15rem;
  min-height: clamp(16rem, 38vw, 22rem);
  border-radius: 1.35rem;
  color: #f4f7e9;
  isolation: isolate;
}

.new-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.new-hero__bg {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  animation: new-hero-drift 18s var(--ease) infinite alternate;
}

.new-hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(16, 42, 58, 0.88) 8%, rgba(16, 42, 58, 0.55) 48%, rgba(23, 55, 70, 0.28) 100%),
    radial-gradient(ellipse 70% 80% at 85% 20%, rgba(196, 170, 62, 0.35), transparent 55%);
}

.new-hero__copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  min-height: inherit;
  padding: clamp(1.25rem, 3vw, 2.1rem);
  max-width: 40rem;
}

.new-hero__kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ddcb6e;
}

.new-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.85rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.new-hero__date {
  margin: 0.15rem 0 0.55rem;
  color: rgba(244, 247, 233, 0.78);
  font-weight: 600;
}

.new-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.btn-primary,
.btn-ghost {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  transition: transform 0.2s var(--ease), background 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: #fffdec;
  color: var(--olive-deep);
}

.btn-primary:hover {
  background: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(244, 247, 233, 0.12);
  color: #f4f7e9;
  border: 1px solid rgba(244, 247, 233, 0.28);
}

.btn-ghost:hover {
  background: rgba(244, 247, 233, 0.22);
  transform: translateY(-1px);
}

.btn-compact {
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

.stage {
  margin: 0 clamp(1rem, 3vw, 2rem) 1.75rem;
}

.stage__chrome {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.stage__label {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
}

.stage__title {
  margin: 0;
  max-width: 42rem;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stage__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1.1rem;
  background: var(--wood);
  box-shadow: 0 18px 48px rgba(16, 42, 58, 0.18);
}

.stage__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.stage .btn-ghost {
  background: rgba(16, 42, 58, 0.06);
  color: var(--ink);
  border-color: rgba(16, 42, 58, 0.14);
}

.stage .btn-ghost:hover {
  background: rgba(82, 119, 95, 0.12);
  border-color: var(--olive);
}

.search-wrap {
  display: block;
  margin: 0 0 1.15rem;
}

.search-wrap input {
  width: 100%;
  max-width: 28rem;
  appearance: none;
  border: 2px solid rgba(16, 42, 58, 0.1);
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(82, 119, 95, 0.18);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.35rem;
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 2.5rem;
  border-top: 1px solid rgba(16, 42, 58, 0.08);
  color: var(--ink-soft);
  font-weight: 600;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--olive-deep);
  text-decoration: underline;
}

@keyframes new-hero-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-1.5%, 1%, 0); }
}

.lang-hero {
  padding: 1.75rem clamp(1rem, 3vw, 2rem) 1rem;
}

.lang-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember);
}

.lang-title {
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
  color: var(--olive-deep);
}

.lang-lead {
  margin: 0.85rem 0 1.35rem;
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: 1.12rem;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem;
}

.lang-chip {
  appearance: none;
  border: 2px solid rgba(16, 42, 58, 0.12);
  border-radius: 1rem;
  padding: 0.95rem 0.75rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.lang-chip:hover {
  transform: translateY(-2px);
  border-color: var(--olive);
}

.lang-chip.is-active {
  background: var(--olive);
  border-color: var(--olive);
  color: #f4f7e9;
  box-shadow: 0 10px 24px rgba(82, 119, 95, 0.28);
}

.lang-chip:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

main {
  padding: 0.5rem clamp(1rem, 3vw, 2rem) 3rem;
}

.catalog-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

.catalog-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.filter input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--olive);
}

.catalog {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem 1rem;
}

.episode {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  width: 100%;
}

.episode:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 4px;
  border-radius: 4px;
}

.thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--wood);
  margin-bottom: 0.65rem;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease);
}

.episode:hover .thumb img,
.episode:focus-visible .thumb img {
  transform: scale(1.05);
}

.badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--olive);
  color: #f4f7e9;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.play {
  position: absolute;
  inset: auto auto 0.7rem 0.7rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(16, 42, 58, 0.78);
  pointer-events: none;
  transition: background 0.2s ease, transform 0.25s var(--ease);
}

.play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 53%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.35rem 0 0.35rem 0.6rem;
  border-color: transparent transparent transparent #fff;
}

.episode:hover .play {
  background: var(--ember);
  transform: scale(1.06);
}

.episode.is-new .thumb {
  box-shadow: 0 0 0 2px var(--ember);
}

.episode-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.92rem, 1.4vw, 1.05rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-date {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.catalog-empty,
.catalog-error {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ink-soft);
}

.player-dialog {
  width: min(960px, calc(100vw - 1.5rem));
  max-width: 960px;
  padding: 0;
  border: 0;
  background: var(--wood);
  color: #eff5f0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.player-dialog::backdrop {
  background: rgba(8, 31, 43, 0.72);
  backdrop-filter: blur(4px);
}

.player-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem 0.75rem 1rem;
}

.player-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 700;
  line-height: 1.25;
}

.player-close {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 50%;
  background: rgba(239, 245, 240, 0.12);
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.player-close:hover {
  background: var(--ember);
}

.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-hint {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
}

.player-hint a {
  color: #d9e7d8;
  font-weight: 600;
  text-decoration: none;
}

.player-hint a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .catalog {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .catalog {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 0.75rem;
  }

  .lang-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .brand span {
    max-width: 12ch;
  }

  .new-hero {
    margin-inline: 0.75rem;
    min-height: 18rem;
    border-radius: 1.1rem;
  }

  .stage {
    margin-inline: 0.75rem;
  }
}

@media (max-width: 420px) {
  .catalog {
    grid-template-columns: 1fr;
  }

  .lang-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .thumb img,
  .play,
  .lang-chip,
  .btn-primary,
  .btn-ghost,
  .yt-btn {
    transition: none;
  }

  .new-hero__bg {
    animation: none;
  }
}
