/* =====================================================================
   ПОЭЗИЯ ДЛЯ ДУШИ · Михаил Каргин
   Дизайн-язык: «северная бумага» — светлый, тёплый, литературный.
   Чернила — глубокий сине-графит (озеро с обложки), акцент — латунь
   (берёза, сварочная искра, низкое солнце). Не «дефолтный» вид.
   ===================================================================== */

:root {
  --paper:      #eef1ef;   /* фон — прохладная светлая бумага */
  --paper-warm: #f5f4ee;   /* тёплые панели / карточки */
  --paper-deep: #e4e8e5;   /* приглушённые блоки */
  --ink:        #1b2a32;   /* основной текст — сине-графит */
  --ink-soft:   #4c5c63;   /* второстепенный текст */
  --ink-faint:  #7d8a8e;   /* подписи */
  --accent:     #a96f2e;   /* латунь / охра */
  --accent-deep:#7f521f;   /* тёмная латунь для ховера */
  --steel:      #3f5d69;   /* сталь / вода */
  --line:       rgba(27,42,50,0.14);
  --line-soft:  rgba(27,42,50,0.08);
  --shadow:     28px 40px 80px -50px rgba(20,34,42,0.55);

  --display: "Playfair Display", Georgia, serif;
  --read:    "Spectral", Georgia, serif;
  --ui:      "Golos Text", system-ui, sans-serif;

  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* тонкая бумажная текстура из мягких пятен света */
  background-image:
    radial-gradient(1200px 600px at 82% -10%, rgba(169,111,46,0.05), transparent 60%),
    radial-gradient(900px 700px at -5% 15%, rgba(63,93,105,0.06), transparent 55%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; z-index: 20;
  border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- Шапка ---------- */
.site-head {
  position: sticky; top: 0; z-index: 15;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.head-inner {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 24px; min-height: 74px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 34%, #fff 0 2px, transparent 3px),
    conic-gradient(from 210deg, var(--accent), var(--steel) 55%, var(--ink) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35), 0 3px 8px -3px rgba(20,34,42,0.5);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-title {
  font-family: var(--display); font-weight: 700; font-size: 21px;
  letter-spacing: .3px; color: var(--ink);
}
.brand-author {
  font-family: var(--ui); font-size: 11.5px; letter-spacing: 2.2px;
  text-transform: uppercase; color: var(--accent-deep); margin-top: 2px;
}
.site-nav { display: flex; gap: 8px; }
.site-nav a {
  text-decoration: none; color: var(--ink-soft);
  font-size: 15px; font-weight: 500; padding: 8px 14px; border-radius: 999px;
  transition: color .2s, background .2s;
}
.site-nav a:hover { color: var(--ink); background: rgba(27,42,50,0.05); }
.site-nav a.is-active { color: var(--accent-deep); }
.site-nav .author-link {
  margin-left: 8px; border: 1px solid var(--line); color: var(--ink);
  background: rgba(255,255,255,.28);
}
.site-nav .author-link::before { content: "✦"; margin-right: 7px; color: var(--accent); }
.site-nav .author-link:hover { border-color: rgba(169,111,46,.45); background: rgba(169,111,46,.08); }

/* ---------- Полноэкранный герой главной ---------- */
.hero {
  position: relative; min-height: calc(100svh - 74px); padding: 0;
  display: grid; place-items: center; overflow: hidden;
  background: #183347 url("hero-lake.png") center 48% / cover no-repeat;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(8,22,31,.76) 0%, rgba(10,28,39,.52) 48%, rgba(9,26,36,.22) 100%),
    linear-gradient(0deg, rgba(7,18,26,.56) 0%, transparent 48%, rgba(8,20,29,.22) 100%);
}
.hero-inner {
  position: relative; z-index: 1; width: min(1120px, calc(100% - 48px));
  display: flex; align-items: center; min-height: calc(100svh - 74px);
}
.hero-word { max-width: 850px; padding: 72px 0 96px; }
.hero-eyebrow {
  font-size: 13px; letter-spacing: 3.2px; text-transform: uppercase;
  color: #e7c395; margin: 0 0 22px;
}
.hero h1 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(64px, 10vw, 132px); line-height: 0.78;
  margin: 0; letter-spacing: -2px; color: #fff;
  text-shadow: 0 8px 38px rgba(3,13,20,.3);
}
.hero h1 .soft { color: #f0bd79; font-weight: 700; font-style: italic; }
.hero-sub {
  margin: 34px 0 0; max-width: 50ch;
  font-family: var(--read); font-size: clamp(18px, 2vw, 22px); color: rgba(255,255,255,.84);
}
.hero-action {
  display: inline-flex; align-items: center; gap: 18px; margin-top: 34px;
  padding: 14px 22px; border: 1px solid rgba(255,255,255,.44); border-radius: 999px;
  color: #fff; text-decoration: none; font-weight: 600;
  background: rgba(255,255,255,.09); backdrop-filter: blur(8px);
  transition: transform .25s, background .25s, border-color .25s;
}
.hero-action:hover { transform: translateY(-2px); background: rgba(255,255,255,.18); border-color: #fff; }
.hero-action span { color: #f0bd79; font-size: 20px; }

/* ---------- Разделитель-эпиграф ---------- */
.epigraph {
  margin: 64px 0; text-align: center;
  font-family: var(--read); font-style: italic; font-size: 22px; color: var(--steel);
}
.epigraph::before, .epigraph::after { content: "· · ·"; display: block; color: var(--accent);
  letter-spacing: 6px; font-style: normal; font-size: 14px; margin: 12px 0; }

/* ---------- Секции ---------- */
.section { padding: 48px 0 72px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; margin-bottom: 34px; border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.section-head h2 {
  font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 38px);
  margin: 0; color: var(--ink);
}
.section-head .count { font-size: 14px; color: var(--ink-faint); letter-spacing: .3px; }

/* ---------- Полка сборников (сигнатурный элемент) ---------- */
.shelf {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 40px 34px;
}
.shelf-single { grid-template-columns: minmax(280px, 390px); justify-content: center; }
.book { text-decoration: none; color: inherit; display: block; }
.book-cover {
  position: relative; aspect-ratio: auto; min-height: 0; border-radius: 4px 7px 7px 4px;
  overflow: hidden; background: var(--paper-deep);
  box-shadow:
    -6px 0 0 -3px rgba(255,255,255,0.5) inset,   /* блик у корешка */
    16px 26px 44px -26px rgba(20,34,42,0.6);
  transform: perspective(1200px) rotateY(-6deg) translateZ(0);
  transform-origin: left center;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s;
}
.book-cover.no-image { aspect-ratio: 1000 / 1413; }
.book-cover img { width: 100%; height: auto; object-fit: contain; }
.book-cover .spine {
  position: absolute; top: 0; bottom: 0; left: 0; width: 9px;
  background: linear-gradient(90deg, rgba(0,0,0,0.28), rgba(0,0,0,0));
}
.book-cover .glare {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,0.22), transparent 40%);
  opacity: .5; transition: opacity .5s;
}
.book:hover .book-cover {
  transform: perspective(1200px) rotateY(-1.5deg) rotateX(1deg) translateY(-12px) scale(1.025);
  box-shadow:
    -6px 0 0 -3px rgba(255,255,255,0.5) inset,
    24px 36px 60px -28px rgba(20,34,42,0.7);
}
.book:hover .book-cover .glare { opacity: .8; }
.book:focus-visible .book-cover { outline: 3px solid var(--accent); outline-offset: 4px; }
.book-meta { margin-top: 18px; }
.shelf-single .book-meta { text-align: center; }
.book-title {
  font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.15;
  color: var(--ink); margin: 0;
}
.book-count {
  font-size: 13px; color: var(--accent-deep); letter-spacing: .4px; margin-top: 6px;
}
.book-desc {
  font-family: var(--read); font-size: 15.5px; color: var(--ink-soft);
  margin-top: 8px; line-height: 1.5;
}
.book-open {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 12px;
  color: var(--accent-deep); font-size: 14px; font-weight: 600;
  border-bottom: 1px solid rgba(169,111,46,.4);
  transition: color .2s, border-color .2s;
}
.book:hover .book-open { color: var(--ink); border-color: var(--ink); }

/* пустая полка */
.empty {
  border: 1px dashed var(--line); border-radius: 12px; padding: 48px 28px;
  text-align: center; color: var(--ink-soft); font-family: var(--read); font-size: 18px;
}

/* ---------- Стих дня ---------- */
.daily {
  background: var(--paper-warm); border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 40px clamp(24px, 5vw, 56px);
  position: relative; overflow: hidden;
}
.daily::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(var(--accent), var(--steel));
}
.daily .kicker {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent-deep); margin: 0 0 14px;
}
.daily h3 {
  font-family: var(--display); font-weight: 700; font-size: clamp(24px, 4vw, 34px);
  margin: 0 0 20px;
}
.daily .lines {
  font-family: var(--read); font-size: 19px; line-height: 1.75; color: var(--ink);
  white-space: pre-wrap;
}
.daily .more {
  display: inline-block; margin-top: 22px; font-weight: 500; color: var(--accent-deep);
  text-decoration: none; border-bottom: 1px solid var(--accent);
}
.daily .more:hover { color: var(--ink); }

/* ---------- Обложка страницы сборника ---------- */
.coll-hero { padding: 44px 0 20px; }
.coll-hero-inner { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: end; }
.coll-hero-cover img { border-radius: 5px; box-shadow: var(--shadow); }
.coll-hero-word .back {
  display: inline-block; font-size: 14px; color: var(--ink-soft);
  text-decoration: none; margin-bottom: 18px;
}
.coll-hero-word .back:hover { color: var(--accent-deep); }
.coll-hero-word h1 {
  font-family: var(--display); font-weight: 900; font-size: clamp(36px, 6vw, 60px);
  line-height: 1.0; margin: 0 0 18px;
}
.coll-hero-word .lead {
  font-family: var(--read); font-size: 19px; color: var(--ink-soft); max-width: 52ch;
}
.coll-hero-word .count-badge {
  margin-top: 20px; display: inline-block; font-size: 13px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent-deep);
}

/* ---------- Оглавление сборника ---------- */
.toc { margin: 40px 0 80px; }
.toc-item {
  display: grid; grid-template-columns: 46px 1fr auto; align-items: baseline;
  gap: 18px; padding: 18px 8px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--line-soft); transition: background .2s;
}
.toc-item:hover { background: rgba(169,111,46,0.06); }
.toc-item:first-child { border-top: 1px solid var(--line); }
.toc-num { font-family: var(--display); color: var(--accent); font-size: 18px; }
.toc-body .t {
  font-family: var(--display); font-weight: 500; font-size: 21px; color: var(--ink);
}
.toc-body .ex {
  font-family: var(--read); font-size: 15px; color: var(--ink-faint); margin-top: 3px;
}
.toc-date { font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ---------- Страница чтения стиха ---------- */
.reader { padding: 48px 0 96px; }
.reader-inner { max-width: 640px; margin: 0 auto; }
.reader .back {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px;
  color: var(--ink-soft); text-decoration: none; margin-bottom: 34px;
}
.reader .back:hover { color: var(--accent-deep); }
.reader .back::before { content: "←"; color: var(--accent); }
.poem-head { margin-bottom: 34px; }
.poem-head h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(32px, 5vw, 46px);
  line-height: 1.08; margin: 0; color: var(--ink);
}
.poem-head .meta {
  margin-top: 12px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-faint);
}
.poem-head .meta a { color: var(--accent-deep); text-decoration: none; }
.poem-body {
  font-family: var(--read); font-size: 21px; line-height: 1.82; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
  padding-left: 26px; border-left: 2px solid var(--accent);
}
.poem-nav {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 56px;
  padding-top: 24px; border-top: 1px solid var(--line);
}
.poem-nav a {
  text-decoration: none; color: var(--ink-soft); font-size: 15px; max-width: 45%;
}
.poem-nav a:hover { color: var(--accent-deep); }
.poem-nav .lbl {
  display: block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 4px;
}
.poem-nav .n-next { text-align: right; margin-left: auto; }

