/* Главная страница сайта семьи Полынь — раскладка и сцена колоды.
 *
 * Общая «кожа» (палитра, шапка, подвал, кнопки, базовая типографика)
 * вынесена в site.css — отсюда импортируется. Здесь только то, что
 * специфично для главной: hero, анимированная колода, секции персонажей,
 * услуг, «почему мы» и финального CTA.
 */

@import url("./site.css");

/* анимации */
@keyframes deckBreathe { 0%,100% { transform: translateY(-5px); } 50% { transform: translateY(7px); } }

/* ---------- hero + сцена колоды ---------- */

.hero {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: clamp(8px, 1.4vh, 20px);
  min-height: 100vh;
  padding: clamp(74px, 9vh, 104px) clamp(20px, 5vw, 40px) clamp(20px, 3vh, 38px);
  overflow: hidden;
}

.hero__copy {
  position: relative; z-index: 6; text-align: center; max-width: 800px;
  display: flex; flex-direction: column; align-items: center; gap: clamp(9px, 1.5vh, 18px);
}
.hero__tag {
  margin: 0; font-family: var(--body); text-transform: uppercase;
  letter-spacing: .34em; font-size: 12px; color: var(--sage);
}
.hero__title {
  margin: 0; font-family: var(--display); font-weight: 500; line-height: 1.04;
  font-size: clamp(29px, 4.2vw, 58px); color: var(--linen);
  letter-spacing: .005em; text-wrap: balance;
}
.hero__title em { font-style: italic; font-weight: 500; color: var(--gold); }
.hero__sub {
  margin: 0; max-width: 560px; font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.6; color: var(--linen-soft);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; margin-top: 4px; }
.hero__note {
  margin: 2px 0 0; max-width: 500px; font-size: 12.5px; line-height: 1.5;
  color: rgba(216, 205, 182, .5);
}

/* область колоды */
.deck-area {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.deck {
  position: relative; width: 100%; max-width: 1060px; height: 100%;
  perspective: 1600px; perspective-origin: 50% 44%;
  --cw: 178px; --ch: 288px;
}
.deck__table {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  width: min(122%, 1180px); height: 84%;
  background: radial-gradient(58% 68% at 50% 48%, rgba(0,69,66,.6) 0%, rgba(0,69,66,.18) 42%, rgba(15,20,36,0) 74%);
  filter: blur(3px); pointer-events: none;
}
.deck__line {
  position: absolute; left: 50%; top: 70%; transform: translate(-50%, -50%);
  width: min(82%, 720px); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,163,110,.34), transparent);
  pointer-events: none;
}
.deck__tilt { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .25s ease-out; will-change: transform; }
.deck__breathe { position: absolute; inset: 0; transform-style: preserve-3d; }

/* карта */
.card {
  position: absolute; left: 50%; top: 50%;
  width: var(--cw); height: var(--ch);
  margin-left: calc(var(--cw) / -2); margin-top: calc(var(--ch) / -2);
  transform-style: preserve-3d; will-change: transform;
}
.card__inner { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(0deg); }
.card__face {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 11px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px rgba(200,163,110,.55), 0 26px 52px -22px rgba(0,0,0,.8);
}
.card__face--back { transform: rotateY(180deg); }

/* колода-глубина (рубашки, не переворачиваются) */
.deck__depth { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform, opacity; }
.deck__depth .card { box-shadow: none; }
.deck__depth .card__face { box-shadow: inset 0 0 0 1px rgba(200,163,110,.5), inset 0 0 0 2px rgba(15,20,36,.5), 0 22px 46px -20px rgba(0,0,0,.75); }
.depth-0 { transform: translate3d(-104px, -2px, 0) rotate(-19deg) scale(.96); z-index: 5; }
.depth-1 { transform: translate3d(0, -18px, 0) rotate(0deg) scale(.98); z-index: 4; }
.depth-2 { transform: translate3d(104px, -2px, 0) rotate(19deg) scale(.96); z-index: 5; }

/* розданные карты — дефолтное состояние «веер» (до/без JS) */
.deal-0 { transform: translate3d(-18px, 8px, 0) rotate(-5deg) scale(.97); z-index: 20; }
.deal-1 { transform: translate3d(0, 12px, 0) rotate(0deg) scale(.97); z-index: 21; }
.deal-2 { transform: translate3d(18px, 8px, 0) rotate(5deg) scale(.97); z-index: 22; }

/* ---------- персонажи (Майя / Лев) ---------- */

.person { max-width: 1100px; margin: 0 auto; padding: clamp(56px, 9vh, 110px) clamp(20px, 5vw, 40px); }
.person--lev { padding-top: clamp(20px, 4vh, 56px); }
.person__row { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(28px, 5vw, 64px); }
.person--lev .person__row { flex-direction: row-reverse; }

