/* «html body» в селекторах: на главной общий сброс .au-home :where(*) и стили заголовков сайта иначе перебивают заставку.
   Заставка при входе на сайт («Визуализация сайта» → Заставка). Цвета праздника: --sti-1, --sti-2, --sti-3. */

/* Пока скрипт заставки грузится — сразу закрываем страницу цветом праздника, чтобы сайт не мелькнул.
   Если скрипт не загрузится, занавес сам уйдёт через 4 секунды. */
html.st-intro-on { overflow: hidden; }
html.st-intro-on::after {
    content: ""; position: fixed; inset: 0; z-index: 2147483000;
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--st-1, #187d35) 70%, #000) 0%, color-mix(in srgb, var(--st-3, #0b4f21) 80%, #000) 60%, #02060a 100%);
    animation: sti-curtain-fallback .6s 4s forwards;
}
html.st-intro-ready::after { display: none; }
@keyframes sti-curtain-fallback { to { opacity: 0; visibility: hidden; } }

html body .sti {
    --sti-1: #00afca; --sti-2: #fec50c; --sti-3: #0b4f6c;
    position: fixed; inset: 0; z-index: 2147483001; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: #fff; text-align: center;
    font-family: "Twemoji Country Flags", "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--sti-1) 70%, #000) 0%, color-mix(in srgb, var(--sti-3) 80%, #000) 60%, #02060a 100%);
    transition: opacity .8s ease, transform .9s cubic-bezier(.6, 0, .3, 1), filter .8s ease;
}
html body .sti *, html body .sti *::before, html body .sti *::after { box-sizing: border-box; }
html body .sti.is-leaving { opacity: 0; transform: scale(1.12); filter: blur(6px); pointer-events: none; }

/* Северное сияние из цветов праздника */
html body .sti__aurora { position: absolute; inset: -20%; pointer-events: none; filter: blur(60px); opacity: .75; }
html body .sti__aurora i { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; mix-blend-mode: screen; animation: sti-drift 14s ease-in-out infinite alternate; }
html body .sti__aurora i:nth-child(1) { left: 5%; top: 0; background: radial-gradient(circle, color-mix(in srgb, var(--sti-1) 80%, transparent), transparent 65%); }
html body .sti__aurora i:nth-child(2) { right: 0; top: 20%; background: radial-gradient(circle, color-mix(in srgb, var(--sti-2) 55%, transparent), transparent 65%); animation-delay: -5s; animation-duration: 17s; }
html body .sti__aurora i:nth-child(3) { left: 25%; bottom: -10%; background: radial-gradient(circle, color-mix(in srgb, var(--sti-3) 90%, transparent), transparent 65%); animation-delay: -9s; }
@keyframes sti-drift { to { transform: translate(8vmax, -6vmax) scale(1.15); } }

/* Лучи, расходящиеся из центра */
html body .sti__rays { position: absolute; left: 50%; top: 42%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; pointer-events: none; opacity: .14;
    background: repeating-conic-gradient(from 0deg, var(--sti-2) 0deg 3deg, transparent 3deg 15deg);
    -webkit-mask: radial-gradient(circle, #000 0, transparent 60%); mask: radial-gradient(circle, #000 0, transparent 60%);
    animation: sti-spin 90s linear infinite, sti-rays-in 2s ease both; }
@keyframes sti-rays-in { from { opacity: 0; } to { opacity: .12; } }

html body .sti__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Подлинный орнамент «қошқар мүйіз» (с Государственного флага): полосы по краям экрана и едва заметный узор по полю.
   Цвет — из темы праздника: орнамент задан маской, закрашивается фоном. */
html body .sti__oyu { position: absolute; top: 0; bottom: 0; width: clamp(44px, 6vw, 92px); pointer-events: none; opacity: .62;
    background: linear-gradient(180deg, var(--sti-2), color-mix(in srgb, var(--sti-2) 55%, #fff) 50%, var(--sti-2));
    -webkit-mask: var(--sti-oyu) center top / 100% auto repeat-y; mask: var(--sti-oyu) center top / 100% auto repeat-y;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--sti-2) 55%, transparent));
    animation: sti-oyu-in 2.2s .15s cubic-bezier(.4, 0, .2, 1) both; }
