:root {
  --bg-color: #FAF4EE;
  --text-main: #2F2520;
  --text-muted: #83726A;
  --accent: #C25D3D;
  --accent-soft: rgba(194, 93, 61, 0.05);
  --white-panel: #FFFFFF;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; width: 100%; max-width: 100vw;}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.7;
  position: relative;
  width: 100%;
  max-width: 100vw;
}

.fluid-section {
  width: 100%;
  padding: 7rem 2rem;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.section-content {
  width: 100%;
  max-width: 900px;
  position: relative;
  z-index: 3;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.font-serif { font-family: 'Cormorant Garamond', serif; }


.global-decor {
  position: absolute;
  pointer-events: none;
  z-index: 1; 
  opacity: 0;
}

.decor-top-left {
  top: 0;
  left: 12%;
  width: 34vw;
  max-width: 36vw;
  height: auto;
  animation: decorBloom 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.15s; /* Появляется чуть позже старта */
}

.decor-top-right {
  top: 0;
  right: 5%;
  width: 34vw;
  max-width: 36vw;
  height: auto;
  animation: decorBloom 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.35s;
}

/* Обёртка для сообщения о локации */
.location-message-wrapper {
    display: flex;
    align-items: stretch;
}

.location-message-card {
    background: var(--white-panel);
    padding: 2.2rem; /* точно как у календаря */
    border-radius: 28px; /* чуть меньше, чем у календаря (28 vs 28) – можно оставить 28px */
    box-shadow: 0 15px 40px rgba(47, 37, 32, 0.03); /* такая же тень, как у календаря */
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* вертикальное центрирование */
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 100%; /* чтобы растянуться по высоте родителя */
}

.location-message-icon svg {
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto;
}

.location-message-text {
    font-size: 1.4rem;
    color: var(--text-main);
    line-height: 1.5;
}

.location-message-sub {
    font-size: 0.9rem;
    color: var(--accent);
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    display: block;
    margin-top: 0.25rem;
}

/* Бесконечные боковые дорожки */
.bg-pattern-track {
  position: absolute;
  top: 0;      /* Начинаются сразу под областью видимости первого экрана */
  bottom: 0;   /* Заканчиваются над массивным нижним кустом, чтобы не было наложения */
  width: 16vw;
  max-width: 36vw;
  pointer-events: none;
  z-index: 1;
  background-repeat: repeat-y; /* Бесконечный вертикальный повтор */
  background-size: 100% auto;   /* Растягивается строго по ширине трека, сохраняя пропорции */
  opacity: 0;
  animation: trackFadeIn 1.75s ease-in-out forwards;
  animation-delay: 0.375s; /* Проявляются плавно после углов */
}

.track-left {
  left: -0.158%;
  background-image: url("по центру слева.svg");
  background-position: left top;
}

.track-right {
  right: 0;
  background-image: url("По центру справа.svg");
  background-position: right top;
}

/* Нижний массивный куст */
.decor-bottom {
  position: relative;
  bottom: -8px;
  left: 0;
  width: 100%;
  max-width: 100vw;
  height: auto;
  z-index: 1;
  transform-origin: bottom center;
  animation: decorBloom 2s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
  animation-delay: 0.7s;
}


/* ВОЛНИСТЫЕ НИТИ КУРСА */
.svg-thread {
  position: absolute;
  left: 0;
  width: 100%;
  height: 240px;
  pointer-events: none;
  z-index: 1;
}
.svg-thread svg { width: 100%; height: 100%; }
.thread-hero { bottom: -120px; }
.thread-story { top: -40px; }
.thread-timing { top: 0; }
.thread-calendar { top: -60px; }
.thread-dress { top: 0; }
.thread-rsvp { top: -40px; }

.guest-row-wrapper {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.4s ease-in-out,
              margin-bottom 0.4s ease-in-out;
  margin-bottom: 0;
}

.guest-row-wrapper.expanded {
  max-height: 9999px; /* Большой запас для раскрытых внутренних полей */
  opacity: 1;
  margin-bottom: 2rem; /* Красивый отступ между блоками гостей */
}

/* ЛЕТАЮЩИЕ МИКРО-ЛИСТИКИ */
.leaf { position: absolute; width: 38px; height: 38px; z-index: 2; opacity: 0; pointer-events: none; }
.leaf-1 { top: 14%; right: 15%; transform: rotate(18deg); animation: leafBloomEntry 1.5s ease-out forwards, gentleBreeze 7s infinite ease-in-out; animation-delay: 0.6s;}
.leaf-2 { top: 45%; left: 14%; transform: rotate(-22deg); animation: leafBloomEntry 1.5s ease-out forwards, gentleBreeze 11s infinite ease-in-out reverse; animation-delay: 0.7s;}

/* ГЛАВНЫЙ ЭКРАН */
.hero-section {
  height: auto;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 2;
}
.staggered-names { margin-bottom: 2.5rem; }
.name-row {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.2rem, 9vw, 6rem);
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.1;
}
.name-1 { transform: translateX(-25px); }
.name-3 { transform: translateX(25px); }
.amp { font-family: 'Cormorant Garamond', serif; font-style: italic; color: var(--accent); }
.date-badge { font-size: 1.25rem; letter-spacing: 6px; color: var(--accent); margin-top: 1rem; }
.scroll-indicator { margin-top: 4rem; animation: bounce 2s infinite ease-in-out; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* МИКРО-ПУШИНКИ HERO-БЛОКА */
.hero-fluff { position: absolute; pointer-events: none; z-index: 2; opacity: 0;}
.svg-fluff-right { right: 18%; top: 52%; width: 45px; animation: fluffBloomEntry 1.4s cubic-bezier(0.34, 1.3, 0.64, 1) forwards, gentleBreeze 9s infinite ease-in-out; animation-delay: 0.5s; }
.svg-fluff1-bottom-left { left: 22%; bottom: 14%; width: 32px; animation: fluffBloomEntry 1.4s cubic-bezier(0.34, 1.3, 0.64, 1) forwards, gentleBreeze 12s infinite ease-in-out reverse; animation-delay: 0.3s;}
.svg-fluff2-top-left { left: 20%; top: 22%; width: 45px; animation: fluffBloomEntry 1.6s cubic-bezier(0.34, 1.3, 0.64, 1) forwards, gentleBreeze 7s infinite ease-in-out; animation-delay: 0.8s; }
.svg-fluff3-top-right { right: 24%; top: 17%; width: 40px; animation: fluffBloomEntry 1.4s cubic-bezier(0.34, 1.3, 0.64, 1) forwards, gentleBreeze 9s infinite ease-in-out; animation-delay: 0.4s; }
.svg-leaf-far-right { right: 14%; top: 9%; width: 50px; transform: rotate(15deg); animation: fluffBloomEntry 1.8s cubic-bezier(0.34, 1.3, 0.64, 1) forwards, gentleBreeze 14s infinite ease-in-out; animation-delay: 0.2s; }


/* Новое реалистичное покачивание пушинок на ветру (дрейф + легкое вращение) */
@keyframes gentleBreeze {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(12px, -15px) rotate(6deg); }
  66% { transform: translate(-8px, -25px) rotate(-4deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Эффект мягкого проявления для пушинок (до полной непрозрачности) */
@keyframes fluffBloomEntry {
  0% {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
  }
}

/* Эффект проявления для легких контурных листиков (до их базовой прозрачности 0.35) */
@keyframes leafBloomEntry {
  0% {
    opacity: 0;
    filter: blur(4px);
  }
  100% {
    opacity: 0.35;
    filter: blur(0);
  }
}

/* НАША ИСТОРИЯ (ПОРТРЕТЫ) */
.seamless-photos {
  display: flex;
  justify-content: center;
  gap: 5rem;
  width: 100%;
  max-width: 950px;
  margin: 0 auto 4rem;
  transition: all 0.5s var(--transition-smooth);
}

.photo-frame {
  position: relative;
  width: 100%;
  max-width: 280px;   
  aspect-ratio: 3 / 4; 
  background: none;
  transition: all 0.5s var(--transition-smooth);
}

/* Сама фотография: настраиваем скругление под новую ширину */
.photo-frame img:not(.svg-frame-overlay) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  
  /* Идеальное скругление верха для широкого формата */
  border-radius: 170px 170px 0 0 !important; 
  
  border: 1px solid rgba(47, 37, 32, 0.08) !important;
  /* Мягкая тень для объема */
  box-shadow: 0 10px 25px rgba(47, 37, 32, 0.05);
  
  transition: all 0.5s var(--transition-smooth);
}

/* Оверлей SVG-арки: теперь управляется как полноценный абсолютный слой */
.svg-frame-overlay {
  position: absolute;
  pointer-events: none; /* Клик проходит сквозь арку на фото */
  z-index: 3;
  display: block !important; /* ГАРАНТИЯ: арка больше никуда не спрячется! */
  /* Плавный переход для размеров и положения */
  transition: all 0.5s var(--transition-smooth);
}

/* Заглушка, пока фото ещё не загружены в assets/ */
.photo-frame.is-placeholder {
  background: linear-gradient(165deg, rgba(255,255,255,0.9) 0%, rgba(250,244,238,0.95) 100%);
  border-radius: 170px 170px 0 0;
  border: 1px dashed rgba(194, 93, 61, 0.2);
}

.photo-frame.is-placeholder::before {
  content: "Скоро здесь будет фото";
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.photo-frame.is-placeholder img.story-photo {
  visibility: hidden;
}

/* Общие правила для наложения масок-арок */
.photo-frame::after {
  content: "";
  position: absolute;
  pointer-events: none; /* Чтобы можно было кликнуть/сохранить фото сквозь арку */
  z-index: 3;
  background-repeat: no-repeat;
  background-size: 100% 100%; /* Арка автоматически сжимается/растет вместе с фото */
}

/* Индивидуальная настройка левой арки (Кирилл) */
.frame-groom .svg-frame-overlay {
  /* Если арка не до конца закрывает фото, делаем микро-вылет наружу на 4px */
  top: -68px;                  
  left: -68px;                 
  width: calc(100% + 108px);    /* Растягиваем шире контейнера, чтобы перекрыть края */
  height: calc(100% + 68px);
}

/* Индивидуальная настройка правой арки (Мария) */
.frame-bride .svg-frame-overlay {
  top: -68px;                  
  left: -38px;                 
  width: calc(100% + 108px);    /* Растягиваем шире контейнера */
  height: calc(100% + 68px);
}

/* Внешние декоративные арки вокруг фото */
.svg-frame-overlay {
  position: absolute;
  top: -16px;   
  left: -16px;  
  width: calc(100% + 32px);   
  height: calc(100% + 32px);  
  z-index: 5; 
  pointer-events: none;
  object-fit: fill;
}

.botanical-branch { position: absolute; width: 70px; height: 70px; bottom: -20px; }
.branch-left { left: -25px; }
.branch-right { right: -25px; }

.story-text h2, .timing-section h2, .dresscode-section h2, .rsvp-section h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  color: var(--accent);
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 400;
}
.subtitle-serif { font-family: 'Cormorant Garamond', serif; font-size: 1.55rem; max-width: 650px; margin: 0 auto; }

/* ТАЙМЛАЙН ДНЯ */
.modern-timeline { display: flex; flex-direction: column; align-items: center; margin-top: 4rem; position: relative; }
.timeline-line-container { position: absolute; top: 15px; bottom: 15px; left: 50%; transform: translateX(-50%); width: 2px; background: rgba(194, 93, 61, 0.1); z-index: 1; }
.timeline-line-progress { width: 100%; height: 0%; background: var(--accent); transition: height 0.1s linear; }
.timeline-row { display: grid; grid-template-columns: 1fr 50px 1fr; width: 100%; max-width: 750px; align-items: center; margin-bottom: 3.5rem; position: relative; z-index: 2; }
.timeline-time { text-align: right; font-weight: 500; font-size: 1.4rem; color: var(--accent); font-family: 'Cormorant Garamond', serif; padding-right: 15px; }
.timeline-node { width: 10px; height: 10px; background-color: var(--accent); border-radius: 50%; justify-self: center; box-shadow: 0 0 0 5px var(--bg-color), 0 0 0 6px rgba(194, 93, 61, 0.2); }
.timeline-desc { font-size: 0.95rem; padding-left: 15px; }

/* КАЛЕНДАРЬ */
.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 4rem; align-items: stretch; }
.mini-calendar { background: white; padding: 2.2rem; border-radius: 28px; box-shadow: 0 15px 40px rgba(47, 37, 32, 0.03); }
.cal-month { text-align: center; font-weight: 500; font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; margin-bottom: 1.2rem; color: var(--accent); }
.cal-days-grid-header, .cal-days-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 0.85rem; }
.cal-days-grid-header { font-weight: 600; margin-bottom: 0.8rem; color: var(--text-muted); }
.cal-days-grid span { padding: 0.6rem 0; display: flex; align-items: center; justify-content: center; }

.heart-svg-day { position: relative; color: var(--accent); font-weight: 600; z-index: 1; }
.heart-svg-day::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(30deg) scale(0);
  width: 44px;
  height: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C25D3D' stroke-width='1.2'%3E%3Cpath d='M12 21.35L10.55 20.03C5.4 15.36 2 12.27 2 8.5 2 5.41 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.08C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.41 22 8.5c0 3.77-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}
