/* ===========================================================
   Рома & Маша — дизайн-система crayon
   =========================================================== */

:root {
  /* Палитра */
  --paper:      #F9F5E7;  /* фон-«бумага» */
  --paper-soft: #FFFCEF;  /* светлый слой для карточек */
  --ink:        #4A3F35;  /* основной тёплый текст */
  --ink-soft:   #6E6253;  /* приглушённый текст (AA на креме) */
  --coral:      #F4A09A;  /* акцент-заливка */
  --coral-deep: #E8837B;  /* hover-заливка */
  --coral-ink:  #A8362C;  /* тёмный терракот ДЛЯ ТЕКСТА (WCAG AA) */
  --coral-tint: #FBE3DF;  /* подложка акцента */

  /* crayon-палитра (россыпь) */
  --lavender: #B39DDB;
  --sage:     #A5D6A7;
  --peach:    #F8C99C;
  --blue:     #64B5F6;
  --pink:     #CE93D8;
  --orange:   #FFB74D;

  /* Шрифты */
  --font-display: 'Pangolin', cursive;
  --font-body:    'Pangolin', cursive;

  /* Ритм */
  --radius:    24px;
  --radius-sm: 16px;
  --blob:      22px 28px 18px 26px;  /* неровная «нарисованная» скруглённость */
  --line:      2.5px;                /* толщина crayon-контура у интерфейсов */
  --maxw:    1180px;
  --maxw-sm: 760px;

  /* Кастомные easing (emilkowalski) — встроенные слишком «слабые» */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background-color: var(--paper);
  line-height: 1.65;
  letter-spacing: 0.005em;
  overflow-x: hidden;
}

