/* ==========================================================================
   Вовочка и Марь Ванна — пластилиновый (claymation) стиль
   Mobile-first. Брейкпоинты: 768px (планшет), 1024px (десктоп)
   ========================================================================== */

:root {
  --bg-cream: #FFF3E1;
  --card-peach: #FFE3B0;
  --text-brown: #2A1F16;
  --clay-orange: #FF6B35;
  --clay-mint: #2FBF71;
  --clay-pink: #F0539A;
  --clay-purple: #7F77DD;
  --clay-mustard: #FFC845;
  --board-green: #1F3B33;
  --white: #FFFFFF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: radial-gradient(circle at 50% -10%, #fffaf0 0%, #ffecc9 30%, #ffdca4 65%, #f6c688 100%);
  color: var(--text-brown);
  font-family: 'Manrope', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Unbounded', cursive, sans-serif; }

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

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

.section-padding { padding: 50px 0; }

.section-title {
  font-size: 1.6rem;
  color: var(--text-brown);
  text-align: center;
  margin-bottom: 30px;
}

/* ---------- Пластилиновые базовые компоненты ---------- */

.clay-box {
  background: var(--card-peach);
  border: 4px solid var(--text-brown);
  border-radius: 32px 24px 38px 26px;
  box-shadow:
    inset 6px 6px 12px rgba(255, 255, 255, 0.7),
    inset -6px -6px 14px rgba(42, 31, 22, 0.12),
    8px 12px 20px rgba(42, 31, 22, 0.15);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.clay-card-link { display: block; text-decoration: none; color: inherit; }

.clay-card-link:hover .clay-box,
.clay-card-link:focus-visible .clay-box {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    inset 8px 8px 16px rgba(255, 255, 255, 0.8),
    inset -6px -6px 14px rgba(42, 31, 22, 0.12),
    12px 18px 25px rgba(42, 31, 22, 0.22);
}

.clay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--clay-orange);
  color: var(--white);
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 24px;
  border: 3px solid var(--text-brown);
  border-radius: 24px 18px 26px 20px;
  cursor: pointer;
  text-decoration: none;
  box-shadow:
    inset 4px 4px 8px rgba(255, 255, 255, 0.6),
    inset -4px -4px 8px rgba(0, 0, 0, 0.2),
    4px 8px 15px rgba(42, 31, 22, 0.2);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.clay-btn:hover, .clay-btn:focus-visible { transform: translateY(-3px) scale(1.03); }

.clay-btn.mint { background: var(--clay-mint); }
.clay-btn.purple { background: var(--clay-purple); }
.clay-btn.pink { background: var(--clay-pink); }
.clay-btn.mustard { background: var(--clay-mustard); color: var(--text-brown); }

/* ---------- Шапка сайта (banner.jpg) ---------- */

.site-header { padding-top: 18px; }

.banner-frame {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 5px solid var(--text-brown);
  border-radius: 34px 26px 40px 28px;
  box-shadow: 6px 10px 0 rgba(42, 31, 22, 0.18);
  margin-bottom: -28px;
}

.banner-img { width: 100%; height: auto; }

.nav-container {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-cream);
  border-radius: 26px;
  border: 3px solid var(--text-brown);
  box-shadow: 4px 8px 15px rgba(42, 31, 22, 0.2);
}

.logo {
  font-size: 1rem;
  font-weight: 900;
  color: var(--clay-orange);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Unbounded', sans-serif;
  white-space: nowrap;
}

.logo-badge {
  background: var(--clay-mustard);
  color: var(--text-brown);
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  border: 2px solid var(--text-brown);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--text-brown);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
  list-style: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  background: var(--bg-cream);
  border: 3px solid var(--text-brown);
  border-radius: 20px;
  padding: 10px;
  box-shadow: 4px 8px 15px rgba(42, 31, 22, 0.2);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
}

.nav-menu.is-open {
  max-height: 260px;
  opacity: 1;
  pointer-events: auto;
  padding: 10px;
}

.nav-link {
  display: block;
  text-decoration: none;
  color: var(--text-brown);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 12px;
}

.nav-link:hover { background: rgba(42, 31, 22, 0.06); }

.nav-cta { padding: 10px 16px !important; font-size: 0.85rem !important; text-align: center; }

/* ---------- Hero ---------- */

