/* ====== Палитра и базовые токены ====== */
:root {
  --bg-deep:       #07091a;
  --bg-mid:        #0d1230;
  --bg-soft:       #161b3d;
  --panel:         rgba(22, 27, 61, 0.55);
  --panel-strong:  rgba(13, 18, 48, 0.85);

  --gold:          #e9c46a;
  --gold-bright:   #ffd97a;
  --gold-deep:     #b8862f;
  --gold-soft:     rgba(233, 196, 106, 0.18);

  --violet:        #6b46c1;
  --violet-soft:   rgba(107, 70, 193, 0.25);

  --text:          #e8e6f5;
  --text-soft:     #b4b0d2;
  --text-mute:     #7e7ba2;

  --serif:   "Cormorant Garamond", "EB Garamond", "Garamond", "Old Standard TT", Georgia, serif;
  --serif-2: "Old Standard TT", "Cormorant Garamond", "EB Garamond", "Garamond", Georgia, serif;
  --sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --container: 1180px;
  --radius-lg: 22px;
  --radius-md: 14px;

  --shadow-card: 0 30px 60px -20px rgba(0, 0, 0, 0.55), 0 12px 24px -12px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 0 0 1px rgba(233, 196, 106, 0.35), 0 24px 60px -28px rgba(233, 196, 106, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at top, #1d214a 0%, var(--bg-deep) 55%, #03040c 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--gold); text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--gold-bright); }

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--gold); color: var(--bg-deep); }