/* Бумажная текстура (зерно поверх фона) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

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

a { color: inherit; }

/* Видимый focus для клавиатурной навигации */
:focus-visible {
  outline: 3px solid var(--coral-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Контейнеры ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
  position: relative;
  z-index: 1;
}
.container--narrow { max-width: var(--maxw-sm); }

/* ---------- Типографика секций ---------- */
.section {
  position: relative;
  padding: 36px 0;
  scroll-margin-top: 72px;
  z-index: 1;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.0;
  text-align: center;
  color: var(--ink);
  margin: 0 0 32px;
  position: relative;
}
.section__title::after {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath d='M5 8 C26 3 44 2 61 5 C77 8 95 8 115 3' fill='none' stroke='%23A8362C' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  display: block;
  width: 124px;
  height: 12px;
  margin: -9px auto 0;
  filter: url(#crayon);
  opacity: 0.9;
}

/* ---------- Кнопки (Circle sketch — нарисованный от руки овал) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 30px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: transform 0.18s var(--ease-out), color 0.2s ease;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 4px -8px;
  border: 2.5px solid var(--coral-ink);
  border-radius: 50%;
  filter: url(#crayon);
  pointer-events: none;
  transition: transform 0.18s var(--ease-out);
}
.btn:hover { color: var(--coral-ink); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-1px); }
  .btn:hover::after { transform: scale(1.04); }
}
.btn:active { transform: translateY(1px); }

.btn--small { padding: 11px 20px; font-size: 0.9rem; }
.btn--small::after { inset: 3px -6px; border-width: 2px; }
.btn--big { padding: 20px 42px; font-size: 1.15rem; }
.btn--big::after { inset: 5px -10px; border-width: 3px; }

/* ---------- Шапка ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 24px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.topbar.is-scrolled {
  background: rgba(249, 245, 231, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px -14px rgba(74, 63, 53, 0.4);
  padding: 10px 24px;
}
.topbar__brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.topbar__nav {
  display: flex;
  gap: 20px;
}
.topbar__nav a {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.topbar__nav a:hover { color: var(--coral-ink); }
.topbar__cta { margin-left: 4px; }

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 22px 20px;
  position: relative;
}
.hero__eyebrow {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  color: var(--coral-ink);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.hero__names {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.4rem, 13vw, 6.5rem);
  line-height: 1;
  margin: 0;
  color: var(--ink);
}
.hero__names .amp {
  color: var(--coral-ink);
  display: inline-block;
  transform: translateY(-2px);
  padding: 0 6px;
}
.hero__date {
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  font-weight: 600;
  color: var(--ink-soft);
  margin: 18px 0 0;
  letter-spacing: 0.02em;
}
.hero__artwrap {
  position: relative;
  width: min(60vw, 720px, 44vh);
  margin: 20px auto 0;
  transform: rotate(-0.8deg);
}
.hero__art { display: block; width: 100%; }
.hero__art img {
  width: 100%;
  filter: drop-shadow(0 22px 36px rgba(74, 63, 53, 0.28));
  animation: floatY 7s ease-in-out infinite;
}
/* летающие дудлы вокруг фото */
.hero__artwrap .crayon { z-index: 2; opacity: 0.9; }
.hero__artwrap .p-tl { top: 2%;  left: -6%; }
.hero__artwrap .p-tr { top: 0;   right: -6%; }
.hero__artwrap .p-bl { bottom: 14%; left: -8%; }
.hero__artwrap .p-br { bottom: 16%; right: -7%; }

.hero__scroll {
  margin-top: 40px;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  opacity: 0.75;
  animation: bob 1.8s var(--ease-in-out) infinite;
}
.hero__scroll svg { width: 32px; height: 32px; }
@media (hover: hover) and (pointer: fine) {
  .hero__scroll:hover { color: var(--coral-ink); opacity: 1; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* ===========================================================
   Иллюстрации-«картинки» (сгенерированные crayon)
   =========================================================== */
.art {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 24px rgba(74, 63, 53, 0.16));
}
.art--mid  { max-width: 540px; }
.art--sm   { max-width: 400px; }

/* ===========================================================
   Приветствие
   =========================================================== */
.welcome__text {
  font-size: clamp(1.1rem, 3.5vw, 1.32rem);
  text-align: center;
  color: var(--ink);
  margin: 0 auto;
  max-width: 32ch;
}

/* ===========================================================
   Doodles (иллюстрации-«наклейки»)
   =========================================================== */
.doodle {
  margin-left: auto;
  margin-right: auto;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(74, 63, 53, 0.18));
}
.doodle--table { width: 100%; max-width: 1100px; margin-top: 40px; }

/* ===========================================================
   Календарь / «Когда?»
   =========================================================== */
.calendar { padding-top: 22px; }
.cal {
  margin: 0 auto;
  max-width: 720px;
  text-align: center;
}
.cal picture { display: block; }
.cal picture img {
  width: 100%;
  height: auto;
  transform: rotate(-0.5deg);
  filter: drop-shadow(0 18px 30px rgba(74, 63, 53, 0.20));
}

/* ===========================================================
   Где и когда — таймлайн
   =========================================================== */
.timeline {
  list-style: none;
  margin: 0 auto;
  padding: 6px 0;
  max-width: 560px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 86px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  background: repeating-linear-gradient(
    to bottom, var(--coral) 0 8px, transparent 8px 16px
  );
  opacity: 0.7;
}
.timeline__item {
  display: grid;
  grid-template-columns: 74px 24px 1fr;
  align-items: center;
  gap: 0;
  padding: 14px 0;
  position: relative;
}
.timeline__time {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--coral-ink);
  text-align: right;
  padding-right: 8px;
}
.timeline__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--coral);
  justify-self: center;
  z-index: 1;
}
.timeline__text {
  padding-left: 14px;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.timeline__text em {
  display: block;
  font-style: normal;
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.85em;
  margin-top: 2px;
}

/* ===========================================================
   Детали — подсекции с иллюстрациями
   =========================================================== */
.details-list {
  margin-top: 6px;
}
.detail-row {
  text-align: center;
  margin: 0 auto;
  position: relative;
}
.detail__art {
  display: block;
  width: clamp(200px, 26vw, 360px);
  height: auto;
  margin: 0 auto 14px;
  filter: drop-shadow(0 14px 22px rgba(74, 63, 53, 0.16));
}
.detail__art--svg {
  width: clamp(80px, 11vw, 130px);
  color: var(--coral);
  filter: url(#crayon) drop-shadow(0 8px 12px rgba(74, 63, 53, 0.14));
}
.detail__head {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.1;
  margin: 0 0 8px;
  color: var(--coral-ink);
}
.detail__text {
  font-size: clamp(1.05rem, 3.3vw, 1.2rem);
  max-width: 30ch;
  margin: 0 auto;
  color: var(--ink);
}

.subdiv {
  display: block;
  width: 150px;
  height: 18px;
  margin: 26px auto;
  color: var(--coral-ink);
  opacity: 0.8;
  filter: url(#crayon);
}

/* ===========================================================
   RSVP
   =========================================================== */
.rsvp { text-align: center; }
.rsvp__text {
  font-size: clamp(1.05rem, 3.3vw, 1.22rem);
  max-width: 34ch;
  margin: 0 auto 30px;
  color: var(--ink);
}

/* ===========================================================
   Футер
   =========================================================== */
.footer {
  text-align: center;
  padding: 30px 22px 70px;
  position: relative;
  z-index: 1;
}
.footer__names {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 0;
  color: var(--ink);
}
.footer__meta {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-weight: 600;
}
.footer__cheers {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.7rem);
  color: var(--coral-ink);
}
.footer__car {
  display: block;
  width: min(760px, 82vw);
  margin: 44px auto 0;
}
.footer__car img {
  width: 100%;
  transform: rotate(-1.5deg);
  filter: drop-shadow(0 16px 26px rgba(74, 63, 53, 0.20));
  animation: wobble 7s ease-in-out infinite;
}

/* ===========================================================
   Reveal-анимация
   =========================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero__scroll, .footer__car img, .crayon, .hero__art img { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ===========================================================
   Адаптив
   =========================================================== */
@media (max-width: 720px) {
  .topbar__nav { display: none; }
  .topbar { padding: 12px 16px; }
  .topbar.is-scrolled { padding: 8px 16px; }

  .section { padding: 42px 0; }

  .hero__artwrap { width: min(82vw, 360px, 40vh); }
  .container { padding: 0 18px; }

  .timeline { max-width: 100%; }
  .timeline::before { left: 70px; }
  .timeline__item { grid-template-columns: 60px 22px 1fr; }
}

@media (max-width: 380px) {
  .hero__names { font-size: 3rem; }
}

/* ===========================================================
   Crayon-дудлы (inline SVG) — россыпь по странице + моушн
   =========================================================== */
.crayon {
  position: absolute;
  display: block;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
  color: var(--coral);
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  filter: url(#crayon) drop-shadow(0 6px 10px rgba(74, 63, 53, 0.14));
}

/* размеры */
.crayon.s-xs { width: 22px; }
.crayon.s-sm { width: 32px; }
.crayon.s-md { width: 46px; }
.crayon.s-lg { width: 64px; }

/* позиции (только углы — не конфликтуют с transform-анимацией) */
.p-tl { top: 6%;  left: 5%; }
.p-tr { top: 8%;  right: 6%; }
.p-bl { bottom: 9%; left: 7%; }
.p-br { bottom: 11%; right: 8%; }
.p-tc { top: 5%; left: 50%; margin-left: -16px; }
.p-ml { top: 42%; left: 4%; }
.p-mr { top: 52%; right: 5%; }
.p-mr2 { top: 30%; right: 8%; }
.p-ml2 { top: 65%; left: 6%; }

/* цвета (currentColor) */
.c-coral  { color: var(--coral); }
.c-pink   { color: var(--pink); }
.c-lav    { color: var(--lavender); }
.c-sage   { color: var(--sage); }
.c-peach  { color: var(--peach); }
.c-blue   { color: var(--blue); }
.c-orange { color: var(--orange); }
.c-ink    { color: var(--ink-soft); opacity: 0.55; }

/* анимации: transform/opacity only */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes sway {
  0%, 100% { transform: rotate(-7deg); }
  50%      { transform: rotate(7deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50%      { opacity: 1;    transform: scale(1.12); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(-1.2deg); }
  50%      { transform: rotate(1.2deg); }
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(16px, -10px); }
}

.a-float { animation: floatY 6s ease-in-out infinite; }
.a-sway  { animation: sway 7s ease-in-out infinite; }
.a-twk   { animation: twinkle 3.6s ease-in-out infinite; }
.a-drift { animation: drift 18s ease-in-out infinite; }

/* hero-дудлы — убраны из зоны заголовка, теперь вокруг фото (см. .hero__artwrap) */

/* на мобильном прячем часть дудлов, чтобы не мельтешили */
@media (max-width: 720px) {
  .crayon.hide-sm { display: none; }
  .crayon.s-lg { width: 48px; }
  .crayon.s-md { width: 34px; }
}
