@font-face {
  font-family: 'Cormorant Garamond';
  src: local('Cormorant Garamond');
}

:root {
  --bg: oklch(0.16 0.012 60);
  --panel-bg: oklch(0.20 0.012 60);
  --ink: oklch(0.94 0.012 80);
  --ink-dim: oklch(0.68 0.015 80);
  --hairline: oklch(1 0 0 / 0.12);
  --glow: oklch(0.3 0.03 60 / 0.35);
  --accent: oklch(0.74 0.10 80);
}

* { box-sizing: border-box; }

/* плавный прокрут при переходе по якорным ссылкам (#about, #news, #books и т.д.) */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px; /* высота fixed-навбара, чтобы секция не пряталась под ним */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: inherit !important; }

/* NAV */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 64px;
  mix-blend-mode: difference;
}
.nav-name {
  font-size: 24px;
  letter-spacing: 0.08em;
}
.nav-links {
  display: flex;
  gap: 36px;
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav-links a {
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; }

/* HERO */
.hero {
  min-height: 46vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 64px;
  position: relative;
  border-bottom: 1px solid var(--hairline);
}
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 30%, var(--glow), transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  font-size: 16px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  z-index: 1;
}
.hero-name {
  font-weight: 500;
  font-size: clamp(52px, 6.5vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  z-index: 1;
}
.hero-tagline {
  font-style: italic;
  font-size: clamp(22px, 2.2vw, 30px);
  color: var(--ink-dim);
  margin-top: 24px;
  max-width: 640px;
  z-index: 1;
}

/* ABOUT */
.about {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 96px;
  align-items: center;
  padding: 160px 64px;
  max-width: 1280px;
  margin: 0 auto;
  border-bottom: 1px solid var(--hairline);
}
.about-photo {
  aspect-ratio: 3/4;
  position: relative;
  border: 1px solid var(--hairline);
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eyebrow {
  font-size: 16px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.about-headline {
  font-size: clamp(34px, 3.4vw, 50px);
  line-height: 1.25;
  font-weight: 500;
  margin-bottom: 28px;
}
.about-body {
  font-size: 21px;
  line-height: 1.8;
  color: var(--ink-dim);
  font-weight: 300;
  max-width: 52ch;
  white-space: pre-line;
}

/* BOOKS */
.books-section {
  padding: 120px 64px 40px;
  max-width: 1280px;
  margin: 0 auto;
}
.books-heading {
  text-align: center;
  margin-bottom: 100px;
}
.books-heading h2 {
  font-size: clamp(40px, 4.4vw, 62px);
  font-weight: 500;
  margin: 0;
}
.book-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 80px 0;
  border-bottom: 1px solid var(--hairline);
}
.book-row.reverse .book-cover { order: 2; }
.book-row.reverse .book-text { order: 1; }
.book-cover {
  aspect-ratio: 2/3;
  position: relative;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.6);
  border: 1px solid var(--hairline);
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.book-status {
  font-size: 16px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
/* необязательные плашки под статусом книги (напр. "Бестселлер", "Новинка", "18+") */
.book-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 20px;
}
.book-flag {
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  background: var(--accent);
  color: var(--bg);
  font-size: 15px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.book-title {
  font-size: clamp(42px, 4.4vw, 64px);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0 0 28px;
}
.book-annotation {
  font-size: 21px;
  line-height: 1.8;
  color: var(--ink-dim);
  font-weight: 300;
  max-width: 50ch;
  margin-bottom: 36px;
  font-style: italic;
  white-space: pre-line;
}
.book-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.book-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border: 1px solid var(--accent);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
}
.book-links a:hover {
  background: var(--accent);
  color: var(--bg);
}

/* NEWS */
.news-section {
  padding: 120px 64px;
  max-width: 1280px;
  margin: 0 auto;
  border-bottom: 1px solid var(--hairline);
}
.news-heading {
  text-align: center;
  margin-bottom: 80px;
}
.news-heading h2 {
  font-size: clamp(40px, 4.4vw, 62px);
  font-weight: 500;
  margin: 0;
}

.news-slider {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
}
.news-viewport {
  flex: 1;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.news-viewport::-webkit-scrollbar { display: none; }

.news-track {
  display: flex;
  gap: 32px;
}

.news-arrow {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.news-arrow:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.news-card {
  scroll-snap-align: start;
  flex: 0 0 640px;
  display: flex;
  flex-direction: row; /* горизонтальная карточка: обложка + текст рядом */
  border: 1px solid var(--hairline);
  background: var(--panel-bg);
}
.news-card-media {
  position: relative;
  display: block;
  flex: 0 0 42%;
  overflow: hidden;
  text-decoration: none;
  border-right: 1px solid var(--hairline);
}
.news-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; /* всегда центр по верхнему краю картинки */
  display: block;
  position: relative;
  z-index: 0;
}

.news-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 6px 14px;
  background: var(--accent);
  color: var(--bg);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.news-card-body {
  padding: 28px 30px 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.news-card-date {
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.news-card-title-link { text-decoration: none; }
.news-card-title {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 14px;
  transition: color 0.2s;
}
.news-card-title-link:hover .news-card-title { color: var(--accent); }
.news-card-excerpt {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-dim);
  font-weight: 300;
  margin: 0 0 24px;
  flex: 1;
}
.news-card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.news-card-open {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-dim);
  transition: color 0.2s;
}
.news-card-open:hover { color: var(--accent); }

.news-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 36px;
}
.news-dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink-dim);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.news-dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

/* NEWS POPUP — ПК: 50% ширины, обложка справа. Моб.: 100% ширины, обложка сверху в затемнении. */
.news-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.05 0.01 60 / 0.86);
  backdrop-filter: blur(6px);
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.news-popup-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}

