* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --cosmic-bg: #050014;
  --cosmic-deep: #0a0a2e;
  --neon-cyan: #7df9ff;
  --neon-gold: #ffd700;
  --neon-purple: #b57bff;
  --text-main: #e8e6ff;
  --card-bg: rgba(20, 12, 60, 0.55);
  --orbit: #9c8cff;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(90, 60, 200, 0.35), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(125, 249, 255, 0.14), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(181, 123, 255, 0.12), transparent 60%),
    var(--cosmic-bg);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
  font-style: italic;
  overflow-x: hidden;
}

/* ---------- Космос: звёзды, планеты, метеоры ---------- */

#stars,
#shooting {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Планеты */
.planet {
  position: fixed;
  border-radius: 50%;
  z-index: 0;
  filter: drop-shadow(0 0 30px rgba(125, 249, 255, 0.35));
  animation: float 18s ease-in-out infinite;
}

.planet--one {
  top: 8%;
  right: 6%;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle at 30% 30%, #ffb347, #b3541e 60%, #5c2400);
}

.planet--two {
  bottom: 10%;
  left: 5%;
  width: 56px;
  height: 56px;
  background: radial-gradient(circle at 35% 35%, #9ef7ff, #2f7bb0 60%, #103a5c);
  animation-delay: -6s;
}

.planet--ring {
  top: 55%;
  left: 80%;
  width: 44px;
  height: 44px;
  background: radial-gradient(circle at 30% 30%, #f3c6ff, #9357c9 60%, #3a1d5c);
}

.planet--ring::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -40%;
  width: 180%;
  height: 30%;
  background: rgba(184, 140, 255, 0.55);
  border-radius: 50%;
  transform: rotate(-18deg);
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-22px) scale(1.05); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.7); }
  50% { opacity: 0.95; transform: scale(1.2); }
}

@keyframes shoot {
  0% { transform: translateX(0) translateY(0) rotate(-24deg); opacity: 0; }
  4% { opacity: 1; }
  18% { transform: translateX(-46vw) translateY(22vh) rotate(-24deg); opacity: 1; }
  28%, 100% { transform: translateX(-70vw) translateY(34vh) rotate(-24deg); opacity: 0; }
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--d, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.meteor {
  position: absolute;
  width: 150px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), transparent);
  border-radius: 2px;
  filter: drop-shadow(0 0 6px var(--neon-cyan));
  animation: shoot var(--t, 7s) linear infinite;
  animation-delay: var(--d, 0s);
}

/* Небольшой заголовочный астеризм */
.constellation {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    radial-gradient(circle at 12% 20%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 20% 28%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 30% 18%, #fff 0 1.5px, transparent 2px);
}

/* ---------- Обёртка контента ---------- */

.wrapper {
  position: relative;
  z-index: 1;
  width: min(1080px, 94%);
  margin: 0 auto;
  padding: 40px 0 70px;
}

/* ---------- Шапка ---------- */

.site-head {
  text-align: center;
  padding: 26px 0 10px;
}

.main-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.6rem);
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--neon-gold), var(--neon-cyan), var(--neon-purple));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hueflow 8s linear infinite;
  text-shadow: 0 0 40px rgba(255, 215, 0, 0.18);
}

.main-sub {
  margin-top: 8px;
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(232, 230, 255, 0.72);
  letter-spacing: 3px;
}

@keyframes hueflow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- Навигация ---------- */

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 26px 0;
}

.nav a {
  font-style: italic;
  text-decoration: none;
  color: var(--text-main);
  padding: 10px 20px;
  border: 1px solid rgba(125, 249, 255, 0.4);
  border-radius: 30px;
  background: rgba(10, 10, 46, 0.5);
  box-shadow: 0 0 14px rgba(125, 249, 255, 0.12);
  transition: all 0.35s ease;
  animation: glimmer 4s ease-in-out infinite;
}

.nav a:nth-child(2n) { animation-delay: 1s; }
.nav a:nth-child(3n) { animation-delay: 2s; }

.nav a:hover {
  color: #050014;
  background: var(--neon-gold);
  border-color: var(--neon-gold);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
  transform: translateY(-3px) scale(1.05);
}

@keyframes glimmer {
  0%, 100% { box-shadow: 0 0 10px rgba(125, 249, 255, 0.15); }
  50% { box-shadow: 0 0 24px rgba(181, 123, 255, 0.45); }
}

/* ---------- Герой-астронавт (главная) ---------- */

.hero {
  text-align: center;
  padding: 46px 10px;
}

.hero p {
  font-size: 1.18rem;
  font-style: italic;
  line-height: 1.7;
  color: rgba(232, 230, 255, 0.9);
  max-width: 760px;
  margin: 0 auto 14px;
}

.hero .orbit-line {
  color: var(--orbit);
  font-size: 1rem;
  letter-spacing: 1.5px;
}

.jackie-badge {
  display: inline-block;
  margin-top: 26px;
  padding: 18px 34px;
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 700;
  color: var(--neon-gold);
  border: 2px dashed rgba(255, 215, 0, 0.55);
  border-radius: 50%;
  animation: orbit 14s linear infinite;
}