.hero { padding: 60px 0 40px; }
.hero-wrapper { display: grid; grid-template-columns: 1fr; gap: 30px; align-items: center; }
.hero-title { font-size: 1.9rem; line-height: 1.2; margin-bottom: 16px; }
.hero-subtitle { font-size: 1.05rem; margin-bottom: 24px; font-weight: 600; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.chalkboard {
  background: var(--board-green);
  color: #F0F7F4;
  border: 6px solid #5C3D2E;
  border-radius: 20px;
  padding: 24px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.chalkboard-label { font-size: 0.8rem; color: var(--clay-mustard); margin-bottom: 10px; }
.chalkboard-quote { font-style: italic; font-size: 1rem; }

/* ---------- Список анекдотов ---------- */

.desk-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.anecdote-card {
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.desk-number {
  display: inline-block;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 14px;
  border: 2px solid var(--text-brown);
  font-size: 0.8rem;
  margin-bottom: 12px;
  font-family: 'Unbounded', sans-serif;
}

.anecdote-title { font-size: 1.2rem; margin-bottom: 10px; }
.anecdote-teaser { font-size: 0.95rem; margin-bottom: 18px; color: #4A3B30; flex-grow: 1; }

.open-page-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--clay-orange);
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 16px;
  border-radius: 14px;
  border: 2px solid var(--text-brown);
  margin-top: 10px;
  width: fit-content;
}

.empty-state { text-align: center; padding: 30px; font-weight: 600; grid-column: 1 / -1; }

.desk-grid.is-loading { opacity: 0.5; pointer-events: none; transition: opacity 0.2s ease; }

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  border: 3px solid var(--text-brown);
  background: var(--card-peach);
  color: var(--text-brown);
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.page-btn.is-active { background: var(--clay-orange); color: var(--white); }
.page-btn.is-disabled { opacity: 0.4; pointer-events: none; }
.page-btn:hover:not(.is-active):not(.is-disabled) { transform: translateY(-3px); }

/* ---------- О проекте / ключевые слова ---------- */

.about-card { padding: 28px; }
.about-card p { margin-bottom: 16px; font-size: 0.98rem; }
.about-card p:last-of-type { margin-bottom: 24px; }

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  display: inline-block;
  background: var(--bg-cream);
  color: var(--text-brown);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 14px;
  border: 2px solid var(--text-brown);
}

/* ---------- Почему у нас ---------- */

.why-us-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.why-us-card { padding: 24px; text-align: center; }
.why-us-icon { font-size: 2.2rem; margin-bottom: 12px; }
.why-us-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.why-us-card p { font-size: 0.92rem; color: #4A3B30; }

/* ---------- Страница анекдота ---------- */

.detail-card { max-width: 800px; margin: 0 auto; padding: 28px; }

.detail-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.detail-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.views-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-brown);
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid var(--text-brown);
  padding: 6px 14px;
  border-radius: 14px;
}

.desk-badge-large {
  display: inline-block;
  font-family: 'Unbounded', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 16px;
  border: 3px solid var(--text-brown);
}

.detail-title { font-size: 1.7rem; margin-bottom: 22px; color: var(--text-brown); text-align: center; }

.anecdote-full-box {
  background: var(--white);
  border: 3px solid var(--text-brown);
  border-radius: 20px;
  padding: 22px;
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 28px;
  box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.05);
}

.video-wrapper {
  background: var(--board-green);
  border: 5px solid var(--text-brown);
  border-radius: 24px;
  padding: 20px;
  text-align: center;
  margin-bottom: 28px;
}

.video-wrapper h3 { color: var(--clay-mustard); margin-bottom: 16px; font-size: 1.05rem; }

.player-container {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  background: #0D1F1A;
  border-radius: 18px;
  border: 3px solid var(--text-brown);
  overflow: hidden;
}

.player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}

.social-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 14px;
  border: 2px solid var(--text-brown);
  background: var(--bg-cream);
  color: var(--text-brown);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.social-link-btn:hover { transform: translateY(-2px); }

.nav-buttons-wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-buttons-wrap .clay-btn { flex: 1 1 auto; text-align: center; }

/* ---------- Футер ---------- */

.footer {
  padding: 30px 0;
  text-align: center;
  border-top: 4px dashed rgba(42, 31, 22, 0.2);
  margin-top: 40px;
  font-size: 0.9rem;
}

/* ---------- Фон: плавающие полупрозрачные шарики ---------- */