/* декоративная рамка-портрет (реальные portrait_*.webp пока отсутствуют) */
.portrait {
  position: relative; flex: 0 0 auto; width: min(340px, 82vw); aspect-ratio: 4 / 5;
  border-radius: 6px; overflow: hidden; border: 1px solid rgba(200,163,110,.45);
  box-shadow: 0 34px 64px -34px rgba(0,0,0,.85);
  background: radial-gradient(120% 92% at 50% 28%, #0a544c 0%, #07332f 56%, #061f1d 100%);
}
.portrait__grain { position: absolute; inset: 0; background-image: radial-gradient(rgba(236,227,208,.3) .7px, transparent 1.3px); background-size: 22px 22px; opacity: .4; }
.portrait__vignette { position: absolute; left: 50%; bottom: 0; width: 76%; height: 80%; transform: translateX(-50%); background: radial-gradient(58% 70% at 50% 28%, rgba(15,20,36,0) 0%, rgba(15,20,36,.28) 60%, rgba(15,20,36,.62) 100%); }
.portrait__frame { position: absolute; inset: 12px; border: 1px solid rgba(200,163,110,.4); border-radius: 3px; pointer-events: none; }

.person__text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.person__name { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4vw, 52px); line-height: 1.04; color: var(--linen); }
.person__role { margin: 0; font-family: var(--body); text-transform: uppercase; letter-spacing: .2em; font-size: 12.5px; color: var(--gold); }
.person__bio { margin: 0; font-size: clamp(16px, 1.4vw, 18px); line-height: 1.65; color: var(--linen-soft); max-width: 46ch; }

/* ---------- услуги ---------- */

.services { border-top: 1px solid rgba(200,163,110,.12); background: linear-gradient(180deg, rgba(0,69,66,.06), rgba(15,20,36,0) 60%); }
.services__inner { max-width: 1100px; margin: 0 auto; padding: clamp(56px, 9vh, 110px) clamp(20px, 5vw, 40px); }
.section-head { margin-bottom: clamp(28px, 4vh, 48px); max-width: 640px; }
.section-head h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4vw, 52px); line-height: 1.04; color: var(--linen); }
.services__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.service-card {
  position: relative; padding: clamp(22px, 2.4vw, 30px);
  background: linear-gradient(160deg, rgba(0,69,66,.18), rgba(0,69,66,.04));
  border: 1px solid rgba(200,163,110,.18); border-radius: 6px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .3s ease, transform .3s ease;
}
.service-card:hover { border-color: rgba(200,163,110,.5); transform: translateY(-3px); }
.service-card__num { font-family: var(--display); font-size: 15px; letter-spacing: .2em; color: var(--gold); }
.service-card h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(21px, 2vw, 26px); color: var(--linen); }
.service-card p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--linen-soft); }

/* ---------- почему мы ---------- */

.why { max-width: 1100px; margin: 0 auto; padding: clamp(56px, 9vh, 110px) clamp(20px, 5vw, 40px); }
.why .section-head { margin-bottom: clamp(28px, 4vh, 52px); }
.why__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(26px, 3.4vw, 52px) clamp(28px, 4vw, 64px); }
.why-item { display: flex; flex-direction: column; gap: 12px; padding-top: 22px; border-top: 1px solid rgba(200,163,110,.32); }
.why-item:nth-child(even) { border-top-color: rgba(148,165,131,.4); }
.why-item h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(20px, 1.9vw, 26px); color: var(--linen); }
.why-item p { margin: 0; font-size: 15.5px; line-height: 1.62; color: var(--linen-soft); max-width: 48ch; }

/* ---------- финальный CTA ---------- */

.final { max-width: 1100px; margin: 0 auto; padding: clamp(20px, 4vh, 48px) clamp(20px, 5vw, 40px) clamp(64px, 9vh, 120px); }
.final__card {
  position: relative; overflow: hidden; border-radius: 10px;
  padding: clamp(44px, 6vw, 84px) clamp(24px, 5vw, 56px); text-align: center;
  background: radial-gradient(120% 130% at 50% 0%, #0a544c 0%, #063e3a 46%, #07312f 100%);
  border: 1px solid rgba(200,163,110,.3);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.final__grain { position: absolute; inset: 0; background-image: radial-gradient(rgba(236,227,208,.22) .8px, transparent 1.5px); background-size: 26px 26px; opacity: .5; pointer-events: none; }
.final__mark { position: relative; width: 46px; height: 46px; }
.final__mark .ring { position: absolute; inset: 0; border: 1px solid rgba(200,163,110,.5); border-radius: 50%; }
.final__mark .diamond { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 1.4px solid var(--gold); }
.final__mark .diamond:last-child { transform: rotate(45deg); }
.final h2 { position: relative; margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(32px, 4.6vw, 58px); line-height: 1.03; color: var(--linen); }
.final p { position: relative; margin: 0; max-width: 520px; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; color: var(--linen-soft); }
.final .btn-primary { position: relative; margin-top: 6px; padding: 15px 34px; }

/* ---------- мобильная / облегчённая версия ---------- */

@media (max-width: 820px) {
  /* hero перестаёт быть на весь экран, но колоде нужна явная высота —
   * карты позиционированы absolute и сами площадь не держат. */
  .hero { min-height: auto; }
  .deck-area { min-height: 54vh; }
}

@media (prefers-reduced-motion: reduce) {
  .deck__breathe { animation: none !important; }
  .deck__tilt { transition: none; }
  .service-card { transition: none; }
}
