/* КЕРНИНГ: брачный контракт, подпись и игровая церемония. Бархатная книга, хромовое тиснение, стразы, подпись и праздничная сцена. */

.kc-btn--small {
  padding: 12px 18px;
  font-size: 15px;
}

.kc-contract .kc-sticker {
  justify-self: start;
  margin-bottom: 6px;
}

/* Книга. */

.kc-book {
  position: relative;
  width: min(900px, 100%);
  margin: 0 auto;
  padding-bottom: 52px;
}

.kc-book__body {
  position: relative;
  min-height: 340px;
  perspective: 1800px;
}

.kc-spread {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 3px solid var(--kc-plum);
  border-radius: 22px;
  background: #fffafd;
  box-shadow: 10px 10px 0 var(--kc-plum);
  overflow: hidden;
}

.kc-spread::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 1;
  width: 28px;
  margin-left: -14px;
  background: linear-gradient(90deg, rgb(67 16 46 / 0), rgb(67 16 46 / .2) 45%, rgb(67 16 46 / .04) 55%, rgb(67 16 46 / 0));
  pointer-events: none;
}

.kc-spread.is-turning {
  animation: kc-page-turn .6s var(--kc-ease) both;
}

.kc-page {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 300px;
  padding: clamp(28px, 4vw, 46px);
  background: linear-gradient(170deg, #fffafd, #ffeaf5);
}

.kc-page::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px dashed rgb(67 16 46 / .25);
  border-radius: 14px;
  pointer-events: none;
}

.kc-page--l {
  padding-left: clamp(40px, 5vw, 58px);
}

.kc-page--r {
  padding-right: clamp(28px, 4vw, 46px);
}

