.site-skip-link {
    position: fixed;
    top: .5rem;
    left: .5rem;
    z-index: 10000001;
    padding: .6em 1em;
    background: #fff;
    color: #171313;
    transform: translateY(calc(-100% - 1rem));
}
.site-skip-link:focus {
    transform: none;
    outline: 3px solid #171313;
}
@media screen and (prefers-reduced-motion: no-preference) {
    /* The first paint of the new body starts this one-shot animation. */
    html:is(.channel-pending, .channel-departing):has(body)::after {
        content: attr(data-channel-number);
    }
    html:is(.channel-pending, .channel-departing):has(body)::after,
    .channel-static.badge-tab__flash {
        position: fixed;
        inset: 0;
        z-index: 10000000;
        box-sizing: border-box;
        padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right));
        text-align: right;
        pointer-events: none;
        background-color: #777;
        /* The small inline texture is visible even on a cold image cache. */
        background-image: url("../img/channel-tv-snow.png"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cfilter id='n' color-interpolation-filters='sRGB'%3E%3CfeTurbulence baseFrequency='.8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='2 0 0 0 -.5 2 0 0 0 -.5 2 0 0 0 -.5 0 0 0 0 1'/%3E%3C/filter%3E%3Cpath d='M0 0h64v64H0z' filter='url(%23n)'/%3E%3C/svg%3E");
        background-size: 153vw 28.8vh, 128px 128px;
        image-rendering: pixelated;
        animation: channel-entry 175ms steps(6, end) forwards;
    }
    /* Keep the first frame visible while an autoplay-permitted device wakes. */
    html.channel-pending.channel-arming:has(body)::after { animation: none; }
    @keyframes channel-entry {
        from { visibility: visible; }
        to { background-position: 153vw 0, 192px 128px; visibility: hidden; }
    }
    html:is(.channel-pending, .channel-departing) dialog[open],
    html:is(.channel-pending, .channel-departing) dialog[open]::backdrop { visibility: hidden; }
    html.channel-departing { background: #171313; }
    html.channel-departing body { opacity: 0; pointer-events: none; }
    html[data-channel-number] #page-loader { display: none; }
}
.channel-tv[aria-pressed="true"] .channel-tv__screen {
    background-color: #777;
    overflow: hidden;
}
.channel-tv[aria-pressed="true"] .channel-tv__screen::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 600%;
    background: url("../img/channel-tv-snow.png") left top / 100% 100% no-repeat;
    animation: channel-snow .32s steps(6, end) infinite;
}
@keyframes channel-snow {
    to { transform: translateX(-100%); }
}
.channel-static {
    position: fixed;
    inset: 0;
    z-index: 10000000;
    pointer-events: none;
    background: #777;
}
.channel-static canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}
.channel-static__number {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    right: max(24px, env(safe-area-inset-right));
}
.channel-static__number, html:is(.channel-pending, .channel-departing)::after {
    color: #36ff6b;
    font: 500 clamp(30px, 4vw, 54px)/1 "Unifont UFC", monospace;
    text-shadow: 0 0 10px #36ff6bb3;
}
button.channel-control {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 1000;
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    padding: 0;
    margin: 0;
    border: 2px solid #171313;
    border-radius: 50%;
    background: #fff8ea;
    color: #171313;
    box-shadow: 2px 2px 0 #171313;
    cursor: pointer;
}
button.channel-tv { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 74px); }
.channel-sound > svg, .channel-tv__icon { transform: scale(1.5); }
.channel-tv__icon { position: relative; width: 32px; height: 30px; }
.channel-tv__icon svg { display: block; position: relative; }
.channel-tv__screen {
    position: absolute;
    left: 4px;
    top: 11px;
    width: 17px;
    height: 12px;
    border-radius: 24% / 32%;
}
@media (width < 500px) {
    button.channel-control { width: 44px; height: 44px; }
    button.channel-tv { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 52px); }
    .channel-sound > svg, .channel-tv__icon { transform: none; }
}
/* The local CakePHP toolbar occupies the bottom-right 40px. */
body:has(iframe[src*="/debug-kit/toolbar/"]) .channel-control { right: max(56px, env(safe-area-inset-right)); }
.channel-control:focus-visible { outline: 3px solid #df0058; outline-offset: 3px; }
@media (hover: hover) { button.channel-control:hover { background: #ffda61; } }
button.channel-control[hidden], .channel-static[hidden],
.channel-sound[aria-pressed="true"] .channel-sound__off,
.channel-sound[aria-pressed="false"] .channel-sound__on { display: none; }
@media (prefers-reduced-motion: reduce) {
    html.channel-pending::after, .channel-static { display: none; }
    .channel-tv[aria-pressed="true"] .channel-tv__screen::before { animation: none; }
}
@media print { button.channel-control, .channel-static { display: none; } }
