/* ============================================================
   Церковь (ОЦХВЕ) г. Невинномысска
   Две темы: тёмная (по умолчанию) и светлая — переключатель в шапке
   ============================================================ */

/* ---------- ТЁМНАЯ ТЕМА (по умолчанию) ---------- */
:root {
  color-scheme: dark;
  --bg-0: #070b14;
  --bg-1: #0b1220;
  --header-bg: rgba(8, 12, 21, .75);
  --panel: rgba(255, 255, 255, .04);
  --panel-2: rgba(255, 255, 255, .01);
  --line: rgba(255, 255, 255, .08);
  --gold: #d0aa62;
  --gold-2: #efd9a7;
  --gold-dim: rgba(208, 170, 98, .35);
  --ink: #edf1f8;
  --muted: #8e9ab0;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --orb-gold: #d0aa62;
  --orb-blue: #2f5fa8;
  --orb-violet: #6f5bd0;
  --orb-opacity: .13;
  --overlay: rgba(4, 7, 13, .9);
  --input-bg: rgba(255, 255, 255, .05);
  --input-line: rgba(255, 255, 255, .12);
  --login-bg-1: rgba(20, 28, 44, .92);
  --login-bg-2: rgba(11, 17, 30, .92);
  --img-bg: #0d1523;
  --error-bg: rgba(201, 86, 86, .12);
  --error-line: rgba(201, 86, 86, .4);
  --error-text: #f0b6b6;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', 'Segoe UI', Arial, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- СВЕТЛАЯ ТЕМА ---------- */
[data-theme="light"] {
  color-scheme: light;
  --bg-0: #efe9db;
  --bg-1: #fbf9f4;
  --header-bg: rgba(252, 250, 244, .85);
  --panel: #ffffff;
  --panel-2: #faf6ec;
  --line: #e4dccb;
  --gold: #a87c2e;
  --gold-2: #7f5c1d;
  --gold-dim: rgba(168, 124, 46, .35);
  --ink: #20242e;
  --muted: #6d7482;
  --shadow: 0 14px 34px rgba(32, 36, 46, .12);
  --orb-gold: #dcb96f;
  --orb-blue: #a9c0e6;
  --orb-violet: #c1b1ea;
  --orb-opacity: .22;
  --overlay: rgba(30, 34, 42, .88);
  --input-bg: #ffffff;
  --input-line: #d8d0bd;
  --login-bg-1: #ffffff;
  --login-bg-2: #f7f2e7;
  --img-bg: #ece6d8;
  --error-bg: rgba(178, 60, 60, .08);
  --error-line: rgba(178, 60, 60, .35);
  --error-text: #b23c3c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(1100px 550px at 85% -10%, var(--gold-dim), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(63,104,182,.10), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 65%);
  background-attachment: fixed;
  animation: pageIn .6s var(--ease) both;
  transition: color .45s ease;
}
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
body.page-exit { animation: pageOut .26s ease forwards; }
@keyframes pageOut { to { opacity: 0; } }

::selection { background: var(--gold); color: #141018; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 8px; }

.container { width: min(1200px, 92%); margin: 0 auto; }
#galleryTop { scroll-margin-top: 90px; }

/* ---------- Фоновые пятна ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--orb-opacity); transition: opacity .45s; }
.bg-orbs i:nth-child(1) { width: 430px; height: 430px; background: var(--orb-gold); top: -140px; right: -90px; animation: floaty 17s ease-in-out infinite alternate; }
.bg-orbs i:nth-child(2) { width: 540px; height: 540px; background: var(--orb-blue); bottom: -200px; left: -160px; animation: floaty 23s ease-in-out infinite alternate-reverse; }
.bg-orbs i:nth-child(3) { width: 320px; height: 320px; background: var(--orb-violet); top: 42%; left: 56%; opacity: calc(var(--orb-opacity) * .6); animation: floaty 27s ease-in-out infinite alternate; }
@keyframes floaty { from { transform: translate(0,0) scale(1); } to { transform: translate(46px,34px) scale(1.16); } }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 4vw;
  background: var(--header-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-dim);
  transition: background-color .45s ease, border-color .45s ease;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--gold); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text b { display: block; font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: .16em; color: var(--ink); line-height: 1.1; transition: color .45s; }
.brand-text small { display: block; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
  position: relative; padding: 10px 2px; white-space: nowrap;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--muted); transition: color .3s;
}
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: 4px; height: 1px; width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }
.nav .nav-exit { border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; }
.nav .nav-exit::after { display: none; }
.nav .nav-exit:hover { color: var(--gold-2); border-color: var(--gold-dim); }

.header-tools { display: flex; align-items: center; gap: 10px; }

/* ---------- Переключатель темы ---------- */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: transparent; color: var(--gold-2);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .35s var(--ease), border-color .3s, color .3s, background-color .3s;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); transform: rotate(20deg); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
.theme-toggle--float { position: fixed; top: 16px; right: 16px; z-index: 90; }

.burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; z-index: 60; }
.burger span { width: 24px; height: 2px; background: var(--ink); transition: .35s; }
body.nav-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .burger span:nth-child(2) { opacity: 0; }
body.nav-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Герой ---------- */
.hero { min-height: 58vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 9vh 0 5vh; }
.hero-kicker { font-size: 12px; font-weight: 600; letter-spacing: .5em; text-transform: uppercase; color: var(--gold); }
.hero-title { font-family: var(--serif); font-weight: 600; font-size: clamp(42px, 7vw, 86px); line-height: 1.04; margin: 20px 0 14px; text-shadow: 0 10px 40px rgba(0,0,0,.25); }
.hero-title .line { display: block; }
.hero-title .gold { color: var(--gold); }
.ltr { display: inline-block; opacity: 0; transform: translateY(.55em) rotate(5deg); animation: letterIn .65s var(--ease) forwards; animation-delay: calc(var(--i) * 40ms + .12s); }
@keyframes letterIn { to { opacity: 1; transform: none; } }
.hero-sub { color: var(--muted); max-width: 560px; line-height: 1.7; font-size: 15px; }
.ornament { width: 150px; height: 1px; margin: 26px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); position: relative; }
.ornament::after { content: ''; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; background: var(--gold); transform: translate(-50%,-50%) rotate(45deg); box-shadow: 0 0 12px var(--gold-dim); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 30px; border-radius: 999px; border: none; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  position: relative; overflow: hidden; transition: transform .3s, box-shadow .3s, border-color .3s, color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn::after {
  content: ''; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .6s;
}
.btn:hover::after { left: 130%; }
.btn-gold { background: linear-gradient(135deg, #e6c887, #b98d45); color: #141018; box-shadow: 0 10px 26px rgba(208,170,98,.28); }
.btn-ghost { background: transparent; color: var(--gold-2); border: 1px solid var(--gold-dim); }
.btn-ghost:hover { border-color: var(--gold); }

/* ---------- Секции ---------- */
.section { padding: 7vh 0 3vh; }
.section-title { font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 4.5vw, 48px); line-height: 1.1; }
.section-title::after { content: ''; display: block; width: 74px; height: 2px; margin-top: 14px; background: linear-gradient(90deg, var(--gold), transparent); }
.section-sub { color: var(--muted); margin: 12px 0 30px; font-size: 15px; }
.muted { opacity: .7; font-size: 12.5px; }

.reveal { opacity: 0; }
.reveal.is-visible { animation: riseIn .75s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes riseIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ---------- Карточки дат ---------- */
.dates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.date-card {
  display: flex; flex-direction: column; gap: 16px; padding: 22px;
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  position: relative; overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s, background-color .45s;
}
.date-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--gold), transparent); opacity: 0; transition: opacity .4s; }
.date-card:hover { transform: translateY(-6px); border-color: var(--gold-dim); box-shadow: var(--shadow); }
.date-card:hover::before { opacity: 1; }
.date-card-top { display: flex; gap: 16px; }
.date-card-date { font-family: var(--serif); font-weight: 600; font-size: 46px; line-height: .9; color: var(--gold); min-width: 76px; }
.date-card-date span { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .28em; color: var(--muted); margin-top: 8px; }
.date-card-wd { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 6px; }
.date-card-body h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.2; }
.date-card-note { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.date-card-count { color: var(--muted); font-size: 12px; margin-top: 10px; opacity: .8; }
.date-card-links { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); }
.date-card-links a {
  color: var(--gold-2); text-decoration: none; font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; margin-right: 16px;
  border-bottom: 1px solid transparent; transition: border-color .3s, color .3s;
}
.date-card-links a:hover { border-color: var(--gold); color: var(--ink); }

