*, *::before, *::after { box-sizing: border-box; }
:root {
 --bg-main: #2D0307; 
 --bg-sec: #4C050C; 
 --ivory: #FFFFF0;
 --ivory-muted: rgba(255, 255, 240, 0.6);
 --accent: #FFFFF0; 
 --accent-muted: rgba(148, 177, 200, 0.4);
}

html { scroll-behavior: smooth; }

body {
 background-color: var(--bg-main);
 color: var(--ivory);
 font-family: 'Cormorant Garamond', serif;
 margin: 0;
 padding: 0;
 overflow-x: hidden;
 font-weight: 300;
 -webkit-text-size-adjust: 100%;
 touch-action: manipulation;
 overscroll-behavior-y: none; 
}

body::before {
 content: "";
 position: fixed;
 top: 0; left: 0; width: 100vw; height: 100vh;
 background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
 opacity: 0.04;
 pointer-events: none;
 z-index: 9999;
 transform: translateZ(0);
 will-change: transform;
}

h1, h2, h3 { font-family: 'Forum', serif; font-weight: 400; margin: 0; }

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

/* =========================================
 КНОПКА МУЗЫКИ
 ========================================= */
.music-toggle {
 position: fixed;
 bottom: 30px;
 left: 30px;
 width: 50px;
 height: 50px;
 border-radius: 50%;
 background: rgba(45, 3, 7, 0.6);
 backdrop-filter: blur(10px);
 border: 1px solid var(--accent);
 color: var(--accent);
 display: flex;
 justify-content: center;
 align-items: center;
 cursor: pointer;
 z-index: 1000;
 transition: all 0.4s ease;
 box-shadow: 0 5px 15px rgba(0,0,0,0.3);
 opacity: 0;
 pointer-events: none;
 transform: translateY(20px);
}
.music-toggle.visible {
 opacity: 1;
 pointer-events: all;
 transform: translateY(0);
}
.music-toggle:hover {
 background: rgba(45, 3, 7, 0.9);
 color: var(--ivory);
 transform: scale(1.1);
}

/* =========================================
 ВИДЕО-ОВЕРЛЕЙ
 ========================================= */
#envelope-overlay {
 position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
 background-color: var(--accent); 
display: flex; justify-content: center; align-items: center;
 z-index: 999999; opacity: 1; transition: opacity 0.8s ease-in-out; overflow: hidden;
 transform: translateZ(0); 
}

#envelope-video {
 position: absolute; 
top: 50%; left: 50%; 
transform: translate(-50%, -50%) translateZ(0);
 width: 100%; 
height: 100%;
 object-fit: cover; 
z-index: 1; 
}

#play-envelope-btn {
 position: relative; z-index: 2; padding: 18px 50px; font-family: 'Forum', serif;
 font-size: 1.2rem; color: var(--ivory); text-transform: uppercase; letter-spacing: 4px;
 background: rgba(255, 255, 255, 0.1); 
backdrop-filter: blur(25px) saturate(180%); -webkit-backdrop-filter: blur(25px) saturate(180%);
 border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 30px;
 cursor: pointer; outline: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
 transition: background-color 0.4s ease, transform 0.4s ease, border-color 0.4s ease, color 0.4s ease;
 transform: translateZ(0); backface-visibility: hidden; 
will-change: transform;
}
#play-envelope-btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.05) translateZ(0); }
#play-envelope-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* =========================================
 ОСНОВНЫЕ СТИЛИ САЙТА
 ========================================= */
nav {
 position: fixed; top: 0; width: 100%; padding: 20px 0;
 display: flex; justify-content: center; gap: 40px; z-index: 1000;
 background: rgba(45, 3, 7, 0.4); 
backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); 
border-bottom: 1px solid rgba(255, 255, 255, 0.05); 
transition: background-color 0.3s ease;
 transform: translateZ(0);
}
nav a { color: var(--ivory); text-decoration: none; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 3px; font-family: 'Forum', serif; position: relative; }
nav a::after { content: ''; position: absolute; bottom: -5px; left: 50%; width: 0; height: 1px; background: var(--accent); transition: width 0.3s ease, left 0.3s ease; }
nav a:hover::after, nav a:focus-visible::after { width: 100%; left: 0; }
nav a:focus-visible { outline: none; color: var(--accent); }