/* ====== Космический фон со звёздами ====== */
.cosmos-bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  overflow: hidden;
}
.stars {
  position: absolute;
  inset: -50px;
  background-repeat: repeat;
  opacity: .55;
}
.stars-1 {
  background-image:
    radial-gradient(1px 1px at 25% 10%, #fff, transparent),
    radial-gradient(1px 1px at 70% 30%, #fff, transparent),
    radial-gradient(1px 1px at 40% 60%, #fff, transparent),
    radial-gradient(1px 1px at 90% 80%, #fff, transparent),
    radial-gradient(1px 1px at 10% 90%, #fff, transparent),
    radial-gradient(1px 1px at 55% 45%, #fff, transparent);
  background-size: 500px 500px;
  animation: drift 220s linear infinite;
}
.stars-2 {
  background-image:
    radial-gradient(1.5px 1.5px at 15% 20%, #f6e2a8, transparent),
    radial-gradient(1.5px 1.5px at 65% 70%, #c9b6f5, transparent),
    radial-gradient(1.5px 1.5px at 35% 85%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 80% 15%, #ffd97a, transparent);
  background-size: 800px 800px;
  animation: drift 360s linear infinite reverse;
  opacity: .6;
}
.stars-3 {
  background-image:
    radial-gradient(2px 2px at 50% 20%, #fff7e0, transparent),
    radial-gradient(2px 2px at 20% 70%, #fff, transparent);
  background-size: 1200px 1200px;
  animation: twinkle 5s ease-in-out infinite alternate;
}
.nebula {
  position: absolute;
  width: 70vw; height: 70vw;
  top: -25vw; right: -15vw;
  background: radial-gradient(circle, rgba(107, 70, 193, 0.18), transparent 65%);
  filter: blur(40px);
}
.nebula::after {
  content: "";
  position: absolute;
  width: 80vw; height: 80vw;
  bottom: -110vw; left: -40vw;
  background: radial-gradient(circle, rgba(233, 196, 106, 0.10), transparent 60%);
  filter: blur(60px);
}
@keyframes drift {
  from { transform: translateY(0); }
  to   { transform: translateY(-500px); }
}
@keyframes twinkle {
  from { opacity: .35; }
  to   { opacity: .85; }
}

/* ====== Контейнер и заголовки ====== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--gold);
  margin: 0 0 18px;
}
.eyebrow.center { text-align: center; }

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.section-title.center { text-align: center; }
.section-sub {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-soft);
  text-align: center;
  font-size: 19px;
  margin: 0 auto 64px;
  max-width: 720px;
}

.lead {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.7;
  color: var(--text-soft);
}

/* ====== Шапка ====== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(20px, 4vw, 56px);
  background: linear-gradient(to bottom, rgba(7, 9, 26, 0.75), rgba(7, 9, 26, 0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold);
}
.brand-mark { display: inline-flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold);
}
.brand-sub {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-top: 4px;
}

.site-nav {
  display: flex;
  gap: 32px;
}
.site-nav a {
  color: var(--text-soft);
  font-size: 14px;
  letter-spacing: 0.06em;
  position: relative;
  padding: 6px 0;
}
.site-nav a::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 1px;
  background: var(--gold);
  transition: all .3s ease;
  transform: translateX(-50%);
}
.site-nav a:hover { color: var(--gold); }
.site-nav a:hover::after { width: 100%; }

/* ====== Hero ====== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh; /* iOS Safari: учитывает динамические панели */
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 120px 28px 80px;
}
.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  filter: brightness(0.55) saturate(1.1);
  z-index: -2;
}
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 0%, rgba(7, 9, 26, 0.4) 50%, var(--bg-deep) 100%),
    linear-gradient(to bottom, rgba(7, 9, 26, 0.2) 0%, rgba(7, 9, 26, 0.85) 90%);
  z-index: -1;
}

.hero-inner {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}
.hero-eyebrow {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 28px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(50px, 9vw, 124px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 36px;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
}
.hero-line-1 {
  display: block;
  font-style: italic;
  color: var(--gold-bright);
  background: linear-gradient(180deg, #ffd97a 0%, #b8862f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.hero-line-2 {
  display: block;
  font-weight: 500;
  color: var(--text);
}
.hero-lead {
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 auto 44px;
}

.hero-actions {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .3s ease;
  white-space: nowrap;
}
.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  color: var(--bg-deep);
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--gold), 0 30px 60px -20px rgba(233, 196, 106, 0.7);
  color: var(--bg-deep);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: rgba(233, 196, 106, 0.4);
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}

.hero-scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scroll-pulse 2.4s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ====== About / split layout ====== */
.about, .author { padding: 120px 0; position: relative; }
.about { background: linear-gradient(180deg, transparent, rgba(13, 18, 48, 0.4) 50%, transparent); }

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
  align-items: center;
}
.split.reverse { grid-template-columns: 0.9fr 1.1fr; }
.split.reverse .split-figure { order: -1; }

.split-figure {
  margin: 0;
  position: relative;
}
.split-figure img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(233, 196, 106, 0.18);
}
.split-figure figcaption {
  position: absolute;
  bottom: -12px; right: 20px;
  background: var(--bg-deep);
  color: var(--gold);
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  border: 1px solid rgba(233, 196, 106, 0.3);
}

.about-blocks {
  display: grid;
  gap: 28px;
  margin-top: 36px;
}
.about-blocks article {
  padding-left: 22px;
  border-left: 2px solid var(--gold-soft);
  transition: border-color .3s ease;
}
.about-blocks article:hover { border-left-color: var(--gold); }
.about-blocks h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  color: var(--gold);
  margin: 0 0 6px;
}
.about-blocks p {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
}

/* ====== Books grid ====== */
.books { padding: 100px 0 140px; }

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 36px;
}

.book-card {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(233, 196, 106, 0.12);
  box-shadow: var(--shadow-card);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .3s ease, box-shadow .3s ease;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.book-card:hover {
  transform: translateY(-6px);
  border-color: rgba(233, 196, 106, 0.45);
  box-shadow: var(--shadow-gold);
}

.book-cover {
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft);
  position: relative;
}
.book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 9, 26, 0.65) 0%, transparent 40%);
}

.book-epoch {
  position: absolute;
  top: 16px; left: 16px;
  background: rgba(7, 9, 26, 0.65);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(233, 196, 106, 0.25);
}

.book-num {
  position: absolute;
  bottom: 14px; right: 18px;
  font-family: var(--serif);
  font-size: 60px;
  font-style: italic;
  color: var(--gold);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7);
  line-height: 1;
}

