/* =========================================================
   «О любви» — сайт книги (этап С2).
   Вступление — сцены из scenes/scenes.css; здесь — шапка и основной сайт.
   ========================================================= */
:root {
  --night: #0c0812;
  --night-2: #140d1d;
  --plum: #2a1630;
  --cream: #fff3e2;
  --cream-dim: rgba(255, 243, 226, .72);
  --gold: #ffcf8a;
  --gold-deep: #e9a85e;
  --lilac: #b9a6e6;
  --line: rgba(255, 207, 138, .2);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --e: cubic-bezier(.19, 1, .22, 1);
  --header-h: 68px;
}

/* Сцены прилипают мягко, основной сайт листается свободно */
html { scroll-snap-type: y proximity; scroll-padding-top: 0; background: var(--night); }
body { background: var(--night); color: var(--cream); line-height: 1.7; }

/* ---------- Шапка ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 max(4vw, 20px);
  transition: background .5s var(--e), box-shadow .5s var(--e);
}
.site-header.is-solid {
  background: rgba(12, 8, 18, .78);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.logo {
  font-family: var(--serif); font-style: italic; font-size: 1.7rem; font-weight: 400;
  color: var(--cream); text-decoration: none; white-space: nowrap;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .5);
}
.site-nav { display: flex; gap: 26px; margin-left: auto; }
.site-nav a, .skip-intro {
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cream-dim); text-decoration: none; transition: color .3s;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .6);
}
.site-nav a:hover, .skip-intro:hover { color: var(--gold); }
.skip-intro { display: none; }
body.in-intro .site-nav { display: none; }
body.in-intro .skip-intro { display: inline; margin-left: auto; }

.lang-switch {
  display: inline-flex; padding: 3px; border-radius: 999px;
  border: 1px solid rgba(255, 214, 160, .45);
  background: rgba(20, 10, 30, .35);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.lang-btn {
  font: 600 .74rem/1 var(--sans); letter-spacing: .12em;
  border: 0; background: transparent; color: var(--cream-dim);
  padding: 8px 13px; border-radius: 999px; cursor: pointer;
  transition: background .4s var(--e), color .4s;
}
.lang-btn.is-active { background: linear-gradient(135deg, #ffe2b0, #f0a668); color: #2a1236; }
.lang-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Текст сцен опускаем под шапку */
.intro .copy { top: max(15vh, calc(var(--header-h) + 36px)); }
body:not(.in-intro) .scene-nav { opacity: 0; pointer-events: none; }
.scene-nav { transition: opacity .5s var(--e); }

/* Переход от сцен к сайту */
.scroll-on {
  position: absolute; z-index: 7; left: 50%; bottom: 30px; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px;
  font-size: .7rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--cream); text-decoration: none; text-shadow: 0 1px 12px rgba(0, 0, 0, .7);
}
.scroll-on i {
  width: 22px; height: 22px; border-right: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
  transform: rotate(45deg); animation: arrow 2.2s var(--e) infinite;
}
@keyframes arrow { 0%, 100% { transform: translateY(0) rotate(45deg); opacity: .6; } 50% { transform: translateY(8px) rotate(45deg); opacity: 1; } }

/* ---------- Основной сайт ---------- */
.site {
  position: relative;
  background:
    radial-gradient(ellipse 70% 40% at 80% 0%, rgba(120, 60, 140, .28), transparent 70%),
    radial-gradient(ellipse 60% 30% at 10% 35%, rgba(255, 170, 100, .1), transparent 70%),
    radial-gradient(ellipse 70% 35% at 90% 70%, rgba(90, 80, 200, .14), transparent 70%),
    linear-gradient(180deg, #07040c 0%, var(--night) 8%, var(--night-2) 55%, #0a0610 100%);
  overflow: hidden;
}
.wrap { position: relative; width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(800px, 100% - 40px); }
.center { text-align: center; }
.block { position: relative; padding: clamp(84px, 11vw, 150px) 0; }
.block + .block::before {   /* золотой разделитель */
  content: ""; position: absolute; top: 0; left: 50%; width: min(420px, 60vw); height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 207, 138, .35), transparent);
}

