* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-card: rgba(30, 20, 15, 0.8);
  --border-light: #c45c2f;
  --text-primary: #fce4c8;
  --text-secondary: #e38c42;
  --accent-orange: #e38c42;
  --accent-darkorange: #b04820;
  --shadow-glow: 0 0 30px rgba(227, 140, 66, 0.15);
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1.2);
  --transition-bounce: 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

body {
  background-image: url('images/фон.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-color: #1a100a;
  font-family: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  min-height: 100vh;
  color: #f0e6d2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  position: relative;
  animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { background-color: #1a100a; }
  50% { background-color: #1f1410; }
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 10, 6, 0.7);
  z-index: 0;
  pointer-events: none;
}

body > * {
  position: relative;
  z-index: 1;
}

.page-container {
  max-width: 950px;
  width: 100%;
  background: rgba(15, 9, 6, 0.35);
  padding: 1.5rem 2.5rem;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.8), 
    0 0 0 1px rgba(196, 92, 47, 0.1),
    inset 0 0 80px rgba(227, 140, 66, 0.03);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-radius: 2.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(196, 92, 47, 0.12);
  transition: box-shadow 0.6s ease, border-color 0.6s ease;
}

.page-container:hover {
  border-color: rgba(196, 92, 47, 0.2);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.8), 
    0 0 0 1px rgba(196, 92, 47, 0.15),
    inset 0 0 80px rgba(227, 140, 66, 0.05),
    0 0 40px rgba(227, 140, 66, 0.08);
}

/* Баннер */
.hero-banner-container {
  width: 100%;
  max-width: 950px;
  margin: 0 auto 0.5rem auto;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.7), 
    0 0 0 1px rgba(196, 92, 47, 0.3);
  transition: transform 0.5s var(--transition-smooth), box-shadow 0.5s ease;
  position: relative;
}

.hero-banner-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(252, 228, 200, 0.08), transparent);
  transition: left 0.8s ease;
}

.hero-banner-container:hover::after {
  left: 100%;
}

.hero-banner-container:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.85), 
    0 0 0 2px rgba(227, 140, 66, 0.5),
    0 0 80px rgba(227, 140, 66, 0.15);
}

.hero-banner {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: filter 0.5s ease;
}

.hero-banner-container:hover .hero-banner {
  filter: brightness(1.08) contrast(1.04);
}

/* Навигация */
.space-nav {
  margin-bottom: 0.5rem;
  background: rgba(12, 7, 5, 0.75);
  border-radius: 2.5rem;
  padding: 0.6rem;
  border: 1px solid rgba(196, 92, 47, 0.25);
  box-shadow: 
    0 0 50px rgba(227, 140, 66, 0.06), 
    inset 0 0 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.5s ease, border-color 0.5s ease;
}

.space-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(252, 228, 200, 0.4), transparent),
    radial-gradient(2px 2px at 70% 80%, rgba(252, 228, 200, 0.25), transparent),
    radial-gradient(1px 1px at 90% 10%, rgba(252, 228, 200, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 40% 50%, rgba(252, 228, 200, 0.2), transparent);
  pointer-events: none;
  z-index: 0;
  animation: starsTwinkle 4s ease-in-out infinite;
}

@keyframes starsTwinkle {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.space-nav__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.space-nav__item {
  display: flex;
}

.space-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.4rem;
  text-decoration: none;
  border-radius: 2rem;
  background: rgba(30, 20, 15, 0.35);
  border: 1px solid rgba(196, 92, 47, 0.12);
  transition: all var(--transition-bounce);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 80px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.space-nav__link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(227, 140, 66, 0.08), transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.space-nav__link::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(252, 228, 200, 0.06) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  transform: scale(0.5);
}

.space-nav__link:hover::before {
  opacity: 1;
}

.space-nav__link:hover::after {
  opacity: 1;
  transform: scale(1);
}

.space-nav__link:hover {
  background: rgba(196, 92, 47, 0.2);
  border-color: #e38c42;
  box-shadow: 
    0 0 40px rgba(227, 140, 66, 0.3), 
    0 8px 25px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(227, 140, 66, 0.08);
  transform: translateY(-6px) scale(1.04);
}

