:root {
  /* Палитра */
  --color-wine: #7a0303;
  --color-wine-soft: #8f1b1b;
  --color-cream: #fefaef;
  --color-cream-100: #fffaf2;
  --color-cream-200: #efe3d2;
  --color-text: #681313;
  /* Затемнено для AA контраста на cream-фоне (>=4.5:1) */
  --color-muted: #7d5247;
  --color-white: #ffffff;
  --color-success: #2e6d3f;
  --color-error: #9f1717;
  --color-border-wine: rgba(122, 3, 3, 0.18);
  --color-border-wine-strong: rgba(122, 3, 3, 0.22);
  /* Скруглённая шкала: 8 / 16 / 24 / pill */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --container-width: 640px;
  --container-width-wide: clamp(640px, 64.5vw, 867px);
  --hero-top-offset: 7%;
  --space-xs: clamp(8px, 1.2vw, 14px);
  --space-sm: clamp(12px, 1.8vw, 22px);
  --space-md: clamp(18px, 2.8vw, 34px);
  --space-lg: clamp(30px, 4.5vw, 56px);
  --space-xl: clamp(44px, 6.4vw, 76px);
  --page-gutter: clamp(20px, 4vw, 32px);
  --section-gap: var(--space-md);
  --section-padding: var(--space-xl);
  --font-heading: "Vetrino", "Cormorant Garamond", Georgia, serif;
  --font-main: "Montserrat Alternates", Arial, sans-serif;
  --font-light: "Montserrat Alternates Light", Arial, sans-serif;
  /* Состояния */
  --focus-ring-width: 2px;
  --focus-ring-offset: 3px;
}

@font-face {
  font-family: "Vetrino";
  src: url("/static/assets/fonts/vetrino/Vetrino.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat Alternates";
  src: url("/static/assets/fonts/montserrat-alternates/MontserratAlternates-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat Alternates Light";
  src: url("/static/assets/fonts/montserrat-alternates/MontserratAlternates-Light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-wine);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 100%;
  letter-spacing: 0;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
}

[x-cloak] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
}

.site-shell {
  width: 100%;
  margin: 0 auto;
  background: var(--color-cream);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: visible;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}

.section {
  padding: var(--section-padding) var(--page-gutter);
  text-align: center;
}

.section:not(.hero) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--section-gap);
}

.section:not(.hero) > :where(h2, h3, p, address, .calendar, .timeline, .swatches, .rsvp-form, .countdown, .contact-row, .button, .wide-image, .bottom-photo-pair, .down-arrow, .heart) {
  margin-top: 0;
  margin-bottom: 0;
}

.js .reveal-block {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
  will-change: opacity, transform;
}

.js .reveal-block.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-cream {
  background: var(--color-cream);
  color: var(--color-text);
}

.section-wine {
  background: var(--color-wine);
  color: var(--color-cream);
}

.hero {
  padding-top: var(--hero-top-offset);
  padding-bottom: var(--space-lg);
  background:
    linear-gradient(
      to bottom,
      var(--color-wine) 0,
      var(--color-wine) calc(100% - 150px),
      var(--color-cream) calc(100% - 150px),
      var(--color-cream) 100%
    );
  color: var(--color-cream);
  text-align: center;
}

.hero__top {
  padding: var(--space-lg) 18px var(--space-lg);
  font-family: var(--font-heading);
}

.eyebrow {
  margin: 0;
  font-family: inherit;
  font-size: clamp(27px, 7.2vw, 40px);
  line-height: 1.05;
  text-transform: none;
  color: inherit;
  opacity: 1;
}

h1,
h2 {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.08;
}

h1 {
  font-size: clamp(42px, 13vw, 58px);
}

.hero h1 {
  font-family: var(--font-heading);
  margin-bottom: 0;
  font-size: clamp(36px, 9.45vw, 54px);
  line-height: 1.02;
  text-transform: uppercase;
  text-wrap: balance;
}

h2 {
  font-size: clamp(34px, 6.2vw, 52px);
}

h3 {
  margin: 0 0 var(--space-md);
  font-family: var(--font-heading);
  font-size: clamp(28px, 5.2vw, 44px);
  font-weight: 400;
  line-height: 1.1;
}

p {
  margin: 0 auto;
  max-width: 30em;
  font-size: clamp(15px, 2.92vw, 23px);
  line-height: 1.58;
}