@keyframes orbit {
  0% { text-shadow: 0 0 6px var(--neon-gold); transform: rotate(0deg) scale(1); }
  25% { text-shadow: 0 0 26px var(--neon-gold); }
  50% { transform: rotate(180deg) scale(1.06); text-shadow: 0 0 10px var(--neon-cyan); }
  100% { transform: rotate(360deg) scale(1); }
}

/* ---------- Космические карты (список фильмов) ---------- */

.decade-head {
  text-align: center;
  margin-bottom: 28px;
}

.decade-head h2 {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  color: var(--neon-gold);
  text-shadow: 0 0 22px rgba(255, 215, 0, 0.4);
}

.decade-head p {
  margin-top: 6px;
  font-style: italic;
  color: rgba(232, 230, 255, 0.65);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.movie-card {
  position: relative;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid rgba(125, 249, 255, 0.25);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 24px rgba(125, 249, 255, 0.05);
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  opacity: 0;
  animation: rise 0.7s ease forwards;
  animation-delay: var(--i, 0s);
}

.movie-card::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -30%;
  width: 60%;
  height: 220%;
  background: linear-gradient(115deg, transparent, rgba(125, 249, 255, 0.14), transparent);
  transform: translateX(-120%) rotate(8deg);
  transition: transform 0.9s ease;
}

.movie-card:hover::before {
  transform: translateX(320%) rotate(8deg);
}

.movie-card:hover {
  transform: translateY(-7px) scale(1.02);
  border-color: var(--neon-gold);
  box-shadow: 0 0 34px rgba(255, 215, 0, 0.35);
}

.movie-card .year {
  display: inline-block;
  font-style: italic;
  font-size: 0.82rem;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  border: 1px solid rgba(125, 249, 255, 0.5);
  border-radius: 20px;
  padding: 2px 12px;
  margin-bottom: 10px;
}

.movie-card h3 {
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.22rem;
  color: #fff;
  text-shadow: 0 0 14px rgba(181, 123, 255, 0.5);
  line-height: 1.3;
}

.movie-card .role {
  margin-top: 6px;
  font-style: italic;
  font-size: 0.94rem;
  color: rgba(232, 230, 255, 0.66);
}

.movie-card .desc {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dotted rgba(125, 249, 255, 0.28);
  font-style: italic;
  font-size: 0.93rem;
  line-height: 1.55;
  color: rgba(232, 230, 255, 0.82);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(34px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Cчётчики ---------- */

.counter-note {
  text-align: center;
  margin-top: 34px;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--orbit);
  letter-spacing: 1px;
}

/* ---------- Подвал ---------- */

.site-foot {
  text-align: center;
  margin-top: 46px;
  padding-top: 18px;
  border-top: 1px dashed rgba(125, 249, 255, 0.3);
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(232, 230, 255, 0.55);
  letter-spacing: 2px;
}

/* ---------- Адаптивность ---------- */

@media (max-width: 860px) {
  .planet--one { width: 60px; height: 60px; top: 4%; }
  .planet--two { width: 40px; height: 40px; }
  .planet--ring { width: 34px; height: 34px; }
  .wrapper { padding: 24px 0 56px; }
  .hero { padding: 30px 6px; }
  .hero p { font-size: 1.05rem; }
}

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(ellipse at 30% 10%, rgba(90, 60, 200, 0.3), transparent 55%),
      radial-gradient(ellipse at 80% 90%, rgba(125, 249, 255, 0.12), transparent 50%),
      var(--cosmic-bg);
  }

  .site-head { padding: 18px 0 6px; }
  .main-title { letter-spacing: 0.5px; }
  .main-sub { letter-spacing: 2px; font-size: 0.92rem; }

  /* Навигация — горизонтальная карусель под палец */
  .nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 10px;
    margin: 20px -4px 24px;
    padding: 6px 4px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    flex: 0 0 auto;
    padding: 10px 18px;
    white-space: nowrap;
    scroll-snap-align: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .grid { grid-template-columns: 1fr; gap: 14px; }
  .movie-card { padding: 14px 16px; border-radius: 14px; }
  .movie-card h3 { font-size: 1.12rem; }
  .movie-card:hover { transform: none; }

  .counter-note { font-size: 0.95rem; }
  .site-foot { letter-spacing: 1.2px; font-size: 0.88rem; }
  .jackie-badge { padding: 14px 26px; font-size: 1.25rem; }

  /* Полноэкранные планеты-обои не должны мешать контенту */
  .decade-head h2 { font-size: 1.7rem; }
}

@media (max-width: 380px) {
  .main-title { font-size: 1.7rem; }
  .nav a { padding: 9px 14px; font-size: 0.95rem; }
  .hero p { font-size: 1rem; }
  .constellation { display: none; }
}

/* Отключение анимаций при выборе «уменьшить движение» в системе */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .movie-card { opacity: 1; }
}

/* Поддержка контактов через палец: убираем серое выделение при тапе */
a, button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}