/* ═══════════════════════════════════════════════════════════════
   BASE — :root tokens, шрифты, reset, body, фоновое видео,
   navigation, music-toggle
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'ScriptThinpen';
  src: url('../fonts/ScriptThinpen.woff2') format('woff2'),
       url('../fonts/ScriptThinpen.ttf')   format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Aquarelle';
  src: url('../fonts/aquarelle.woff2') format('woff2'),
       url('../fonts/aquarelle.ttf')   format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Whites & cream */
  --white: #FFFCF7;
  --cream: #FAF4EA;
  --ivory: #F3EBDA;

  /* Beige range */
  --beige: #E8D5BC;
  --beige-mid: #D6BD98;
  --beige-deep: #B89A6E;
  --taupe:  #8E7548;
  --bronze: #6F5A35;

  /* Gold */
  --gold:       #C9A96E;
  --gold-light: #E4D5B7;
  --gold-deep:  #A8884A;

  /* Text */
  --charcoal:   #3A2F1F;
  --text:       #4A3F2A;
  --text-light: #8A7A5C;

  /* Aliases (legacy support) */
  --sage:      var(--beige-deep);
  --sage-deep: var(--taupe);
  --olive:     var(--bronze);
  --blush:     var(--beige);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  color: var(--text);
  background: var(--cream);
  overflow-x: hidden;
  line-height: 1.7;
}

/* ─── Background video (двойной кроссфейд) ─── */
.bg-video {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
  transition: opacity 1.2s ease-in-out;
}
.bg-video-2 { opacity: 0; }

/* ─── Nav ─── */
nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  padding: 1.2rem 3rem;
  display: flex; justify-content: center; gap: 2.5rem;
  background: rgba(255,252,247,0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(201,169,110,0.20);
  transition: all 0.4s;
}
nav.scrolled {
  padding: 0.8rem 3rem;
  box-shadow: 0 2px 20px rgba(120,90,40,0.10);
}
nav a {
  text-decoration: none; color: var(--taupe);
  font-size: 0.72rem; letter-spacing: 3px; text-transform: uppercase;
  transition: color 0.3s;
}
nav a:hover { color: var(--bronze); }

/* ─── Language switch ─── */
.lang-switch {
  display: flex; align-items: center; gap: 0.3rem;
  margin-left: 0.4rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(201,169,110,0.30);
}
.lang-btn {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.62rem; letter-spacing: 1px;
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 20px;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s;
}
.lang-btn:hover { color: var(--bronze); }
.lang-btn.active {
  color: var(--white);
  background: var(--gold-deep);
  border-color: var(--gold-deep);
}

/* ─── Шрифты для армянской / грузинской раскладки ───
   Cormorant Garamond и Aquarelle не поддерживают эти письменности,
   поэтому для соответствующих языков подключаем Noto Serif */
body.lang-hy .section-title,
body.lang-hy .invite-heading,
body.lang-hy .invite-date,
body.lang-hy .cal-month,
body.lang-hy .hero-ampersand,
body.lang-hy .detail-card h3,
body.lang-hy .countdown-num {
  font-family: 'Noto Serif Armenian', serif;
}
body.lang-ka .section-title,
body.lang-ka .invite-heading,
body.lang-ka .invite-date,
body.lang-ka .cal-month,
body.lang-ka .hero-ampersand,
body.lang-ka .detail-card h3,
body.lang-ka .countdown-num {
  font-family: 'Noto Serif Georgian', serif;
}
/* ─── Music toggle ─── */
.music-toggle {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 101;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(201,169,110,0.45);
  background: rgba(255,252,247,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(120,90,40,0.15);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
  opacity: 0; visibility: hidden;
}
.music-toggle.show { opacity: 1; visibility: visible; }
.music-toggle:hover {
  transform: scale(1.1);
  border-color: var(--gold);
}
.music-bars {
  display: flex; align-items: flex-end; gap: 2.5px; height: 16px;
}
.music-bars span {
  width: 3px; background: var(--olive); border-radius: 1px;
  transition: height 0.3s;
}
.music-bars.playing span:nth-child(1) { animation: bar 0.8s 0s   infinite alternate; }
.music-bars.playing span:nth-child(2) { animation: bar 0.8s 0.2s infinite alternate; }
.music-bars.playing span:nth-child(3) { animation: bar 0.8s 0.4s infinite alternate; }
.music-bars.playing span:nth-child(4) { animation: bar 0.8s 0.1s infinite alternate; }
.music-bars.paused span { height: 3px !important; }

/* ─── Scroll progress — сердечко на прямой дорожке справа ─── */
.scroll-progress {
  position: fixed;
  /* отступ справа автоматически адаптируется к ширине экрана */
  right: clamp(0.4rem, 1.5vw, 1.5rem);
  top: 50%;
  transform: translateY(-50%);
  /* высота дорожки — пропорционально высоте экрана */
  height: clamp(40vh, 58vh, 65vh);
  width: clamp(22px, 2vw, 30px);
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  animation: fadeUp 1s 1.6s forwards;
}
.scroll-track {
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(201,169,110,0.30)  8%,
    rgba(201,169,110,0.65) 50%,
    rgba(201,169,110,0.30) 92%,
    transparent 100%);
  transform: translateX(-50%);
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(201,169,110,0.20);
}
.scroll-heart {
  position: absolute;
  left: 50%;
  top: 0;
  /* размер сердечка — адаптивный */
  width: clamp(18px, 1.5vw, 24px);
  height: clamp(18px, 1.5vw, 24px);
  transform: translateX(-50%);
  color: #d63d3d;
  filter:
    drop-shadow(0 0 6px rgba(214,61,61,0.65))
    drop-shadow(0 2px 3px rgba(0,0,0,0.30));
  transition: top 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  animation: heartBeat 1.6s ease-in-out infinite;
}
.scroll-heart svg {
  width: 100%; height: 100%;
  display: block;
}
/* На очень маленьких экранах прячем (не нужен на узких телефонах) */
@media (max-width: 380px) {
  .scroll-progress { display: none; }
}

/* ─── Responsive (общее) ─── */
@media (max-width: 768px) {
  nav { gap: 1.2rem; padding: 1rem 1.5rem; flex-wrap: wrap; }
  nav a { font-size: 0.6rem; letter-spacing: 2px; }
  .lang-switch { padding-left: 0.6rem; margin-left: 0; }
}