html body .sti__oyu--l { left: clamp(10px, 3vw, 44px); }
html body .sti__oyu--r { right: clamp(10px, 3vw, 44px); animation-delay: .35s; }
html body .sti__field { position: absolute; inset: 0; pointer-events: none; opacity: .07; background: var(--sti-2);
    -webkit-mask: var(--sti-oyu) 0 0 / 54px auto repeat, radial-gradient(ellipse at 50% 45%, transparent 22%, #000 78%);
    -webkit-mask-composite: source-in; mask: var(--sti-oyu) 0 0 / 54px auto repeat, radial-gradient(ellipse at 50% 45%, transparent 22%, #000 78%); mask-composite: intersect;
    animation: sti-field-in 2.4s .4s ease both; }
@keyframes sti-field-in { from { opacity: 0; } to { opacity: .07; } }
@keyframes sti-oyu-in { from { clip-path: inset(0 0 100% 0); opacity: 0; } to { clip-path: inset(0); opacity: var(--oyu-op, .62); } }

/* Мягкое затемнение под текстом — читается на любом цвете праздника */
html body .sti__stage::before { content: ""; position: absolute; left: 50%; top: 58%; z-index: -1; width: 130%; height: 75%; transform: translate(-50%, -50%); pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(2, 6, 10, .45) 0%, rgba(2, 6, 10, .25) 45%, transparent 72%); }
html body .sti__stage { position: relative; z-index: 2; width: min(920px, 100% - 40px); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 0 80px; }

/* Развевающийся флаг: полоски одной картинки качаются с задержкой — получается волна */
html body .sti__flag { position: relative; display: flex; width: min(440px, 78vw); aspect-ratio: 2 / 1; margin-bottom: 18px; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .45)); animation: sti-rise 1.1s .2s cubic-bezier(.2, .8, .2, 1) both; }
html body .sti__flag > span:not(.sti__pole) { flex: 1 1 0; height: 100%; background-repeat: no-repeat; margin-right: -0.5px; animation: sti-wave 2.6s ease-in-out infinite; }
html body .sti__flag::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .0) 0, rgba(255, 255, 255, .35) 10%, rgba(0, 0, 0, .25) 20%, rgba(255, 255, 255, .0) 30%);
    background-size: 200% 100%; animation: sti-shine 2.6s linear infinite; }
html body .sti__pole { position: absolute; left: -10px; top: -14px; bottom: -60px; width: 7px; border-radius: 4px; background: linear-gradient(90deg, #d1d5db, #f9fafb, #9ca3af); }
html body .sti__pole::before { content: ""; position: absolute; left: 50%; top: -12px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff7d1, var(--sti-2)); }
@keyframes sti-wave { 0%, 100% { transform: translateY(-5px); filter: brightness(1); } 50% { transform: translateY(7px); filter: brightness(.88); } }
@keyframes sti-shine { to { background-position: -200% 0; } }

/* Эмблема праздника */
html body .sti__emblem { position: relative; width: 150px; height: 150px; margin-bottom: 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 76px; line-height: 1;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), rgba(255, 255, 255, .06) 70%);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .35), 0 0 0 9px color-mix(in srgb, var(--sti-2) 65%, transparent), 0 0 80px color-mix(in srgb, var(--sti-2) 60%, transparent);
    animation: sti-pop 1.1s .2s cubic-bezier(.2, .9, .3, 1.35) both, sti-glow 3s 1.4s ease-in-out infinite; }
html body .sti__emblem::before { content: ""; position: absolute; inset: -22px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--sti-2) 70%, transparent); animation: sti-spin 18s linear infinite; }

/* Свеча (траур, день памяти) */
html body .sti__candle { position: relative; width: 46px; height: 150px; margin: 40px 0 18px; animation: sti-fade-in 1.6s .2s ease both; }
html body .sti__candle i { position: absolute; left: 0; right: 0; bottom: 0; height: 110px; border-radius: 8px 8px 4px 4px; background: linear-gradient(90deg, #d6d3d1, #fafaf9 45%, #a8a29e); }
html body .sti__candle b { position: absolute; left: 50%; bottom: 104px; width: 22px; height: 42px; margin-left: -11px; border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
    background: radial-gradient(ellipse at 50% 70%, #fff 0, #fde68a 30%, #f59e0b 60%, rgba(245, 158, 11, 0) 75%);
    box-shadow: 0 0 40px 18px rgba(253, 230, 138, .35); transform-origin: 50% 100%; animation: sti-flicker 2.4s ease-in-out infinite; }
@keyframes sti-flicker { 0%, 100% { transform: scale(1) rotate(-1deg); } 30% { transform: scale(1.06, .96) rotate(2deg); } 60% { transform: scale(.96, 1.05) rotate(-2deg); } }

/* Тексты */
html body .sti__chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(6px); animation: sti-rise .8s .8s both; }
html body .sti__chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sti-2); box-shadow: 0 0 12px var(--sti-2); }
html body .sti__title { margin: 6px 0 0; font-size: clamp(30px, 5.6vw, 66px); font-weight: 800; line-height: 1.12; letter-spacing: -.015em; color: #fff; text-wrap: balance;
    text-shadow: 0 4px 30px rgba(0, 0, 0, .35); }
