:root {
  --gold: #BFAB8A;
  --gold-light: #d4c4a0;
  --grey: #A4B6C4;
  --font: "Open Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  height: 100svh;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: #071939;
  color: #fff;
}

.gold { color: var(--gold); }

.brand-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #071939;
}
.brand-bg-img {
  position: absolute;
  inset: 0;
  background: url("/assets/bg_pir.png") center top / cover no-repeat;
  background-color: #071939;
}
.brand-bg-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 25, 57, 0.12) 0%,
    transparent 35%,
    transparent 70%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

/* Титульный экран — один блок на весь viewport */
.title-scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  height: 100svh;
}

#scene3d {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.desk-flat {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  height: min(22vh, calc(100vw * 228 / 1920));
  min-height: 96px;
  background: url("/assets/bg_pir_stol.png") center bottom / 100% 100% no-repeat;
  pointer-events: none;
}

body.is-book-focus .desk-flat {
  filter: blur(14px) brightness(0.45);
  transition: filter 0.45s ease;
}

/* Текст интегрирован поверх сцены, чуть выше центра */
.title-copy {
  position: absolute;
  left: 50%;
  top: clamp(8%, 12vh, 16%);
  transform: translateX(-50%);
  z-index: 2;
  width: min(920px, 92vw);
  text-align: center;
  pointer-events: none;
}

.title-badge {
  font-size: clamp(9px, 1.1vw, 11px);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: clamp(10px, 1.5vh, 18px);
}

.title-head {
  font-size: clamp(26px, 5.2vw, 56px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: clamp(8px, 1.2vh, 14px);
}

.title-lead {
  font-size: clamp(12px, 1.45vw, 16px);
  color: var(--grey);
  line-height: 1.55;
  letter-spacing: 0.03em;
  margin-bottom: clamp(10px, 1.5vh, 18px);
}

.title-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(10px, 2vw, 18px);
}

.price-old {
  font-size: clamp(15px, 2vw, 20px);
  color: rgba(164,182,196,0.45);
  text-decoration: line-through;
}

.price-new {
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 800;
  color: var(--gold);
}

/* Режим фокуса на книге — экран на 2 половины */
body.is-book-focus .title-copy {
  opacity: 0;
  transform: translateX(-50%) translateY(-12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

body.is-book-focus .brand-bg {
  filter: blur(14px) brightness(0.45);
  transition: filter 0.45s ease;
}

body.is-book-focus #scene3d {
  filter: blur(14px) brightness(0.45);
  transition: filter 0.45s ease;
}

#scene3dBook {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

body.is-book-focus #scene3dBook {
  opacity: 1;
}

.book-focus {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.book-focus[hidden] { display: none !important; }

.book-focus-dim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.18) 40%,
    rgba(0, 0, 0, 0.5) 55%,
    rgba(0, 0, 0, 0.58) 100%
  );
  pointer-events: auto;
  cursor: pointer;
}

.book-focus-panel {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 46%;
  right: clamp(28px, 5vw, 72px);
  width: auto;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: none;
  overflow: auto;
  padding: clamp(36px, 5vh, 64px) clamp(20px, 2.5vw, 36px) clamp(36px, 5vh, 64px) clamp(20px, 2.5vw, 40px);
  text-align: left;
  pointer-events: auto;
  background: linear-gradient(
    90deg,
    rgba(7, 25, 57, 0) 0%,
    rgba(7, 25, 57, 0.5) 22%,
    rgba(7, 25, 57, 0.8) 100%
  );
  animation: focusIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes focusIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.book-focus-close {
  position: absolute;
  top: clamp(16px, 3vh, 28px);
  right: clamp(16px, 3vw, 28px);
  width: 44px;
  height: 44px;
  border: 1px solid rgba(191,171,138,0.35);
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  color: var(--grey);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.book-focus-close:hover {
  color: #fff;
  border-color: var(--gold);
  background: rgba(0,0,0,0.5);
}

.book-focus-num {
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: clamp(14px, 2vh, 22px);
}

.book-focus-title {
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin-bottom: clamp(16px, 2vh, 24px);
  max-width: 22ch;
}

.book-focus-text {
  font-size: clamp(15px, 1.35vw, 18px);
  color: rgba(220, 230, 238, 0.92);
  line-height: 1.65;
  margin-bottom: clamp(22px, 3vh, 32px);
  max-width: 36ch;
}

.book-focus-more {
  align-self: flex-start;
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #071939;
  background: var(--gold);
  padding: 14px 28px;
  transition: background 0.2s, transform 0.2s;
}

.book-focus-more:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .book-focus-panel {
    left: 42%;
    right: clamp(16px, 3vw, 32px);
    max-width: none;
  }

  .book-focus-title { max-width: none; }
}

@media (max-width: 640px) {
  .title-copy { top: clamp(6%, 8vh, 12%); }
  .title-head { font-size: clamp(22px, 6.5vw, 32px); }

  body.is-book-focus #scene3dBook { opacity: 0; }

  .book-focus-dim {
    background: rgba(0, 0, 0, 0.55);
  }

  .book-focus-panel {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 52vh;
    padding: 28px 22px 32px;
    background: linear-gradient(180deg, rgba(7, 25, 57, 0.92), rgba(7, 25, 57, 0.98));
    animation-name: focusInMobile;
  }

  .book-focus-title {
    font-size: clamp(18px, 5.2vw, 24px);
    max-width: none;
  }

  .book-focus-text {
    font-size: 15px;
    max-width: none;
  }

  .book-focus-more {
    width: 100%;
    text-align: center;
  }

  @keyframes focusInMobile {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
