/* RUTI App - Animated loading screen (1.56.3). Always dark, in brand colours, phone and desktop. */

html.rs-on, html.rs-on body { background: #0B1120; overflow: hidden; }
html.rs-skip .rs { display: none !important; }

.rs {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
    background: radial-gradient(120% 80% at 50% 42%, #18233A 0%, #0B1220 55%, #060911 100%);
    transition: opacity .45s ease, transform .45s ease;
}
.rs--out { opacity: 0; transform: scale(1.06); pointer-events: none; }

.rs__stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 2.2vh, 26px);
    transform: translateY(-3vh);
}

/* The RUTI mark: two halves of the same image that slide in and lock together */
.rs__mark { position: relative; width: clamp(220px, 24vw, 340px); aspect-ratio: 600 / 310; }
.rs__half { position: absolute; inset: 0; width: 100%; height: 100%; }
.rs__half--l { clip-path: inset(0 50% 0 0); animation: rsInL .7s cubic-bezier(.2, .8, .2, 1) both; }
.rs__half--r { clip-path: inset(0 0 0 50%); animation: rsInR .7s cubic-bezier(.2, .8, .2, 1) both; }
.rs__glow {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 115%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(233, 196, 99, .30) 0%, rgba(18, 136, 190, .16) 35%, rgba(196, 74, 39, .08) 55%, rgba(11, 18, 32, 0) 72%);
    animation: rsGlow 1.2s ease-out .45s both, rsBreath 2.4s ease-in-out 1.65s infinite alternate;
}

.rs__word { width: clamp(130px, 11vw, 190px); height: auto; animation: rsUp .5s ease-out .45s both; }
.rs__tag {
    margin: 0;
    font: 600 clamp(13px, 1.05vw, 16px)/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    letter-spacing: .06em;
    color: #AEB8C7;
    animation: rsUp .5s ease-out .55s both;
}

/* Four brand dots swinging like pendulums, one after another */
.rs__dots { display: flex; gap: clamp(10px, 1vw, 14px); height: 64px; margin-top: 6px; animation: rsFade .4s ease-out .7s both; }
.rs__pend {
    width: 14px;
    height: 58px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    transform-origin: 50% 0;
    animation: rsSwing 1.1s ease-in-out infinite alternate;
}
.rs__pend:nth-child(2) { animation-delay: .14s; }
.rs__pend:nth-child(3) { animation-delay: .28s; }
.rs__pend:nth-child(4) { animation-delay: .42s; }
.rs__dot { display: block; width: 14px; height: 14px; border-radius: 50%; }
.rs__dot--1 { background: #C44A27; }
.rs__dot--2 { background: #D9930D; }
.rs__dot--3 { background: #6E9A0F; }
.rs__dot--4 { background: #1288BE; }

@media (min-width: 900px) {
    .rs__pend { width: 16px; height: 66px; }
    .rs__dot { width: 16px; height: 16px; }
    .rs__dots { height: 72px; }
}

@keyframes rsInL { from { transform: translateX(-40%) rotate(-10deg); opacity: 0; } 80% { transform: translateX(1.5%); opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes rsInR { from { transform: translateX(40%) rotate(10deg); opacity: 0; } 80% { transform: translateX(-1.5%); opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes rsGlow { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 35% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: .55; transform: translate(-50%, -50%) scale(1); } }
@keyframes rsBreath { from { opacity: .45; } to { opacity: .75; } }
@keyframes rsUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rsSwing { from { transform: rotate(32deg); } to { transform: rotate(-32deg); } }
@keyframes rsPulse { from { opacity: .3; } to { opacity: 1; } }

/* Reduce motion: a still logo, the dots only fade gently */
@media (prefers-reduced-motion: reduce) {
    .rs, .rs * { animation: none !important; transition: none !important; }
    .rs .rs__glow { opacity: .55; }
    .rs .rs__dot { animation: rsPulse 1.2s ease-in-out infinite alternate !important; }
    .rs .rs__pend:nth-child(2) .rs__dot { animation-delay: .2s !important; }
    .rs .rs__pend:nth-child(3) .rs__dot { animation-delay: .4s !important; }
    .rs .rs__pend:nth-child(4) .rs__dot { animation-delay: .6s !important; }
}

/* 1.72.0 – the live RUTI logo (silent video drawn on a canvas with its black made transparent) */
.rs__mark--live { width: clamp(280px, 34vw, 460px); aspect-ratio: 640 / 334; }
.rs__video { position: absolute; inset: 0; width: 100%; height: 100%; animation: rsFade .35s ease-out both; }
.rs__mark--live .rs__glow { width: 80%; opacity: .7; }
.rs .ruti-live { display: block; }
.rs .ruti-live canvas { display: block; width: 100%; height: 100%; }
.rs .ruti-live video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; top: 0; }