.calendar-location-section.revealed .heart-svg-day::before {
  animation: heartFadeIn 1.5s var(--transition-smooth) forwards;
  animation-delay: 2.5s;
}
@keyframes heartFadeIn {
  0% { transform: translate(-50%, -50%) rotate(30deg) scale(0); opacity: 0; }
  100% { transform: translate(-50%, -50%) rotate(30deg) scale(1); opacity: 0.85; }
}

@keyframes decorBloom {
  0% {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

/* Эффект плавного проявления для бесконечных боковых треков */
@keyframes trackFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.locations-list { display: flex; flex-direction: column; gap: 2.5rem; }
.loc-item h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.9rem; margin-bottom: 0.2rem; font-weight: 400; }
.time-accent { font-size: 1.1rem; color: var(--accent); font-weight: 500; margin-bottom: 0.2rem; }
.text-link { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; border-bottom: 1px solid rgba(131, 114, 106, 0.3); padding-bottom: 2px; display: inline-block; width: fit-content; transition: border-color 0.2s; }
.text-link:hover { border-color: var(--accent); color: var(--accent); }

/* ДРЕСС-КОД */
.section-intro { margin-top: -1rem; margin-bottom: 3rem; color: var(--text-muted); font-size: 0.95rem; }
.dresscode-unified { max-width: 680px; margin: 0 auto; text-align: center; }
.palette-unified { flex-wrap: wrap; max-width: 360px; margin-left: auto; margin-right: auto; }
.dresscode-hint { font-size: 0.95rem; margin-bottom: 2rem; line-height: 1.6; }
.dresscode-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.dresscode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; }
.dress-profile { text-align: center; }
.profile-title { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; margin-bottom: 1rem; }
.palette { display: flex; gap: 0.6rem; justify-content: center; margin-bottom: 2rem; }
.palette span { width: 32px; height: 32px; border-radius: 50%; border: 2px solid white; box-shadow: 0 4px 12px rgba(47,37,32,0.08); }
.photo-placeholders-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.img-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.img-slot { background-color: rgba(255, 255, 255, 0.75); aspect-ratio: 3/4; border-radius: 20px; display: flex; align-items: center; justify-content: center; border: 1px dashed rgba(194, 93, 61, 0.15); box-shadow: 0 8px 24px rgba(47,37,32,0.02); }
.slot-text { font-size: 0.75rem; color: var(--text-muted); }

