:root {
    color-scheme: light dark;

    --bg: #f5f6f8;
    --fg: #191c21;
    --muted: #6b7280;
    --card: #ffffff;
    --line: rgba(16, 24, 40, 0.09);
    --accent: #2f6feb;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 18px 40px -20px rgba(16, 24, 40, 0.28);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0f13;
        --fg: #e8eaed;
        --muted: #98a2b0;
        --card: #15181e;
        --line: rgba(255, 255, 255, 0.08);
        --accent: #6ea8ff;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 20px 44px -22px rgba(0, 0, 0, 0.9);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 2.5rem);
    background:
        radial-gradient(38rem 26rem at 50% -12%, rgba(47, 111, 235, 0.12), transparent 70%),
        var(--bg);
    color: var(--fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    text-align: center;
    -webkit-font-smoothing: antialiased;
}

.card {
    width: min(27rem, 100%);
    padding: clamp(1.75rem, 5vw, 2.75rem);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    animation: card-in 700ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dots {
    display: inline-flex;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
}

.dots span {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.3;
    animation: dot-pulse 1.4s ease-in-out infinite;
}

.dots span:nth-child(2) {
    animation-delay: 180ms;
}

.dots span:nth-child(3) {
    animation-delay: 360ms;
}

@keyframes dot-pulse {
    0%,
    100% {
        opacity: 0.25;
        transform: translateY(0) scale(0.85);
    }
    50% {
        opacity: 1;
        transform: translateY(-0.2rem) scale(1);
    }
}

h1 {
    margin: 0;
    font-size: clamp(1.375rem, 4.5vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.subtitle {
    margin: 0.4rem 0 0;
    font-size: clamp(0.9375rem, 3vw, 1.0625rem);
    color: var(--muted);
}

.status {
    margin: 1.6rem 0 0;
    min-height: 1.25rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.status.is-swapping {
    animation: status-in 420ms ease both;
}

@keyframes status-in {
    from {
        opacity: 0;
        transform: translateY(0.35rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress {
    position: relative;
    height: 4px;
    margin-top: 0.85rem;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}

.progress__bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: progress-slide 1.8s ease-in-out infinite;
}

@keyframes progress-slide {
    from {
        transform: translateX(-105%);
    }
    to {
        transform: translateX(245%);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }

    .progress__bar {
        width: 100%;
        opacity: 0.45;
    }
}