address {
  margin: 0;
  font-size: clamp(15px, 2.92vw, 23px);
  font-style: normal;
  line-height: 1.5;
}

address strong {
  font-weight: 600;
}

.heart {
  display: block;
  width: clamp(48px, 9vw, 64px);
  height: auto;
  margin: var(--space-md) auto 0;
  /* Сердце-PNG от Tilda — тёмно-винное. Для использования на винном фоне делаем его кремовым через фильтр. */
}

.heart--light {
  /* Для hero (на винном фоне): инвертируем тёмное в светлое */
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.heart--wine {
  /* Для секции «Пожелания» (на кремовом фоне): затемняем для лучшей видимости */
  filter: brightness(0.75) saturate(1.1);
  opacity: 1;
  margin: 0 auto !important;
  width: clamp(38px, 7.2vw, 51px);
}

.heart-block {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--space-md) 0 var(--space-md) 0;
}

.section--compact-top {
  padding-top: 0;
}

.countdown-section {
  background: linear-gradient(
    to bottom,
    var(--color-cream) 0,
    var(--color-cream) calc(100% - 300px),
    var(--color-wine) calc(100% - 300px),
    var(--color-wine) 100%
  );
  position: relative;
  z-index: 1;
  padding-bottom: 150px;
}

.wishes-section {
  padding-bottom: var(--section-padding);
}

.hero__date {
  font-family: inherit;
  margin: 4px 0 0;
  font-size: clamp(34px, 9vw, 50px);
  line-height: 1;
  letter-spacing: 0;
}

.hero__event {
  max-width: calc(100vw - 36px);
  margin-top: var(--space-lg);
}

.hero h1 {
  max-width: calc(100vw - 36px);
}

.hero__top .heart {
  margin-top: var(--space-lg);
}

.polaroid {
  width: calc(100% - var(--page-gutter) - var(--page-gutter));
  max-width: 412px;
  max-width: min(412px, calc(100vw - var(--page-gutter) - var(--page-gutter)));
  margin: var(--space-md) auto 0;
  padding: 0;
  background: transparent;
  border-radius: var(--radius-md);
  transform: none;
  box-shadow: none;
}

.polaroid img {
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--color-cream-200);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.wide-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--color-cream-200);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.countdown-section .wide-image {
  aspect-ratio: 1070 / 1113;
  object-position: center top;
  margin-top: var(--space-xl);
  position: relative;
  z-index: 2;
}

.intro {
  margin-top: 0;
  color: var(--color-text);
}

.intro strong {
  font-weight: 600;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-xs);
  margin: 0 auto;
  max-width: 340px;
  font-size: clamp(15px, 2.92vw, 23px);
  line-height: 1.3;
}

.calendar div {
  color: var(--color-muted);
  font-size: inherit;
}

.calendar span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: var(--radius-pill);
}

.calendar__selected {
  position: relative;
  z-index: 0;
  color: var(--color-cream);
  background: transparent;
  font-weight: 600;
}

.calendar__selected::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 53%;
  left: 50%;
  width: 72px;
  height: 72px;
  background-image: url("/static/assets/images/heart2.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  animation: heartPulse 3.4s ease-in-out infinite;
  transform: translate(-50%, -50%);
}

@keyframes heartPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.down-arrow {
  width: clamp(90px, 17.4vw, 174px);
  margin: 0 auto;
  animation: arrowFloat 4.9s ease-in-out infinite;
}

.down-arrow img {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes arrowFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(10px);
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(56px, 9vw, 72px);
  padding: 0 1.25em;
  border: 2px solid var(--color-wine);
  border-radius: var(--radius-pill);
  background: var(--color-wine);
  color: var(--color-cream);
  font: inherit;
  font-size: clamp(13px, 2.35vw, 18px);
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(122, 3, 3, 0.18);
}

.button:active {
  transform: translateY(0);
  box-shadow: none;
}

.button:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-wine);
  outline-offset: var(--focus-ring-offset);
}

.button--light:focus-visible {
  outline-color: var(--color-cream);
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

.button--full {
  width: 100%;
}

.button span {
  display: inline-block;
  min-width: 112px;
}

.button--light {
  border-color: var(--color-cream);
  background: transparent;
  color: var(--color-cream);
}

.button--telegram::before,
.contact-link::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 1.37em;
  height: 1.37em;
  background-color: currentColor;
  vertical-align: -0.25em;
}

.button--telegram {
  gap: 0.5em;
}

