:root {
    color-scheme: dark;
    --page: #0a0b0a;
    --ink: #f3f2ec;
    --track: rgba(243, 242, 236, 0.10);
    --glow-tight: rgba(243, 242, 236, 0.30);
    --glow-wide: rgba(243, 242, 236, 0.12);
    --bar-width: 220px;
    --bar-height: 3px;
    --message-width: 320px;
    --message-size: 18px;
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --progress-duration: 480ms;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--page);
    color: var(--ink);
    font-family: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", "Nirmala UI", "Leelawadee UI", "Noto Sans", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.visit-main {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: 24px;
}

.visit-state {
    display: flex;
    width: min(100%, 420px);
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.route-bar-stage {
    position: relative;
    width: var(--bar-width);
    max-width: 100%;
    height: var(--bar-height);
}

.route-bar {
    position: relative;
    width: 100%;
    height: var(--bar-height);
    background: var(--track);
    border-radius: 999px;
    overflow: hidden;
}

.route-bar-glow {
    position: absolute;
    top: 50%;
    left: 0;
    width: 8%;
    height: var(--bar-height);
    transform: translateY(-50%);
    border-radius: 999px;
    box-shadow:
        0 0 12px 1px var(--glow-tight),
        0 0 28px 6px var(--glow-wide);
    pointer-events: none;
    transition: width var(--progress-duration) var(--ease-out);
    will-change: width;
}

.route-bar__fill {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--ink);
    border-radius: inherit;
    transform: scaleX(0.08);
    transform-origin: left center;
    transition: transform var(--progress-duration) var(--ease-out);
    will-change: transform;
}

.visit-message {
    max-width: var(--message-width);
    margin: 0;
    color: var(--ink);
    font-size: var(--message-size);
    line-height: 1.7;
    text-align: center;
    white-space: pre-line;
    text-wrap: balance;
}

.visit-message:focus {
    outline: none;
}

.visit-countdown {
    display: inline-block;
    min-width: 2ch;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-align: center;
    unicode-bidi: isolate;
}

body[data-route-show-animation="false"] .route-bar__fill,
body[data-route-show-animation="false"] .route-bar-glow {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .route-bar__fill,
    .route-bar-glow {
        transition: none;
    }
}