html body .sti__w { display: inline-block; white-space: nowrap; }
html body .sti__l { display: inline-block; opacity: 0; animation: sti-letter .7s cubic-bezier(.2, .8, .2, 1) forwards; }
html body .sti__title .sti__gold { background: linear-gradient(90deg, #fff 0%, var(--sti-2) 50%, #fff 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sti-letter .7s cubic-bezier(.2, .8, .2, 1) forwards, sti-shine 4s 2s linear infinite; }
html body .sti__lead { max-width: 720px; margin: 2px 0 0; font-size: clamp(16px, 2.2vw, 22px); line-height: 1.5; color: rgba(255, 255, 255, .88); animation: sti-rise .9s both; }
html body .sti__uni { margin: 6px 0 0; font-size: 14px; letter-spacing: .04em; color: rgba(255, 255, 255, .7); animation: sti-rise .9s both; }
html body .sti__enter { margin-top: 18px; display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 12px 26px; border: 0; border-radius: 999px; cursor: pointer;
    font: inherit; font-weight: 800; font-size: 16px; color: #111; background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--sti-2) 75%, #fff));
    box-shadow: 0 14px 34px rgba(0, 0, 0, .35), 0 0 0 0 color-mix(in srgb, var(--sti-2) 60%, transparent); animation: sti-rise .9s both, sti-pulse 2.2s 3s ease-in-out infinite; transition: transform .2s ease; }
html body .sti__enter:hover { transform: translateY(-2px) scale(1.03); }
html body .sti__enter:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
html body .sti__enter svg { transition: transform .2s ease; }
html body .sti__enter:hover svg { transform: translateX(4px); }

html body .sti__skip { position: absolute; top: max(18px, env(safe-area-inset-top)); right: 18px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .3); backdrop-filter: blur(6px); animation: sti-fade-in .6s .6s both; }
html body .sti__skip:hover { background: rgba(0, 0, 0, .4); }
html body .sti__skip:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
html body .sti__progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 4px; background: rgba(255, 255, 255, .12); }
html body .sti__progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--sti-1), var(--sti-2)); animation: sti-progress linear forwards; }

html body .sti--mourning { background: radial-gradient(circle at 50% 35%, #374151 0%, #111827 55%, #030712 100%); }
html body .sti--mourning .sti__title { font-size: clamp(26px, 4.2vw, 48px); font-weight: 700; }
html body .sti--mourning .sti__progress i { background: #9ca3af; }

@keyframes sti-spin { to { transform: rotate(360deg); } }
@keyframes sti-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sti-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes sti-pop { from { opacity: 0; transform: scale(.3) rotate(-25deg); } to { opacity: 1; transform: none; } }
@keyframes sti-glow { 50% { box-shadow: 0 0 0 3px rgba(255, 255, 255, .45), 0 0 0 12px color-mix(in srgb, var(--sti-2) 50%, transparent), 0 0 120px color-mix(in srgb, var(--sti-2) 75%, transparent); } }
@keyframes sti-letter { from { opacity: 0; transform: translateY(.55em) rotate(4deg); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes sti-pulse { 50% { box-shadow: 0 14px 34px rgba(0, 0, 0, .35), 0 0 0 14px color-mix(in srgb, var(--sti-2) 0%, transparent); } 0% { box-shadow: 0 14px 34px rgba(0, 0, 0, .35), 0 0 0 0 color-mix(in srgb, var(--sti-2) 55%, transparent); } }
@keyframes sti-progress { to { transform: scaleX(1); } }

@media (max-width: 575.98px) {
    /* Узкий экран: полосы орнамента тоньше и не заходят под флаг и текст */
    html body .sti__oyu { --oyu-op: .42; width: 22px; }
    html body .sti__oyu--l { left: 5px; }
    html body .sti__oyu--r { right: 5px; }
    html body .sti__stage { width: calc(100% - 64px); }
    html body .sti__flag { width: min(300px, 70vw); }
    html body .sti__stage { gap: 10px; padding-bottom: 60px; }
    html body .sti__emblem { width: 112px; height: 112px; font-size: 56px; }
    html body .sti__chip { font-size: 11px; padding: 6px 12px; }
    html body .sti__skip { top: 12px; right: 12px; padding: 7px 12px; }
    html body .sti__enter { min-height: 46px; padding: 11px 22px; font-size: 15px; }
}
@media (max-height: 560px) {
    html body .sti__flag { width: min(300px, 60vw); margin-bottom: 8px; }
    html body .sti__emblem { width: 96px; height: 96px; font-size: 48px; }
    html body .sti__candle { height: 110px; margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    html body .sti *, html body .sti *::before, html body .sti *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; }
    html body .sti__progress i { animation-duration: var(--sti-dur, 4s) !important; }
    html body .sti { transition: opacity .3s ease; }
    html body .sti.is-leaving { transform: none; filter: none; }
}