.button--telegram::before,
.contact-link--telegram::before {
  clip-path: polygon(6% 47%, 94% 12%, 78% 91%, 52% 67%, 38% 81%, 40% 61%);
}

.contact-link--phone::before {
  clip-path: polygon(28% 5%, 43% 5%, 50% 29%, 40% 36%, 49% 52%, 64% 60%, 72% 50%, 95% 57%, 95% 72%, 88% 88%, 75% 95%, 52% 88%, 30% 72%, 14% 50%, 5% 26%, 12% 12%);
}

.timeline {
  display: grid;
  gap: var(--space-md);
}

.timeline div {
  display: grid;
  gap: var(--space-xs);
}

.timeline strong {
  font-family: var(--font-heading);
  font-size: clamp(29px, 5.1vw, 45px);
  font-weight: 400;
}

.timeline span {
  font-size: clamp(15px, 2.92vw, 23px);
  line-height: 1.5;
}

.swatches {
  display: flex;
  justify-content: center;
  margin: 0;
}

.swatches img {
  width: clamp(36px, 6.8vw, 55px);
  height: clamp(36px, 6.8vw, 55px);
  border-radius: var(--radius-pill);
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(78, 28, 18, 0.12);
  margin-left: -7px;
  position: relative;
}

.swatches img:first-child {
  margin-left: 0;
}

.dress-code-section {
  margin: 0 var(--page-gutter);
  padding: var(--section-padding) 0 var(--section-padding);
  overflow: hidden;
}

.dress-code-section h2,
.dress-code-section p,
.dress-code-section .swatches,
.dress-code-section .heart-block {
  padding-right: var(--space-md);
  padding-left: var(--space-md);
}

.dress-code-heart {
  margin: 0;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.dress-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.03;
  margin: 0;
  overflow: hidden;
  background: var(--color-cream-200);
  cursor: pointer;
  user-select: none;
}

.dress-slider:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-wine);
  outline-offset: var(--focus-ring-offset);
}

.dress-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dress-slider img.is-active {
  opacity: 1;
  z-index: 1;
}

.rsvp-form {
  display: grid;
  gap: var(--space-sm);
  text-align: left;
}

.rsvp-form label,
.rsvp-form legend {
  font-size: clamp(13px, 2.43vw, 20px);
  line-height: 1.45;
}

.rsvp-form input[type="text"] {
  width: 100%;
  margin-top: var(--space-xs);
  padding: var(--space-sm);
  border: 1px solid var(--color-border-wine-strong);
  border-radius: var(--radius-md);
  background: var(--color-cream-100);
  color: var(--color-text);
  font: inherit;
}

.rsvp-form input[type="text"]:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-wine);
  outline-offset: 2px;
  border-color: var(--color-wine);
}

fieldset {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  padding: var(--space-sm);
  border: 1px solid var(--color-border-wine);
  border-radius: var(--radius-md);
}

fieldset label {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border-wine);
  border-radius: var(--radius-pill);
  background: rgba(255, 250, 240, 0.72);
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

fieldset label:has(input:checked) {
  border-color: var(--color-wine);
  background: var(--color-wine);
  color: var(--color-cream);
}

fieldset label:has(input:focus-visible) {
  outline: var(--focus-ring-width) solid var(--color-wine);
  outline-offset: var(--focus-ring-offset);
}

fieldset input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-message {
  margin: 0;
  min-height: 30px;
  font-size: clamp(13px, 2.43vw, 20px);
  line-height: 1.5;
}

.form-message.success {
  color: var(--color-success);
}

.form-message.error {
  color: var(--color-error);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xs);
  margin: 0;
}

.countdown div {
  padding: var(--space-sm) var(--space-xs);
  border-radius: var(--radius-md);
  background: rgba(122, 3, 3, 0.08);
}

.countdown strong {
  display: block;
  font-size: clamp(22px, 4.2vw, 35px);
}

.countdown span {
  font-size: clamp(11px, 1.94vw, 15px);
  color: var(--color-muted);
}

.today {
  font-family: var(--font-heading);
  font-size: clamp(22px, 4.2vw, 35px);
}

.bottom-photos-section {
  overflow: hidden;
}

.bottom-photo-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  max-width: 390px;
  margin: var(--space-md) auto 0;
  padding: var(--space-lg) var(--space-xs);
}

.bottom-photo {
  width: 100%;
  height: auto;
  transform-origin: 50% 80%;
  will-change: transform;
}

