@font-face {
    font-family: Mix;
    src: url("/xmpp-assets/Fonts/kyunmix.woff2") format("woff2");
    font-display: swap;
}

@font-face {
    font-family: Gohu;
    src: url("/xmpp-assets/Fonts/gohufont.woff2") format("woff2");
    font-display: swap;
}

@font-face {
    font-family: Simple;
    src: url("/xmpp-assets/Fonts/simple.woff2") format("woff2");
    font-display: swap;
}

@font-face {
    font-family: Pixellari;
    src: url("/xmpp-assets/Fonts/Pixellari.woff2") format("woff2");
    font-display: swap;
}

:root {
    --main-bg: #151515;
    --box-bg: #1a1a1a;
    --button-bg: rgb(30, 30, 30);
    --text: #949494;
    --text-focus: #d2d2d2;
    --text-dark: #777;
    --border: rgba(255, 255, 255, 0.06);
    --accent: #7eb4ff;
    --danger: #ff9b9b;
    --font-body: Mix, Gohu, sans-serif;
    --font-mono: Gohu, monospace;
    --font-small: Simple, sans-serif;
    --font-display: Pixellari, var(--font-body);
    --font-size-body: 16px;
    --font-size-small: 14px;
    --font-smoothing: none;
    --image-rendering: pixelated;
    --border-width: 2px;
    --box-padding: 24px;
    --control-height: 40px;
    --control-line-height: 1.5;
    --control-padding-y: 6px;
    --control-padding-x: 12px;
    --control-background: var(--box-bg);
    --box-texture-image: url("/xmpp-assets/assets/boxbg.png");
    --box-texture-size: 372px 84px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    --focus-ring: rgb(from var(--accent) r g b / 20%);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

html {
    background: var(--main-bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    line-height: 1.25;
    font-synthesis: none;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

* {
    image-rendering: var(--image-rendering);
    text-decoration: none;
    user-select: none;
    font-smooth: var(--font-smoothing);
    -webkit-font-smoothing: var(--font-smoothing);
    -moz-osx-font-smoothing: grayscale;
}

summary,
a {
    outline: var(--border-width) solid transparent;
    outline-offset: calc(-1 * var(--border-width));
}

summary:focus-visible,
a:focus-visible {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

.shell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(100%, 520px);
    gap: 20px;
}

.masthead {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    text-align: center;
}

h1 {
    margin: 0;
    color: var(--text-focus);
    font-family: var(--font-display);
    font-size: clamp(38px, 11vw, 48px);
    font-weight: normal;
    line-height: 1;
}

em {
    color: var(--text-dark);
    font-style: normal;
}

.box {
    position: relative;
    overflow: hidden;
    padding: var(--box-padding);
    background-color: var(--main-bg);
    background-image: var(--box-texture-image);
    background-size: var(--box-texture-size);
    border: var(--border-width) solid var(--border);
    box-shadow: var(--box-shadow);
    corner-shape: square;
}

.box::before {
    content: "";
    position: absolute;
    inset: 0;
    border-top: var(--border-width) solid var(--accent);
    opacity: 0.85;
    pointer-events: none;
}

.box > * {
    position: relative;
    z-index: 1;
}

.services {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.service {
    position: relative;
    display: grid;
    grid-template-columns: 54px 88px 1fr;
    align-items: center;
    min-height: 44px;
    gap: 10px;
    padding: 10px 0 10px 18px;
    color: var(--text);
    border-top: var(--border-width) solid var(--border);
    overflow: hidden;
    transition:
        background-color 400ms ease,
        border-color 80ms ease,
        box-shadow 80ms ease,
        color 400ms ease,
        transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.service:first-child {
    border-top: 0;
}

.service:hover,
.service:focus-visible {
    color: var(--text-focus);
    background: rgba(255, 255, 255, 0.018);
    border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
    transform: translateX(6px);
}

.service::before {
    content: "";
    width: 5px;
    height: 5px;
    background: var(--accent);
    opacity: 0.75;
    box-shadow: 0 0 12px rgb(from var(--accent) r g b / 35%);
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    transition:
        opacity 260ms ease,
        background-color 260ms ease,
        box-shadow 260ms ease,
        transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.service::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgb(from var(--accent) r g b / 8%), transparent);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-110%);
}

.service:hover::before,
.service:focus-visible::before {
    opacity: 1;
    box-shadow: 0 0 16px rgb(from var(--accent) r g b / 48%);
    transform: translateY(-50%) scale(1.25);
}

.service:hover::after,
.service:focus-visible::after {
    animation: row-scan 680ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.route {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--font-size-small);
    transition:
        color 260ms ease,
        transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.service strong {
    color: var(--text-focus);
    font-weight: normal;
    transition:
        color 260ms ease,
        transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
        text-shadow 260ms ease;
}

.service span:last-child {
    color: var(--text-dark);
    font-family: var(--font-small);
    font-size: var(--font-size-small);
    line-height: 1.35;
    transition: color 260ms ease;
}

.service:hover .route,
.service:focus-visible .route {
    transform: translateX(2px);
}

.service:hover strong,
.service:focus-visible strong {
    color: #f0f0f0;
    text-shadow: 0 0 10px rgba(126, 180, 255, 0.16);
    transform: translateX(1px);
}

.service:hover span:last-child,
.service:focus-visible span:last-child {
    color: var(--text);
}

.service[data-status="down"] {
    color: var(--text-dark);
    cursor: not-allowed;
    opacity: 0.62;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.service[data-status="down"],
.service[data-status="down"] * {
    user-select: none;
    -webkit-user-select: none;
}

.service[data-status="down"],
.service[data-status="down"]:hover,
.service[data-status="down"]:focus-visible {
    background: transparent;
    border-color: var(--border);
    box-shadow: none;
    transform: none;
}

.service[data-status="down"]::before {
    background: var(--danger);
    box-shadow: 0 0 12px rgb(from var(--danger) r g b / 35%);
}

.service[data-status="down"] .route {
    color: var(--danger);
}

.service[data-status="down"] strong,
.service[data-status="down"] span:last-child {
    color: var(--text-dark);
    text-shadow: none;
    transform: none;
}

.service[data-status="down"]::after {
    display: none;
}

a {
    color: var(--accent);
}

.notes {
    color: var(--text);
    font-family: var(--font-small);
    font-size: var(--font-size-small);
    line-height: 1.45;
}

.notes p,
.notes ul {
    margin: 0 0 12px;
}

.notes p:last-child,
.notes ul:last-child {
    margin-bottom: 0;
}

.fold {
    border-top: var(--border-width) solid var(--border);
    padding-top: 12px;
}

.fold:first-child {
    border-top: 0;
    padding-top: 0;
}

.fold[open] > summary {
    margin-bottom: 10px;
}

summary {
    color: var(--text-focus);
    cursor: pointer;
}

.notes strong {
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(126, 180, 255, 0.35);
    transition:
        color 220ms ease,
        text-shadow 220ms ease;
}

.fold:hover > summary strong,
summary:focus-visible strong {
    color: var(--text-focus);
    text-shadow:
        0 0 12px rgba(126, 180, 255, 0.58),
        0 0 24px rgba(126, 180, 255, 0.24);
}

ul {
    padding-left: 18px;
    text-align: left;
}

li + li {
    margin-top: 4px;
}

.fold li,
.contact a span {
    transition:
        color 220ms ease,
        text-shadow 220ms ease;
}

.fold li:hover,
.contact a:hover span,
.contact a:focus-visible span {
    color: var(--text-focus);
    text-shadow:
        0 0 10px rgba(126, 180, 255, 0.48),
        0 0 20px rgba(126, 180, 255, 0.18);
}

.contact {
    display: grid;
    gap: 8px;
}

.contact a {
    position: relative;
    display: grid;
    grid-template-columns: 16px 1fr;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    color: var(--text);
    overflow: hidden;
    transition:
        color 260ms ease,
        transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.contact a:hover,
.contact a:focus-visible {
    color: var(--text-focus);
    transform: translateX(3px);
}

.icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: square;
    stroke-linejoin: miter;
    transition:
        color 260ms ease,
        transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.contact a:first-child .icon {
    fill: currentColor;
    stroke: none;
    transform-origin: center;
}

.contact a:first-child::before,
.contact a:first-child::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.contact a:first-child::before {
    left: 4px;
    top: 50%;
    width: 58px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgb(from var(--accent) r g b / 80%),
        transparent
    );
    opacity: 0;
    transform: translate(-54px, -50%) scaleX(0.18);
    transform-origin: left center;
}

.contact a:first-child::after {
    left: 11px;
    top: 50%;
    width: 4px;
    height: 4px;
    background: var(--accent);
    opacity: 0;
    box-shadow:
        0 0 8px rgb(from var(--accent) r g b / 70%),
        16px -7px 0 rgb(from var(--accent) r g b / 28%),
        27px 5px 0 rgb(from var(--accent) r g b / 20%);
    transform: translate(-10px, 8px) scale(0.5);
}

.contact a:last-child .icon path {
    stroke-dasharray: 54;
    stroke-dashoffset: 0;
}

.contact a:hover .icon,
.contact a:focus-visible .icon {
    color: var(--text-focus);
}

.contact a:first-child:hover .icon,
.contact a:first-child:focus-visible .icon {
    animation: paper-plane-hover 1120ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.contact a:first-child:hover::before,
.contact a:first-child:focus-visible::before {
    animation: paper-plane-trail 1120ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.contact a:first-child:hover::after,
.contact a:first-child:focus-visible::after {
    animation: paper-plane-spark 1120ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.contact a:last-child:hover .icon path,
.contact a:last-child:focus-visible .icon path {
    animation: icon-draw 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes row-scan {
    0% {
        opacity: 0;
        transform: translateX(-110%);
    }

    18% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(110%);
    }
}

@keyframes icon-draw {
    from {
        stroke-dashoffset: 54;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes paper-plane-hover {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 0 rgba(126, 180, 255, 0));
    }

    12% {
        opacity: 1;
        transform: translate(-2px, 2px) rotate(-10deg) scale(0.95);
    }

    26% {
        opacity: 1;
        transform: translate(13px, -9px) rotate(18deg) scale(1.1);
        filter: drop-shadow(0 0 8px rgba(126, 180, 255, 0.46));
    }

    44% {
        opacity: 0;
        transform: translate(46px, -30px) rotate(38deg) scale(0.74);
    }

    45% {
        opacity: 0;
        transform: translate(-27px, 17px) rotate(-26deg) scale(0.72);
    }

    66% {
        opacity: 1;
        transform: translate(-7px, 4px) rotate(-8deg) scale(0.94);
        filter: drop-shadow(0 0 7px rgba(126, 180, 255, 0.38));
    }

    82% {
        transform: translate(4px, -2px) rotate(8deg) scale(1.05);
    }

    92% {
        transform: translate(-1px, 1px) rotate(-3deg) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 0 rgba(126, 180, 255, 0));
    }
}

@keyframes paper-plane-trail {
    0%,
    12% {
        opacity: 0;
        transform: translate(-54px, -50%) scaleX(0.18);
    }

    28% {
        opacity: 0.85;
        transform: translate(-4px, -50%) scaleX(0.72);
    }

    48% {
        opacity: 0;
        transform: translate(42px, -50%) scaleX(0.18);
    }

    100% {
        opacity: 0;
        transform: translate(42px, -50%) scaleX(0.18);
    }
}

@keyframes paper-plane-spark {
    0%,
    16% {
        opacity: 0;
        transform: translate(-10px, 8px) scale(0.5);
    }

    30% {
        opacity: 1;
        transform: translate(14px, -7px) scale(1);
    }

    48% {
        opacity: 0;
        transform: translate(42px, -18px) scale(0.45);
    }

    100% {
        opacity: 0;
        transform: translate(42px, -18px) scale(0.45);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }

    .service:hover,
    .service:focus-visible,
    .contact a:hover,
    .contact a:focus-visible {
        transform: none;
    }

    .contact a:first-child:hover::before,
    .contact a:first-child:focus-visible::before,
    .contact a:first-child:hover::after,
    .contact a:first-child:focus-visible::after {
        animation: none !important;
    }
}

@media (max-width: 560px) {
    .page {
        align-items: flex-start;
        padding: 24px 12px;
    }

    .shell {
        gap: 16px;
    }

    .box {
        --box-padding: 18px;
    }

    .service {
        grid-template-columns: 48px 1fr;
        gap: 4px 10px;
        min-height: 54px;
    }

    .service span:last-child {
        grid-column: 2;
    }
}