/* ПОЖЕЛАНИЯ */
.wishes-elegant-card { max-width: 720px; margin: 0 auto; padding: 3rem 2rem; position: relative; background: linear-gradient(to right, transparent, rgba(194, 93, 61, 0.03) 50%, transparent); }
.wishes-title { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; color: var(--accent); margin-bottom: 1.25rem; letter-spacing: 0.02em; }
.quote-decoration, .quote-decoration-end { font-family: 'Playfair Display', serif; font-size: 4.5rem; color: var(--accent); height: 20px; opacity: 0.25; }
.quote-decoration { text-align: left; line-height: 1; margin-bottom: 0.8rem; }
.quote-decoration-end { text-align: right; line-height: 0.2; margin-top: 0.8rem; }
.wishes-text { font-size: 1.45rem; color: var(--text-main); font-style: italic; padding: 0 1rem; line-height: 1.75; }
.wishes-text em { font-style: normal; color: var(--accent); }

/* АНКЕТА RSVP */
.container-form { max-width: 580px; background: var(--white-panel); padding: 4rem 3rem; border-radius: 36px; box-shadow: 0 40px 90px rgba(47, 37, 32, 0.04); margin: 0 auto; }
.embedded-countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin: 2.5rem 0; }
.count-box { background: var(--bg-color); padding: 1.1rem 0.4rem; border-radius: 18px; text-align: center; }
.count-box strong { display: block; font-size: 1.9rem; color: var(--accent); font-family: 'Cormorant Garamond', serif; }
.count-box span { display: block; font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

.modern-form { margin-top: 2.5rem; }
.menu-note { margin-bottom: 2.5rem; padding: 1.5rem 1.25rem; background: var(--accent-soft); border-radius: 18px; }
.menu-note-title { font-family: 'Cormorant Garamond', serif; font-size: 1.35rem; color: var(--accent); margin-bottom: 0.75rem; }

.guest-card {
  margin-bottom: 2rem;
  border-bottom: 1px dashed rgba(131, 114, 106, 0.25);
  padding-bottom: 1.5rem;
  overflow: hidden;
  max-height: 9999px;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 0.5s var(--transition-smooth),
    opacity 0.4s var(--transition-smooth),
    transform 0.4s var(--transition-smooth),
    margin-bottom 0.5s var(--transition-smooth),
    padding-bottom 0.5s var(--transition-smooth),
    border-bottom-width 0.5s var(--transition-smooth);
}

.guest-card.guest-card--entering {
  max-height: 0;
  opacity: 0;
  transform: translateY(-16px);
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom-width: 0;
  pointer-events: none;
}

.guest-card.guest-card--removing {
  max-height: 0 !important;
  opacity: 0 !important;
  transform: translateY(-10px);
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom-width: 0 !important;
  pointer-events: none;
}

.guest-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.guest-card-header h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: var(--accent);
}

