/* =========================================================================
   Серёжа и Катя — приглашение на свадьбу (17 ноября 2026)
   -------------------------------------------------------------------------
   1.  Переменные оформления
   2.  База и типографика
   3.  Утилиты: контейнер, разделитель, кнопки, ссылки, анимация появления
   4.  Первый экран
   5.  Секции и общая типографика текста
   6.  Программа дня (временная линия)
   7.  Места проведения
   8.  Обратный отсчёт
   9.  Финальный блок
   10. Уменьшенная анимация и печать
   ========================================================================= */

/* ------------------------- 1. Переменные оформления ---------------------- */
:root {
  /* Цвета */
  --cream: #faf6ef;          /* тёплый молочный фон */
  --cream-card: #fdfaf5;     /* фон карточки-приглашения */
  --cream-band: rgba(242, 234, 221, 0.6);  /* тёплая полоса (#f2eadd) для секции с таймером */
  --graphite: #2e2c29;       /* основной текст */
  --graphite-soft: #5c574f;  /* второстепенный текст */
  --olive: #5f664b;          /* приглушённый оливковый */
  --olive-soft: #8c9276;     /* оливковый для декора (не для текста) */
  --burgundy: #6e2b33;       /* мягкий бордовый */
  --rule: rgba(46, 44, 41, 0.14);          /* тонкие линии из графита */
  --rule-soft: rgba(46, 44, 41, 0.08);
  --gold-line: rgba(176, 141, 79, 0.55);   /* тёплое золото (#b08d4f) — только линии */

  /* Шрифты: выразительная антиква для заголовков + лаконичный гротеск для текста.
     Запасные варианты — системные шрифты с поддержкой кириллицы. */
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Ритм и размеры */
  --container: 68rem;
  --container-narrow: 44rem;
  --space-section: clamp(4rem, 13vw, 8rem);
  --radius: 2px;
  --tap: 2.75rem;            /* минимальная зона касания — 44px */

  color-scheme: light;
}

/* ------------------------- 2. База и типографика ------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--cream);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;   /* плавный переход по якорям */
}

body {
  margin: 0;
  /* Ненавязчивая текстура бумаги: SVG-шум, встроенный в CSS */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23paper)' opacity='.05'/%3E%3C/svg%3E");
  background-repeat: repeat;
  color: var(--graphite);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  font-weight: 400;
  line-height: 1.75;
  overflow-x: hidden;        /* страховка от горизонтальной прокрутки */
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

p,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection {
  background-color: rgba(110, 43, 51, 0.14);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Переход к содержимому с клавиатуры */
.skip-link {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 10;
  padding: 0.8rem 1.4rem;
  background-color: var(--graphite);
  color: var(--cream-card);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translate(-50%, -140%);
  transition: transform 0.25s ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

/* ------------------------------ 3. Утилиты ------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip-path: inset(50%);
}

/* Атрибут hidden должен побеждать любой display из классов */
[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* Разделитель: тонкие линии и веточка по центру */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.85rem, 4vw, 1.4rem);
  width: 100%;
  max-width: 21rem;
  margin: 0 auto clamp(1.5rem, 5vw, 2.25rem);
  color: var(--olive);
}

.divider__line {
  flex: 1 1 auto;
  height: 1px;
  background-color: var(--rule);
}

.divider__mark {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
}

/* Кнопка-«оттиск»: тонкая рамка, прописные буквы, сдержанный hover */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: var(--tap);
  margin-top: clamp(0.5rem, 3vw, 1rem);
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--graphite);
  border-radius: var(--radius);
  background-color: transparent;
  color: var(--graphite);
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 2.9vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.button:hover {
  background-color: var(--graphite);
  border-color: var(--graphite);
  color: var(--cream-card);
}

.button__icon {
  width: 0.95rem;
  height: 0.95rem;
  transform: rotate(90deg);   /* стрелка вниз — подсказка о переходе к программе */
  transition: transform 0.35s ease;
}

.button:hover .button__icon {
  transform: rotate(90deg) translateX(2px);
}

/* Ссылка со стрелкой */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--tap);
  color: var(--burgundy);
  font-size: clamp(0.7rem, 2.9vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.link-arrow__text {
  padding-bottom: 2px;
  border-bottom: 1px solid var(--gold-line);
  transition: border-color 0.3s ease;
}

.link-arrow:hover .link-arrow__text {
  border-color: var(--burgundy);
}

.link-arrow__icon {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 0.3s ease;
}

.link-arrow:hover .link-arrow__icon {
  transform: translate(2px, -2px);
}

/* Появление блоков при прокрутке.
   Класс .js ставится в index.html — без JavaScript контент виден сразу. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s cubic-bezier(0.22, 0.7, 0.28, 1),
    transform 0.8s cubic-bezier(0.22, 0.7, 0.28, 1);
}

/* ---------------------------- 4. Первый экран ---------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 5vw, 2.25rem);
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(1.5rem, 7vw, 4rem) clamp(1rem, 5vw, 2.5rem);
  text-align: center;
  /* Очень мягкий тёплый свет сверху — эффект бумаги под лампой */
  background-image: radial-gradient(120% 75% at 50% 0%,
      rgba(255, 255, 255, 0.6),
      rgba(255, 255, 255, 0) 62%);
}