.space-nav__link:active {
  transform: translateY(0px) scale(0.97);
  transition: all 0.1s ease;
}

.space-nav__icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e38c42;
  transition: all var(--transition-bounce);
  filter: drop-shadow(0 0 10px rgba(227, 140, 66, 0.5));
  flex-shrink: 0;
}

.space-nav__link:hover .space-nav__icon {
  color: #fce4c8;
  filter: drop-shadow(0 0 20px rgba(252, 228, 200, 0.8));
  transform: scale(1.2) rotate(-6deg);
  animation: iconFloat 0.8s ease-in-out;
}

@keyframes iconFloat {
  0%, 100% { transform: scale(1.2) rotate(-6deg) translateY(0); }
  50% { transform: scale(1.2) rotate(-6deg) translateY(-4px); }
}

.space-nav__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.space-nav__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fce4c8;
  line-height: 1.2;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  font-family: 'Marcellus', serif;
  text-transform: uppercase;
}

.space-nav__link:hover .space-nav__title {
  color: #ffffff;
  text-shadow: 0 0 25px rgba(252, 228, 200, 0.6), 0 0 10px rgba(227, 140, 66, 0.4);
}

.space-nav__item:first-child .space-nav__link {
  animation: navPulse 3.5s ease-in-out infinite;
}

@keyframes navPulse {
  0%, 100% {
    border-color: rgba(196, 92, 47, 0.15);
    box-shadow: 0 0 10px rgba(227, 140, 66, 0.05);
  }
  50% {
    border-color: rgba(227, 140, 66, 0.8);
    box-shadow: 0 0 30px rgba(227, 140, 66, 0.2);
  }
}

/* Дрейфующая частица */
.space-nav__link .floating-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fce4c8;
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 12px 4px rgba(252, 228, 200, 0.6);
  pointer-events: none;
}

.space-nav__link:hover .floating-particle {
  animation: particleDrift 2.5s linear infinite;
}

@keyframes particleDrift {
  0% {
    top: 20%;
    right: 20%;
    opacity: 0.9;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.5);
  }
  100% {
    top: 80%;
    right: 75%;
    opacity: 0;
    transform: scale(1.3);
  }
}

/* Приветственный блок */
.welcome-banner {
  background: linear-gradient(145deg, rgba(30, 20, 15, 0.65), rgba(20, 15, 12, 0.75));
  border-radius: 1.8rem;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border: 1px solid rgba(227, 140, 66, 0.2);
  box-shadow: 
    inset 0 0 40px rgba(227, 140, 66, 0.03), 
    0 8px 30px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(227, 140, 66, 0.06), transparent 70%);
  border-radius: 50%;
  transition: transform 0.6s ease;
}

.welcome-banner:hover::before {
  transform: scale(1.4);
}

.welcome-banner:hover {
  border-color: rgba(227, 140, 66, 0.45);
  box-shadow: 
    inset 0 0 40px rgba(227, 140, 66, 0.08), 
    0 12px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(227, 140, 66, 0.1);
  transform: translateY(-2px);
}

.welcome-text h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #fce4c8;
  font-family: 'Marcellus', serif;
  letter-spacing: 1px;
  text-shadow: 0 0 25px rgba(227, 140, 66, 0.3), 0 0 10px rgba(227, 140, 66, 0.1);
  transition: text-shadow 0.4s ease;
}

.welcome-banner:hover .welcome-text h2 {
  text-shadow: 0 0 35px rgba(227, 140, 66, 0.5), 0 0 15px rgba(227, 140, 66, 0.2);
}

.welcome-text p {
  color: #e38c42;
  margin-top: 0.3rem;
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
}

/* Сетка карточек */
.fanfic-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 0.2rem 0;
}

.fic-card {
  background: linear-gradient(145deg, rgba(25, 18, 14, 0.7), rgba(18, 12, 10, 0.75));
  border-radius: 1.8rem;
  padding: 1.5rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  border: 1px solid rgba(196, 92, 47, 0.12);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.6), 
    inset 0 1px 0 rgba(252, 228, 200, 0.03);
  cursor: pointer;
  transition: all var(--transition-bounce);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: relative;
  overflow: hidden;
}