/* ---------- Поиск ---------- */
.search-head { padding: 48px 0 8px; }
.search-head h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5vw, 44px); margin: 0 0 24px;
}
.search-form { display: flex; gap: 12px; max-width: 620px; }
.search-form input {
  flex: 1; font-family: var(--read); font-size: 18px; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper-warm);
  color: var(--ink);
}
.search-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.search-form button {
  font-family: var(--ui); font-weight: 600; font-size: 16px; padding: 0 24px;
  border: none; border-radius: 10px; background: var(--ink); color: #fff; cursor: pointer;
}
.search-form button:hover { background: var(--accent-deep); }
.search-results { margin: 40px 0 90px; }
.search-note { color: var(--ink-soft); font-family: var(--read); font-size: 18px; }
.result {
  display: block; text-decoration: none; color: inherit; padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
}
.result:hover .r-title { color: var(--accent-deep); }
.result .r-title { font-family: var(--display); font-weight: 500; font-size: 22px; }
.result .r-coll { font-size: 13px; color: var(--accent-deep); letter-spacing: .5px; margin-top: 2px; }
.result .r-ex { font-family: var(--read); color: var(--ink-soft); margin-top: 6px; }
mark { background: rgba(169,111,46,0.24); color: inherit; padding: 0 2px; border-radius: 3px; }

