/* Живое приглашение: та же композиция, что у печатной версии (invite.html), плюс движение.
   Координаты в % — от картинки 1054×1492 px. Внутри карточки 1 мм печатного листа A5 = 100cqw / 148. */
:root {
  --ink: #3a2412;
  --accent: #6e3513;
  --gold: #a8742f;
  --paper: #f8f0e3;
  --night: #20160e;
  --halo: 0 0 1.5px #fbf3e6, 0 0 5px rgba(251, 243, 230, .95);
  --cw: min(100vw, 640px, calc((100svh - 52px) * 0.7064));
  --mm: calc(100cqw / 148);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* кнопки .btn иначе перебивают hidden своим display */
html, body { margin: 0; }
body {
  min-height: 100svh; background: var(--night); color: var(--ink);
  font-family: 'PT Serif', Georgia, serif; -webkit-text-size-adjust: 100%;
}
.backdrop {
  position: fixed; inset: -60px; z-index: -1;
  background: url(assets/art.webp) center / cover no-repeat;
  filter: blur(30px) brightness(.42) saturate(1.1);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- переключатель языка ---------- */
.langs {
  display: flex; justify-content: flex-end; gap: 4px;
  width: var(--cw); margin: 0 auto; padding: 8px 8px 8px 0; height: 52px;
}
.langs button {
  min-width: 52px; min-height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid rgba(217, 176, 102, .55); background: transparent; color: #f3e3c4;
  font: 700 13px/1 'PT Serif', serif; letter-spacing: .08em; cursor: pointer;
}
.langs button[aria-pressed="true"] { background: #d9b066; border-color: #d9b066; color: var(--night); }
.langs .music { margin-right: auto; min-width: 40px; width: 40px; padding: 0; display: grid; place-items: center; }
.langs .music[aria-pressed="true"] { background: transparent; color: #f3d38c; border-color: rgba(217, 176, 102, .8); }
.langs .music .ico-off { display: none; }
.langs .music[aria-pressed="false"] .ico-on { display: none; }
.langs .music[aria-pressed="false"] .ico-off { display: block; }

/* ---------- экран «Чакырууну ачуу»: открытие запускает музыку и появление карточки ---------- */
.opener {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 40%, rgba(32, 22, 14, .55), rgba(20, 13, 8, .94));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .9s ease, visibility .9s;
}
.opener.is-gone { opacity: 0; visibility: hidden; }
.opener-inner { text-align: center; color: #f3e3c4; max-width: 360px; }
.opener-logos { display: flex; justify-content: center; gap: 14px; margin-bottom: 18px; }
.opener-logos img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }
/* именная страница (window.PERSON): обращение над кнопкой */
.opener-greet { margin: -4px 0 20px; font: 600 22px/1.25 'Libertine', 'PT Serif', serif; color: #f3d899; text-wrap: balance; }
.opener-kicker { margin: 0 0 18px; font: 700 13px/1.4 'PT Serif', serif; letter-spacing: .2em; text-transform: uppercase; color: #d9b066; }
.opener-btn {
  min-height: 56px; padding: 14px 30px; border: 0; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, #ecd08f, #c0924a); color: #2a1a0c;
  font: 700 19px/1.2 'Libertine', 'PT Serif', serif; letter-spacing: .02em;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .45);
  animation: invite-glow 2.8s ease-in-out infinite;
}
.opener-btn:focus-visible { outline: 2px solid #f3d38c; outline-offset: 3px; }
.opener-note { margin: 14px 0 0; font-style: italic; font-size: 14px; color: rgba(243, 227, 196, .75); }
@keyframes invite-glow {
  0%, 100% { box-shadow: 0 8px 28px rgba(0, 0, 0, .45), 0 0 0 0 rgba(236, 208, 143, .0), inset 0 1px 0 rgba(255, 255, 255, .45); }
  50%      { box-shadow: 0 8px 28px rgba(0, 0, 0, .45), 0 0 0 10px rgba(236, 208, 143, .14), inset 0 1px 0 rgba(255, 255, 255, .45); }
}
.langs button:focus-visible, .btn:focus-visible { outline: 2px solid #f3d38c; outline-offset: 2px; }

/* ---------- карточка ---------- */
.sheet { display: flex; flex-direction: column; align-items: center; padding-bottom: 32px; }
.card {
  position: relative; width: var(--cw); aspect-ratio: 1054 / 1492; overflow: hidden;
  container-type: inline-size; box-shadow: 0 18px 60px rgba(0, 0, 0, .5);
}
.art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fx.sky {
  -webkit-mask: url(assets/sky-mask.png) 0 0 / 100% 100% no-repeat;
          mask: url(assets/sky-mask.png) 0 0 / 100% 100% no-repeat;
}
.strip { position: absolute; left: 0; top: 0; width: 400%; will-change: transform; }
/* текстура облаков — две ширины карточки, бесшовная: сдвиг на половину полосы = один повтор */
.clouds-far .strip  { height: 41.55%; background: url(assets/clouds-far.webp) 0 0 / 50% 100% repeat-x; opacity: .5;
                      animation: drift 200s linear infinite; }
.clouds-near .strip { height: 41.55%; background: url(assets/clouds-near.webp) 0 0 / 50% 100% repeat-x; opacity: .55;
                      animation: drift 110s linear infinite; }
.mist {
  -webkit-mask: url(assets/mist-mask.png) 0 0 / 100% 100% no-repeat;
          mask: url(assets/mist-mask.png) 0 0 / 100% 100% no-repeat;
}
.mist .strip { height: 100%; background: url(assets/mist.webp) 0 0 / 50% 34.85% repeat;
               animation: drift 320s linear infinite reverse, breathe 19s ease-in-out infinite alternate; }
@keyframes drift   { from { transform: translate3d(-50%, 0, 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes breathe { from { opacity: .3; } to { opacity: .62; } }

/* беркут: три вложенных движения дают круг в перспективе, крылья машут отдельно (из обложки книги) */
.eagle-path { position: absolute; left: 70%; top: 5.6%; width: 5.4%; will-change: transform; }
.eagle-bob, .eagle { position: relative; width: 100%; aspect-ratio: 126 / 30; will-change: transform; }
.eagle svg { position: absolute; display: block; overflow: visible; fill: rgba(47, 33, 22, .82); }
.eagle-body { left: 45.24%; top: 33.33%; width: 9.52%; height: 66.67%; }
.wing { position: absolute; top: 3.33%; width: 48.41%; height: 76.67%; }
.wing svg, .wing-l > span { position: absolute; inset: 0; width: 100%; height: 100%; }
.wing-r { left: 51.59%; transform-origin: 0 78.26%; }
.wing-l { left: 0; transform: scaleX(-1); }
.wing-l > span { transform-origin: 0 78.26%; }
.eagle-path { animation: soar-x 34s ease-in-out infinite alternate; }
.eagle-bob  { animation: soar-y 34s ease-in-out -17s infinite alternate; }
.eagle      { animation: bank 34s ease-in-out -17s infinite alternate; }
.wing-r, .wing-l > span { animation: flap 9s ease-in-out 2s infinite; }
@keyframes soar-x { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-640%, 0, 0); } }
@keyframes soar-y { from { transform: translate3d(0, 0, 0) scale(.8); } to { transform: translate3d(0, 160%, 0) scale(1.05); } }
@keyframes bank   { from { transform: rotate(-7deg); } to { transform: rotate(6deg); } }
@keyframes flap {
  0%, 78%  { transform: rotate(0); }
  81%      { transform: rotate(-26deg); }
  84.5%    { transform: rotate(14deg); }
  88%      { transform: rotate(-20deg); }
  92%      { transform: rotate(8deg); }
  96%,100% { transform: rotate(0); }
}

/* блик по золоту: узкая светлая полоса проходит по рамке и орнаментам раз в 9 секунд */
.glint {
  -webkit-mask: url(assets/gold-mask.png) 0 0 / 100% 100% no-repeat;
          mask: url(assets/gold-mask.png) 0 0 / 100% 100% no-repeat;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 238, 196, .95) 50%, transparent 58%) 0 0 / 300% 300% no-repeat;
  mix-blend-mode: screen; animation: glint 9s ease-in-out 1.6s infinite;
}
@keyframes glint { 0% { background-position: 100% 100%; } 45%, 100% { background-position: 0% 0%; } }
.sweep { animation: sweep 9s ease-in-out .9s infinite; }
@keyframes sweep { 0% { transform: translateX(0); } 30%, 100% { transform: translateX(780px); } }

/* логотипы, заголовок, текст — как в печатной версии */
.logo { position: absolute; top: 4.2%; width: 11.4%; aspect-ratio: 1; }
.logo.l { left: 8.6%; }
.logo.r { left: 80.1%; }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 calc(var(--mm) * .5) calc(var(--mm) * .7) rgba(60, 35, 10, .35)); }
.title {
  position: absolute; left: 39.5%; width: 52%; top: 11.6%; height: 7.4%; margin: 0;
  display: flex; align-items: center; justify-content: center;
}
.title svg { width: 100%; height: 100%; overflow: visible; }
.title-text { font-family: 'Libertine', 'Linux Libertine G', 'PT Serif', serif; font-weight: 600; }

.body {
  /* 12.10: текст крупнее (с телефона был мелким) — колонка шире, до правой рамки */
  position: absolute; left: 42%; width: 50%; top: 25%; height: 57%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--mm) * 3.6);
  text-align: center; text-shadow: var(--halo);
}
.body p { margin: 0; text-wrap: balance; }
.nw { white-space: nowrap; }   /* даты и время, которые нельзя рвать (см. noBreak в content.js) */
.intro .lead, .intro .tail { font-size: calc(var(--mm) * 4.5); line-height: 1.35; }
.intro .greet { font-family: 'Libertine', 'PT Serif', serif; font-weight: 600; color: var(--accent);
  font-size: calc(var(--mm) * 5.4); line-height: 1.2; margin-bottom: calc(var(--mm) * 2) !important; }
.intro .event, .intro .conf { font-family: 'Libertine', 'PT Serif', serif; font-weight: 600;
  color: var(--accent); font-size: calc(var(--mm) * 5.6); line-height: 1.18; }
.intro .event { margin-top: calc(var(--mm) * 1.8); }
.intro .conf { font-style: italic; }
.intro .and { font-style: italic; font-size: calc(var(--mm) * 4.3); line-height: 1.3; margin: calc(var(--mm) * 1) 0; }
.intro .note { font-style: italic; font-size: calc(var(--mm) * 4.3); line-height: 1.3; margin-top: calc(var(--mm) * 1.6); }
.intro .tail { margin-top: calc(var(--mm) * 1.2); }
.rule { width: 58%; height: calc(var(--mm) * 3); display: block; flex: none; }
.details .dk { font: 700 calc(var(--mm) * 2.7) / 1.25 'PT Serif', serif; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent); margin: calc(var(--mm) * 2) 0 calc(var(--mm) * .4); }
.details .dk:first-child { margin-top: 0; }
.details .dv { font-size: calc(var(--mm) * 3.9); line-height: 1.3; }