.center-eyebrow { justify-content: center; }
.center-eyebrow::before { display: none; }
.h-section {
  font-family: var(--serif); font-weight: 300; line-height: 1.05;
  font-size: clamp(2.4rem, 5vw, 3.8rem); margin: 0 0 1.4rem; color: var(--cream);
}
.prose { color: var(--cream-dim); font-size: 1.08rem; max-width: 34rem; margin: 0 0 1rem; }
.muted { color: var(--cream-dim); font-size: .95rem; margin: 0; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 .8rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
  padding: 17px 32px; border-radius: 999px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .5s var(--e), box-shadow .5s var(--e), background .5s var(--e), color .5s;
}
.btn-gold { color: #2a1236; background: linear-gradient(135deg, #ffe2b0, #f0a668); box-shadow: 0 14px 40px -14px rgba(255, 150, 90, .7); }
.btn-gold:hover, .btn-gold:focus-visible { transform: translateY(-2px); box-shadow: 0 0 0 6px rgba(255, 200, 140, .14), 0 18px 48px -12px rgba(255, 150, 90, .9); outline: none; }
.btn-ghost { color: var(--cream); background: rgba(255, 236, 214, .06); border-color: rgba(255, 214, 160, .45); }
.btn[disabled] { cursor: not-allowed; opacity: .62; }
.btn-block { width: 100%; }
.soon {
  font-size: .62rem; letter-spacing: .14em; padding: 4px 8px; border-radius: 999px;
  background: rgba(185, 166, 230, .2); color: var(--lilac); border: 1px solid rgba(185, 166, 230, .4);
}

/* Плейсхолдеры (обложка, фото, QR) */
.ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 24px; border-radius: 20px;
  border: 1px dashed rgba(255, 207, 138, .5); color: var(--cream-dim);
}
.ph-mark { font-size: 2.6rem; line-height: 1; color: var(--gold); }
.ph-label { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--cream); }
.ph-file { font: .74rem/1 ui-monospace, Consolas, monospace; opacity: .6; }
/* Реальные изображения поверх плейсхолдера (если файл есть в assets/) */
.ph { position: relative; overflow: hidden; }
.ph-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.has-img { border: 1px solid rgba(255, 207, 138, .35); padding: 0; }
.ph.has-img > :not(.ph-img) { visibility: hidden; }
.ph-photo .ph-img { object-position: 50% 25%; }

/* Книга */
.book-grid { display: grid; grid-template-columns: minmax(240px, 400px) 1fr; gap: clamp(40px, 7vw, 100px); align-items: center; }
.ph-cover {
  aspect-ratio: 2 / 3; width: 100%;
  background:
    radial-gradient(circle at 70% 22%, rgba(255, 214, 150, .55), transparent 45%),
    linear-gradient(165deg, #3a2148 0%, #6a2f55 45%, #c86a54 85%, #f2a86a 100%);
  box-shadow: 0 40px 90px -30px rgba(255, 140, 90, .45), 0 0 0 1px rgba(255, 207, 138, .15);
  transform: rotate(-2deg);
}
.book-title { font-family: var(--serif); font-weight: 300; margin: 0 0 1.1rem; line-height: .95; }
.book-title > span:first-child {
  display: block; font-size: clamp(3.6rem, 8vw, 6.6rem);
  background: linear-gradient(175deg, #fffaf0 10%, #ffe3b0 55%, #f5b27a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.book-title-alt { display: block; font-style: italic; font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--lilac); margin-top: .5rem; }
.book-author { font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 0 0 2.2rem; }
.book-author-alt { display: block; font-size: .7em; font-style: italic; color: var(--cream-dim); }
.book-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Автор */
.author-grid { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: clamp(40px, 7vw, 96px); align-items: center; }
.ph-photo {
  aspect-ratio: 4 / 5; width: 100%;
  background: radial-gradient(circle at 50% 30%, rgba(185, 166, 230, .3), transparent 60%), linear-gradient(170deg, #241632, #3b2440 60%, #5a3040);
  box-shadow: 0 30px 70px -30px rgba(120, 80, 200, .45);
}
.ph-photo.has-img { box-shadow: 0 30px 70px -30px rgba(120, 80, 200, .45), 0 0 0 6px rgba(255, 207, 138, .06); }

/* Аннотация */
.lead-serif {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.45rem, 2.6vw, 2.05rem); line-height: 1.5; margin: 0 0 2.4rem; color: var(--cream);
}
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.facts li {
  font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 207, 138, .05);
}

/* Отрывок */
.passage {
  position: relative; margin: 0; padding: clamp(40px, 6vw, 72px) clamp(26px, 6vw, 80px);
  border-radius: 24px;
  background: radial-gradient(ellipse 80% 70% at 50% 0%, rgba(255, 180, 110, .12), transparent 70%), rgba(255, 240, 220, .035);
  border: 1px solid var(--line);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .8);
}
.passage figcaption { font-size: .74rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-bottom: 1.4rem; text-align: center; }
.passage blockquote { margin: 0; }
.passage blockquote p {
  font-family: var(--serif); font-size: clamp(1.4rem, 2.5vw, 1.9rem); line-height: 1.6; margin: 0; color: var(--cream);
}
.passage blockquote p::first-letter {
  float: left; font-size: 4.2em; line-height: .8; padding: .08em .12em 0 0; font-weight: 400;
  color: var(--gold); text-shadow: 0 0 24px rgba(255, 180, 110, .35);
}
.passage-sign { display: block; margin-top: 1.8rem; text-align: right; font-family: var(--serif); font-style: italic; color: var(--cream-dim); }

/* Карточки */
.card {
  position: relative; border-radius: 22px; padding: clamp(28px, 4vw, 40px);
  background: linear-gradient(170deg, rgba(255, 240, 220, .06), rgba(255, 240, 220, .02));
  border: 1px solid rgba(255, 207, 138, .16);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .8);
}
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 2rem; margin: 0 0 .7rem; line-height: 1.1; }
.badge {
  display: inline-block; align-self: flex-start; margin-bottom: 1rem; font-size: .66rem; letter-spacing: .18em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; color: var(--lilac); border: 1px solid rgba(185, 166, 230, .35); background: rgba(185, 166, 230, .1);
}
.badge-gold { color: var(--gold); border-color: var(--line); background: rgba(255, 207, 138, .08); }