.remove-guest-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
  font-family: inherit;
  flex-shrink: 0;
}

.add-guest-btn {
  background: none;
  border: 1px dashed var(--accent);
  color: var(--accent);
  width: 100%;
  padding: 1rem;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 2rem;
  transition: background 0.2s;
}

.add-guest-btn:hover { background: var(--accent-soft); }

.contact-email-row { margin-bottom: 1.5rem; }
.field-hint { font-size: 0.82rem; margin-top: 0.55rem; line-height: 1.5; }

.input-row { display: flex; flex-direction: column; margin-bottom: 2rem; }
.input-row label { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.7rem; color: var(--text-main); }

input[type="text"], input[type="email"], textarea { padding: 1.1rem 1.3rem; border: 1px solid rgba(47, 37, 32, 0.05); background-color: var(--bg-color); border-radius: 16px; font-family: inherit; font-size: 1rem; color: var(--text-main); transition: all 0.3s; width: 100%; }
input[type="text"]:focus, input[type="email"]:focus, textarea:focus { outline: none; border-color: var(--accent); background-color: var(--white-panel); }

.segmented-control { display: flex; background: var(--bg-color); padding: 0.35rem; border-radius: 14px; box-sizing: border-box; }
.segment-option { flex: 1; text-align: center; cursor: pointer; position: relative; display: flex; }
.segment-option input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.segment-option span { display: flex; align-items: center; justify-content: center; width: 100%; padding: 0.7rem 0.5rem; line-height: 1; border-radius: 11px; font-size: 0.9rem; font-weight: 500; transition: all 0.25s var(--transition-smooth); }
.segment-option input:checked + span { background: var(--accent); color: white; box-shadow: 0 4px 12px rgba(194, 93, 61, 0.2); }

