/* ===== ОСНОВНЫЕ ПЕРЕМЕННЫЕ ===== */
:root {
  --scratch-blue: #4D97FF;
  --scratch-blue-dark: #3366CC;
  --scratch-yellow: #FFD500;
  --scratch-green: #59C059;
  --scratch-red: #FF6680;
  --scratch-purple: #9966FF;
  --scratch-orange: #FF8C1A;
  --bg-dark: #1a1a2e;
  --bg-darker: #16162a;
  --bg-card: #222244;
  --bg-card-hover: #2a2a55;
  --text-primary: #f0f0ff;
  --text-secondary: #b0b0d0;
  --nav-yellow: #FFD500;
  --glow-white: #ffffff;
  --section-radius: 24px;
}

/* ===== СБРОС И БАЗОВЫЕ ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== ПЛАВАЮЩИЙ КОТ ===== */
.scratch-cat {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  cursor: pointer;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 20px rgba(77, 151, 255, 0.4));
}

.scratch-cat:hover {
  transform: scale(1.1);
}

.scratch-cat svg {
  width: 80px;
  height: 80px;
  animation: catBounce 3s ease-in-out infinite;
}

@keyframes catBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.cat-speech {
  position: absolute;
  bottom: 90px;
  right: 0;
  background: white;
  color: #333;
  padding: 8px 16px;
  border-radius: 16px 16px 4px 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px) scale(0.8);
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.scratch-cat:hover .cat-speech {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== НАВБАР ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  height: 70px;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid rgba(77, 151, 255, 0.2);
}

.nav-brand {
  font-size: 22px;
  font-weight: 800;
  color: var(--scratch-blue);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: var(--nav-yellow);
  font-weight: 700;
  font-size: 15px;
  padding: 8px 18px;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  letter-spacing: 0.3px;
}

.nav-link:hover {
  background: rgba(255, 213, 0, 0.1);
  color: #ffe44d;
  text-shadow: 0 0 10px rgba(255, 213, 0, 0.3);
}

/* Активная ссылка — белое свечение */
.nav-link.active {
  color: var(--glow-white);
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.8),
    0 0 20px rgba(255, 255, 255, 0.6),
    0 0 40px rgba(255, 255, 255, 0.4),
    0 0 60px rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(255, 255, 255, 0.8),
      0 0 20px rgba(255, 255, 255, 0.6),
      0 0 40px rgba(255, 255, 255, 0.4),
      0 0 60px rgba(255, 255, 255, 0.2);
  }
  50% {
    text-shadow:
      0 0 15px rgba(255, 255, 255, 1),
      0 0 30px rgba(255, 255, 255, 0.8),
      0 0 50px rgba(255, 255, 255, 0.5),
      0 0 80px rgba(255, 255, 255, 0.3);
  }
}

.nav-burger {
  display: none;
  font-size: 28px;
  color: var(--nav-yellow);
  cursor: pointer;
  padding: 5px;
}

/* ===== ГЕРОЙ ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 30px 60px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(77, 151, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(153, 102, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255, 213, 0, 0.08) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--scratch-blue), var(--scratch-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(16px, 2.5vw, 24px);
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cat-big svg {
  width: clamp(150px, 20vw, 220px);
  height: auto;
  margin-bottom: 40px;
  animation: catFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 10px 40px rgba(77, 151, 255, 0.3));
}

@keyframes catFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-12px) rotate(2deg); }
  75% { transform: translateY(-6px) rotate(-2deg); }
}

.cta-button {
  display: inline-block;
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--scratch-blue), var(--scratch-purple));
  color: white;
  font-size: 18px;
  font-weight: 700;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 30px rgba(77, 151, 255, 0.4);
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(77, 151, 255, 0.6);
}

/* Парящие частицы */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.3;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ===== СЕКЦИИ ===== */
.section {
  padding: 100px 30px;
}

.section-alt {
  background: var(--bg-darker);
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 50px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== КАРТОЧКИ ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--scratch-blue);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(77, 151, 255, 0.2);
}

.card-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--scratch-blue);
}

.card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

/* ===== ШАГИ ===== */
.steps-box {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 40px;
  border: 2px solid rgba(77, 151, 255, 0.2);
}

.steps-box h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
}

.steps {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  text-align: center;
}

.step-num {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--scratch-blue), var(--scratch-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  margin: 0 auto 16px;
  box-shadow: 0 4px 20px rgba(77, 151, 255, 0.3);
}

.step p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.step a {
  color: var(--scratch-blue);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s;
}

.step a:hover {
  border-bottom-color: var(--scratch-blue);
}

/* ===== ТУТОРИАЛ PNG ===== */
.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.tutorial-step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.tutorial-step:hover {
  border-color: rgba(77, 151, 255, 0.3);
  box-shadow: 0 8px 30px rgba(77, 151, 255, 0.1);
}

