@view-transition {
            navigation: auto;
        }

        :root {
            color-scheme: dark;
            --bg: #0b0f16;
            --panel: #111928;
            --panel-2: #1f2a3a;
            --border: rgba(255, 255, 255, .12);
            --text: #e6eaf0;
            --muted: rgba(230, 234, 240, .66);
            --accent: #3a8dca;
            --soft: #7cc7ee;
            --success: #4eb58a;
        }

        html[data-theme="light"] {
            color-scheme: light;
            --bg: #f4f6f9;
            --panel: #fff;
            --panel-2: #e8edf3;
            --border: rgba(31, 42, 58, .14);
            --text: #1e293b;
            --muted: rgba(30, 41, 59, .64);
            --soft: #5aaed6;
        }

        @media (prefers-color-scheme: light) {
            html:not([data-theme]) {
                color-scheme: light;
                --bg: #f4f6f9;
                --panel: #fff;
                --panel-2: #e8edf3;
                --border: rgba(31, 42, 58, .14);
                --text: #1e293b;
                --muted: rgba(30, 41, 59, .64);
                --soft: #5aaed6;
            }
        }

        * {
            box-sizing: border-box;
        }

        html,
        body {
            min-width: 100%;
            min-height: 100%;
            margin: 0;
        }

        body {
            display: grid;
            place-items: center;
            padding: 24px;
            overflow-x: hidden;
            background: var(--bg);
            color: var(--text);
            font-family: Figtree, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            view-transition-name: cold-start-page;
        }

        body::before {
            position: fixed;
            z-index: -1;
            inset: 0;
            content: "";
            background:
                radial-gradient(circle at 18% 16%, rgba(58, 141, 202, .16), transparent 38%),
                radial-gradient(circle at 82% 84%, rgba(124, 199, 238, .07), transparent 34%);
        }

        .page {
            width: min(100%, 700px);
        }

        .brand {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 11px;
            margin-bottom: 20px;
            font-size: 13px;
            font-weight: 650;
            letter-spacing: .14em;
            text-transform: uppercase;
        }

        .brand-mark {
            position: relative;
            width: 36px;
            height: 36px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--panel-2);
        }

        .brand-mark::before,
        .brand-mark::after {
            position: absolute;
            top: 10px;
            width: 8px;
            height: 14px;
            content: "";
            border: solid var(--soft);
        }

        .brand-mark::before {
            left: 8px;
            border-width: 2px 0 2px 2px;
            border-radius: 8px 0 0 8px;
        }

        .brand-mark::after {
            right: 8px;
            border-width: 2px 2px 2px 0;
            border-radius: 0 8px 8px 0;
        }

        .panel {
            position: relative;
            overflow: hidden;
            padding: 38px 42px 34px;
            border: 1px solid var(--border);
            border-radius: 14px;
            background: var(--panel);
            box-shadow: 0 24px 70px rgba(0, 0, 0, .2);
            transition: border-color .35s ease, box-shadow .35s ease, transform .35s ease;
        }

        .panel::before {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 1px;
            content: "";
            background: linear-gradient(90deg, transparent, var(--accent), transparent);
            animation: top-line 2.4s ease-in-out both;
        }

        .eyebrow {
            margin: 0 0 10px;
            color: var(--accent);
            font-size: 12px;
            font-weight: 650;
            letter-spacing: .13em;
            text-align: center;
            text-transform: uppercase;
        }

        h1 {
            margin: 0;
            font-size: clamp(26px, 5vw, 37px);
            font-weight: 520;
            line-height: 1.15;
            letter-spacing: -.025em;
            text-align: center;
            text-wrap: balance;
        }

        .description {
            max-width: 500px;
            margin: 13px auto 0;
            color: var(--muted);
            font-size: 15px;
            line-height: 1.55;
            text-align: center;
        }

        .crypto {
            position: relative;
            width: min(100%, 430px);
            height: 156px;
            margin: 24px auto 16px;
            contain: layout paint;
        }

        .crypto::before {
            position: absolute;
            top: 77px;
            left: 12%;
            width: 76%;
            height: 1px;
            content: "";
            background: linear-gradient(90deg, transparent, var(--accent), var(--soft), var(--accent), transparent);
            opacity: .45;
            transform: scaleX(0);
            animation: build-line 1.8s ease-out both;
        }

        .packet {
            position: absolute;
            top: 58px;
            display: grid;
            width: 43px;
            height: 38px;
            place-items: center;
            border: 1px solid rgba(58, 141, 202, .35);
            border-radius: 7px;
            background: var(--panel-2);
            color: var(--soft);
            font: 600 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
            letter-spacing: .05em;
            will-change: transform, opacity;
        }

        .packet::after {
            position: absolute;
            right: 7px;
            bottom: 6px;
            left: 7px;
            height: 2px;
            content: "";
            border-radius: 2px;
            background: var(--accent);
            opacity: .45;
        }

        .packet.left-a {
            left: 3%;
            animation: packet-left 1.8s ease-in-out both;
        }

        .packet.left-b {
            left: 18%;
            animation: packet-left 1.8s .18s ease-in-out both;
        }

        .packet.right-a {
            right: 3%;
            animation: packet-right 1.8s ease-in-out both;
        }

        .packet.right-b {
            right: 18%;
            animation: packet-right 1.8s .18s ease-in-out both;
        }

        .secure-core {
            position: absolute;
            top: 15px;
            left: 50%;
            width: 126px;
            height: 126px;
            transform: translateX(-50%);
        }

        .ring,
        .ring::after {
            position: absolute;
            inset: 0;
            border: 1px solid rgba(58, 141, 202, .23);
            border-radius: 50%;
        }

        .ring {
            animation: ring-pulse 1.8s ease-out both;
        }

        .ring::after {
            inset: 13px;
            content: "";
            border-color: rgba(124, 199, 238, .16);
            animation: ring-turn 1.8s ease-out both;
        }

        .lock {
            position: absolute;
            top: 30px;
            left: 35px;
            width: 56px;
            height: 65px;
        }

        .shackle {
            position: absolute;
            top: 0;
            left: 11px;
            width: 34px;
            height: 35px;
            border: 5px solid var(--soft);
            border-bottom: 0;
            border-radius: 19px 19px 0 0;
            transform-origin: 50% 100%;
            animation: build-shackle 1.8s ease-in-out both;
        }

        .lock-body {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 56px;
            height: 42px;
            border: 1px solid rgba(255, 255, 255, .14);
            border-radius: 9px;
            background: linear-gradient(145deg, var(--accent), #276c9f);
            box-shadow: 0 8px 24px rgba(58, 141, 202, .25);
            transform-origin: 50% 100%;
            animation: build-body 1.8s ease-in-out both;
        }

        .keyhole {
            position: absolute;
            top: 13px;
            left: 25px;
            width: 7px;
            height: 13px;
            border-radius: 6px 6px 3px 3px;
            background: #fff;
            opacity: .9;
            animation: key-flash 1.8s ease-in-out both;
        }

        .status {
            min-height: 21px;
            margin: 0;
            color: var(--text);
            font-size: 14px;
            font-weight: 520;
            text-align: center;
            transition: color .25s ease;
        }

        .status::before {
            display: inline-block;
            width: 7px;
            height: 7px;
            margin-right: 9px;
            border-radius: 50%;
            background: var(--success);
            box-shadow: 0 0 0 5px rgba(78, 181, 138, .1);
            content: "";
            animation: status-pulse 1.2s ease-in-out both;
        }

        .steps {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 7px;
            margin-top: 24px;
        }

        .step {
            height: 3px;
            overflow: hidden;
            border-radius: 3px;
            background: rgba(58, 141, 202, .14);
        }

        .step::after {
            display: block;
            width: 100%;
            height: 100%;
            content: "";
            border-radius: inherit;
            background: linear-gradient(90deg, var(--accent), var(--soft));
            transform: scaleX(0);
            transform-origin: left;
        }

        .step.done::after {
            transform: scaleX(1);
            transition: transform .35s ease;
        }

        .note {
            margin: 15px 0 0;
            color: var(--muted);
            font-size: 11px;
            text-align: center;
        }

        body.is-waiting .panel::before {
            opacity: .45;
            transform: scaleX(1);
        }

        body.is-waiting .crypto::before {
            opacity: .28;
            transform: scaleX(1);
        }

        body.is-waiting .packet {
            opacity: 0;
        }

        body.is-waiting .ring {
            opacity: .38;
            transform: scale(1);
        }

        body.is-waiting .shackle,
        body.is-waiting .lock-body {
            opacity: 1;
            transform: none;
        }

        body.is-waiting .keyhole {
            opacity: .9;
            transform: scale(1);
        }

        body.is-waiting .status::before {
            opacity: .75;
            transform: scale(1);
        }

        body.is-ready .panel {
            border-color: rgba(78, 181, 138, .42);
            box-shadow: 0 24px 70px rgba(0, 0, 0, .2), 0 0 0 1px rgba(78, 181, 138, .08);
            animation: ready-panel .4s ease-out both;
        }

        body.is-ready .secure-core {
            animation: ready-lock .4s ease-out both;
        }

        body.is-ready .status {
            color: var(--success);
        }

        body.is-ready .status::before {
            animation: ready-dot .4s ease-out both;
        }

        @keyframes top-line {
            0% { opacity: .25; transform: scaleX(.35); }
            50% { opacity: .9; transform: scaleX(1); }
            100% { opacity: .45; transform: scaleX(1); }
        }

        @keyframes build-line {
            0% { opacity: 0; transform: scaleX(0); }
            35%, 75% { opacity: .55; transform: scaleX(1); }
            100% { opacity: .28; transform: scaleX(1); }
        }

        @keyframes packet-left {
            0% { opacity: 0; transform: translateX(-14px) scale(.8); }
            28% { opacity: 1; transform: translateX(0) scale(1); }
            67% { opacity: .7; transform: translateX(24px) scale(.88); }
            100% { opacity: 0; transform: translateX(48px) scale(.7); }
        }

        @keyframes packet-right {
            0% { opacity: 0; transform: translateX(14px) scale(.8); }
            28% { opacity: 1; transform: translateX(0) scale(1); }
            67% { opacity: .7; transform: translateX(-24px) scale(.88); }
            100% { opacity: 0; transform: translateX(-48px) scale(.7); }
        }

        @keyframes ring-pulse {
            0% { opacity: .2; transform: scale(.78); }
            45%, 70% { opacity: 1; transform: scale(1); }
            100% { opacity: .38; transform: scale(1); }
        }

        @keyframes ring-turn {
            to { transform: rotate(360deg); }
        }

        @keyframes build-shackle {
            0%, 15% { opacity: 0; transform: translateY(9px) scale(.7); }
            38%, 88% { opacity: 1; transform: translateY(0) scale(1); }
            100% { opacity: 1; transform: translateY(0) scale(1); }
        }

        @keyframes build-body {
            0%, 28% { opacity: 0; transform: scaleX(.25) scaleY(.65); }
            52%, 88% { opacity: 1; transform: scale(1); }
            100% { opacity: 1; transform: scale(1); }
        }

        @keyframes key-flash {
            0%, 50% { opacity: 0; transform: scale(.4); }
            68%, 90% { opacity: .9; transform: scale(1); }
            100% { opacity: .9; transform: scale(1); }
        }

        @keyframes status-pulse {
            50% { opacity: .55; transform: scale(.82); }
        }

        @keyframes ready-panel {
            50% { transform: translateY(-2px); }
        }

        @keyframes ready-lock {
            50% { filter: drop-shadow(0 0 10px rgba(78, 181, 138, .35)); transform: translateX(-50%) scale(1.04); }
        }

        @keyframes ready-dot {
            50% { box-shadow: 0 0 0 9px rgba(78, 181, 138, .12); transform: scale(1.12); }
        }

        @media (max-width: 600px) {
            body {
                padding: 16px;
            }

            .brand {
                justify-content: flex-start;
                margin-left: 4px;
            }

            .panel {
                padding: 30px 20px 26px;
            }

            .crypto {
                height: 142px;
                margin-top: 17px;
                transform: scale(.9);
            }

            .packet.left-b,
            .packet.right-b {
                display: none;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                animation: none !important;
                transition-duration: .01ms !important;
            }

            .crypto::before {
                opacity: .28;
                transform: scaleX(1);
            }

            .packet {
                display: none;
            }

            ::view-transition-group(root),
            ::view-transition-old(root),
            ::view-transition-new(root),
            ::view-transition-group(cold-start-page),
            ::view-transition-old(cold-start-page),
            ::view-transition-new(cold-start-page) {
                animation: none !important;
            }
        }