.burger-menu { 
display: none; position: fixed; top: 20px; right: 20px; z-index: 1001; cursor: pointer; 
width: 30px; height: 20px; flex-direction: column; justify-content: space-between; 
background: transparent; border: none; padding: 0; outline: none;
}
.burger-menu:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.burger-menu span { display: block; height: 2px; width: 100%; background-color: var(--accent); transition: transform 0.3s ease, opacity 0.3s ease; }
.mobile-nav { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; position: fixed; top: 0; right: -100%; width: 100%; height: 100vh; background-color: rgba(45, 3, 7, 0.95); backdrop-filter: blur(10px); z-index: 1000; transition: right 0.4s ease; transform: translateZ(0); visibility: hidden; }
.mobile-nav.open { right: 0; visibility: visible; }
.mobile-nav a { color: var(--ivory); text-decoration: none; font-size: 1.5rem; text-transform: uppercase; letter-spacing: 5px; font-family: 'Forum', serif; }
.burger-menu.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.burger-menu.open span:nth-child(2) { opacity: 0; }
.burger-menu.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.hero { height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 12vh; align-items: center; text-align: center; position: relative; }
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url('hero-bg.jpg') center/cover no-repeat; opacity: 0.4; z-index: -1; transform: translateZ(0); }
.hero-date { font-family: 'Forum', serif; font-size: 1.2rem; letter-spacing: 6px; text-transform: uppercase; margin-bottom: 15px; color: var(--accent); }
.hero h1 { font-size: 6.5vw; line-height: 1; letter-spacing: 2px; text-transform: uppercase; }
.hero-names { display: flex; flex-direction: column; align-items: center; }
.hero-ampersand { font-size: 4vw; color: var(--accent); font-style: italic; margin: -10px 0; font-family: 'Cormorant Garamond', serif; }

.quote-box {
 margin-top: 35px;
 padding: 35px 50px;
 max-width: 850px;
 width: 90%;
 text-align: center;
}
.quote-text {
 font-family: 'Cormorant Garamond', serif;
 font-style: italic;
 font-size: 1.6rem;
 line-height: 1.6;
 color: var(--ivory);
 margin-bottom: 15px;
}
.quote-author {
 font-family: 'Forum', serif;
 font-size: 1rem;
 letter-spacing: 3px;
 text-transform: uppercase;
 color: var(--accent);
 margin: 0;
}

/* =========================================
 ВОЛНЫ (ПЕРЕХОДЫ СЕКЦИЙ)
 ========================================= */
.section-transition {
 position: relative;
 width: 100%;
 height: clamp(50px, 8vw, 120px); 
 margin-top: -2px;
 margin-bottom: -2px;
 z-index: 10;
}
.section-transition svg {
 width: 100%;
 height: 100%;
 display: block;
}

.wave-bg-main { background-color: var(--bg-main); }
.wave-bg-sec { background-color: var(--bg-sec); }
.wave-bg-ivory { background-color: var(--ivory); }

.section { padding: 80px 5%; display: flex; flex-direction: column; align-items: center; position: relative; overflow: hidden; border: none; }
.section-header { text-align: center; margin-bottom: 60px; position: relative; z-index: 3; }
.section-header h2 { font-size: 3.5rem; color: var(--ivory); margin-bottom: 15px; }

.glow-orb { position: absolute; width: 40vw; height: 40vw; max-width: 500px; max-height: 500px; background: var(--accent); filter: blur(120px); opacity: 0.2; border-radius: 50%; z-index: 0; pointer-events: none; transform: translateZ(0); }
.glow-orb.burgundy { background: var(--bg-sec); opacity: 0.4; }

/* Светлая секция */
.ivory-section { background-color: var(--ivory) !important; color: var(--bg-main) !important; border: none; }
.ivory-section h2 { color: var(--bg-main) !important; }
.ivory-section .glow-orb { background: var(--bg-main); opacity: 0.12; filter: blur(100px); }

.ivory-section .glass-panel { 
 background: var(--bg-sec) !important;
 border: 1px solid var(--accent) !important; 
 box-shadow: 0 15px 35px rgba(45, 3, 7, 0.4) !important;
 color: var(--ivory) !important;
}
.ivory-section .glass-panel h3 {
 color: var(--ivory) !important;
}
.ivory-section .glass-panel p, 
.ivory-section .glass-panel .desc-text {
 color: var(--ivory) !important; 
 opacity: 0.95;
}
.ivory-section .glass-panel strong {
 color: var(--accent); 
}

