@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Nunito:ital,wght@0,400;0,600;0,700;0,800;1,400;1,700&family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

:root {
  --yellow:       #FFD93D;
  --yellow-light: #FFF8D6;
  --orange:       #FF6B35;
  --red:          #FF2D5B;
  --green:        #06D6A0;
  --blue:         #118AB2;
  --purple:       #7B2D8B;
  --dark:         #1A1A2E;
  --card-bg:      #FFFFFF;
  --bg:           #F7F5F0;
  --text:         #1A1A2E;
  --text-muted:   #888;
  --border:       #E8E2D9;
  --font-head:    'Russo One', sans-serif;
  --font-display: 'Playfair Display', serif;
  --font-body:    'Nunito', sans-serif;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 12px rgba(0,0,0,.07);
  --shadow-hover: 0 8px 32px rgba(0,0,0,.13);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); min-height: 100vh; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ===== ХЕДЕР ===== */
.site-header {
  background: var(--dark);
  border-bottom: 3px solid var(--yellow);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 20px; height: 60px;
  display: flex; align-items: center; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 38px; height: 38px; background: var(--yellow);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex-shrink: 0;
}
.logo-name { font-family: var(--font-head); font-size: 17px; color: #fff; }
.logo-tagline { font-size: 10px; color: rgba(255,255,255,.4); font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.header-nav { margin-left: auto; display: flex; gap: 2px; }
.header-nav a {
  color: rgba(255,255,255,.65); font-weight: 700; font-size: 13px;
  padding: 7px 14px; border-radius: 8px; transition: all .2s;
}
.header-nav a:hover { background: rgba(255,255,255,.1); color: var(--yellow); }

/* ===== УЗКИЙ ГЕРОЙ ===== */
.site-hero {
  background: var(--dark);
  padding: 28px 20px 24px;
  text-align: center;
}
.site-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(20px, 3vw, 28px);
  color: #fff; margin-bottom: 6px;
}
.site-hero h1 span { color: var(--yellow); }
.site-hero p { font-size: 14px; color: rgba(255,255,255,.5); }
.hero-stats {
  display: flex; justify-content: center; gap: 28px;
  margin-top: 16px; flex-wrap: wrap;
}
.hero-stat strong { display: block; font-family: var(--font-head); font-size: 22px; color: var(--yellow); }
.hero-stat span { font-size: 11px; color: rgba(255,255,255,.4); font-weight: 700; }

/* ===== КОНТЕЙНЕР ===== */
.site-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 20px 60px; }

/* ===== СЕТКА КАРТОЧЕК (КАК ДЗЕН) ===== */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media(max-width: 900px) { .stories-grid { grid-template-columns: repeat(2, 1fr); } }
@media(max-width: 560px) { .stories-grid { grid-template-columns: 1fr; } }

/* ===== КАРТОЧКА ===== */
.story-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow .25s, transform .25s;
  display: flex; flex-direction: column;
  cursor: pointer;
}
.story-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

/* Обложка с зумом при наведении */
.story-card-cover {
  overflow: hidden;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--yellow-light), #FFE0D3);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  flex-shrink: 0;
}
.story-card-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.story-card:hover .story-card-cover img { transform: scale(1.06); }

.story-card-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }

.story-card-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.story-card-date { font-size: 11px; color: var(--text-muted); font-weight: 700; }
.story-card-read-time { font-size: 11px; color: var(--text-muted); }