/* ---------- Подвал ---------- */
.site-foot {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 40px 0;
}
.foot-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
}
.foot-title { font-family: var(--display); font-weight: 700; font-size: 18px; }
.foot-meta { color: var(--ink-faint); font-size: 14px; }
.foot-admin {
  margin-left: auto; font-size: 13px; color: var(--ink-faint); text-decoration: none;
  border-bottom: 1px solid transparent;
}
.foot-admin:hover { color: var(--accent-deep); border-color: var(--accent); }

/* ---------- Появление при скролле ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
  .hero { background-position: 60% center; }
  .coll-hero-inner { grid-template-columns: 200px 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-nav a { padding: 8px 10px; font-size: 14px; }
  .site-nav { gap: 1px; }
  .site-nav .author-link { margin-left: 2px; }
  .site-nav .author-link::before { display: none; }
  .head-inner { justify-content: center; min-height: 64px; }
  .hero { min-height: calc(100svh - 64px); background-position: 67% center; }
  .hero-inner { width: min(100% - 36px, 1120px); min-height: calc(100svh - 64px); }
  .hero-word { padding: 56px 0 74px; }
  .hero h1 { font-size: clamp(54px, 18vw, 82px); line-height: .84; letter-spacing: -1px; }
  .hero-sub { font-size: 17px; }
  .coll-hero-inner { grid-template-columns: 1fr; }
  .coll-hero-cover { max-width: 200px; }
  .poem-body { font-size: 19px; padding-left: 18px; }
  .toc-item { grid-template-columns: 32px 1fr; }
  .toc-date { display: none; }
  .search-form { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