/* Стандартные панели */
.glass-panel { 
background: rgba(255, 255, 255, 0.04); 
backdrop-filter: blur(25px) saturate(200%); 
-webkit-backdrop-filter: blur(25px) saturate(200%); 
border: 1px solid rgba(255, 255, 255, 0.1); 
border-radius: 32px;
 padding: 50px; 
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08); 
position: relative; 
z-index: 2; 
transform: translateZ(0); 
backface-visibility: hidden;
}
.desc-text { font-size: 1.4rem; line-height: 1.7; color: var(--ivory-muted); }

/* =========================================
 ДРЕСС-КОД ПАЛИТРА (Интеграция Изображения)
 ========================================= */
.dress-code-image-wrap {
 margin-top: 40px;
 width: 100%;
 border-radius: 20px;
 overflow: hidden;
 border: 1px solid rgba(45, 3, 7, 0.15); /* Темный акцент для светлого фона панели */
 box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
 transform: translateZ(0); /* Аппаратное ускорение */
}
.dress-code-img {
 display: block;
 width: 100%;
 height: auto;
 transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.dress-code-image-wrap:hover .dress-code-img {
 transform: scale(1.03); /* Легкий 2D зум, строго без 3D-наклонов */
}

/* Специальный стиль для светлой панели в секции Дресс-код */
#dresscode .glass-panel {
 background: var(--ivory) !important;
 border: 1px solid var(--accent) !important;
 box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3) !important;
}
#dresscode .glass-panel .desc-text {
 color: var(--bg-main) !important;
 font-weight: 400;
}

/* Секция Таймера */
.countdown-section { 
padding: 60px 5%; 
background-color: var(--bg-sec); 
position: relative; 
z-index: 10; 
border: none;
}
.countdown-container { display: flex; justify-content: center; gap: 60px; max-width: 800px; margin: 0 auto; flex-wrap: wrap; }
.countdown-item { display: flex; flex-direction: column; align-items: center; min-width: 100px; }
.countdown-number { font-family: 'Forum', serif; font-size: 4.5rem; color: var(--ivory); line-height: 1; margin-bottom: 10px; text-shadow: 0 0 20px rgba(255, 255, 240, 0.2); }
.countdown-label { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 4px; color: var(--ivory-muted); }

.gallery-grid { column-count: 3; column-gap: 20px; max-width: 1000px; width: 100%; margin: 0 auto; position: relative; z-index: 2; }
.gallery-item { break-inside: avoid; margin-bottom: 20px; border-radius: 16px; overflow: hidden; position: relative; cursor: pointer; transform: translateZ(0); }
.gallery-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.gallery-item img { width: 100%; height: auto; display: block; transition: transform 0.5s ease, filter 0.5s ease; filter: grayscale(20%); will-change: transform, filter; }
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.05); filter: grayscale(0%); }
.gallery-item::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(148, 177, 200, 0.2); opacity: 0; transition: opacity 0.5s ease; pointer-events: none; }
.gallery-item:hover::after, .gallery-item:focus-visible::after { opacity: 1; }

.lightbox { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(45, 3, 7, 0.95); backdrop-filter: blur(10px); z-index: 100000; display: none; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.4s ease; transform: translateZ(0); }
.lightbox.active { display: flex; opacity: 1; }
.lightbox img { max-width: 90%; max-height: 90vh; border-radius: 4px; box-shadow: 0 0 30px rgba(148, 177, 200, 0.15); border: 1px solid rgba(148, 177, 200, 0.3); transform: scale(0.95); transition: transform 0.4s ease; will-change: transform; }
.lightbox.active img { transform: scale(1); }
.lightbox-close { position: absolute; top: 30px; right: 40px; color: var(--accent); font-size: 3rem; font-family: sans-serif; cursor: pointer; line-height: 1; transition: color 0.3s ease; outline: none; }
.lightbox-close:hover, .lightbox-close:focus-visible { color: var(--ivory); }
.lightbox-close:focus-visible { outline: 2px solid var(--ivory); outline-offset: 5px; }