.tutorial-num {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--scratch-yellow);
  color: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
}

.tutorial-content {
  flex: 1;
}

.tutorial-content h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--scratch-yellow);
}

.tutorial-content p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.tutorial-content ul {
  list-style: none;
  padding: 0;
}

.tutorial-content li {
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.tutorial-content li strong {
  color: var(--text-primary);
}

.tutorial-content code {
  background: rgba(77, 151, 255, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--scratch-blue);
}

.tip {
  background: rgba(255, 213, 0, 0.08);
  border-left: 4px solid var(--scratch-yellow);
  padding: 14px 18px;
  border-radius: 0 12px 12px 0;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tip strong {
  color: var(--scratch-yellow);
}

.code-block {
  background: rgba(0, 0, 0, 0.3);
  padding: 16px 20px;
  border-radius: 12px;
  margin-top: 12px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.code-comment {
  color: #6a6a8a;
}

.code-highlight {
  color: var(--scratch-yellow);
  font-weight: 600;
}

/* Таблица форматов */
.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: rgba(77, 151, 255, 0.15);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--scratch-blue);
  border-bottom: 2px solid rgba(77, 151, 255, 0.2);
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* ===== МУЛЬТФИЛЬМЫ ===== */
.cartoon-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 28px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--scratch-purple);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(153, 102, 255, 0.2);
}

.feature-icon {
  font-size: 40px;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--scratch-purple);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.feature-card code {
  background: rgba(153, 102, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--scratch-purple);
}

/* Скрипт-блоки */
.cartoon-tutorial {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 40px;
  border: 2px solid rgba(153, 102, 255, 0.2);
}

.cartoon-tutorial h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
}

.cartoon-script {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.script-block {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.script-label {
  display: block;
  font-weight: 700;
  color: var(--scratch-blue);
  margin-bottom: 16px;
  font-size: 15px;
}

.script-line {
  padding: 6px 12px;
  margin: 4px 0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border-left: 3px solid var(--scratch-green);
}

.script-line.indented {
  margin-left: 24px;
  border-left-color: var(--scratch-orange);
}

/* ===== ВИДЕО ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.video-card {
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.video-card:hover {
  border-color: var(--scratch-red);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(255, 102, 128, 0.2);
}

.video-thumb {
  height: 180px;
  background: linear-gradient(135deg, var(--scratch-blue), var(--scratch-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.video-thumb-2 { background: linear-gradient(135deg, var(--scratch-green), var(--scratch-blue)); }
.video-thumb-3 { background: linear-gradient(135deg, var(--scratch-orange), var(--scratch-red)); }
.video-thumb-4 { background: linear-gradient(135deg, var(--scratch-purple), var(--scratch-blue)); }
.video-thumb-5 { background: linear-gradient(135deg, var(--scratch-yellow), var(--scratch-orange)); }
.video-thumb-6 { background: linear-gradient(135deg, var(--scratch-red), var(--scratch-purple)); }

.video-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  cursor: pointer;
}

.video-card:hover .video-play {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.video-duration {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.video-info {
  padding: 24px;
}

.video-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.video-info p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.video-link {
  color: var(--scratch-red);
  font-weight: 700;
  font-size: 14px;
  transition: color 0.3s;
}

.video-link:hover {
  color: #ff8899;
}

/* Ресурсы */
.resources-box {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 40px;
  border: 2px solid rgba(255, 213, 0, 0.2);
}

.resources-box h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.resource-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.resource-link:hover {
  background: rgba(77, 151, 255, 0.1);
  border-color: var(--scratch-blue);
  color: var(--scratch-blue);
}

.resource-icon {
  font-size: 24px;
}

/* ===== ФУТЕР ===== */
.footer {
  padding: 60px 30px;
  text-align: center;
  border-top: 2px solid rgba(77, 151, 255, 0.15);
}

.footer-cat svg {
  width: 50px;
  height: 50px;
  margin-bottom: 16px;
}

.footer p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 8px;
}

.footer-small {
  font-size: 13px;
  color: #6a6a8a;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.98);
    flex-direction: column;
    padding: 20px;
    gap: 4px;
    border-bottom: 2px solid rgba(77, 151, 255, 0.2);
    backdrop-filter: blur(20px);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-burger {
    display: block;
  }

  .nav-link {
    padding: 12px 16px;
    text-align: center;
  }

  .tutorial-step {
    flex-direction: column;
    gap: 16px;
  }

  .scratch-cat {
    bottom: 16px;
    right: 16px;
  }

  .scratch-cat svg {
    width: 60px;
    height: 60px;
  }

  .steps {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 60px 16px;
  }

  .cartoon-script {
    grid-template-columns: 1fr;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }
}