/* Карточка-приглашение с двойной тонкой рамкой */
.hero__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 4vw, 1.6rem);
  width: 100%;
  max-width: 40rem;
  padding: clamp(2rem, 9vw, 4.25rem) clamp(1.25rem, 7vw, 3.75rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background-color: var(--cream-card);
}

.hero__card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--rule-soft);
  border-radius: 1px;
  pointer-events: none;
}

.eyebrow {
  font-size: clamp(0.66rem, 2.7vw, 0.74rem);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--olive);
}

.hero__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05em;
  font-size: clamp(2.75rem, 13vw, 4rem);
  line-height: 0.98;
}

.hero__amp {
  margin-block: 0.02em;
  font-size: 0.78em;
  font-style: italic;
  line-height: 1;
  color: var(--burgundy);
}

.hero__date {
  font-size: clamp(0.78rem, 3.2vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--burgundy);
}

.hero__lead {
  max-width: 24rem;
  font-size: clamp(0.98rem, 3.9vw, 1.08rem);
  line-height: 1.7;
  color: var(--graphite-soft);
  text-wrap: balance;
}

/* Деликатная подсказка о прокрутке */
.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.scroll-hint__line {
  position: relative;
  display: block;
  width: 1px;
  height: 2.75rem;
  background-image: linear-gradient(to bottom,
      rgba(46, 44, 41, 0) 0%,
      var(--rule) 45%,
      var(--rule) 100%);
  overflow: hidden;
}

.scroll-hint__line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background-color: var(--olive);
  animation: hint-drop 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.scroll-hint__text {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--olive);
}

@keyframes hint-drop {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }
  25% {
    opacity: 1;
  }
  80% {
    opacity: 0;
  }
  100% {
    opacity: 0;
    transform: translateY(2.75rem);
  }
}

/* На низких экранах подсказку о прокрутке убираем, чтобы не теснить карточку */
@media (max-height: 620px) {
  .scroll-hint {
    display: none;
  }
}

/* --------------------- 5. Секции и типографика текста -------------------- */
.section {
  padding-block: var(--space-section);
  scroll-margin-top: clamp(1rem, 4vw, 2rem);
}

.section__title {
  margin-bottom: clamp(1.5rem, 5vw, 2.25rem);
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  text-align: center;
}

.section__text {
  max-width: 34rem;
  margin-inline: auto;
  font-size: clamp(1rem, 3.9vw, 1.08rem);
  line-height: 1.8;
  color: var(--graphite-soft);
  text-align: center;
  text-wrap: pretty;
}

/* Дата как типографический акцент: линия — дата — линия */
.date-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 4vw, 1.6rem);
  margin-top: clamp(2rem, 7vw, 3rem);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6.6vw, 2.25rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.02em;
  font-variant-numeric: lining-nums;
  color: var(--burgundy);
  text-align: center;
}

.date-mark::before,
.date-mark::after {
  content: "";
  flex: 1 1 auto;
  min-width: 1.25rem;
  max-width: 6rem;
  height: 1px;
}

.date-mark::before {
  background-image: linear-gradient(to left, var(--gold-line), rgba(176, 141, 79, 0));
}

.date-mark::after {
  background-image: linear-gradient(to right, var(--gold-line), rgba(176, 141, 79, 0));
}

/* ---------------------- 6. Программа дня: временная линия ---------------- */
.timeline {
  position: relative;
  display: grid;
  gap: clamp(2.25rem, 7vw, 3rem);
  max-width: 44rem;
  margin-inline: auto;
  padding-left: 1.75rem;
  list-style: none;
}

/* Вертикальная линия времени */
.timeline::before {
  content: "";
  position: absolute;
  top: 0.6em;
  bottom: 0.6em;
  left: 5px;
  width: 1px;
  background-color: var(--rule);
}

.timeline__item {
  position: relative;
}

/* Точка на линии */
.timeline__item::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: -1.75rem;
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-radius: 50%;
  background-color: var(--olive);
  box-shadow: 0 0 0 4px var(--cream);
}

.timeline__time {
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6.5vw, 1.9rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.02em;
  font-variant-numeric: lining-nums;
  color: var(--burgundy);
}

.timeline__time--text {
  padding-top: 0.3rem;
  font-size: clamp(1.15rem, 5.2vw, 1.4rem);
  font-style: italic;
  font-weight: 400;
  color: var(--olive);
}

.timeline__title {
  margin-bottom: 0.4rem;
  font-size: clamp(1.3rem, 5.6vw, 1.7rem);
}

