/* ===========================
   1. ОБЩИЕ НАСТРОЙКИ
=========================== */
html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

html {
    scroll-behavior: auto;
}

html.lock,
body.lock {
    overflow: hidden !important;
    height: 100%;
    touch-action: none;
}

body {
    background: #f7f3ee;
    color: #40362f;
    font-family: "Manrope", sans-serif;
}

p,
small,
li,
label,
button {
    font-family: "Manrope", sans-serif;
    font-weight: 400;
}

.date,
.time,
.time-box span,
.timer span {
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum";
}

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

h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 48px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    color: #b89776;
}

h2::after {
    content: "";
    display: block;
    width: 70px;
    height: 2px;
    background: #c6ab86;
    margin: 20px auto 0;
}

p {
    line-height: 1.8;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================
   2. HERO (ПЕРВЫЙ ЭКРАН)
========================================== */
.hero {
    position: relative;
    height:100svh;
    min-height:100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url("images/hero.jpg") center center/cover no-repeat;
    background-attachment: scroll; /* Важно для плавности! */
    overflow: hidden; /* Убираем лишние скроллы */
    will-change: auto;
}

.hero::before {
    content: "";
    position: absolute;
    z-index:1;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,.20), rgba(0,0,0,.45));
    /* УБРАЛ backdrop-filter: blur(2px) — это тормозит! */
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    width: min(90%, 520px);
    padding: 60px 42px;
    border-radius: 32px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    
}

.hero-content > *:not(.scroll) {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s forwards;
}

.hero-content > *:not(.scroll):nth-child(1) { animation-delay: .3s; }
.hero-content > *:not(.scroll):nth-child(2) { animation-delay: .6s; }
.hero-content > *:not(.scroll):nth-child(3) { animation-delay: .9s; }
.hero-content > *:not(.scroll):nth-child(4) { animation-delay: 1.2s; }

.date {
    font-size: 15px;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: .85;
    margin-bottom: 24px;
}

.hero h1 {
    font-family: "Cormorant Garamond", serif;
    font-size: 104px;
    font-weight: 400;
    line-height: .92;
    margin: 0 auto 28px;
}

.hero h1 span {
    display: block;
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: translateX(-8px);
    animation: titleUp .9s forwards;
}

.hero h1 span:nth-child(1) { animation-delay: .8s; }
.hero h1 span:nth-child(2) { animation-delay: 1s; }
.hero h1 span:nth-child(3) { animation-delay: 1.2s; }

.amp {
    font-size: 42px;
    margin: 8px 0;
    opacity: .85;
}

.time {
    font-size: 24px;
    letter-spacing: 3px;
    margin-bottom: 26px;
    opacity: .95;
}

.invite {
    font-size: 18px;
    line-height: 1.8;
    opacity: .9;
}

.scroll {
    width: 40px;
    height: 40px;
    margin: 55px auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: scrollMove 2s ease-in-out infinite;
}

.scroll svg {
    width: 26px;
    height: 26px;
    display: block;
}

@keyframes heroZoom {
    from { background-size: 100%; }
    to { background-size: 110%; }
}

@keyframes titleUp {
    to { opacity: 1; transform: none; }
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollMove {
    0% { transform: translateY(0); opacity: .55; }
    50% { transform: translateY(12px); opacity: 1; }
    100% { transform: translateY(0); opacity: .55; }
}

/* ===========================
   3. МУЗЫКА
=========================== */
.music-toggle {
    position: fixed;

    top: 20px;
    right: 20px;

    width: 48px;
    height: 48px;

    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;

    background: rgba(255,255,255,0.1);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    color: #b89776;

    cursor: pointer;

    z-index: 1000000;

    transition: all .3s ease;

    display: flex;
    align-items: center;
    justify-content: center;
}

.music-toggle:hover {
    transform: scale(1.08);
    background: rgba(255,255,255,0.25);
}

.music-toggle.is-playing {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

.music-toggle svg {
    pointer-events: none;
}

.music-toggle svg path {
    stroke: #fff;
    transition: stroke 0.3s;
}

/* ===========================
   4. ИСТОРИЯ
=========================== */
.story {
    padding: 110px 24px;
    background: #fbf9f6;
    text-align: center;
}

.story-grid {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-top: 60px;
    align-items: center;
}

.story-item {
    width: 290px;
    background: white;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(0,0,0,.12);
    transition: .45s;
    opacity: 0;
    transform: translateY(40px);
}

.story-item.show {
    opacity: 1;
    transform: translateY(0);
}

.story-item:nth-child(1) { transform: rotate(-5deg); }
.story-item:nth-child(2) { transform: rotate(5deg); }
.story-item:hover { transform: rotate(0deg) scale(1.03); }

.story-item img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 4px;
}

.story-item h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 500;
    margin-top: 18px;
}

