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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; /* без серой вспышки при нажатии; отклик даёт :active */
  scroll-behavior: smooth;
}

::selection {
  color: var(--color-text);
  background: rgb(163 171 142 / 0.45); /* шалфей вместо системного синего */
}

/* Нажатия срабатывают сразу, без ожидания двойного тапа; подписи кнопок не выделяются долгим нажатием */
a,
button,
label,
summary {
  touch-action: manipulation;
}

button,
.button {
  -webkit-user-select: none;
  user-select: none;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-variant-numeric: lining-nums; /* ровные цифры вместо «старостильных» у Cormorant */
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-accent);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Страница — вертикальная «лента»: на телефоне во всю ширину, на компьютере по центру */

.page {
  max-width: var(--page-width);
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: clip;
  background: var(--color-bg);
}

@media (min-width: 481px) {
  body {
    background: #e7e4dc url("../img/bg-lace.jpg") center / cover fixed;
  }

  .page {
    box-shadow: 0 0 60px rgb(40 40 30 / 0.25);
  }
}

/* Секции */

.section {
  padding: var(--space-section) 1.5rem 0;
  text-align: center;
}

.section__title {
  margin: 0 0 1.5rem;
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 12vw, 3.25rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-accent);
}

/* Первый экран по образцу: орхидеи по углам, текст в свободных местах между ними.
   Фон — картинка 896×1600; на телефонах она вписана по высоте, поэтому позиции
   по вертикали заданы в % высоты экрана и совпадают с зонами на картинке. */

.hero {
  position: relative;
  isolation: isolate;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* картинка всегда чуть шире экрана (как на высоких телефонах): орхидеи уходят к краям,
     середина свободна под текст; и при этом всегда закрывает всю высоту */
  /* сверху лёгкая дымка: на коротких экранах лепестки заходят под меню */
  background-color: #efeae2;
  background-image:
    linear-gradient(to bottom, rgb(239 234 226 / 0.9), rgb(239 234 226 / 0) 76px),
    url("../img/hero-orchids.jpg");
  background-position: 0 0, center;
  background-repeat: no-repeat;
  background-size:
    100% 100%,
    max(122%, calc(max(100svh, 560px) * 0.56)) auto;
  /* низ растворяется в следующей секции */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent);
}

.hero__nav {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  left: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero__monogram {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 300;
  line-height: 1;
  color: var(--color-text);
  text-decoration: none;
}

.hero__monogram-line {
  width: 1px;
  height: 1.5rem;
  background: currentColor;
  opacity: 0.55;
}

.hero__links {
  display: flex;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 11px — меньше на телефоне не читается; высота 44px — палец попадает */
.hero__links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-numbers);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
}

/* центральная колонка между орхидеями: начинается под бутонами */
.hero__content {
  position: absolute;
  top: 29.5%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(13.5rem, 100% - 2.5rem);
  transform: translateX(-50%);
}

.hero__content > p {
  margin: 0;
}

.hero__greeting {
  margin-bottom: 0.85rem !important;
  text-wrap: balance; /* ровные строки при переносе длинных имён */
  overflow-wrap: anywhere; /* слово без пробелов не вылезает за край экрана */
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text);
}

.hero__kicker {
  margin-bottom: 0.9rem !important;
  font-family: var(--font-numbers);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.hero__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 2.05rem;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
}

/* каллиграфическое «и» с росчерком между именами */
.hero__and {
  position: relative;
  display: grid;
  place-items: center;
  width: 11.5rem;
  height: 2.5rem;
  text-transform: none;
}

.hero__swash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--color-text);
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.7;
}

.hero__and-letter {
  position: relative;
  font-family: var(--font-script);
  font-size: 1.15em;
  letter-spacing: 0;
}

.hero__date {
  margin-top: 1.1rem !important;
  font-family: var(--font-numbers);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero__place {
  margin-top: 0.4rem !important;
  font-family: var(--font-numbers);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* «Листайте вниз» — по центру под датой, правее нижней орхидеи */
.hero__scroll {
  position: absolute;
  top: 63%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  max-width: 8em;
  font-family: var(--font-numbers);
  font-size: 0.6875rem;
  line-height: 1.6;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
  transform: translateX(-50%);
}

.hero__scroll::before {
  content: "";
  width: 1px;
  height: 1rem;
  background: var(--color-line);
}

.hero__scroll-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--color-muted);
  border-radius: 50%;
}

.hero__scroll-icon svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* справа внизу — правее лепестков нижней орхидеи; строки разбиты как в образце */
.hero__quote {
  position: absolute;
  top: 76%;
  right: 1.25rem;
  max-width: 9rem;
  margin: 0;
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.5;
  text-align: right;
  white-space: pre-line;
  color: var(--color-text);
}

.hero__quote::after {
  content: "";
  display: block;
  width: 3.25rem;
  height: 1px;
  margin: 0.8rem 0 0 auto;
  background: var(--color-line);
}

/* Короткие экраны (iPhone SE и т. п.): текст на ступень мельче, без цитаты
   и «Листайте вниз» — между цветами им нет места */
@media (max-height: 759px) {
  .hero__quote,
  .hero__scroll {
    display: none;
  }

  .hero__content {
    top: 28%;
  }

  .hero__greeting {
    font-size: 1.2rem;
  }

  .hero__names {
    font-size: 1.85rem;
  }

  .hero__and {
    height: 2.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Кнопки */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.5rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 140ms var(--ease-out),
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}

/* отклик в момент касания, а не когда палец отпущен */
.button:active {
  transform: scale(0.97);
}

.button:disabled {
  cursor: progress;
  opacity: 0.75;
  transform: none;
}

.button--ghost {
  color: var(--color-accent);
  background: transparent;
}

/* hover только у мыши: на телефоне он «залипает» после нажатия */
@media (hover: hover) and (pointer: fine) {
  .button:hover {
    background: var(--color-text);
    border-color: var(--color-text);
  }

  .button--ghost:hover {
    color: #fff;
    background: var(--color-accent);
    border-color: var(--color-accent);
  }
}

/* Появление секций (класс ставит reveal.js, только если анимации разрешены) */

.reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}