.buy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; max-width: 900px; margin: 3rem auto 0; }
.buy-card { display: flex; flex-direction: column; gap: 6px; }
.buy-card > p { color: var(--cream-dim); margin: 0 0 1.6rem; }
.buy-card .btn { margin-top: auto; }
.buy-kaspi { background: linear-gradient(170deg, rgba(255, 207, 138, .1), rgba(185, 166, 230, .05)); }
.ph-qr { aspect-ratio: 1; width: min(200px, 100%); margin: 8px auto 16px; background: rgba(255, 240, 220, .04); }
.ph-qr .ph-label { font-size: 1.1rem; }
.buy-kaspi .muted { text-align: center; }

.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 3rem 0 3.4rem; }
.review p { font-family: var(--serif); font-style: italic; font-size: 1.25rem; line-height: 1.5; margin: 0 0 1.2rem; }
.review-name { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-dim); }

/* Формы */
.form { display: grid; gap: 18px; max-width: 780px; margin: 0 auto; }
.form h3 { font-size: 1.9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: grid; gap: 7px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cream-dim); }
.form input, .form textarea {
  font: 400 1rem/1.5 var(--sans); color: var(--cream);
  background: rgba(255, 240, 220, .04); border: 1px solid rgba(255, 207, 138, .2); border-radius: 14px;
  padding: 14px 16px; resize: vertical; transition: border-color .3s, box-shadow .3s, background .3s;
}
.form input::placeholder, .form textarea::placeholder { color: rgba(255, 243, 226, .38); }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--gold); background: rgba(255, 240, 220, .07); box-shadow: 0 0 0 4px rgba(255, 207, 138, .12); }
.form .btn { justify-self: start; }
.form-note { margin: 0; min-height: 1.4em; color: var(--gold); font-size: .95rem; }

/* Футер */
.site-footer {
  position: relative; text-align: center; padding: 70px 20px 56px;
  border-top: 1px solid var(--line); color: var(--cream-dim); font-size: .86rem;
}
.site-footer p { margin: 4px 0; }
.footer-logo { font-family: var(--serif); font-style: italic; font-size: 2rem; color: var(--cream); margin-bottom: 10px !important; }

/* Появление при прокрутке */
.js .fade-up { opacity: 0; transform: translateY(26px); transition: opacity 1.1s var(--e), transform 1.1s var(--e); transition-delay: var(--fd, 0s); }
.js .fade-up.is-in { opacity: 1; transform: none; }
.js .cover.fade-up.is-in .ph-cover { transform: rotate(-2deg); }

/* Плавная смена языка */
body.lang-fading [data-i18n], body.lang-fading [data-i18n-html] { opacity: 0; }
[data-i18n], [data-i18n-html] { transition: opacity .25s ease; }

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
  .site-nav { display: none; }
  body:not(.in-intro) .lang-switch { margin-left: auto; }
  .reviews-grid { grid-template-columns: 1fr 1fr; }
  .reviews-grid .review:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .site-header { gap: 14px; }
  .logo { font-size: 1.4rem; }
  .skip-intro { font-size: .68rem; letter-spacing: .1em; }
  .intro .copy { top: calc(var(--header-h) + 22px); }
  .book-grid, .author-grid { grid-template-columns: 1fr; text-align: center; }
  .cover, .author-photo { width: min(260px, 72%); margin: 0 auto; }
  .book-actions { justify-content: center; }
  .book-actions .btn { flex: 1 1 240px; }
  .prose { margin-inline: auto; }
  .author-grid .eyebrow { justify-content: center; }
  .author-grid .eyebrow::before { display: none; }
  .buy-grid, .reviews-grid, .form-row { grid-template-columns: 1fr; }
  .form .btn { justify-self: stretch; }
  .scroll-on { bottom: 22px; font-size: .62rem; letter-spacing: .2em; width: max-content; max-width: calc(100% - 80px); text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .js .fade-up { opacity: 1; transform: none; transition: none; }
  .scroll-on i { animation: none; }
  .site-header, .lang-btn, .btn, [data-i18n], [data-i18n-html] { transition: none; }
}