.story-card-model {
  font-size: 10px; padding: 2px 7px; border-radius: 100px; font-weight: 800;
}
.model-claude { background: #f0e6ff; color: var(--purple); }
.model-gemini { background: #e6f4ff; color: var(--blue); }

.story-card-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  color: var(--text); line-height: 1.4;
  margin-bottom: 8px; flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story-card:hover .story-card-title { color: var(--orange); }

.story-card-excerpt {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.6; margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card-footer {
  display: flex; align-items: center;
  justify-content: space-between; margin-top: auto;
}
.story-read-btn {
  font-size: 12px; font-weight: 800; color: var(--orange);
  display: flex; align-items: center; gap: 4px;
  transition: gap .2s;
}
.story-card:hover .story-read-btn { gap: 8px; }
.story-views { font-size: 11px; color: var(--text-muted); font-weight: 700; }

/* ===== БОЛЬШАЯ КАРТОЧКА (первая история) ===== */
.story-card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow .25s, transform .25s;
  cursor: pointer;
}
.story-card-featured:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
@media(max-width:700px) { .story-card-featured { grid-template-columns: 1fr; } }

.story-card-featured .story-card-cover {
  aspect-ratio: unset; min-height: 240px;
}
.story-card-featured .story-card-body { padding: 24px 28px; justify-content: center; }
.story-card-featured .story-card-title {
  font-size: 20px; -webkit-line-clamp: 4;
  margin-bottom: 10px;
}
.story-card-featured .story-card-excerpt { -webkit-line-clamp: 3; font-size: 14px; }

.featured-label {
  display: inline-block; background: var(--yellow);
  color: var(--dark); font-weight: 800; font-size: 10px;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 100px; margin-bottom: 10px;
}

/* ===== ЗАГОЛОВОК СЕКЦИИ ===== */
.section-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section-title { font-family: var(--font-head); font-size: 18px; color: var(--dark); }
.section-count { font-size: 13px; color: var(--text-muted); font-weight: 700; margin-left: auto; }

/* ===== ПАГИНАЦИЯ ===== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.page-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  border: 2px solid var(--border); background: var(--card-bg);
  color: var(--text); transition: all .2s; cursor: pointer;
  text-decoration: none;
}
.page-btn:hover, .page-btn.active { background: var(--yellow); border-color: var(--yellow); color: var(--dark); }

/* ===== ПУСТО ===== */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state .emoji { font-size: 64px; margin-bottom: 16px; }
.empty-state h2 { font-family: var(--font-head); font-size: 24px; margin-bottom: 10px; }
.empty-state p { color: var(--text-muted); font-size: 15px; margin-bottom: 24px; }

/* ===== ОДИНОЧНАЯ ИСТОРИЯ ===== */
.story-page { max-width: 780px; margin: 0 auto; padding: 40px 20px 80px; }
.story-cover-wrap { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; box-shadow: var(--shadow-hover); }
.story-cover-wrap img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.story-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.story-title { font-family: var(--font-display); font-size: clamp(22px, 4vw, 36px); font-weight: 700; font-style: italic; line-height: 1.3; margin-bottom: 28px; }
.story-content { font-size: 17px; line-height: 1.9; color: var(--text); }
.story-content p { margin-bottom: 20px; }

/* ===== RSS ===== */
.rss-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; color: var(--orange);
  border: 2px solid var(--orange); border-radius: 8px;
  padding: 5px 12px; transition: all .2s;
}
.rss-btn:hover { background: var(--orange); color: #fff; }

/* ===== ФУТЕР ===== */
.site-footer {
  background: var(--dark); color: rgba(255,255,255,.4);
  text-align: center; padding: 28px 20px; font-size: 13px;
}
.site-footer a { color: var(--yellow); font-weight: 700; }

/* ===== АНИМАЦИЯ ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.story-card, .story-card-featured { animation: fadeUp .35s ease both; }
.story-card:nth-child(2) { animation-delay: .05s; }
.story-card:nth-child(3) { animation-delay: .10s; }
.story-card:nth-child(4) { animation-delay: .15s; }
.story-card:nth-child(5) { animation-delay: .20s; }
.story-card:nth-child(6) { animation-delay: .25s; }

/* ===== ФЛЭШ ===== */
.flash { padding: 12px 18px; border-radius: 8px; font-weight: 700; margin-bottom: 16px; }
.flash-success { background: #d4f5eb; color: #0a6b4a; }
.flash-error   { background: #ffe0e6; color: #c0132e; }
.flash-info    { background: #e6f0ff; color: #1a4a8a; }

@media(max-width:768px) { .header-nav { display: none; } .site-hero { padding: 20px 16px 18px; } }