/* ---------- Чипы ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
.chip {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-family: var(--sans);
  color: var(--muted); text-decoration: none; font-size: 13px; letter-spacing: .06em;
  transition: .3s;
}
.chip:hover { color: var(--ink); border-color: var(--gold-dim); transform: translateY(-2px); }
.chip.is-active { background: linear-gradient(135deg, #e6c887, #b98d45); color: #141018; border-color: transparent; font-weight: 600; }

/* ---------- Фото ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.media-item {
  position: relative; overflow: hidden; border-radius: 12px; cursor: zoom-in;
  border: 1px solid var(--line); background: var(--img-bg);
  transition: transform .3s, border-color .45s, background-color .45s;
}
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform .65s var(--ease); }
.media-item:hover img { transform: scale(1.08); }
.media-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px;
  font-size: 12px; color: #dbe3ef; background: linear-gradient(transparent, rgba(5,8,14,.85));
  opacity: 0; transform: translateY(6px); transition: .35s;
}
.media-item:hover figcaption { opacity: 1; transform: none; }

/* ---------- Видео ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.video-card {
  cursor: pointer; overflow: hidden; border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s, background-color .45s;
}
.video-card:hover { transform: translateY(-6px); border-color: var(--gold-dim); box-shadow: var(--shadow); }
.video-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--img-bg); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.video-card:hover .video-thumb img { transform: scale(1.06); }
.play-badge {
  position: absolute; inset: 0; margin: auto; width: 62px; height: 62px; border-radius: 50%;
  background: rgba(9,13,22,.55); border: 1px solid var(--gold-dim);
  display: grid; place-items: center; transition: .35s;
}
.play-badge::before { content: ''; width: 0; height: 0; border: 10px solid transparent; border-left: 16px solid var(--gold-2); border-right: 0; margin-left: 5px; }
.video-card:hover .play-badge { transform: scale(1.12); background: rgba(208,170,98,.25); border-color: var(--gold); }
.video-body { padding: 15px 18px 18px; }
.video-body h3 { font-family: var(--serif); font-weight: 600; font-size: 20px; }
.video-body p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.rv-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rv-links .chip { padding: 7px 14px; font-size: 12px; }

/* ---------- Пагинация ---------- */
.pagination-wrap { margin-top: 38px; }
.pagination { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.page-num, .page-arrow {
  min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; color: var(--muted);
  background: transparent; cursor: pointer; font-family: var(--sans);
  text-decoration: none; font-size: 14px; transition: .3s;
}
.page-num:hover, .page-arrow:hover { border-color: var(--gold); color: var(--gold-2); transform: translateY(-2px); }
.page-num.is-active {
  background: linear-gradient(135deg, #e6c887, #b98d45); color: #10131c;
  font-weight: 700; border-color: transparent; box-shadow: 0 6px 18px rgba(208,170,98,.25);
}
.page-num:disabled, .page-arrow:disabled { opacity: .3; cursor: default; pointer-events: none; }
.pagination-note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 14px; letter-spacing: .06em; }

.empty { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; width: 100%; }

/* ---------- Информация ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 10px; }
.info-block {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s, background-color .45s;
}
.info-block:hover { transform: translateY(-5px); border-color: var(--gold-dim); box-shadow: var(--shadow); }
.info-block h3 { font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--gold-2); margin-bottom: 12px; }
.info-block p { color: var(--muted); line-height: 1.75; font-size: 14.5px; }
.info-block p + p { margin-top: 10px; }
.info-block b { color: var(--ink); }
.sched-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px dashed var(--line); font-size: 14px; color: var(--muted); transition: border-color .45s; }
.sched-row:last-child { border-bottom: none; }
.sched-day { font-family: var(--serif); color: var(--gold); font-size: 16px; white-space: nowrap; }

.quote {
  margin: 7vh auto 4vh; max-width: 760px; text-align: center; padding: 0 20px;
  font-family: var(--serif); font-style: italic; font-size: clamp(22px, 3vw, 30px);
  color: var(--gold-2); line-height: 1.5;
}
.quote cite { display: block; margin-top: 14px; font-family: var(--sans); font-style: normal; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }

/* ---------- Вход ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); padding: 44px 36px; text-align: center;
  background: linear-gradient(165deg, var(--login-bg-1), var(--login-bg-2));
  border: 1px solid var(--gold-dim); border-radius: 18px;
  box-shadow: var(--shadow);
  animation: cardIn .8s var(--ease) both; position: relative; overflow: hidden;
  transition: background-color .45s, border-color .45s, box-shadow .45s;
}
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.97); } to { opacity: 1; transform: none; } }
.login-mark { width: 52px; height: 52px; color: var(--gold); margin-bottom: 14px; }
.login-title { font-family: var(--serif); font-weight: 600; font-size: 32px; letter-spacing: .06em; color: var(--ink); }
.login-sub { color: var(--muted); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; margin-top: 8px; }
.login-error { background: var(--error-bg); border: 1px solid var(--error-line); color: var(--error-text); padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-top: 18px; animation: fadeIn .4s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.login-card label { display: block; text-align: left; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.login-card input[type="text"], .login-card input[type="password"] {
  width: 100%; padding: 13px 16px; font-family: var(--sans); font-size: 15px;
  background: var(--input-bg); border: 1px solid var(--input-line);
  border-radius: 10px; color: var(--ink); outline: none; transition: .3s;
}
.login-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.login-check {
  display: flex !important; align-items: center; gap: 8px;
  text-transform: none !important; letter-spacing: 0 !important;
  font-size: 13px !important; margin-top: 16px !important; cursor: pointer;
}
.login-check input { width: auto; accent-color: var(--gold); }
.login-btn { width: 100%; margin-top: 24px; }
.login-hint { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.hash-out {
  background: var(--panel); border: 1px dashed var(--gold-dim); padding: 12px; margin-top: 16px;
  font-family: ui-monospace, Consolas, monospace; font-size: 13px;
  word-break: break-all; color: var(--gold-2); border-radius: 8px; text-align: left;
}
.shake { animation: shake .5s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); }
}

/* ---------- Лайтбокс ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; padding: 4vh 4vw;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--overlay); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .25s, background-color .45s;
}
.lightbox.is-open { opacity: 1; }
.lightbox-stage img, .lightbox-stage video, .lightbox-stage iframe {
  max-width: min(1100px, 100%); max-height: 78vh;
  border-radius: 10px; border: 1px solid var(--gold-dim);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: scaleIn .35s var(--ease);
}
.lightbox-stage iframe { width: min(1100px, 100%); aspect-ratio: 16 / 9; height: auto; background: #000; }
@keyframes scaleIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.lightbox-caption { color: var(--muted); font-size: 14px; letter-spacing: .04em; }
.lightbox-close {
  position: absolute; top: 18px; right: 24px; background: none; border: none; cursor: pointer;
  font-size: 36px; line-height: 1; color: var(--ink); transition: transform .3s, color .3s;
}
.lightbox-close:hover { color: var(--gold); transform: rotate(90deg); }

/* ---------- Подвал ---------- */
.site-footer { text-align: center; padding: 46px 5vw 40px; color: var(--muted); font-size: 13px; letter-spacing: .06em; transition: color .45s; }
.footer-line { width: 120px; height: 1px; margin: 0 auto 18px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.footer-verse { margin-top: 6px; color: var(--muted); opacity: .75; font-size: 12px; letter-spacing: .12em; }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 45;
    flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 90px 8vw 34px; background: var(--header-bg);
    backdrop-filter: blur(14px); border-bottom: 1px solid var(--gold-dim);
    transform: translateY(-105%); transition: transform .5s var(--ease);
  }
  body.nav-open .nav { transform: none; }
  .nav a { font-size: 15px; letter-spacing: .2em; padding: 12px 0; }
  .burger { display: flex; }
  .video-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .date-card-top { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .brand-text b { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; }
}

/* ============================================================
   ДОПОЛНЕНИЯ: анимация названия, сортировка, удаление, загрузка
   ============================================================ */

/* --- Анимированное название --- */

 /* ============================================================
   АНИМАЦИЯ НАЗВАНИЯ v3: книга-перелистывание + пагинация
   ============================================================ */
:root      { --gold-hi: #f8e7bd; --gold-mid: #c99a3f; }
[data-theme="light"] { --gold-hi: #ead09a; --gold-mid: #8a6420; }

/* До разбивки скриптом страницы скрыты (только при включённом JS) */
html.js .title-anim:not(.is-ready) .title-page { opacity: 0; }

.title-block { position: relative; text-align: center; }
.title-block::before {
  content: ''; position: absolute; inset: -18% -12%; z-index: -1;
  background: radial-gradient(closest-side, var(--gold-dim), transparent 72%);
  opacity: 0;
  animation: glowIn 1.8s ease .3s forwards, glowBreath 7s ease-in-out 2.4s infinite;
}
@keyframes glowIn { to { opacity: .5; } }
@keyframes glowBreath { 0%, 100% { opacity: .4; } 50% { opacity: .7; } }

/* --- Крест рисуется сам --- */
.title-cross { width: 74px; height: 74px; margin: 0 auto 16px; display: block; color: var(--gold); }
.title-cross circle, .title-cross path {
  fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.title-cross .cross-ring { animation: drawLine 1.2s var(--ease) .1s forwards; }
.title-cross .cross-v    { animation: drawLine .6s var(--ease) .95s forwards; }
.title-cross .cross-h    { animation: drawLine .5s var(--ease) 1.25s forwards; }
.title-cross { animation: crossGlow 4.5s ease-in-out 2.2s infinite; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes crossGlow {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(208,170,98,.25)); }
  50% { filter: drop-shadow(0 0 14px rgba(208,170,98,.6)); }
}

/* --- Книга и страницы-листы --- */
.title-book { display: block; perspective: 1000px; }
html.js .title-page {
  display: block; opacity: 0;
  transform-origin: left center;
  transform: rotateY(-95deg) translateX(-6%);
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
}
html.js .title-anim.is-ready .title-page.is-flipped {
  animation: pageFlip .9s var(--ease) var(--d, .1s) forwards;
}
html.js .title-anim.is-ready .title-page.is-set { opacity: 1; transform: none; filter: none; }
@keyframes pageFlip {
  0%   { opacity: 0; transform: rotateY(-95deg) translateX(-6%); filter: blur(6px); }
  55%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: rotateY(0) translateX(0); filter: blur(0); }
}

.title-line { display: block; }

/* --- «ОЦХВЕ»: золотой градиент + пробегающий блик --- */
.title-page .gold-text { color: var(--gold); transition: color .4s; }
.title-page .gold-text.gradiate {
  background: linear-gradient(105deg,
              var(--gold) 18%, var(--gold-hi) 44%, var(--gold-mid) 58%, var(--gold) 82%);
  background-size: 230% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 8px 26px rgba(208,170,98,.28));
  animation: goldSweep 7s ease-in-out .4s infinite;
}
@keyframes goldSweep {
  0%, 52%, 100% { background-position: 130% 0; }
  82% { background-position: -30% 0; }
}
.hero-title .title-gold { font-size: 1.14em; letter-spacing: .06em; }

/* --- Строка города --- */
.title-city {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(13px, 1.6vw, 19px);
  letter-spacing: .34em; text-transform: uppercase;
  color: var(--muted); margin-top: 10px;
}

/* --- Росчерк с алмазом --- */
.title-flourish { width: min(340px, 72%); margin: 24px auto 0; display: block; color: var(--gold); overflow: visible; }
.title-flourish path {
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.title-flourish .fl-left  { animation: drawLine .9s var(--ease) 3.9s forwards; }
.title-flourish .fl-right { animation: drawLine .9s var(--ease) 4.1s forwards; }
.title-flourish .fl-diamond {
  fill: var(--gold); stroke: none; opacity: 0;
  transform-box: fill-box; transform-origin: center;
  animation: flPop .6s var(--ease) 4.5s forwards;
}
@keyframes flPop {
  0%   { opacity: 0; transform: scale(0) rotate(0deg); }
  70%  { opacity: 1; transform: scale(1.25) rotate(95deg); }
  100% { opacity: 1; transform: scale(1) rotate(90deg); }
}

/* --- Искры-звёздочки --- */
.sparkle {
  position: absolute; width: 9px; height: 9px; color: var(--gold);
  opacity: 0; pointer-events: none; z-index: 2;
  animation: twinkle var(--tw-dur, 3s) ease-in-out var(--tw-delay, 0s) infinite;
}
.sparkle::before, .sparkle::after { content: ''; position: absolute; background: currentColor; border-radius: 1px; }
.sparkle::before { left: 50%; top: 0; bottom: 0; width: 1.6px; transform: translateX(-50%); }
.sparkle::after  { top: 50%; left: 0; right: 0; height: 1.6px; transform: translateY(-50%); }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.15) rotate(0deg); }
  50% { opacity: .85; transform: scale(1) rotate(135deg); }
}