/* ===========================
   5. TIMELINE (НАШ ДЕНЬ)
=========================== */
.timeline {
    position: relative;
    padding: 140px 30px;
    background: #fbf9f6;
    overflow: hidden;
}

.timeline h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 52px;
    font-weight: 500;
    text-align: center;
    color: #b89776;
    margin-bottom: 18px;
}

.timeline h2::after {
    content: "";
    display: block;
    width: 70px;
    height: 2px;
    margin: 22px auto 0;
    background: #cbb28d;
}

.timeline-line {
    position: relative;
    z-index: 2;
    max-width: 520px;
    margin: 0 auto;
    padding-left: 45px;
}

.timeline-line::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #d8c4a5;
}

.event {
    position: relative;
    padding-bottom: 45px;
    opacity: 0;
    transform: translateY(35px);
}

.timeline.show .event {
    animation: showEvent .7s forwards;
}

.timeline.show .event:nth-child(1) { animation-delay: .15s; }
.timeline.show .event:nth-child(2) { animation-delay: .35s; }

.event-last {
    padding-bottom: 0;
}

.circle {
    position: absolute;
    left: -45px;
    top: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #b99a74;
    border: 4px solid #fff;
    box-shadow: 0 0 0 3px rgba(185,154,116,.18);
}

.content {
    background: #fff;
    border-radius: 20px;
    padding: 22px 26px;
    box-shadow: 0 18px 40px rgba(0,0,0,.08);
    transition: .35s;
}

.event:hover .content {
    transform: translateY(-5px);
    box-shadow: 0 25px 45px rgba(0,0,0,.10);
}

.content h4 {
    font-family: "Manrope", sans-serif;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #9b7b58;
    margin-bottom: 8px;
}

.content p {
    font-size: 17px;
    color: #5e5349;
    line-height: 1.6;
}

@keyframes showEvent {
    to { opacity: 1; transform: none; }
}

/* ===========================
   6. CEREMONY & VENUE
=========================== */
.ceremony, .venue {
    padding: 120px 30px;
    text-align: center;
}

.ceremony { background: #fbf9f6 }
.venue { background: #fbf9f6; }

.ceremony h2, .venue h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 54px;
    font-weight: 400;
    color: #b89776;
    margin-bottom: 50px;
}

.ceremony img, .venue img {
    width: 100%;
    max-width: 720px;
    display: block;
    margin: 35px auto;
    border-radius: 28px;
    object-fit: cover;
    box-shadow: 0 20px 50px rgba(0,0,0,.12);
    transition: .4s;
}

.ceremony img:hover, .venue img:hover {
    transform: translateY(-6px);
}

.ceremony h3 {
    margin-top: 34px;
    font-family: "Cormorant Garamond", serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.35;
    color: #4f4339;
}

.address {
    margin: 18px auto 35px;
    max-width: 420px;
    font-size: 17px;
    line-height: 1.8;
    color: #86786c;
}

.venue p:first-of-type {
    margin-top: 36px;
    font-family: "Cormorant Garamond", serif;
    font-size: 40px;
    color: #493d34;
}

.venue p:last-of-type {
    margin-top: 10px;
    margin-bottom: 36px;
    color: #85786b;
    font-size: 17px;
    line-height: 1.7;
}

.route-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 16px 34px;
    border-radius: 100px;
    background: #b89776;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: .35s;
}

.route-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(184,151,118,.35);
}

/* ===========================
   7. DRESS CODE
=========================== */
.dress {
    padding: 130px 30px;
    background: #fbf9f6;
    text-align: center;
}

.dress h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 54px;
    font-weight: 400;
    color: #b89776;
    margin-bottom: 28px;
}

.dress-text {
    max-width: 420px;
    margin: 0 auto 55px;
    font-size: 17px;
    line-height: 1.8;
    color: #4f4339;
}

.colors {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 22px;
    margin-bottom: 70px;
}

