html {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

:root {
    color-scheme: light dark;
    --page-bg: #f6f3ea;
    --text-color: #111;
    --prefix-color: rgba(17, 17, 17, 0.3);
    --button-bg: #111;
    --button-text: #fff;
    --button-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
    --button-shadow-focus: 0 14px 36px rgba(0, 0, 0, 0.2);
    --redirect-font-size: clamp(2rem, 5vw, 4.2rem);
    --redirect-line-height: 1.16;
    --redirect-letter-spacing: 0.02em;
    --redirect-font-weight: 500;
    --visual-viewport-top: 0px;
    --visual-viewport-height: 100dvh;
}

:root[data-style='terminal'] {
    --page-bg: #f3efe4;
    --text-color: #101010;
    --prefix-color: rgba(16, 16, 16, 0.36);
    --redirect-letter-spacing: 0.01em;
    --redirect-font-weight: 550;
}

body {
    background-color: var(--page-bg);
    color: var(--text-color);
    min-height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 24px;
    font-family: Arial, sans-serif;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
}

* {
    box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
    :root {
        --page-bg: #121212;
        --text-color: #f2f2f2;
        --prefix-color: rgba(242, 242, 242, 0.3);
        --button-bg: #fff3a1;
        --button-text: #111;
        --button-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
        --button-shadow-focus: 0 18px 42px rgba(0, 0, 0, 0.55);
    }

    :root[data-style='terminal'] {
        --page-bg: #111111;
        --text-color: #f1efe8;
        --prefix-color: rgba(241, 239, 232, 0.38);
        --button-bg: #f1efe8;
        --button-text: #111111;
    }

    .footer {
        color: var(--text-color);
    }

    .footer a {
        color: #6bb6ff !important;
    }

    .footer a:hover {
        color: #8cc8ff !important;
    }

    .noscript-shell {
        background: rgba(26, 26, 26, 0.9);
        color: #e0e0e0;
        border-color: yellow;
    }
}

.page-shell {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--visual-viewport-top);
    height: var(--visual-viewport-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: top 0.24s ease-out, height 0.24s ease-out;
}

body.redirect-launch .page-shell {
    pointer-events: none;
    animation: redirect-launch-left 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.redirect-return .page-shell {
    animation: redirect-return-right 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.redirect-launch .redirect-form {
    animation: redirect-launch-tilt 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.redirect-return .redirect-form {
    animation: redirect-return-tilt 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.redirect-launch .footer-logo {
    animation: redirect-launch-logo 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.redirect-return .footer-logo {
    animation: redirect-return-logo 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.redirect-shell {
    width: min(100%, 940px);
}

.redirect-copy {
    margin: 0 0 18px;
    max-width: 42rem;
    color: var(--prefix-color);
    font-size: 0.95rem;
    line-height: 1.45;
}

.redirect-form {
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 14px;
}

.redirect-form.is-invalid {
    animation: invalid-key-shake 0.48s ease-in-out;
}

.redirect-line {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.redirect-prefix {
    margin: 0;
    font-family: Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    font-size: clamp(0.85rem, 1.8vw, 1.15rem);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
    color: var(--prefix-color);
    white-space: normal;
    overflow-wrap: anywhere;
    text-transform: lowercase;
}

.redirect-input-shell {
    position: relative;
    min-width: 0;
    width: 100%;
}

#redirectKey {
    font-family: Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    font-size: var(--redirect-font-size);
    font-weight: var(--redirect-font-weight);
    line-height: var(--redirect-line-height);
    letter-spacing: var(--redirect-letter-spacing);
    text-align: left;
    overflow-wrap: anywhere;
}

.redirect-caret {
    display: none;
}

#redirectKey {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    -webkit-text-fill-color: var(--text-color);
    min-height: calc(var(--redirect-font-size) * var(--redirect-line-height));
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    caret-color: var(--text-color);
    border: 0;
    resize: none;
    overflow: hidden;
    overflow-wrap: anywhere;
    transition: color 0.2s ease;
}

#redirectKey:focus {
    outline: none;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0;
    height: 78px;
    margin-left: 0;
    padding: 0;
    font-size: 2rem;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 999px;
    box-shadow: var(--button-shadow);
    flex: 0 0 auto;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(-14px) scale(0.92);
    transition: width 0.28s ease, margin-left 0.28s ease, opacity 0.22s ease, transform 0.28s ease, box-shadow 0.2s ease;
}

button:focus-visible {
    outline: none;
    box-shadow: var(--button-shadow-focus);
}

button svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.redirect-form.has-value button {
    width: 78px;
    margin-left: 14px;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.footer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer a {
    text-decoration: none;
    color: blue;
}

.footer-logo img,
.footer-logo svg {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.footer-logo svg {
    border: 2px solid #111;
}

.footer-logo {
    position: fixed;
    left: 24px;
    bottom: 24px;
    margin-top: 0;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.footer-logo:hover {
    opacity: 0.8;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.noscript-shell {
    margin: 0;
    padding: 0;
    background: #fff;
    color: #fff;
    font-family: Arial, sans-serif;
}

.noscript-shell h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
}

.noscript-shell p {
    margin-bottom: 0;
}

.noscript-shell code {
    font-family: inherit;
    background: transparent;
    color: inherit;
}

@media (max-width: 768px) {
    body {
        height: 100svh;
    }
}

@media (max-width: 560px) {
    .page-shell {
        padding: 18px;
    }

    .redirect-form {
        align-items: flex-start;
        gap: 0;
    }

    .redirect-copy {
        margin: 0 0 14px;
        font-size: 0.9rem;
    }

    .redirect-line {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0;
    }

    .redirect-prefix,
    #redirectKey {
        font-size: clamp(1.7rem, 9vw, 3rem);
    }

    .redirect-input-shell {
        grid-column: 1;
        width: 100%;
        min-height: 1.05em;
    }

    #redirectKey {
        padding-top: 0;
    }

    .redirect-caret {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 1px;
        height: 2.05em;
        background: currentColor;
        opacity: 0.9;
        pointer-events: none;
        transform: translateY(0.02em);
        animation: redirect-caret-blink 1.1s steps(1, end) infinite;
    }

    .redirect-form.has-value .redirect-caret,
    .redirect-input-shell:focus-within .redirect-caret {
        opacity: 0;
        animation: none;
    }

    button {
        height: 64px;
        position: fixed;
        right: 16px;
        top: calc(var(--visual-viewport-top) + var(--visual-viewport-height) - 76px);
        margin: 0;
        z-index: 2;
        transform: translateY(12px) scale(0.92);
    }

    button svg {
        width: 26px;
        height: 26px;
    }

    .redirect-form.has-value button {
        width: 64px;
        margin-left: 0;
        transform: translateY(0) scale(1);
    }

    .footer-logo img {
        width: 48px;
        height: 48px;
    }

    .footer-logo {
        left: 16px;
        bottom: 16px;
    }
}

@keyframes invalid-key-shake {
    0% {
        transform: translateX(0) rotate(0deg);
    }

    15% {
        transform: translateX(-9px) rotate(-1.5deg);
    }

    30% {
        transform: translateX(10px) rotate(1.7deg);
    }

    45% {
        transform: translateX(-7px) rotate(-1.1deg);
    }

    60% {
        transform: translateX(8px) rotate(1deg);
    }

    75% {
        transform: translateX(-4px) rotate(-0.6deg);
    }

    100% {
        transform: translateX(0) rotate(0deg);
    }
}

@keyframes redirect-launch-left {
    0% {
        transform: translate3d(0, 0, 0);
        opacity: 1;
        filter: blur(0);
    }

    100% {
        transform: translate3d(-18vw, 0, 0) scale(0.985);
        opacity: 0;
        filter: blur(8px);
    }
}

@keyframes redirect-launch-tilt {
    0% {
        transform: translate3d(0, 0, 0) skewX(0deg);
    }

    100% {
        transform: translate3d(-4vw, 0, 0) skewX(-7deg);
    }
}

@keyframes redirect-launch-logo {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
        opacity: 0.5;
    }

    100% {
        transform: translate3d(-12vw, 0, 0) rotate(-8deg);
        opacity: 0;
    }
}

@keyframes redirect-return-right {
    0% {
        transform: translate3d(-18vw, 0, 0) scale(0.985);
        opacity: 0;
        filter: blur(8px);
    }

    100% {
        transform: translate3d(0, 0, 0);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes redirect-return-tilt {
    0% {
        transform: translate3d(-4vw, 0, 0) skewX(-7deg);
    }

    100% {
        transform: translate3d(0, 0, 0) skewX(0deg);
    }
}

@keyframes redirect-return-logo {
    0% {
        transform: translate3d(-12vw, 0, 0) rotate(-8deg);
        opacity: 0;
    }

    100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
        opacity: 0.5;
    }
}

@keyframes redirect-caret-blink {
    0%, 45% {
        opacity: 0.7;
    }

    46%, 100% {
        opacity: 0;
    }
}
