/* Запрошення на засватання — український народний мотив + динаміка */

:root {
  --ink: #1c1c1f;
  --blue: #4a90c8;
  --blue-deep: #2d5f8f;
  --paper: #fdfcf9;
  --paper-edge: #f0ebe3;
  --accent: #3d6b4a;
  --parallax-x: 0px;
  --parallax-y: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: clamp(15px, 2.2vw, 18px);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: 'Tenor Sans', sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #3f5872 0%, var(--paper) 45%, #3f5872 100%);
  /* background: linear-gradient(
    160deg,
    #e8eef5 0%,
    var(--paper) 45%,
    #eef4ef 100%
  ); */
  background-size: 200% 200%;
  animation: bg-shift 18s ease-in-out infinite alternate;
}

@keyframes bg-shift {
  0% {
    background-position: 0% 40%;
  }

  100% {
    background-position: 100% 60%;
  }
}

.invitation {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 42rem;
  min-height: 36rem;
  background-color: #ffffff;
  /* background-color: var(--paper); */
  border: 1px solid var(--paper-edge);
  box-shadow:
    0 4px 24px rgba(28, 28, 31, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  animation: card-in 1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
  transition: box-shadow 0.45s ease;
}

.invitation:hover {
  box-shadow:
    0 12px 40px rgba(45, 95, 143, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Обгортка для паралаксу + легкого руху */
.invitation__decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transform: translate(var(--parallax-x), var(--parallax-y));
  will-change: transform;
}

/* Квіткова рама (барвінок) */
.invitation__barvinok {
  position: absolute;
  inset: 0;
  background-image: url("./assets/barvinok-rama.png");
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: min(78%, 22rem) auto;
  opacity: 1;
  filter: saturate(1.35) contrast(1.18) brightness(1.02) drop-shadow(0 1px 1px rgba(255, 255, 255, 0.35));
  animation: barvinok-breathe 9s ease-in-out infinite;
}

@keyframes barvinok-breathe {

  0%,
  100% {
    opacity: 0.88;
    transform: translateY(0);
  }

  50% {
    opacity: 0.96;
    transform: translateY(-5px);
  }
}

/* Окремий блок на всю ширину .invitation: смуги по лівому й правому краю картки */
/* Період повтору орнаменту: вихідний PNG 122×634 px — calc за шириною смуги */
.invitation__frame {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  min-height: 36rem;
  margin: 0;
  padding: 2.5rem 4.75rem 2.5rem 2rem;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(217, 239, 255, 0.58) 0%, rgba(185, 221, 255, 0.58) 100%),
    url("./assets/border-vyshyvanka.png");
  background-repeat: no-repeat, repeat-y;
  background-position: center, right top;
  background-size: cover, 2.85rem auto;
  border-radius: 18px;
  box-shadow:
    0 16px 40px rgba(24, 74, 112, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

@media (max-width: 520px) {
  .invitation__frame {
    padding: 1.75rem 3.2rem 1.75rem 1.1rem;
  }
}

.invitation__header {
  text-align: center;
  margin-bottom: 1.75rem;
  padding-top: 0.25rem;
  opacity: 0;
  animation: rise-in 0.75s ease-out 0.35s forwards;
}

.invitation__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue-deep);
  font-weight: 600;
}

.invitation__title {
  margin: 0;
  font-family: "Marck Script", cursive;
  font-size: clamp(2.1rem, 5vw, 2.85rem);
  color: var(--blue-deep);
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.invitation__body {
  margin: 0 auto;
  max-width: 24rem;
  margin-left: auto;
  padding-left: clamp(0.5rem, 1vw, 1.25rem);
  font-size: 1.2rem;
  line-height: 1.65;
  text-align: left;
}

.invitation__body p {

  opacity: 0;
  animation: rise-in 0.7s ease-out forwards;
}

.invitation__body p:nth-child(1) {
  animation-delay: 0.5s;
}

.invitation__body p:nth-child(2) {
  animation-delay: 0.68s;
}

.invitation__body p:nth-child(3) {
  animation-delay: 0.86s;
}

.invitation__body p:last-child {
  margin-bottom: 0;
}

.invitation__when {
  margin-top: 1.25rem !important;
  font-weight: 600;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Поля для заповнення */
.field {
  display: inline;
  padding: 0 0.12em;
  border-bottom: 1.5px dashed var(--blue);
  color: var(--blue-deep);
  font-weight: 600;
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.field:hover,
.field:focus-visible {
  outline: none;
  color: var(--ink);
  border-bottom-color: var(--blue-deep);
  background-color: rgba(74, 144, 200, 0.08);
}


/* Менше руху — доступність */
@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
    background-size: auto;
  }

  .invitation {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .invitation:hover {
    box-shadow:
      0 4px 24px rgba(28, 28, 31, 0.08),
      0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  }

  .invitation__decor {
    transform: none !important;
  }

  .invitation__barvinok {
    animation: none;
  }

  .music-btn.playing i {
    animation: none;
  }
}

/* Музика — як на головному сайті (кнопка + фіксоване положення) */
.music-control {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
}

.music-btn {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  border: none;
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(45, 95, 143, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.35s ease,
    visibility 0.35s ease;
  opacity: 0;
  visibility: hidden;
}

.music-btn.visible {
  opacity: 1;
  visibility: visible;
}

@media (hover: hover) {
  .music-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(45, 95, 143, 0.45);
  }
}

.music-btn i {
  transition: transform 0.3s ease;
}

.music-btn.playing i {
  animation: rotate-music 4s linear infinite;
}

@keyframes rotate-music {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media print {
  body {
    animation: none;
    background: #fff;
    padding: 0;
  }

  .invitation {
    box-shadow: none;
    border: none;
    max-width: none;
    min-height: auto;
    animation: none;
    opacity: 1;
    transform: none;
  }

  .invitation:hover {
    box-shadow: none;
  }

  .invitation__decor {
    transform: none !important;
  }

  .invitation__barvinok {
    animation: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .invitation__header,
  .invitation__body p,
  .invitation__footer {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .music-control {
    display: none;
  }

  .invitation__frame {
    animation: none !important;
    background-position: left top, right top;
  }
}