.color {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    transition: .35s;
    box-shadow: inset 0 8px 14px rgba(255,255,255,.35), 0 12px 24px rgba(0,0,0,.08);
}

.color:hover {
    transform: translateY(-8px) scale(1.08);
}

.c1 { background: #640707; }
.c2 { background: #47260d; }
.c3 { background: #000000fd; }
.c4 { background: #012b09fd; }
.c5 { background: #0f0849; }

.looks-title {
    margin: 70px 0 25px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 500;
    color: #b89776;
}

.looks-slider {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    scroll-padding: calc((100vw - 220px) / 2);
    cursor: grab;
    overscroll-behavior-x: contain;
}

.looks-slider::-webkit-scrollbar {
    display: none;
}

.looks-track {
    display: flex;
    gap: 20px;
    width: max-content;
    padding-left: calc(50vw - 110px);
    padding-right: calc(50vw - 110px);
}
.looks-track img {
    width: 220px;
    aspect-ratio: 3/4;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 22px;
    scroll-snap-align: center;
    box-shadow: 0 18px 38px rgba(0,0,0,.10);
    transition: .35s;
    cursor: zoom-in;
}

.looks-track img:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 50px rgba(0,0,0,.15);
}

/* ===========================
   8. ПОЖЕЛАНИЯ, ФОТО, ТАЙМЕР
=========================== */
.gift {
    text-align: center;
    background: #fbf9f6;
    padding: 120px 30px;
}

.gift h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 54px;
    font-weight: 400;
    color: #b89776;
    margin-bottom: 50px;
}

.gift p {
    max-width: 650px;
    margin: auto;
    font-size: 18px;
    color: #4f4339;
}

.couple {
    display: flex;
    justify-content: center;
    margin: 50px 0;
    padding: 0 20px;
}

.couple img {
    width: 300px;
    max-width: 75vw;
    height: auto;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0,0,0,.18);
    display: block;
    cursor: pointer;
}

.countdown {
    background: #fbf9f6;
    text-align: center;
    padding: 120px 30px;
}

.countdown h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 54px;
    font-weight: 400;
    color: #b89776;
    margin-bottom: 50px;
}

.timer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    max-width: 420px;
    margin: 50px auto 0;
}

.time-box {
    padding: 30px 15px;
    border-radius: 24px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 15px 40px rgba(0,0,0,.08);
    transition: .35s;
}

@media (hover: hover) {

    .time-box:hover {
        transform: translateY(-6px);
    }

}

@media (hover: none) {

    .time-box {
        transition: none;
    }

}

.time-box span {
    display: block;
    color: #b89776;
    font-size: 52px;
    font-family: "Manrope", sans-serif;
    font-weight: 600;
    margin-bottom: 10px;
}

.time-box small {
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 12px;
    color: #b89776;

}

/* ===========================
   СНЕГ (ТОЛЬКО НА ПЕРВОМ ЭКРАНЕ)
=========================== */
.snow {
    position: absolute; /* Было fixed, меняем на absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Только высота первого экрана */
    pointer-events: none;
    z-index: 2; /* Ниже чем hero-content (у него z-index: 5) */
    overflow: hidden;
}

.snow span {
    position: absolute;
    top: -10px;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    opacity: .8;
    animation: snow linear infinite;
    box-shadow: 0 0 8px rgba(255,255,255,.8);
}

@keyframes snow {
    0% { transform: translateY(-10px); }
    100% { transform: translateY(110vh); }
}

/* ===========================
   ВИДЕО КОНВЕРТ
=========================== */
#intro {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #fcfbfb;

    overflow: hidden;
    cursor: pointer;
}

#intro video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#intro.fade-out {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

/* МОБИЛЬНАЯ ВЕРСИЯ — видео поменьше */
@media(max-width:768px){
    #intro video{
        width:100%;
        height:100%;
        object-fit:cover;
        border-radius:0;
    }
}