/* --- Компактный блок на странице входа --- */
.login-title-block .title-cross { width: 46px; height: 46px; margin-bottom: 10px; }
.login-title { line-height: 1.2; }
.login-title .title-gold { font-size: inherit; }
.login-title-block::before { inset: -30% -20%; }

/* --- Доступность --- */
@media (prefers-reduced-motion: reduce) {
  html.js .title-page { opacity: 1 !important; transform: none !important; animation: none !important; }
  .sparkle { display: none; }
  .title-cross circle, .title-cross path, .title-flourish path { stroke-dashoffset: 0 !important; animation: none !important; }
  .title-flourish .fl-diamond { opacity: 1 !important; transform: rotate(90deg) !important; animation: none !important; }
  }
   
   /* --- Доступность --- */
   @media (prefers-reduced-motion: reduce) {
     .t-ltr { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; }
     .sparkle { display: none; }
     html.js .title-anim:not(.is-ready) .title-line { opacity: 1; }
     .title-cross circle, .title-cross path, .title-flourish path { stroke-dashoffset: 0 !important; animation: none !important; }
     .title-flourish .fl-diamond { opacity: 1 !important; transform: rotate(90deg) !important; animation: none !important; }
   }

/* --- Сортировка --- */
.sort-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -10px 0 28px; color: var(--muted); font-size: 13px; }
.sort-form select {
  background: var(--input-bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 16px; font-family: var(--sans); font-size: 13px;
  cursor: pointer; outline: none; transition: border-color .3s;
}
.sort-form select:hover, .sort-form select:focus { border-color: var(--gold); }

/* --- Кнопка удаления (админ, видна при наведении) --- */
.del-form { position: absolute; top: 10px; right: 10px; z-index: 3; }
.del-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: rgba(9,13,22,.6); color: #fff; font-size: 16px; line-height: 1;
  cursor: pointer; opacity: 0; transition: .3s;
}
.media-item:hover .del-btn, .video-card:hover .del-btn { opacity: 1; }
.del-btn:hover { background: #c95656; border-color: #c95656; transform: scale(1.1); }

/* --- Страница загрузки --- */
.ok-banner {
  background: rgba(120,180,120,.12); border: 1px solid rgba(120,180,120,.45);
  color: #bfe8bf; padding: 12px 16px; border-radius: 10px; margin: 0 0 26px;
  font-size: 14px; animation: fadeIn .4s both;
}
[data-theme="light"] .ok-banner { color: #2e6b2e; background: rgba(46,107,46,.08); }
.upload-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 8px; }
.upload-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s, background-color .45s;
}
.upload-card:hover { transform: translateY(-4px); border-color: var(--gold-dim); box-shadow: var(--shadow); }
.upload-card h3 { font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--gold-2); margin-bottom: 6px; }
.upload-card .card-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.upload-card label { display: block; text-align: left; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.upload-card input[type="text"], .upload-card input[type="date"], .upload-card select, .upload-card input[type="file"] {
  width: 100%; padding: 11px 14px; font-family: var(--sans); font-size: 14px;
  background: var(--input-bg); border: 1px solid var(--input-line); border-radius: 10px;
  color: var(--ink); outline: none; transition: .3s;
}
.upload-card input:focus, .upload-card select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.upload-card .radio-row { display: flex; gap: 18px; margin: 12px 0 4px; }
.upload-card .radio-row label {
  display: inline-flex; align-items: center; gap: 6px; text-transform: none;
  letter-spacing: 0; font-size: 14px; margin: 0; cursor: pointer; color: var(--ink);
}
.upload-card .radio-row input { accent-color: var(--gold); }
.upload-card .btn { margin-top: 18px; width: 100%; }
.upload-note { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-top: 12px; }
.upload-wide { margin-top: 20px; }
.upload-inline { display: grid; gap: 10px; margin-top: 10px; }

/* ============================================================
   Управление материалами (админ): удаление по датам
   ============================================================ */
   .admin-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: -10px 0 26px; }
   .inline-form { display: inline-block; margin: 0; }
   
   .chip-danger { border-color: rgba(178, 60, 60, .5); color: #ff9f9f; }
   .chip-danger:hover { border-color: #c95656; color: #ffd6d6; background: rgba(178,60,60,.12); }
   
   .manage-date-row {
     display: flex; justify-content: space-between; align-items: center; gap: 14px;
     padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px;
     margin-bottom: 12px; background: var(--panel); flex-wrap: wrap;
     transition: transform .3s var(--ease), border-color .3s, background-color .45s;
   }
   .manage-date-row:hover { transform: translateX(4px); border-color: var(--gold-dim); }
   .manage-date-row b { font-family: var(--serif); font-size: 19px; }
   .manage-counts { color: var(--muted); font-size: 13px; margin-top: 4px; }
   
   .manage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
   .pick {
     position: relative; display: block; border: 1px solid var(--line); border-radius: 10px;
     overflow: hidden; cursor: pointer; background: var(--img-bg); transition: .3s;
   }
   .pick:hover { border-color: var(--gold-dim); }
   .pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
   .pick .pick-cap { display: block; padding: 6px 8px; font-size: 11px; color: var(--muted); }
   .pick input, .manage-video-row input { accent-color: var(--gold); width: auto; }
   .pick.is-checked { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dim); }
   
   .manage-video-row {
     display: flex; align-items: center; gap: 12px; padding: 10px 14px;
     border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px;
     background: var(--panel); cursor: pointer; transition: .3s;
   }
   .manage-video-row:hover { border-color: var(--gold-dim); }
   .manage-video-row img { width: 110px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--img-bg); }
   .manage-video-row .grow { flex: 1; color: var(--ink); font-size: 14px; }
   .manage-video-row.is-checked { border-color: var(--gold); }
   
   .check-tools { display: flex; gap: 10px; margin: 12px 0 16px; flex-wrap: wrap; }
   .manage-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
   .btn-danger { background: linear-gradient(135deg, #e07070, #b23c3c); color: #fff; box-shadow: 0 10px 26px rgba(178,60,60,.25); }
   .btn-danger:hover { filter: brightness(1.08); }
   .manage-hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-top: 18px; }
   /* ---------- 3D-фон главной (canvas-икосаэдр) ---------- */
.bg3d-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -2; opacity: .55; pointer-events: none; }
[data-theme="light"] .bg3d-canvas { opacity: .38; }

/* ---------- График выступлений (инфо) ---------- */
.speaker-list { display: flex; flex-direction: column; }
.speaker-row {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.speaker-row:last-child { border-bottom: none; }
.speaker-date { grid-row: span 2; align-self: start; font-family: var(--serif); color: var(--gold); font-size: 16px; white-space: nowrap; }
.speaker-name { color: var(--ink); font-weight: 600; font-size: 14.5px; }
.speaker-theme { color: var(--muted); font-size: 13px; }

/* ---------- Фото Рожкао ---------- */
.rozhkao-photos { margin: 40px 0 6px; }