.bg-balls {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-balls span {
  position: absolute;
  bottom: -140px;
  display: block;
  border-radius: 50%;
  opacity: 0;
  filter: blur(1px);
  animation: bgBallFloat linear infinite;
}

.bg-balls span:nth-child(1) { left: 4%;  width: 60px; height: 60px; background: var(--clay-orange);  animation-duration: 24s; animation-delay: 0s; }
.bg-balls span:nth-child(2) { left: 18%; width: 34px; height: 34px; background: var(--clay-mint);    animation-duration: 18s; animation-delay: 3s; }
.bg-balls span:nth-child(3) { left: 34%; width: 76px; height: 76px; background: var(--clay-pink);    animation-duration: 29s; animation-delay: 7s; }
.bg-balls span:nth-child(4) { left: 50%; width: 46px; height: 46px; background: var(--clay-purple);  animation-duration: 21s; animation-delay: 1s; }
.bg-balls span:nth-child(5) { left: 64%; width: 30px; height: 30px; background: var(--clay-mustard); animation-duration: 16s; animation-delay: 5s; }
.bg-balls span:nth-child(6) { left: 76%; width: 68px; height: 68px; background: var(--clay-orange);  animation-duration: 27s; animation-delay: 9s; }
.bg-balls span:nth-child(7) { left: 88%; width: 40px; height: 40px; background: var(--clay-mint);    animation-duration: 19s; animation-delay: 4s; }
.bg-balls span:nth-child(8) { left: 95%; width: 52px; height: 52px; background: var(--clay-pink);    animation-duration: 25s; animation-delay: 11s; }

@keyframes bgBallFloat {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.3; }
  50%  { transform: translateY(-55vh) translateX(18px) rotate(180deg); }
  92%  { opacity: 0.22; }
  100% { transform: translateY(-110vh) translateX(-16px) rotate(360deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-balls span { animation: none; display: none; }
}

/* ---------- Анонс новых серий ---------- */

.announcement { padding: 0 0 30px; }

.announcement-inner {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px 20px;
  background: linear-gradient(145deg, var(--card-peach), #ffd48f);
  border: 4px solid var(--text-brown);
  border-radius: 30px 24px 34px 26px;
  box-shadow:
    inset 6px 6px 12px rgba(255, 255, 255, 0.7),
    inset -6px -6px 14px rgba(42, 31, 22, 0.12),
    8px 12px 20px rgba(42, 31, 22, 0.15);
}

.announcement-inner::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 3px dashed rgba(42, 31, 22, 0.25);
  border-radius: 22px;
  pointer-events: none;
}

.announcement-emoji {
  position: relative;
  z-index: 2;
  font-size: 36px;
  filter: drop-shadow(0 4px 3px rgba(42, 31, 22, 0.25));
  animation: announceBounce 2.2s ease-in-out infinite;
}

.announcement-emoji:last-child { animation-delay: 0.7s; }

.announcement-text { position: relative; z-index: 2; }

.announcement-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-brown);
  margin-bottom: 10px;
}

.announcement-times {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: 'Unbounded', sans-serif;
}

.announcement-times span {
  padding: 6px 12px;
  border-radius: 14px;
  border: 3px solid var(--text-brown);
}

.announcement-times .morning { background: var(--clay-mint); color: #0F2A1E; }
.announcement-times .evening { background: var(--clay-mustard); color: var(--text-brown); }
.announcement-times .dash { border: 0; padding: 0; color: var(--text-brown); font-family: 'Manrope', sans-serif; }

.announcement-subtitle {
  margin-top: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  color: #4A3B30;
  max-width: 480px;
}

.announcement-subtitle strong { color: var(--clay-purple); }

@keyframes announceBounce { 50% { transform: translateY(-6px) rotate(4deg); } }

/* ---------- Бегущая строка ---------- */

.marquee-section { padding: 0 0 10px; }

.marquee-bar {
  overflow: hidden;
  background: var(--clay-orange);
  border: 3px solid var(--text-brown);
  border-radius: 18px;
  box-shadow: 4px 8px 15px rgba(42, 31, 22, 0.2);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 22s linear infinite;
  padding: 10px 0;
}

.marquee-track span {
  color: var(--white);
  font-weight: 800;
  font-family: 'Unbounded', sans-serif;
  font-size: 0.78rem;
  margin: 0 18px;
  white-space: nowrap;
}

@keyframes marqueeScroll { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ==========================================================================
   Планшет: >= 768px
   ========================================================================== */
@media (min-width: 768px) {
  .container { padding: 0 24px; }
  .section-padding { padding: 60px 0; }
  .section-title { font-size: 1.9rem; }

  .nav-container { max-width: 680px; padding: 12px 24px; }
  .logo { font-size: 1.15rem; }

  .hero-title { font-size: 2.4rem; }
  .hero-subtitle { font-size: 1.15rem; }

  .desk-grid { grid-template-columns: repeat(2, 1fr); }
  .why-us-grid { grid-template-columns: repeat(3, 1fr); }

  .detail-card { padding: 36px; }
  .detail-title { font-size: 2rem; }

  .announcement-inner { flex-direction: row; padding: 28px 34px; gap: 20px; }
  .announcement-emoji { font-size: 48px; }
  .announcement-title { font-size: 1.3rem; }
  .announcement-times { font-size: 1.3rem; }
  .announcement-subtitle { font-size: 1rem; }

  .marquee-track span { font-size: 0.88rem; margin: 0 24px; }
}

/* ==========================================================================
   Десктоп: >= 1024px
   ========================================================================== */
@media (min-width: 1024px) {
  .banner-frame { border-radius: 40px 30px 46px 32px; margin-bottom: -34px; }
  .nav-container { max-width: 760px; }

  .nav-toggle { display: none; }

  .nav-menu {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 22px;
    max-height: none;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0 !important;
  }

  .nav-link { padding: 4px 0; }

  .hero { padding: 70px 0 60px; }
  .hero-wrapper { grid-template-columns: 1.2fr 0.8fr; gap: 40px; }
  .hero-title { font-size: 3rem; }

  .section-title { font-size: 2.2rem; margin-bottom: 45px; }

  .desk-grid { grid-template-columns: repeat(3, 1fr); gap: 30px; }
}