.timeline__text {
  max-width: 34rem;
  line-height: 1.75;
  color: var(--graphite-soft);
  text-wrap: pretty;
}

/* ----------------------- 7. Места проведения ----------------------------- */
.venues {
  display: grid;
  gap: clamp(1rem, 4vw, 1.5rem);
  max-width: 44rem;
  margin-inline: auto;
}

.venue {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.75rem, 7vw, 2.5rem) clamp(1.25rem, 5vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background-color: var(--cream-card);
  text-align: center;
  transition: border-color 0.35s ease;
}

.venue:hover {
  border-color: var(--olive-soft);
}

.venue__icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: clamp(0.9rem, 3vw, 1.25rem);
  color: var(--olive);
}

.venue__icon--fruit {
  width: 3.75rem;
  height: 2.5rem;
}

.venue__title {
  font-size: clamp(1.35rem, 5.6vw, 1.6rem);
}

.venue__meta {
  margin-top: 0.4rem;
  font-size: clamp(0.68rem, 2.8vw, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite-soft);
  text-wrap: balance;
}

.venue .link-arrow {
  margin-top: clamp(0.75rem, 3vw, 1.15rem);
}

/* ------------------------- 8. Обратный отсчёт ---------------------------- */
.section--countdown {
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  background-color: var(--cream-band);
}

.countdown {
  max-width: 34rem;
  margin-inline: auto;
  text-align: center;
}

/* Показывается, если JavaScript отключён */
.countdown__static {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 6vw, 2rem);
  color: var(--burgundy);
}

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.4rem, 2.5vw, 1.25rem);
}

.countdown__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding-inline: clamp(0.25rem, 2vw, 1rem);
  border-left: 1px solid var(--rule);
}

.countdown__cell:first-child {
  border-left: 0;
}

.countdown__value {
  min-width: 2ch;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 10vw, 3.25rem);
  font-weight: 500;
  line-height: 1;
  /* Цифры одной высоты и ширины — таймер не «дрожит» при смене секунд */
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--graphite);
}

.countdown__label {
  font-size: clamp(0.58rem, 2.6vw, 0.68rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive);
}

.countdown__done {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 8vw, 2.75rem);
  color: var(--burgundy);
}

/* --------------------------- 9. Финальный блок --------------------------- */
.section--final {
  padding-bottom: clamp(5rem, 16vw, 9rem);
}

.final__quote {
  max-width: 30rem;
  margin-inline: auto;
  font-size: clamp(1.45rem, 6.6vw, 2.15rem);
  font-style: italic;
  line-height: 1.4;
  text-align: center;
}

.final__sign {
  margin-top: clamp(1.5rem, 5vw, 2.25rem);
  font-size: clamp(0.95rem, 3.7vw, 1.05rem);
  color: var(--graphite-soft);
  text-align: center;
}

.final__names {
  font-family: var(--font-display);
  font-size: 1.3em;
  color: var(--burgundy);
}

.final__date {
  margin-top: 0.4rem;
  font-size: clamp(0.7rem, 2.9vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--olive);
  text-align: center;
}

.final__sprig {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  margin: clamp(2rem, 7vw, 3rem) auto 0;
  color: var(--olive-soft);
}

/* ---------------------- 10. Планшеты и большие экраны -------------------- */
@media (min-width: 600px) {
  /* Имена в одну строку: Серёжа & Катя */
  .hero__names {
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 0.22em;
    font-size: clamp(3rem, 8.5vw, 5.25rem);
  }

  .hero__amp {
    margin-block: 0;
  }
}

@media (min-width: 760px) {
  .venues {
    grid-template-columns: 1fr 1fr;
    max-width: none;
  }

  /* Временная линия: время слева, линия по центру отступа */
  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    left: 11.5rem;
    top: 0.5em;
    bottom: 0.5em;
  }

  .timeline__item {
    display: grid;
    grid-template-columns: 10rem 1fr;
    column-gap: 3rem;
    align-items: start;
  }

  .timeline__item::before {
    left: 11.5rem;
    margin-left: -3.5px;
  }

  .timeline__time {
    margin-bottom: 0;
    text-align: right;
  }

  .timeline__time--text {
    padding-top: 0.4rem;
  }
}

/* --------------- 11. Уменьшенная анимация и режим печати ----------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  /* Необязательные анимации появления отключаем полностью */
  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .scroll-hint__line::after {
    animation: none;
    opacity: 0;
  }
}

@media print {
  html {
    background-color: #fff;
  }

  body {
    background-image: none;
    color: #000;
  }

  .skip-link,
  .scroll-hint,
  .button,
  .divider__line,
  .countdown__grid,
  .countdown__done {
    display: none !important;
  }

  /* На печати показываем дату вместо таймера */
  .countdown__static[hidden] {
    display: block !important;
  }

  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .section {
    padding-block: 1.2cm;
    break-inside: avoid;
  }

  .hero__card,
  .venue,
  .timeline__item {
    break-inside: avoid;
  }
}