.dynamic-row { max-height: 9999px; opacity: 1; overflow: hidden; transition: max-height 0.45s var(--transition-smooth), opacity 0.35s var(--transition-smooth), margin-bottom 0.45s var(--transition-smooth), padding 0.45s var(--transition-smooth); }
.dynamic-row.collapsed { max-height: 0 !important; opacity: 0 !important; margin-bottom: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; pointer-events: none; }

.dynamic-row.allergy-select-container {
  max-w-sm: 100%; /* оставляем твою структуру */
  max-height: 9999px; /* Огромный запас для маневра! */
}

.allergy-details-wrapper textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;       /* Разрешаем только вниз */
  overflow-y: auto;      /* Скролл внутри при переполнении */   
}

.smooth-expand {
  max-height: 9999px;      /* Запасной размер для маневра — из Citation 1 */
  opacity: 1;
  margin-top: 1.2rem;
  overflow: hidden;
  transition: max-height 0.4s var(--transition-smooth), opacity 0.3s var(--transition-smooth), margin-top 0.4s var(--transition-smooth);
}

.smooth-expand.collapsed {
  max-height: 0 !important;   /* ← Переопределяем для скрытого состояния */
  opacity: 0 !important;
  margin-top: 0 !important;
  pointer-events: none;
}

.max-w-sm { max-width: 100%; }
.submit-btn { background: var(--accent); color: white; border: none; width: 100%; padding: 1.2rem; border-radius: 16px; font-size: 1rem; font-weight: 500; cursor: pointer; font-family: inherit; transition: opacity 0.2s; margin-top: 1rem; z-index: 5; position: relative; }
.submit-btn:hover { opacity: 0.95; }
.status-msg { text-align: center; margin-top: 1rem; font-size: 0.9rem; }