.timeline-container { max-width: 800px; width: 100%; display: flex; flex-direction: column; gap: 80px; position: relative; z-index: 2; }
.timeline-item { display: grid; grid-template-columns: 1fr 2fr; align-items: center; gap: 40px; position: relative; }
.time-huge { font-family: 'Forum', serif; font-size: 6rem; color: transparent; -webkit-text-stroke: 1px rgba(148, 177, 200, 0.3); line-height: 1; text-align: right; transition: transform 0.5s ease, color 0.5s ease, text-shadow 0.5s ease; will-change: transform, color; }
.timeline-item.focus .time-huge, .timeline-item:hover .time-huge { color: var(--accent); -webkit-text-stroke: 0px; transform: scale(1.05); text-shadow: 0 0 20px var(--accent-muted); }
.timeline-info h3 { font-size: 2rem; margin-bottom: 10px; color: var(--ivory); }

.location-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 1200px; width: 100%; border-radius: 32px; overflow: hidden; padding: 0; transform: translateZ(0); }
.location-content { padding: 60px; display: flex; flex-direction: column; justify-content: center; }
.location-content h3 { font-size: 2.8rem; color: var(--ivory); margin-bottom: 20px; }
.location-map-wrap { position: relative; min-height: 500px; filter: grayscale(40%) sepia(20%) hue-rotate(320deg); transition: filter 0.5s ease; will-change: filter; }
.location-map-wrap:hover { filter: none; }
.location-map-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.btn-trendy { display: inline-flex; align-items: center; justify-content: center; padding: 18px 45px; background: transparent; color: var(--ivory); font-family: 'Forum', serif; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 2px; border: 1px solid var(--accent); text-decoration: none; position: relative; overflow: hidden; transition: color 0.4s ease; margin-top: 20px; transform: translateZ(0); }
.btn-trendy::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: var(--accent); transition: left 0.4s ease; z-index: -1; }
.btn-trendy:hover, .btn-trendy:focus-visible { color: var(--bg-main); }
.btn-trendy:hover::before, .btn-trendy:focus-visible::before { left: 0; }
.btn-trendy:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.reveal-up, .reveal-left, .reveal-right {
 opacity: 0;
 will-change: transform, opacity;
 backface-visibility: hidden;
 transform: translateZ(0);
}
.reveal-up { transform: translateY(70px); transition: opacity 0.8s ease, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal-left { transform: translateX(-70px); transition: opacity 0.8s ease, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal-right { transform: translateX(70px); transition: opacity 0.8s ease, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1); }

.reveal-up.active, .reveal-left.active, .reveal-right.active { 
opacity: 1; 
transform: translate(0, 0); 
}

/* MEDIA QUERIES */
@media (max-width: 900px) {
 .location-split { grid-template-columns: 1fr; }
 .hero h1 { font-size: 11vw; } 
 .hero-ampersand { font-size: 7vw; }
 .gallery-grid { column-count: 2; }
}
@media (max-width: 768px) {
 nav#desktop-nav { display: none; }
 .burger-menu { display: flex; }
}
@media (max-width: 600px) {
 .music-toggle {
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
 }
 .section-transition {
    height: 50px;
 }
 .quote-box {
    padding: 25px 20px;
 }
 .quote-text {
    font-size: 1.3rem;
 }
 .hero-date { font-size: 1rem; letter-spacing: 4px; margin-bottom: 10px; }
 .timeline-item { grid-template-columns: 1fr; gap: 10px; text-align: center; }
 .time-huge { text-align: center; font-size: 4rem; }
 .location-content { padding: 30px 20px; text-align: center; }
 .countdown-container { gap: 30px; }
 .countdown-number { font-size: 3rem; }
 .countdown-item { min-width: 70px; }
 .section { padding: 60px 5%; }
 .section-header h2 { font-size: 2.5rem; }
 .location-content h3 { font-size: 2.2rem; }
 .timeline-info h3 { font-size: 1.8rem; }
 .gallery-grid { column-count: 1; }
 .lightbox-close { top: 15px; right: 20px; font-size: 2.5rem; }
 .desc-text { font-size: 1.2rem; }
 .glass-panel { padding: 25px; border-radius: 24px; } 
 .hero { padding-bottom: 10vh; } 
}