.bottom-photo--left {
  transform: rotate(-4deg);
  animation: photoSwayLeft 4.8s ease-in-out infinite;
}

.bottom-photo--right {
  transform: rotate(4deg);
  animation: photoSwayRight 5.2s ease-in-out infinite;
  margin-left: -20px;
  position: relative;
  z-index: 1;
}

@keyframes photoSwayLeft {
  0%,
  100% {
    transform: rotate(-4deg) translateY(0);
  }

  50% {
    transform: rotate(-1.5deg) translateY(-4px);
  }
}

@keyframes photoSwayRight {
  0%,
  100% {
    transform: rotate(4deg) translateY(0);
  }

  50% {
    transform: rotate(1.5deg) translateY(4px);
  }
}

.contacts .contact-row {
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-sm);
  border: 1px solid rgba(254, 250, 239, 0.24);
  border-radius: var(--radius-md);
  text-align: center;
}

.contacts .contact-row span,
.contacts .contact-row a {
  font-size: clamp(13px, 2.35vw, 18px);
  line-height: 1.5;
}

.contacts a:not(.button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42em;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.contacts {
  padding-bottom: var(--space-lg);
  margin-top: -150px;
  padding-top: 150px;
  position: relative;
}

.contacts-gradient {
  background: linear-gradient(
    to bottom,
    var(--color-cream) 0,
    var(--color-cream) calc(100% - 150px),
    var(--color-wine) calc(100% - 150px),
    var(--color-wine) 100%
  );
}

.contacts a:not(.button):focus-visible {
  outline: var(--focus-ring-width) solid var(--color-cream);
  outline-offset: var(--focus-ring-offset);
  border-radius: 4px;
}

.hero__top,
.polaroid,
.intro > *,
.section > :where(h2, p, address, .calendar, .timeline, .swatches, .rsvp-form, .countdown, .contact-row, .button, .wide-image, .bottom-photo-pair) {
  max-width: var(--container-width);
  margin-right: auto;
  margin-left: auto;
}

.polaroid {
  width: calc(100% - var(--page-gutter) - var(--page-gutter));
}

@media (max-width: 699px) {
  .hero__top,
  .intro > *,
  .section > :where(h2, p, address, .calendar, .timeline, .swatches, .rsvp-form, .countdown, .contact-row, .button, .wide-image, .bottom-photo-pair) {
    max-width: calc(100vw - var(--page-gutter) - var(--page-gutter));
  }

  .polaroid {
    width: calc(100% - var(--page-gutter) - var(--page-gutter));
    max-width: min(342px, calc(100vw - var(--page-gutter) - var(--page-gutter)));
  }

  .hero h1 {
    font-size: clamp(32px, 8vw, 48px);
  }

  .eyebrow {
    font-size: clamp(30px, 7.7vw, 43px);
  }

  .hero__date {
    font-size: clamp(33px, 8.7vw, 48px);
  }
}

@media (min-width: 700px) and (orientation: portrait) {
  body {
    padding: 0;
    background: var(--color-cream);
  }

  .site-shell {
    width: 100%;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .section > :where(h2, p, address, .calendar, .timeline, .swatches, .rsvp-form, .countdown, .contact-row, .button, .wide-image, .bottom-photo-pair) {
    max-width: var(--container-width);
    margin-right: auto;
    margin-left: auto;
  }

  .dress-code-section {
    max-width: var(--container-width);
    margin-right: auto;
    margin-left: auto;
  }
}

@media (min-width: 900px) and (orientation: landscape) {
  body {
    padding: 0;
    background: var(--color-cream);
  }

  .site-shell {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .hero__top,
  .polaroid,
  .intro > *,
  .section > :where(h2, p, address, .calendar, .timeline, .swatches, .rsvp-form, .countdown, .contact-row, .button, .wide-image, .bottom-photo-pair) {
    max-width: var(--container-width-wide);
    margin-right: auto;
    margin-left: auto;
  }

  .polaroid {
    width: calc(100% - var(--page-gutter) - var(--page-gutter));
  }

  .dress-code-section {
    max-width: var(--container-width-wide);
    margin-right: auto;
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal-block {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .dress-slider img {
    transition: none;
  }

  .bottom-photo {
    animation: none;
  }

  .down-arrow {
    animation: none;
  }

  .calendar__selected::before {
    animation: none;
  }
}