/* эффект появления попапа: лёгкий подъём + масштаб */
.news-popup {
  position: relative;
  width: 50%;
  max-width: 980px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid var(--hairline);
  transform: translateY(28px) scale(0.97);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.news-popup-overlay.active .news-popup {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.news-popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  background: var(--bg);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.news-popup-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.news-popup-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas: "content cover";
  min-height: 100%;
}
.news-popup-cover {
  grid-area: cover;
  position: relative;
  min-height: 320px;
}
.news-popup-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}
.news-popup-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, oklch(0.05 0.01 60 / 0.05), oklch(0.05 0.01 60 / 0.55));
}
.news-popup-content {
  grid-area: content;
  padding: 56px 48px;
}
.news-popup-date {
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.news-popup-title {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 24px;
}
.news-popup-text {
  font-size: 19px;
  line-height: 1.8;
  color: var(--ink-dim);
  font-weight: 300;
}
.news-popup-text p { margin: 0 0 20px; }
.news-popup-full-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
}
.news-popup-full-link:hover { color: var(--accent); }

/* LINKS / RESOURCES */
.resources {
  padding: 140px 64px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  border-bottom: 1px solid var(--hairline);
}
.resources h2 {
  font-size: clamp(36px, 3.8vw, 52px);
  font-weight: 500;
  margin: 0 0 56px;
}
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--hairline);
}
.resource-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 26px 8px;
  border-top: 1px solid var(--hairline);
  text-decoration: none;
  font-size: 32px;
  transition: color 0.2s;
}
.resource-list a:first-child { border-top: none; }
.resource-list a:hover { color: var(--accent); }
.resource-hint {
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* CONTACT */
.contact {
  padding: 160px 64px 100px;
  text-align: center;
}
.contact-email {
  display: inline-block;
  font-size: clamp(34px, 4.4vw, 60px);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 10px;
  transition: color 0.2s, border-color 0.2s;
}
.contact-email:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.footer-copy {
  margin-top: 80px;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

/* MOBILE */
@media (max-width: 768px) {
  .nav {
    padding: 20px 24px;
  }
  .nav-name {
    font-size: 18px;
  }
  .nav-links {
    gap: 18px;
    font-size: 12px;
  }

  .hero {
    min-height: auto;
    padding: 120px 20px 48px;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 100px 24px;
  }
  .about-photo {
    max-width: 320px;
    margin: 0 auto;
  }

  .books-section {
    padding: 80px 24px 24px;
  }
  .books-heading {
    margin-bottom: 60px;
  }
  .book-row,
  .book-row.reverse {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 48px 0;
  }
  .book-row .book-cover,
  .book-row.reverse .book-cover {
    order: 1;
    max-width: 280px;
    margin: 0 auto;
  }
  .book-row .book-text,
  .book-row.reverse .book-text {
    order: 2;
  }
  .book-annotation,
  .book-title {
    max-width: 100%;
  }

  .resources {
    padding: 80px 24px;
  }
  .resource-list a {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 20px 4px;
    font-size: 24px;
  }

  .contact {
    padding: 100px 24px 60px;
  }

  /* NEWS — mobile */
  .news-section {
    padding: 80px 24px;
  }
  .news-heading {
    margin-bottom: 48px;
  }
  .news-arrow {
    display: none; /* на мобилках листают пальцем, стрелки не нужны */
  }
  .news-track {
    gap: 20px;
  }
  .news-card {
    flex-basis: 90vw;
  }
  .news-card-media {
    display: none; /* без обложки карточка компактнее и ниже */
  }
  .news-card-body {
    padding: 20px 20px 22px;
  }
  .news-card-title {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }
  .news-card-excerpt {
    font-size: 16px;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }

  /* NEWS POPUP — mobile: 100% ширины, обложка сверху (шапка) в затемнении */
  .news-popup-overlay {
    padding: 0;
  }
  .news-popup {
    width: 100%;
    max-width: none;
    max-height: 100vh;
    height: 100%;
  }
  .news-popup-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "cover"
      "content";
  }
  .news-popup-cover {
    min-height: 220px;
  }
  .news-popup-content {
    padding: 32px 24px 48px;
  }
}

@media (max-width: 480px) {
  .nav {
    padding: 16px 16px;
  }
  .nav-links {
    gap: 12px;
    font-size: 10px;
  }

  .hero {
    padding: 100px 16px 40px;
  }

  .about,
  .books-section,
  .resources,
  .contact {
    padding-left: 16px;
    padding-right: 16px;
  }

  .about-body,
  .book-annotation {
    font-size: 18px;
  }

  .news-card {
    flex-basis: 92vw;
  }
  .news-card-body {
    padding: 18px 16px 22px;
  }
  .news-popup-content {
    padding: 28px 18px 40px;
  }
  .news-popup-title {
    font-size: 26px;
  }
}

/* ============================================================
   READER PAGES (check.html, pyanenkaya.html)
   Отдельная светлая "читательская" тема — своя палитра
   (--reader-*), не пересекается с тёмной темой сайта.
   ============================================================ */
:root {
  --reader-bg: #f6f1e6;
  --reader-ink: #2b2620;
  --reader-ink-dim: #6f6555;
  --reader-hairline: #ddd3bd;
  --reader-accent: #9c7a3c;
}

body.reader-page {
  margin: 0;
  background: var(--reader-bg);
  color: var(--reader-ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
}
.reader-page a { color: var(--reader-accent) !important; }
.reader-page ::selection { background: var(--reader-accent); color: var(--reader-bg); }

/* хлебные крошки */
.crumbs {
  max-width: 700px;
  margin: 0 auto;
  padding: 28px 24px 0;
  font-size: 15px;
  letter-spacing: 0.03em;
  color: var(--reader-ink-dim);
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { margin: 0 8px; color: var(--reader-hairline); }
.crumbs .current { color: var(--reader-ink); }

/* шапка: автор + заголовок */
.reader-head {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  text-align: center;
  border-bottom: 1px solid var(--reader-hairline);
}
.reader-author {
  font-size: 16px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--reader-accent);
  margin-bottom: 14px;
}
.reader-title {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}
.reader-kind {
  margin-top: 10px;
  font-size: 16px;
  font-style: italic;
  color: var(--reader-ink-dim);
}
.reader-age {
  display: inline-block;
  margin-top: 16px;
  padding: 3px 10px;
  border: 1px solid var(--reader-accent);
  color: var(--reader-accent);
  font-size: 13px;
  letter-spacing: 0.1em;
}
.reader-epigraph {
  max-width: 520px;
  margin: 24px auto 0;
  font-size: 18px;
  font-style: italic;
  line-height: 1.7;
  color: var(--reader-ink-dim);
}
.reader-legal {
  max-width: 560px;
  margin: 22px auto 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--reader-ink-dim);
  opacity: 0.8;
}
.reader-legal p { margin: 0 0 6px; }

/* текст */
.reader-text {
  max-width: 700px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  font-size: 21px;
  line-height: 1.85;
}
.reader-text p { margin: 0 0 20px; }
.reader-text p.scene-break {
  text-align: center;
  margin: 40px 0;
  color: var(--reader-accent);
  letter-spacing: 0.4em;
}

/* подвал */
.reader-footer {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  border-top: 1px solid var(--reader-hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.reader-footer a {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.reader-footer a:hover { text-decoration: underline; }
.reader-copy {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--reader-ink-dim);
}

@media (max-width: 640px) {
  .reader-text { font-size: 19px; padding: 36px 18px 32px; }
  .crumbs { padding: 20px 18px 0; font-size: 13px; }
  .reader-head { padding: 20px 18px 32px; }
  .reader-footer { padding: 24px 18px 56px; }
}