.book-body {
  padding: 28px 26px 30px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.book-years {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.book-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.15;
  margin: 10px 0 14px;
  color: var(--text);
}
.book-epigraph {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--text-mute);
  border-left: 2px solid var(--gold);
  padding-left: 14px;
  margin: 0 0 18px;
  line-height: 1.5;
}
.book-desc {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.6;
  margin: 0 0 22px;
  flex: 1;
}
.book-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.book-themes li {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  border: 1px solid rgba(233, 196, 106, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(233, 196, 106, 0.04);
}
.book-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}
.book-actions .btn { padding: 10px 18px; font-size: 12px; }
.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  border-top: 1px solid rgba(233, 196, 106, 0.12);
  margin-top: 18px;
  padding-top: 14px;
}

/* ====== Author / principles ====== */
.principles {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  gap: 14px;
}
.principles li {
  position: relative;
  padding-left: 28px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text-soft);
}
.principles li::before {
  content: "◆";
  position: absolute;
  left: 0; top: 0;
  color: var(--gold);
  font-size: 14px;
}

/* ====== Modal ====== */
.book-modal {
  border: none;
  border-radius: var(--radius-lg);
  background: var(--bg-mid);
  color: var(--text);
  padding: 0;
  max-width: 720px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 50px 100px -20px rgba(0,0,0,0.75);
  border: 1px solid rgba(233, 196, 106, 0.25);
}
.book-modal::backdrop {
  background: rgba(3, 4, 12, 0.85);
  backdrop-filter: blur(8px);
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(7, 9, 26, 0.6);
  color: var(--gold);
  border: 1px solid rgba(233, 196, 106, 0.3);
  font-size: 22px;
  cursor: pointer;
  z-index: 2;
  transition: background .2s ease;
}
.modal-close:hover { background: var(--gold); color: var(--bg-deep); }
.modal-inner { padding: 40px 40px 36px; overflow-y: auto; max-height: 90vh; }
.modal-inner h3 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--gold);
}
.modal-inner .meta-line {
  color: var(--text-mute);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 24px;
}
.modal-inner .epigraph {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--text-soft);
  border-left: 2px solid var(--gold);
  padding-left: 18px;
  margin: 0 0 20px;
}
.modal-inner p { color: var(--text-soft); font-size: 16px; line-height: 1.7; }
.modal-actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ====== Footer ====== */
.site-footer {
  border-top: 1px solid rgba(233, 196, 106, 0.12);
  padding: 50px 0;
  background: rgba(3, 4, 12, 0.5);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.footer-brand strong {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--gold);
  font-weight: 600;
}
.footer-brand span {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.footer-note {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
  font-style: italic;
  font-family: var(--serif);
}
.footer-admin {
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.footer-admin:hover { color: var(--gold); }

/* ====== Reveal animation ====== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====== Responsive ====== */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .split, .split.reverse {
    grid-template-columns: 1fr;
    gap: 50px;
  }
  .split.reverse .split-figure { order: 0; }
  .about, .author, .books { padding: 80px 0; }
}

@media (max-width: 700px) {
  /* стрелка-индикатор "вниз" под кнопками мешает — прячем на мобильном */
  .hero-scroll { display: none; }
  .hero {
    padding: 110px 18px 60px;
    min-height: 100svh;
  }
  .hero-title {
    font-size: clamp(32px, 8.2vw, 52px);
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
    overflow-wrap: break-word;
    word-break: normal;
    padding: 0 4px;
  }
  .hero-line-1 { font-size: 0.92em; margin-bottom: 6px; }
  .hero-line-2 { font-size: 1em; }
  .hero-lead  { font-size: 17px; margin-bottom: 32px; }
  .hero-eyebrow { font-size: 11px; letter-spacing: 0.28em; margin-bottom: 20px; }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 320px;
    margin: 0 auto;
    gap: 12px;
  }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .site-header { padding: 14px 18px; }
  .brand-sub { display: none; }
  .btn { padding: 12px 24px; font-size: 12px; }
  .container { padding: 0 18px; }
  .modal-inner { padding: 30px 24px 28px; }
  .book-num { font-size: 44px; }
  /* на узких экранах — гарантированно вмещаем "над Россией" */
  .hero-title { font-size: clamp(28px, 7.5vw, 44px); }
  .hero-inner { padding: 0 4px; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 26px; }
  .hero-lead { font-size: 16px; }
}