.reveal-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.85s var(--transition-smooth), transform 0.85s var(--transition-smooth); }
.reveal-on-scroll.revealed { opacity: 1; transform: translateY(0); }

.main-footer { text-align: center; padding: 2rem 1rem 0.25rem 1rem; color: var(--accent); font-size: 1.6rem; }


.lightbox {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    visibility: hidden;
    opacity: 0;
    transition: background-color 0.3s ease, visibility 0s linear 0.3s, opacity 0.3s ease;
    will-change: opacity, background-color;
}

.lightbox.active {
    background-color: rgba(0, 0, 0, 0.85);
    visibility: visible;
    opacity: 1;
    transition: background-color 0.3s ease, visibility 0s linear 0s, opacity 0.3s ease;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    cursor: default;
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
    font-weight: 300;
    transition: transform 0.2s ease;
    line-height: 1;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active .lightbox-close {
    opacity: 1;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

/* =========================================================================
   ЖЕСТКАЯ МОБИЛЬНАЯ АДАПТАЦИЯ (СТАБИЛИЗАЦИЯ ИНТЕРФЕЙСА)
   ========================================================================= */
@media (max-width: 1024px) {
    /* Уменьшаем фото, чтобы они не заезжали на боковые элементы */
    .seamless-photos {
        gap: 5rem;
    }
    .photo-frame {
        width: 80%;
        max-width: 240px;
    }
    /* Корректируем наложение арок, чтобы они не выходили за пределы */
    .frame-groom .svg-frame-overlay,
    .frame-bride .svg-frame-overlay {
        width: calc(100% + 108px) !important;
        height: calc(100% + 68px) !important;
    }
    
}

@media (max-width: 768px) {
  .fluid-section { padding: 4.5rem 1.5rem; }
  .svg-thread { height: 110px; }

  /* Цифры отсчета
  */
  .embedded-countdown {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
  }
  .count-box {
      aspect-ratio: 1 / 1; /* квадрат */
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 0.4rem;
  }
  .count-box strong {
      font-size: 1.4rem;
  }
  .count-box span {
      font-size: 0.55rem;
  }
  
  .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 2.5rem;
  }
    .lightbox-content {
        max-width: 95%;
        max-height: 85%;
  }

  /* -----------------------------------------------------------------------
     УПРАВЛЕНИЕ РАЗМЕРАМИ РАСТЕНИЙ НА ТЕЛЕФОНАХ (МЕНЯЙ ЦИФРЫ ТУТ)
     ----------------------------------------------------------------------- */
  
  /* Левый верхний угол на мобильном */
  .decor-top-left { 
    width: 30vw;        /* Процент от ширины экрана смартфона (уменьшай, если много) */
    max-width: 150px;   /* Жесткий лимит в пикселях */
    top: 0;          /* Прижимаем ближе к верхнему краю экрана на мобилках */
    left: 5%;         /* Прижимаем ближе к левому краю */
  }
  
  /* Правый верхний угол на мобильном */
  .decor-top-right { 
    width: 30vw; 
    max-width: 150px; 
    top: 0; 
    right: 5%; 
  }
  
  /* Большой куст в самом низу сайта */
  .decor-bottom {
    width: 100%;        /* Делаем его чуть шире экрана, чтобы он ушел краями в бока */
    max-width: 100%;
    left: 0;         /* Центрируем его из-за увеличенной ширины (120% -> левее на -10%) */
    bottom: -8px;      /* ХАК: уводим нижнюю часть куста под экран на 35 пикселей! */
  }

  /* Скрываем боковые бесконечные треки на мобилках, чтобы не мешали читать текст */
  .bg-pattern-track {
    display: none;
  }

  .dresscode-photos {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 0px 2rem 0px 2rem
  }

  .mini-calendar {
    padding: 1.2rem 0.8rem;
    border-radius: 20px;
  }
  .cal-month {
      font-size: 1.1rem;
      margin-bottom: 0.8rem;
  }
  .cal-days-grid-header, .cal-days-grid {
      font-size: 0.7rem;
  }
  .cal-days-grid span {
      padding: 0.4rem 0;
  }

  .loc-item p {
    word-break: break-word;
    font-size: 0.85rem;
  }
  .loc-item .time-accent {
      font-size: 1rem;
  }
  
  /* ----------------------------------------------------------------------- */
  
  /* Остальная стабилизация интерфейса */
  .svg-frame-overlay { display: block !important; }
  .photo-frame img { border-radius: 120px 120px 0 0 !important; border: none !important; }
  
  /* Делаем карточки фото на мобильном телефоне крупнее и шире */
  .seamless-photos { 
    flex-direction: row !important;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 2.5rem;
  }

  .frame-groom .svg-frame-overlay,
  .frame-bride .svg-frame-overlay {
      top: -40px !important;
      left: -30px !important;
      width: calc(100% + 60px) !important;
      height: calc(100% + 60px) !important;
  }

  /* Возвращаем скругление фотографий на телефонах, чтобы они не становились прямоугольными */
  .photo-frame img:not(.svg-frame-overlay) { 
    /* Пропорциональное скругление под мобильный экран */
    border-radius: 140px 140px 0 0 !important;
    /* Убедимся, что обводка и тень остаются на мобильных */
    border: 1px solid rgba(47, 37, 32, 0.08) !important;
    box-shadow: 0 8px 20px rgba(47, 37, 32, 0.04);
  }

  .photo-frame { 
    width: 42%;         /* Увеличили: было 65%, теперь на мобильном они шире */
    max-width: 180px;   /* Увеличили предел: было 220px */
  }

  .timeline-line-container { left: 80px; transform: none; }
  .timeline-row { grid-template-columns: 60px 40px 1fr; gap: 0; margin-bottom: 2.5rem; }
  .timeline-time { text-align: right; padding-right: 12px; font-size: 1.1rem; }
  .timeline-desc { padding-left: 10px; text-align: left; }
  .timeline-node { justify-self: center; }
  
  .grid-2 { grid-template-columns: 1fr; gap: 3rem; }
  .locations-list { text-align: center; align-items: center; gap: 2rem; }
  .loc-item { text-align: center; }
  .text-link { margin: 0 auto; display: block; }
  
  .dresscode-photos { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .dresscode-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .container-form { padding: 2.5rem 1.5rem; width: 100%; border-radius: 28px; }
  .wishes-text { font-size: 1.35rem; }
  .name-1 { transform: translateX(-12px); }
  .name-3 { transform: translateX(12px); }
  
  /* Отключаем громоздкие пушинки на мобилках первого экрана */
  .svg-fluff2-top-left, .svg-fluff3-top-right, .svg-leaf-far-right { display: none; }
  }

@media (max-width: 550px) {
    
    .grid-2 {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    .location-message-wrapper {
        order: 2;
        width: 100%;
        max-width: 320px;
        padding: 0;
        margin: 0 auto;
        display: block;
    }
    .location-message-icon svg {
        width: 36px;
        height: 36px;
    }
    .location-message-card {
        background: var(--white-panel);
        padding: 1.2rem 0.8rem;
        border-radius: 20px;
        order: 2;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        display: block; /* убираем flex, чтобы не мешал центрированию */
    }
    .location-message-text {
        font-size: 1.1rem;
    }
    .location-message-sub {
    font-size: 0.8rem; 
    }
    .calendar-wrapper {
        order: 1;
        width: 100%;
        max-width: 320px; /* ограничиваем ширину календаря */
        margin: 0 auto;
    }
    .mini-calendar {
        padding: 1rem 0.6rem;
        border-radius: 20px;
        width: 100%;
    }
    .cal-month {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }
    .cal-days-grid-header,
    .cal-days-grid {
        font-size: 0.7rem;
        gap: 0;
    }
    .cal-days-grid-header span,
    .cal-days-grid span {
        padding: 0.5rem 0;
        line-height: 1.2;
    }

    .locations-list {
        order: 2;
        width: 100%;
        text-align: center; /* центрируем весь текст */
    }
    .loc-item {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    .loc-item h3 {
        font-size: 1.9rem;
    }
    .loc-item .time-accent {
        font-size: 1rem;
    }
    .loc-item p {
        font-size: 0.85rem;
        word-break: break-word;
        max-width: 280px;
        margin: 0 auto 0.4rem;
    }
    .text-link {
        display: inline-block;
        margin: 0 auto;
    }
}

@media (max-width: 440px) {
    .heart-svg-day::before,
    .heart-svg-day::after {
        width: 28px !important;
        height: 28px !important;
    }
    .embedded-countdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    .count-box {
        padding: 0.3rem;
        aspect-ratio: 1 / 1;
    }
    .count-box strong {
      font-size: 1.4rem;
  }
  .count-box span {
      font-size: 0.55rem;
  }
}

@media (max-width: 400px) {
      .dresscode-photos {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 0px 1rem 0px 1rem
    }
    .timeline-line-container {
    left: 45px; /* прижмём линию к левому краю, чтобы она была рядом с точками */
    transform: none;
    }
    .timeline-row {
        grid-template-columns: 36px 20px 1fr; /* уменьшаем первую колонку */
        gap: 0;
        margin-bottom: 2rem;
    }
    .timeline-time {
        text-align: right;
        padding-right: 8px;
        font-size: 0.9rem;
    }
    .timeline-node {
        width: 10px;
        height: 10px;
        justify-self: center;
    }
    .heart-svg-day::before {
  width: 30px;
  height: 30px;
  }
}

@media (max-width: 375px) {
    .photo-frame { width: 42%; max-width: 140px; }
    .dresscode-photos { gap: 0.4rem; }
    .count-box strong { font-size: 1.4rem; }
    .count-box span { font-size: 0.55rem; }
    .hero-section { padding: 1rem; }
    .name-row { font-size: clamp(2rem, 10vw, 3rem); }
    .container-form { padding: 1.5rem 1rem; }
}