@media(max-width:768px){
    .hero{
        background-size:130% 130% !important;
        background-position:center center !important;
    }
}
/* ===========================
   11. ЛАЙТБОКС
=========================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background 0.4s ease;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.lightbox-close:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-content {
    position: relative;
    z-index: 5;
    max-width: 90%;
    max-height: 90vh;
    transform: scale(0.85);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    display: block;
}

/* ==========================================
   12. АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ (до 768px)
========================================== */
@media(max-width: 768px) {
    h2 { font-size: 36px; margin-bottom: 30px; }
    h2::after { width: 50px; margin: 15px auto 0; }

    .hero h1 { font-size: 56px; margin: 0 auto 20px; }
    .hero .amp { font-size: 32px; }
    .hero-content { padding: 40px 25px; width: 90%; }
    .date { font-size: 13px; letter-spacing: 3px; }
    .time { font-size: 20px; }
    .invite { font-size: 16px; }

    .timeline, .ceremony, .venue, .dress, .gift, .countdown {
        padding: 80px 20px !important;
    }

    .timeline-line { padding-left: 30px !important; max-width: 100% !important; }
    .circle { left: -30px !important; width: 14px !important; height: 14px !important; border-width: 3px !important; }
    .timeline-line::before { left: 7px !important; }
    .content { padding: 18px 20px !important; }
    .content h4 { font-size: 24px !important; }
    .content p { font-size: 15px !important; }

    .ceremony img, .venue img { max-width: 100% !important; border-radius: 20px !important; }
    .ceremony h3 { font-size: 28px !important; }
    .address { font-size: 15px !important; }
    .venue p:first-of-type { font-size: 32px !important; }

    .color { width: 45px !important; height: 45px !important; }
    .colors { gap: 15px !important; flex-wrap: nowrap !important; justify-content: center !important; }
    .looks-track img {
    width: 180px !important;
}

.looks-slider {
    scroll-padding: calc((100vw - 180px) / 2) !important;
}

.looks-track {
    padding-left: calc((100vw - 180px) / 2) !important;
    padding-right: calc((100vw - 180px) / 2) !important;
}

    .route-btn { padding: 14px 28px !important; font-size: 15px !important; }
    .time-box { padding: 20px 10px !important; }
    .time-box span { font-size: 40px !important; }
    .time-box small { font-size: 10px !important; }
    .music-toggle { width: 42px !important; height: 42px !important; top: 15px !important; right: 15px !important; }

    /* Мобильный конверт */
    .envelope-new { width: 320px; height: 224px; }
    .card-names { font-size: 26px; }
    .card-text { font-size: 11px; }
}

@media(max-width: 480px) {
    .hero h1 { font-size: 44px; }
    .hero .amp { font-size: 26px; }
    h2 { font-size: 30px; }
    .timeline-line { padding-left: 25px !important; }
    .circle { left: -25px !important; width: 12px !important; height: 12px !important; }
    .timeline-line::before { left: 6px !important; }
    .content h4 { font-size: 22px !important; }
    .content p { font-size: 14px !important; }
}

.looks-slider {
    position: relative;
    padding-bottom: 30px;
}

/* ---------- Swipe Indicator ---------- */

.swipe-hint{

    width:64px;
    height:5px;

    margin:12px auto 0;

    border-radius:999px;

    background:rgba(64,54,47,.12);

    position:relative;

    overflow:hidden;

}

.swipe-hint::before{

    content:"";

    position:absolute;

    top:0.5px;
    left:2px;

    width:22px;
    height:4px;

    border-radius:999px;

    background:#c6ab86;

    animation:swipeIndicator 1.7s ease-in-out infinite;

}

.swipe-hint.hidden{

    opacity:0;
    transition:.45s ease;

}

@keyframes swipeIndicator{

    0%{
        transform:translateX(0);
    }

    50%{
        transform:translateX(38px);
    }

    100%{
        transform:translateX(0);
    }

}



@media (min-width: 769px) {

    .looks-slider{
        overflow: visible;
    }

    .looks-track{
        width: 100%;
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

}

section:not(.hero) {
    opacity: 0;
    transition: opacity .6s ease;
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
}

section:not(.hero).show {
    opacity: 1;
}

.lock {
       overflow: hidden !important;
       position: fixed !important;
       width: 100% !important;
       top: 0 !important;
   }

   /* ФИКС iOS - убирает прыжки при скролле */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
}

html {
    overscroll-behavior-y: none; /* Убирает "резиновый" скролл iOS */
}

.heart-burst {
    position: fixed;
    pointer-events: none;
    z-index: 1000001;
}

.heart-burst-item {
    position: absolute;
    left: 0;
    top: 0;
    color: #fff;
    line-height: 1;
    text-shadow:
        0 0 6px rgba(255, 255, 255, 0.95),
        0 0 14px rgba(255, 255, 255, 0.55);
    animation: heartBurst 1.5s ease-out forwards;
}

@keyframes heartBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.4);
    }
}