
/* ===== ШРИФТЫ ===== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* ===== ПЕРЕМЕННЫЕ ЦВЕТОВ ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #ec4899;
  --accent: #14b8a6;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* ===== БАЗОВЫЕ СТИЛИ ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  color: var(--text-main);
  padding: 2rem 1rem;
  line-height: 1.6;
}

/* ===== НАВИГАЦИЯ ===== */
nav {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.25rem 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-gradient);
  border-radius: 16px 16px 0 0;
}

nav a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

nav a:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

/* ===== СЕТКА КАРТОЧЕК ===== */
.cart {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

/* ===== КАРТОЧКА АВТОРА ===== */
.cidug {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cidug::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--bg-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cidug:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--primary);
}

.cidug:hover::before {
  opacity: 1;
}

/* ===== ИЗОБРАЖЕНИЕ ===== */
.cidug img {
  width: 110px;
  height: 110px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid transparent;
  background: linear-gradient(white, white) padding-box,
              var(--bg-gradient) border-box;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cidug:hover img {
  transform: scale(1.08) rotate(1deg);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.25);
}

/* ===== КОНТЕНТ КАРТОЧКИ ===== */
.cidug .xowafi-content {
  flex: 1;
  min-width: 0;
}

.cidug h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
}

.cidug h3 a {
  color: var(--text-main);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
  position: relative;
}

.cidug h3 a::after {
  content: '→';
  position: absolute;
  right: -1.2rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.2s ease;
  color: var(--primary);
}

.cidug h3 a:hover {
  color: var(--primary-dark);
}

.cidug h3 a:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* ===== БАДЖ/ТЕГ (опционально) ===== */
.cidug .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(147, 51, 234, 0.1));
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  margin-top: 0.5rem;
}

/* ===== ФУТЕР ===== */
footer {
  margin-top: 4.5rem;
  padding: 2.5rem 1rem 3rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
}

footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  text-decoration: underline;
}

/* ===== АНИМАЦИИ ===== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cidug {
  animation: slideIn 0.5s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.1s);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.75rem;
  }
  
  nav {
    padding: 1rem 1.25rem;
    flex-direction: column;
    text-align: center;
  }
  
  .cart {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .cidug {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }
  
  .cidug img {
    width: 130px;
    height: 130px;
    margin: 0 auto;
  }
  
  .cidug h3 {
    font-size: 1.1rem;
  }
  
  .cidug h3 a::after {
    display: none;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .cart {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== ТЁМНАЯ ТЕМА ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --bg-gradient: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  }
  
  body {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  }
  
  nav, .cidug {
    background: #1e293b;
  }
  
  footer {
    background: rgba(30, 41, 59, 0.6);
  }
}

/* ===== ДОСТУПНОСТЬ ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.cidug:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