/* появление при открытии: только когда работает скрипт (иначе всё видно сразу) */
.js .card .logo, .js .card .title, .js .card .intro > p, .js .card .rule, .js .card .details { opacity: 0; }
.js .card.is-open .logo   { animation: rise 1.1s ease-out .2s both; }
.js .card.is-open .title  { animation: rise 1.4s ease-out .5s both; }
.js .card.is-open .intro > p { animation: rise 1s ease-out both; }
.js .card.is-open .rule    { animation: rise 1s ease-out 2.7s both; }   /* абзацы intro: задержку 1.1 с + 0.4 с на каждый ставит invite.js */
.js .card.is-open .details { animation: rise 1s ease-out 2.9s both; }
@keyframes rise { from { opacity: 0; transform: translateY(calc(var(--mm) * 1.5)); } to { opacity: 1; transform: none; } }

/* ---------- практическая часть под карточкой ---------- */
.info {
  width: var(--cw); background: var(--paper); padding: 22px 20px 26px;
  border-top: 1px solid rgba(168, 116, 47, .5);
}
.info-lead { margin: 0 0 18px; font-size: 17px; line-height: 1.5; text-align: center; text-wrap: balance; }
.info-lead b { color: var(--accent); }
.facts { margin: 0; display: grid; gap: 14px; }
.facts div { border-left: 2px solid var(--gold); padding-left: 12px; }
.facts dt { font: 700 12px/1.3 'PT Serif', serif; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.facts dd { margin: 3px 0 0; font-size: 18px; line-height: 1.35; }
.facts dd a { color: var(--accent); }
.program { margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(168, 116, 47, .35); scroll-margin-top: 12px; }
.program-title { margin: 0; text-align: center; font: 700 22px/1.2 'Libertine', 'PT Serif', serif; color: var(--accent); }
.program .day { margin: 20px 0 10px; padding-bottom: 5px; border-bottom: 1px solid rgba(168, 116, 47, .5);
  font: 700 12px/1.3 'PT Serif', serif; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.prog { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.prog li { display: grid; grid-template-columns: 6.6em 1fr; gap: 12px; align-items: baseline; }
.prog .t { font-weight: 700; font-size: 15px; line-height: 1.4; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prog .n { display: block; font-size: 17px; line-height: 1.35; }
.prog .p { display: block; margin-top: 2px; font-size: 14px; line-height: 1.35; font-style: italic; color: rgba(58, 36, 18, .75); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; justify-content: center; }
.actions .btn { flex: 1 1 240px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 18px;
  border: 1px solid var(--gold); border-radius: 12px; background: transparent; color: var(--accent);
  font: 700 16px/1.2 'PT Serif', serif; text-decoration: none; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fbf3e6; flex: 1 1 100%; }
.actions .btn.wide { flex-basis: 100%; }
.btn:hover { background: rgba(168, 116, 47, .12); }
.btn.primary:hover { background: #5a2b0f; }
.more { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid rgba(168, 116, 47, .35); }
.more .btn { flex: 1 1 220px; font-weight: 400; }
/* подпись автора: мелко, бледно, под подвалом */
.credit { width: var(--cw); margin: 0; padding: 14px 16px 26px; text-align: center; font-size: 12.5px; line-height: 1.5;
  color: rgba(243, 227, 196, .5); box-sizing: border-box; }
.credit a { color: rgba(233, 196, 124, .9); text-decoration: none; border-bottom: 1px solid rgba(233, 196, 124, .35); }
.credit a:hover, .credit a:focus-visible { color: #f3d38c; border-bottom-color: #f3d38c; }
.foot { width: var(--cw); padding: 18px 16px 0; color: rgba(243, 227, 196, .72); font-size: 13px; line-height: 1.5; text-align: center; }

@media (min-width: 700px) {
  .info-lead { display: none; }   /* на широком экране текст карточки читается и так */
}

@media (prefers-reduced-motion: reduce) {
  .strip, .eagle-path, .eagle-bob, .eagle, .wing-r, .wing-l > span, .glint, .sweep, .opener-btn { animation: none !important; }
  .js .card .logo, .js .card .title, .js .card .intro > p, .js .card .rule, .js .card .details { opacity: 1; animation: none !important; }
}

/* ---------- торжественная страница «/» (мероприятия 17–18 октября) ----------
   Тёмно-красный и золото, как карточка A6 мероприятий, чтобы не путать со светлой страницей конференции.
   Класс fest стоит у <body> в index.html; tools_build_pages.py снимает его для /konferenciya/. */
body.fest { background: #36070b; }
body.fest .backdrop { background: radial-gradient(ellipse 85% 65% at 50% 28%, #8d1e27 0%, #5c0e16 52%, #2c0508 100%); filter: none; }
body.fest .card { box-shadow: 0 0 0 1px rgba(233, 196, 124, .9), 0 0 0 5px #4e0b12, 0 0 0 6px rgba(233, 196, 124, .55), 0 18px 60px rgba(0, 0, 0, .55); }
body.fest .info { background: linear-gradient(180deg, #651119 0%, #4c0a11 100%); color: #f4e6c9; border-top-color: rgba(233, 196, 124, .55); }
body.fest .info-lead b, body.fest .facts dt, body.fest .facts dd a, body.fest .program-title,
body.fest .program .day, body.fest .prog .t { color: #e9c47c; }
body.fest .facts div { border-left-color: #c9a056; }
body.fest .program, body.fest .more { border-top-color: rgba(233, 196, 124, .3); }
body.fest .program .day { border-bottom-color: rgba(233, 196, 124, .45); }
body.fest .prog .p { color: rgba(244, 230, 201, .7); }
/* пометка под днём программы (айтыш и конференция одновременно) и слово вместо времени */
.prog-note { margin: 14px 0 0; padding: 10px 14px; border: 1px solid rgba(168, 116, 47, .45); border-radius: 10px; background: rgba(168, 116, 47, .08);
  font-size: 15px; line-height: 1.45; font-style: italic; }
body.fest .prog-note { border-color: rgba(233, 196, 124, .45); background: rgba(233, 196, 124, .08); color: #f4e6c9; }
.prog .t.t-word { white-space: normal; font-style: italic; font-weight: 400; }
/* о музыке страницы */
.music-note { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(168, 116, 47, .35); font-size: 15px; line-height: 1.5; }
.music-title { margin: 0 0 4px; font: 700 17px/1.3 'Libertine', 'PT Serif', serif; color: var(--accent); }
.music-meta { margin: 0 0 8px; font-style: italic; color: rgba(58, 36, 18, .75); }
.music-story { margin: 0 0 8px; text-wrap: pretty; white-space: pre-line; }   /* абзацы через \n */
.music-src { margin: 0; font-size: 14px; }
.music-src a { color: var(--accent); }
body.fest .music-note { border-top-color: rgba(233, 196, 124, .3); }
body.fest .music-title, body.fest .music-src a { color: #e9c47c; }
body.fest .music-meta { color: rgba(244, 230, 201, .7); }
body.fest .btn { border-color: rgba(233, 196, 124, .7); color: #f3d79b; }
body.fest .btn:hover { background: rgba(233, 196, 124, .12); }
body.fest .btn.primary { background: linear-gradient(180deg, #ecd08f, #c0924a); border-color: #d9b066; color: #2a0a0d; }
body.fest .btn.primary:hover { background: linear-gradient(180deg, #f3dca3, #c99b52); }