.fic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 60%, rgba(227, 140, 66, 0.04));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.fic-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e38c42, transparent);
  transform: scaleX(0);
  transition: transform 0.5s ease;
}

.fic-card:hover::before {
  opacity: 1;
}

.fic-card:hover::after {
  transform: scaleX(1);
}

.fic-card:hover {
  border-color: #e38c42;
  box-shadow: 
    0 12px 40px rgba(227, 140, 66, 0.2), 
    0 0 0 1px rgba(227, 140, 66, 0.25),
    0 0 60px rgba(227, 140, 66, 0.06);
  transform: translateY(-6px) scale(1.01);
  background: linear-gradient(145deg, rgba(30, 22, 18, 0.75), rgba(20, 14, 12, 0.8));
}

.fic-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fic-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: #fce4c8;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-family: 'Marcellus', serif;
  letter-spacing: 0.3px;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.fic-card:hover .fic-title {
  color: #ffffff;
  text-shadow: 0 0 20px rgba(252, 228, 200, 0.3);
}

.fic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: 0.9rem;
  color: #e38c42;
}

.pairing {
  color: #fce4c8;
  font-weight: 600;
  background: rgba(196, 92, 47, 0.12);
  padding: 0.3rem 1.2rem;
  border-radius: 30px;
  border: 1px solid rgba(196, 92, 47, 0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.4s ease;
  letter-spacing: 0.3px;
}

.fic-card:hover .pairing {
  background: rgba(227, 140, 66, 0.2);
  border-color: rgba(227, 140, 66, 0.4);
  box-shadow: 0 0 25px rgba(227, 140, 66, 0.15);
  transform: scale(1.04);
}

/* Футер */
.footer-note {
  text-align: center;
  color: #c45c2f;
  font-size: 0.85rem;
  margin-top: 0.8rem;
  border-top: 1px solid rgba(196, 92, 47, 0.2);
  padding-top: 1.2rem;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

/* Анимация появления карточек */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardGlow {
  0%, 100% { border-color: rgba(196, 92, 47, 0.12); }
  50% { border-color: rgba(227, 140, 66, 0.25); }
}

.fic-card:first-child {
  animation: cardGlow 4s ease-in-out infinite;
}

/* Адаптив */
@media (max-width: 768px) {
  .page-container {
    padding: 1.2rem;
    border-radius: 1.8rem;
  }
  
  .space-nav__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .space-nav__link {
    padding: 0.8rem 0.3rem;
    border-radius: 1.5rem;
    min-height: 70px;
  }
  
  .space-nav__icon {
    width: 28px;
    height: 28px;
  }
  
  .space-nav__title {
    font-size: 0.7rem;
  }
  
  .welcome-banner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.2rem;
  }
  
  .fic-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.2rem;
  }
  
  .fic-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1rem 0.5rem;
  }
  
  .page-container {
    padding: 1rem;
    border-radius: 1.5rem;
    gap: 1rem;
  }
  
  .hero-banner-container {
    border-radius: 1.5rem;
  }
  
  .space-nav {
    border-radius: 1.8rem;
    padding: 0.4rem;
  }
  
  .space-nav__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
  }
  
  .space-nav__link {
    padding: 0.6rem 0.2rem;
    border-radius: 1.2rem;
    gap: 0.3rem;
    min-height: 60px;
  }
  
  .space-nav__icon {
    width: 22px;
    height: 22px;
  }
  
  .space-nav__title {
    font-size: 0.6rem;
  }
  
  .welcome-text h2 {
    font-size: 1.2rem;
  }
  
  .welcome-text p {
    font-size: 0.85rem;
  }
  
  .fic-card {
    padding: 1rem;
    border-radius: 1.2rem;
  }
  
  .fic-title {
    font-size: 1.1rem;
  }
  
  .fic-meta {
    font-size: 0.8rem;
    gap: 0.8rem;
  }
}