.kc-page__num {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.kc-page__title {
  font-family: var(--kc-display);
  font-size: clamp(36px, 4.4vw, 52px);
  font-weight: 900;
  line-height: .92;
  letter-spacing: -.03em;
}

.kc-page__text {
  max-width: 36ch;
  font-size: clamp(17px, 1.5vw, 19px);
  font-weight: 600;
  line-height: 1.45;
}

.kc-page .kc-btn {
  justify-self: start;
  margin-top: 6px;
}

.kc-book__cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: clamp(28px, 5vw, 56px) clamp(40px, 7vw, 72px);
  border: 3px solid var(--kc-plum);
  border-radius: 22px;
  background:
    radial-gradient(circle at 28% 18%, rgb(255 255 255 / .35) 0, rgb(255 255 255 / 0) 42%),
    repeating-linear-gradient(90deg, rgb(255 255 255 / .05) 0 2px, rgb(255 255 255 / 0) 2px 5px),
    linear-gradient(160deg, #ff8cc6 0%, #d4166f 46%, #8a2460 100%);
  box-shadow: 10px 10px 0 var(--kc-plum);
  color: #ffffff;
  text-align: center;
  cursor: pointer;
  transform-origin: 0 50%;
  backface-visibility: hidden;
  transition: transform 1.1s cubic-bezier(.65, 0, .25, 1);
}

.kc-book__cover:focus-visible {
  outline: 3px solid var(--kc-plum);
  outline-offset: 6px;
}

.kc-book[data-state="open"] .kc-book__cover {
  transform: rotateY(-180deg);
  pointer-events: none;
}

.kc-book__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 26px;
  border-right: 2px solid var(--kc-plum);
  border-radius: 19px 0 0 19px;
  background:
    repeating-linear-gradient(180deg, rgb(255 255 255 / .55) 0 3px, rgb(255 255 255 / 0) 3px 16px),
    linear-gradient(90deg, #2c0a20, #8a2460 60%, #c2186f);
}

.kc-book__frame {
  position: absolute;
  inset: 24px 24px 24px 50px;
  border: 3px double #ffe4f2;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgb(67 16 46 / .35);
  pointer-events: none;
}

.kc-book__corner {
  position: absolute;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #ffffff 0%, #ffe2a0 18%, #c3a6d9 36%, #ffffff 52%, #e7a8d4 70%, #ffffff 100%);
  clip-path: polygon(0 0, 100% 0, 100% 14%, 14% 14%, 14% 100%, 0 100%);
  pointer-events: none;
}

.kc-book__corner--tl {
  top: 30px;
  left: 58px;
}

.kc-book__corner--tr {
  top: 30px;
  right: 30px;
  transform: scaleX(-1);
}

.kc-book__corner--bl {
  bottom: 30px;
  left: 58px;
  transform: scaleY(-1);
}

.kc-book__corner--br {
  right: 30px;
  bottom: 30px;
  transform: scale(-1);
}

.kc-book__stones {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.kc-book__stone {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0, #ffd0ea 30%, #ff4fa3 66%, #9a0f4f 100%);
  box-shadow: 0 0 8px rgb(255 255 255 / .8), 0 2px 0 rgb(67 16 46 / .4);
}

.kc-book__kicker {
  position: relative;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .22em;
  line-height: 1;
  text-transform: uppercase;
}

.kc-book__title {
  position: relative;
  max-width: 10ch;
  font-family: var(--kc-display);
  font-size: clamp(46px, 8.4vw, 92px);
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.02em;
  background: linear-gradient(100deg, #ffffff 0%, #ffe2a0 18%, #ffb0d8 36%, #ffffff 52%, #e9c27a 68%, #ffd0ea 84%, #ffffff 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 var(--kc-plum)) drop-shadow(0 0 6px rgb(255 255 255 / .5));
  animation: kc-shine 5s ease-in-out infinite;
}

.kc-book__hint {
  position: relative;
  margin-top: 8px;
  padding: 10px 18px;
  border: 2px solid #ffe4f2;
  border-radius: 999px;
  background: rgb(67 16 46 / .35);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.kc-book__ribbon {
  position: absolute;
  left: 70%;
  bottom: -46px;
  width: 30px;
  height: 62px;
  background: linear-gradient(90deg, #ff2e88, #ff8cc6 50%, #d4166f);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  pointer-events: none;
}

.kc-book__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.kc-book__count {
  font-size: 15px;
  font-weight: 800;
}

@keyframes kc-page-turn {
  from {
    opacity: 0;
    transform: perspective(1400px) rotateY(-16deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Подпись. */

.kc-sign {
  width: min(760px, 100%);
  margin: 0 auto;
  scroll-margin-top: 24px;
}

.kc-sign__title {
  font-family: var(--kc-display);
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.02em;
}

.kc-sign__title:focus {
  outline: none;
}

.kc-sign__pad {
  position: relative;
  height: 200px;
  border: 3px dashed var(--kc-plum);
  border-radius: 18px;
  background: linear-gradient(#fffafd, #ffe6f3);
  overflow: hidden;
}

.kc-sign__canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.kc-sign__line {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 46px;
  border-top: 2px solid rgb(67 16 46 / .35);
  pointer-events: none;
}

.kc-sign__hint {
  position: absolute;
  left: 7%;
  bottom: 12px;
  color: rgb(67 16 46 / .6);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  transition: opacity .3s ease;
}

.kc-sign__pad.is-signed .kc-sign__hint {
  opacity: 0;
}

/* Церемония. */

.kc-fest {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(24px, 5vw, 56px) var(--kc-gutter);
  background: radial-gradient(circle at 50% 30%, #fff8e6 0, #ffd6ec 30%, #ffb3dc 62%, #f08cc0 100%);
}

.kc-fest__glow {
  position: absolute;
  inset: -10%;
  opacity: 0;
  background: radial-gradient(circle at 50% 36%, rgb(255 240 200 / .95) 0, rgb(255 205 230 / .7) 26%, rgb(255 140 198 / .35) 52%, rgb(255 140 198 / 0) 74%);
  pointer-events: none;
  transition: opacity 1.6s ease;
}

.kc-fest.is-glow .kc-fest__glow {
  opacity: 1;
  animation: kc-fest-breathe 6s ease-in-out infinite;
}

.kc-fest__fire {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.kc-fest__bits,
.kc-fest__lights {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.kc-fest__bit {
  position: absolute;
  left: var(--x, 50%);
  top: 0;
  width: var(--s, 18px);
  height: var(--s, 18px);
  animation: kc-fest-fall var(--d, 9s) linear var(--delay, 0s) infinite;
}

.kc-fest__bit svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.kc-fest__bit--petal {
  width: calc(var(--s, 18px) * .8);
  border-radius: 80% 0 80% 0;
  background: radial-gradient(circle at 35% 30%, #ffffff 0, #ffd0ea 40%, #ff7ab8 100%);
}

.kc-fest__light {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff6d6;
  box-shadow: 0 0 12px #ffd27a, 0 0 22px rgb(255 210 122 / .6);
  animation: kc-fest-twinkle 3.6s ease-in-out var(--delay, 0s) infinite;
}

.kc-fest__inner {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 20px;
  width: min(640px, 100%);
  text-align: center;
}

.kc-fest__kicker {
  padding: 12px 16px;
  border: 3px solid var(--kc-plum);
  border-radius: 12px;
  background: repeating-linear-gradient(-45deg, #ffd0e8 0 14px, #ffffff 14px 28px);
  box-shadow: 5px 5px 0 var(--kc-plum);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
  opacity: 0;
  translate: 0 14px;
  transition: opacity .8s ease, translate .8s var(--kc-ease);
}

.kc-fest__title {
  font-family: var(--kc-display);
  font-size: clamp(54px, 9vw, 104px);
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.03em;
  background: linear-gradient(100deg, #ffffff 0%, #ffe2a0 18%, #ffb0d8 36%, #ffffff 52%, #e9c27a 68%, #ffd0ea 84%, #ffffff 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 5px 0 var(--kc-plum));
  opacity: 0;
  translate: 0 18px;
  transition: opacity 1s ease, translate 1s var(--kc-ease);
}

.kc-fest__title:focus {
  outline: none;
}

.kc-fest.is-title .kc-fest__kicker,
.kc-fest.is-title .kc-fest__title {
  opacity: 1;
  translate: 0 0;
}

.kc-fest__card {
  display: grid;
  width: min(380px, 100%);
  border: 3px solid var(--kc-plum);
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 10px 10px 0 var(--kc-plum);
  overflow: hidden;
  opacity: 0;
  scale: .92;
  transition: opacity .9s ease, scale .9s var(--kc-ease);
}

.kc-fest.is-card .kc-fest__card {
  opacity: 1;
  scale: 1;
}

.kc-fest__panel {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-bottom: 3px solid var(--kc-plum);
  background: radial-gradient(circle at 50% 40%, #ffffff 0, #ffd6ec 40%, #ff8cc6 100%);
}

.kc-fest__rings {
  width: 52%;
  height: auto;
  filter: drop-shadow(3px 4px 0 rgb(67 16 46 / .3));
}

.kc-fest__body {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 22px 26px;
  background: linear-gradient(170deg, #ffffff, #ffe0f0);
}

.kc-fest__role {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}

.kc-fest__name {
  font-family: var(--kc-display);
  font-size: clamp(32px, 6vw, 44px);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.02em;
}

.kc-fest__line {
  font-family: var(--kc-display);
  font-size: clamp(26px, 4.4vw, 34px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.01em;
}

.kc-fest__note {
  max-width: 46ch;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0;
  transition: opacity .8s ease;
}

.kc-fest__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  opacity: 0;
  translate: 0 12px;
  pointer-events: none;
  transition: opacity .6s ease, translate .6s var(--kc-ease);
}

.kc-fest__tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.kc-fest.is-final .kc-fest__note {
  opacity: 1;
}

.kc-fest.is-final .kc-fest__actions {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
}

.kc-fest.is-final [data-kc-fest-skip] {
  display: none;
}

.kc-fest__bit,
.kc-fest__light {
  will-change: transform;
}

@keyframes kc-fest-fall {
  from {
    transform: translate3d(0, -10vh, 0) rotate(0deg);
  }
  to {
    transform: translate3d(36px, 125vh, 0) rotate(300deg);
  }
}

@keyframes kc-fest-twinkle {
  0%,
  100% {
    opacity: .3;
  }
  50% {
    opacity: 1;
  }
}

@keyframes kc-fest-breathe {
  0%,
  100% {
    opacity: .9;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

@media (max-width: 760px) {
  .kc-spread {
    grid-template-columns: minmax(0, 1fr);
  }

  .kc-spread::before {
    display: none;
  }

  .kc-page--l {
    padding-right: clamp(28px, 4vw, 46px);
    border-bottom: 2px dashed rgb(67 16 46 / .25);
  }

  .kc-page {
    min-height: 0;
  }

  .kc-book__body {
    min-height: 300px;
  }

  .kc-book__cover {
    padding-left: 48px;
  }

  .kc-book__ribbon {
    left: 58%;
  }
}

@media (max-width: 520px) {
  .kc-book__corner {
    width: 44px;
    height: 44px;
  }

  .kc-book__corner--tl,
  .kc-book__corner--bl {
    left: 42px;
  }

  .kc-book__frame {
    inset: 20px 18px 20px 42px;
  }

  .kc-sign__pad {
    height: 180px;
  }

  .kc-fest__actions .kc-btn,
  .kc-fest__tools .kc-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kc-book__cover,
  .kc-spread.is-turning,
  .kc-book__title,
  .kc-fest__bit,
  .kc-fest__light,
  .kc-fest.is-glow .kc-fest__glow {
    animation: none;
    transition: none;
  }

  .kc-fest__kicker,
  .kc-fest__title,
  .kc-fest__card,
  .kc-fest__note,
  .kc-fest__actions {
    transition: none;
  }

  .kc-fest__bits {
    display: none;
  }
}

.kc-page__punch {
  margin-top: auto;
  padding-top: 6px;
  font-size: clamp(16px, 1.4vw, 18px);
  font-weight: 800;
  line-height: 1.35;
  color: #b0106a;
}
