@font-face {
    font-family: "AMI Mono";
    src: url("fonts/jetbrains-mono-regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "AMI Mono";
    src: url("fonts/jetbrains-mono-semibold.ttf") format("truetype");
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
}

@font-face {
    font-family: "AMI Narrow";
    src: url("fonts/liberation-sans-narrow-regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --black: #090b09;
    --graphite: #101310;
    --graphite-2: #171b17;
    --text: #f2f5ef;
    --muted: #bac2ba;
    --line: #4b554d;
    --acid: #35f28a;
    --pink: #ff5c9a;
    --yellow: #f5dd4c;
    --gutter: clamp(1rem, 4vw, 4rem);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--black);
}

body {
    min-height: 100svh;
    max-width: 100vw;
    margin: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow-x: hidden;
    background: var(--black);
    color: var(--text);
    font-family: "AMI Narrow", "Nimbus Sans Narrow", sans-serif;
    font-size: 1.08rem;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

button,
a {
    touch-action: manipulation;
}

a {
    color: var(--acid);
    text-underline-offset: 0.22em;
}

a:hover {
    color: var(--yellow);
}

:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 20;
    padding: 0.7rem 1rem;
    border: 2px solid var(--black);
    background: var(--yellow);
    color: var(--black);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.route-header,
main,
footer {
    width: min(calc(100vw - (2 * var(--gutter))), 100rem);
    margin-inline: var(--gutter) auto;
}

.route-header {
    min-height: 4.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    border-top: 4px solid var(--acid);
    border-bottom: 1px solid var(--line);
}

.route-header > *,
main > *,
footer > * {
    min-width: 0;
}

.brand {
    min-height: 3.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
    font-family: "AMI Mono", ui-monospace, monospace;
    font-weight: 600;
    text-decoration: none;
}

.brand:hover {
    color: var(--text);
}

.brand-mark {
    width: 2.15rem;
    height: 2.15rem;
    overflow: visible;
    fill: var(--black);
    stroke: var(--acid);
    stroke-width: 1.7;
}

.brand-core {
    fill: var(--pink);
    stroke: var(--black);
}

.route-header p,
.route-code,
.endpoint p,
.transfer p,
.route-facts dt,
footer p {
    margin: 0;
    color: var(--muted);
    font-family: "AMI Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    line-height: 1.35;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.route-header p,
.route-code,
footer p {
    overflow-wrap: anywhere;
}

main {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(19rem, 0.9fr) minmax(32rem, 1.1fr);
    border-bottom: 1px solid var(--line);
}

.move-copy {
    min-width: 0;
    padding: clamp(3.5rem, 9vh, 8rem) clamp(2rem, 5vw, 5rem) clamp(3.5rem, 8vh, 7rem) 0;
    border-right: 1px solid var(--line);
}

.route-code {
    max-width: max-content;
    margin-bottom: clamp(2rem, 5vh, 4rem);
    padding-bottom: 0.7rem;
    border-bottom: 3px solid var(--pink);
    color: var(--text);
}

h1 {
    max-width: 10ch;
    margin: 0 0 2rem;
    font-family: "AMI Mono", ui-monospace, monospace;
    font-size: clamp(3rem, 6.4vw, 7.2rem);
    font-weight: 600;
    line-height: 0.96;
    letter-spacing: -0.07em;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.summary {
    max-width: 37rem;
    margin: 0 0 2rem;
    color: #d7ddd7;
    font-size: clamp(1.08rem, 1.5vw, 1.3rem);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.summary strong {
    color: var(--acid);
    font-family: "AMI Mono", ui-monospace, monospace;
    font-size: 0.9em;
    word-break: break-all;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.continue,
.redirect-control {
    min-width: 0;
    min-height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    border: 2px solid var(--acid);
    border-radius: 0;
    font-family: "AMI Mono", ui-monospace, monospace;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.continue {
    gap: 1.5rem;
    background: var(--acid);
    color: var(--black);
    text-decoration: none;
}

.continue svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: square;
    stroke-width: 1.8;
}

.continue:hover {
    background: transparent;
    color: var(--acid);
}

.continue:active {
    background: var(--text);
    border-color: var(--text);
    color: var(--black);
}

.redirect-control {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

.redirect-control:hover {
    border-color: var(--text);
}

.redirect-control:active {
    background: var(--text);
    color: var(--black);
}

.redirect-timing {
    max-width: 35rem;
    margin-top: 1.5rem;
}

.redirect-timing progress {
    width: 100%;
    height: 0.35rem;
    display: block;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--graphite-2);
    color: var(--acid);
    accent-color: var(--acid);
}

.redirect-timing progress::-webkit-progress-bar {
    background: var(--graphite-2);
}

.redirect-timing progress::-webkit-progress-value,
.redirect-timing progress::-moz-progress-bar {
    background: var(--acid);
}

.redirect-state,
.no-script {
    margin: 0.7rem 0 0;
    color: var(--muted);
    font-family: "AMI Mono", ui-monospace, monospace;
    font-size: 0.76rem;
}

.redirect-state b {
    color: var(--text);
}

.route-diagram {
    min-width: 0;
    align-self: center;
    padding: clamp(3.5rem, 9vh, 8rem) 0 clamp(3.5rem, 8vh, 7rem) clamp(2rem, 5vw, 5rem);
}

.endpoint {
    min-height: 7.5rem;
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1.4rem;
    border: 1px solid var(--line);
    background: var(--graphite);
}

.endpoint-index {
    align-self: stretch;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.15rem;
    border-right: 1px solid var(--line);
    color: var(--muted);
    font-family: "AMI Mono", ui-monospace, monospace;
    font-size: 0.72rem;
}

.endpoint strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text);
    font-family: "AMI Mono", ui-monospace, monospace;
    font-size: clamp(1.15rem, 2.2vw, 2rem);
    line-height: 1.15;
}

.endpoint-old {
    opacity: 0.68;
}

.endpoint-live {
    border: 2px solid var(--acid);
}

.endpoint-live .endpoint-state {
    color: var(--acid);
}

.endpoint-state {
    color: var(--muted);
    font-family: "AMI Mono", ui-monospace, monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.transfer {
    min-height: 6rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr auto;
    column-gap: 1rem;
    padding-left: 3.6rem;
}

.transfer span {
    align-self: stretch;
    width: 1px;
    margin-left: 1rem;
    background: var(--pink);
}

.transfer svg {
    width: 3rem;
    align-self: end;
    fill: none;
    stroke: var(--pink);
    stroke-width: 1.5;
}

.transfer p {
    grid-column: 1 / -1;
    align-self: end;
    padding-bottom: 0.45rem;
    color: var(--pink);
}

.route-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 2rem 0 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.route-facts div {
    min-width: 0;
    padding: 0.8rem;
    border-right: 1px solid var(--line);
}

.route-facts div:last-child {
    border-right: 0;
}

.route-facts dd {
    margin: 0.25rem 0 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-family: "AMI Mono", ui-monospace, monospace;
    font-size: 0.8rem;
}

footer {
    min-height: 4.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

footer a {
    max-width: 100%;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    font-family: "AMI Mono", ui-monospace, monospace;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
    word-break: break-all;
}

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

[hidden] {
    display: none !important;
}

@media (max-width: 860px) {
    .route-header,
    main,
    footer {
        width: calc(100vw - (2 * var(--gutter)));
        margin-inline: var(--gutter);
    }

    main {
        grid-template-columns: minmax(0, 1fr);
    }

    .move-copy {
        padding: 4.5rem 0 3.5rem;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .route-diagram {
        padding: 3.5rem 0 4rem;
    }
}

@media (max-width: 520px) {
    :root {
        --gutter: max(1rem, env(safe-area-inset-left), env(safe-area-inset-right));
    }

    .route-header {
        min-height: 4.25rem;
    }

    .route-header p {
        max-width: 8.5rem;
        margin-left: auto;
        text-align: right;
    }

    .move-copy {
        padding-top: 3.5rem;
    }

    .route-code {
        max-width: 100%;
    }

    h1 {
        font-size: clamp(2.65rem, 15vw, 4.25rem);
    }

    .actions,
    .continue,
    .redirect-control {
        width: 100%;
    }

    .continue {
        gap: 0.5rem;
        justify-content: space-between;
    }

    .endpoint {
        grid-template-columns: 1.75rem minmax(0, 1fr);
        gap: 0.85rem;
        padding: 1rem;
    }

    .endpoint-state {
        grid-column: 2;
    }

    .transfer {
        padding-left: 2.7rem;
    }

    .route-facts {
        grid-template-columns: 1fr;
    }

    .route-facts div,
    .route-facts div:last-child {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .route-facts div:last-child {
        border-bottom: 0;
    }

    footer {
        min-height: 6.5rem;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 0.25rem;
        padding-block: 1rem;
    }
}

@media (max-height: 560px) and (orientation: landscape) {
    .move-copy,
    .route-diagram {
        padding-block: 2.5rem;
    }

    .route-code {
        margin-bottom: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
