* {
    box-sizing: border-box;
}

:root {
    --bg: #080b20;
    --bg-secondary: #11152d;
    --panel: rgba(14, 17, 37, 0.82);
    --panel-strong: rgba(18, 21, 44, 0.94);
    --card: rgba(28, 31, 54, 0.72);
    --card-hover: rgba(36, 40, 68, 0.88);

    --cyan: #43dcff;
    --cyan-soft: rgba(67, 220, 255, 0.16);

    --green: #48e995;
    --green-soft: rgba(72, 233, 149, 0.14);

    --purple: #987cff;
    --purple-soft: rgba(152, 124, 255, 0.14);

    --text: #f4f6ff;
    --muted: #9299b8;
    --muted-strong: #b4bad2;

    --danger: #ff6d82;
    --warning: #ffc861;

    --radius-card: 22px;
    --radius-item: 15px;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    background:
        url("/assets/hero-desktop.jpg") center center / cover no-repeat fixed;

    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;

    background:
        radial-gradient(circle at 50% 42%, rgba(70, 120, 255, 0.06), transparent 34%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03), transparent 30%, rgba(35, 20, 75, 0.04));
}

a {
    color: inherit;
    text-decoration: none;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.page-shell {
    min-height: 100svh;
    min-height: 100dvh;

    display: flex;
    flex-direction: column;

    padding: 22px 28px 16px;
}

.topbar {
    width: min(1180px, 100%);
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    position: relative;
    z-index: 2;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;

    transition: opacity 0.2s ease;
}

.brand:hover {
    opacity: 0.84;
}

.brand-logo-wrap {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
}

.brand-logo {
    width: 52px;
    height: 52px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(255, 88, 42, 0.18));
}

.topbar-spacer {
    flex: 1 1 auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.brand-text small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.02em;
}

.system-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 9px 13px;
    border: 1px solid rgba(72, 233, 149, 0.10);
    border-radius: 999px;

    color: var(--green);
    background: rgba(72, 233, 149, 0.08);

    font-size: 12px;
    font-weight: 600;

    box-shadow:
        0 0 24px rgba(72, 233, 149, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;

    border-radius: 50%;
    background: var(--green);

    box-shadow: 0 0 0 0 rgba(72, 233, 149, 0.46);

    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(72, 233, 149, 0.42);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(72, 233, 149, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(72, 233, 149, 0);
    }
}

.main-content {
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    padding: 28px 0;
}


.system-state.degraded {
    color: var(--warning);
    background: rgba(255, 200, 97, 0.08);
    border-color: rgba(255, 200, 97, 0.10);
}

.system-state.down {
    color: var(--danger);
    background: rgba(255, 109, 130, 0.08);
    border-color: rgba(255, 109, 130, 0.10);
}

.system-state.unknown {
    color: var(--muted-strong);
    background: rgba(180, 186, 210, 0.08);
    border-color: rgba(180, 186, 210, 0.08);
}

.overall-badge.degraded {
    color: var(--warning);
    background: rgba(255, 200, 97, 0.10);
    border-color: rgba(255, 200, 97, 0.09);
}

.overall-badge.down {
    color: var(--danger);
    background: rgba(255, 109, 130, 0.10);
    border-color: rgba(255, 109, 130, 0.09);
}

.overall-badge.unknown {
    color: var(--muted-strong);
    background: rgba(180, 186, 210, 0.08);
    border-color: rgba(180, 186, 210, 0.08);
}

.status-pill.degraded .pulse-dot {
    background: var(--warning);
    animation-name: pulseWarning;
}

.status-pill.down .pulse-dot {
    background: var(--danger);
    animation-name: pulseDanger;
}

.status-pill.unknown .pulse-dot {
    background: var(--muted);
    animation: none;
    box-shadow: none;
}

.system-state.degraded .pulse-dot,
.overall-badge.degraded .pulse-dot {
    background: var(--warning);
    animation-name: pulseWarning;
}

.system-state.down .pulse-dot,
.overall-badge.down .pulse-dot {
    background: var(--danger);
    animation-name: pulseDanger;
}

.system-state.unknown .pulse-dot,
.overall-badge.unknown .pulse-dot {
    background: var(--muted);
    animation: none;
    box-shadow: none;
}

@keyframes pulseWarning {
    0% { box-shadow: 0 0 0 0 rgba(255, 200, 97, 0.38); }
    70% { box-shadow: 0 0 0 7px rgba(255, 200, 97, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 200, 97, 0); }
}

@keyframes pulseDanger {
    0% { box-shadow: 0 0 0 0 rgba(255, 109, 130, 0.38); }
    70% { box-shadow: 0 0 0 7px rgba(255, 109, 130, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 109, 130, 0); }
}

.status-card {
    position: relative;

    width: min(620px, 100%);
    padding: 27px;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-card);

    background:
        linear-gradient(
            145deg,
            rgba(22, 25, 49, 0.70),
            rgba(12, 14, 31, 0.78)
        );

    box-shadow:
        0 35px 90px rgba(0, 0, 0, 0.48),
        0 0 55px rgba(83, 72, 190, 0.11),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);

    backdrop-filter: blur(12px) saturate(115%);
    -webkit-backdrop-filter: blur(12px) saturate(115%);

    overflow: hidden;
}

.status-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 14%;
    right: 14%;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(67, 220, 255, 0.55),
        transparent
    );

    opacity: 0.75;
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 22px;
}

.status-heading {
    display: flex;
    align-items: center;
    gap: 13px;
}

.heartbeat-icon {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    color: var(--cyan);

    border-radius: 12px;
    background: rgba(67, 220, 255, 0.07);

    box-shadow:
        inset 0 0 20px rgba(67, 220, 255, 0.06),
        0 0 25px rgba(67, 220, 255, 0.06);
}

.heartbeat-icon svg {
    width: 27px;
    height: 27px;
}

.status-heading h1 {
    margin: 0;

    font-family: "Orbitron", "Inter", sans-serif;
    font-size: clamp(20px, 2.2vw, 25px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.status-heading p {
    margin: 6px 0 0;

    color: var(--muted);
    font-size: 12px;
}

.overall-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    flex: 0 0 auto;

    padding: 9px 12px;

    border: 1px solid rgba(72, 233, 149, 0.09);
    border-radius: 999px;

    color: var(--green);
    background: var(--green-soft);

    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.services {
    display: grid;
    gap: 10px;
}

.service {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;

    min-height: 70px;
    padding: 13px 15px;

    border: 1px solid transparent;
    border-radius: var(--radius-item);

    background:
        linear-gradient(
            145deg,
            rgba(31, 34, 57, 0.76),
            rgba(25, 27, 47, 0.76)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 7px 22px rgba(0, 0, 0, 0.08);

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.service:hover {
    transform: translateY(-2px);

    border-color: rgba(67, 220, 255, 0.13);

    background:
        linear-gradient(
            145deg,
            rgba(37, 40, 67, 0.92),
            rgba(28, 31, 53, 0.92)
        );

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.18),
        0 0 25px rgba(67, 220, 255, 0.035);
}

.service-main {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 12px;
}

.service-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    color: var(--cyan);
    background: rgba(67, 220, 255, 0.055);

    border: 1px solid rgba(67, 220, 255, 0.08);
}

.service-icon svg {
    width: 21px;
    height: 21px;
}

.service-copy {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-url {
    color: #777f9e;
    font-size: 10px;
    line-height: 1.2;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-meta {
    margin-top: 1px;

    color: #8990aa;

    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    line-height: 1.2;
}

.service-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-latency {
    min-width: 72px;

    color: #9299b8;

    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    text-align: right;
}

.status-pill {
    min-width: 91px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 8px 10px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 600;

    white-space: nowrap;
}

.status-pill.up {
    color: var(--green);
    background: var(--green-soft);
}

.status-pill.degraded {
    color: var(--warning);
    background: rgba(255, 200, 97, 0.10);
}

.status-pill.down {
    color: var(--danger);
    background: rgba(255, 109, 130, 0.10);
}

.status-pill.unknown {
    color: var(--muted-strong);
    background: rgba(180, 186, 210, 0.08);
}

.status-arrow {
    width: 17px;
    height: 17px;

    display: grid;
    place-items: center;

    color: #6f7797;
}

.status-arrow svg {
    width: 13px;
    height: 13px;
}

.status-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 22px;
    padding-top: 17px;

    border-top: 1px solid rgba(255, 255, 255, 0.065);

    color: #707896;

    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    line-height: 1.5;
}

.footer-source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer-source svg {
    width: 12px;
    height: 12px;
}

.separator {
    color: #505670;
}

.auto-refresh {
    color: #8188a2;
}

.loading-card {
    min-height: 160px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    color: var(--muted);

    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-item);

    background: rgba(25, 27, 47, 0.54);

    font-size: 12px;
}

.spinner {
    width: 16px;
    height: 16px;

    border: 2px solid rgba(255, 255, 255, 0.13);
    border-top-color: var(--cyan);
    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.site-footer {
    width: min(1180px, 100%);
    margin: 0 auto;

    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;

    color: #777e9d;
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
}

.site-footer a {
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--cyan);
}

/* Планшеты */
@media (max-width: 900px) {
    .page-shell {
        padding: 18px 20px 14px;
    }

    .status-card {
        width: min(640px, 100%);
    }
}

/* Телефон */
@media (max-width: 680px) {
    body {
        background:
            url("/assets/hero-mobile.jpg") center center / cover no-repeat;

        background-attachment: scroll;
    }

    body::before {
        background:
            radial-gradient(
                circle at 50% 25%,
                rgba(70, 100, 255, 0.12),
                transparent 34%
            );
    }

    .page-shell {
        min-height: 100svh;
        padding:
            max(14px, env(safe-area-inset-top))
            12px
            max(12px, env(safe-area-inset-bottom));
    }

    .topbar {
        align-items: flex-start;
    }

    .brand-logo-wrap {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .brand-logo {
        width: 44px;
        height: 44px;
    }

    .brand-text strong {
        font-size: 15px;
    }

    .brand-text small {
        display: none;
    }

    .system-state {
        padding: 8px 10px;
        font-size: 10px;
    }

    .main-content {
        padding: 16px 0;
        align-items: center;
    }

    .status-card {
        width: 100%;
        padding: 18px 14px;

        border-radius: 18px;

        backdrop-filter: blur(10px) saturate(110%);
        -webkit-backdrop-filter: blur(10px) saturate(110%);
    }

    .status-header {
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 17px;
    }

    .status-heading {
        gap: 10px;
    }

    .heartbeat-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .heartbeat-icon svg {
        width: 23px;
        height: 23px;
    }

    .status-heading h1 {
        font-size: 18px;
    }

    .status-heading p {
        margin-top: 4px;
        font-size: 10px;
    }

    .overall-badge {
        padding: 7px 9px;
        font-size: 9px;
    }

    .overall-badge .pulse-dot {
        width: 6px;
        height: 6px;
    }

    .services {
        gap: 8px;
    }

    .service {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;

        min-height: auto;
        padding: 12px;

        border-radius: 13px;
    }

    .service-main {
        gap: 10px;
    }

    .service-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 9px;
    }

    .service-icon svg {
        width: 18px;
        height: 18px;
    }

    .service-name {
        font-size: 13px;
    }

    .service-url {
        font-size: 9px;
    }

    .service-right {
        width: 100%;
        justify-content: space-between;
        padding-left: 44px;
    }

    .service-latency {
        min-width: 0;
        font-size: 9px;
    }

    .status-pill {
        min-width: 85px;
        padding: 7px 9px;
        font-size: 9px;
    }

    .status-arrow {
        display: none;
    }

    .status-footer {
        margin-top: 17px;
        padding-top: 14px;
        font-size: 8px;
    }

    .site-footer {
        font-size: 8px;
        padding-top: 3px;
    }
}

/* Очень узкие телефоны */
@media (max-width: 390px) {
    .status-card {
        padding: 15px 11px;
    }

    .system-state {
        display: none;
    }

    .status-heading h1 {
        font-size: 17px;
    }

    .status-heading p {
        font-size: 9px;
    }

    .service-right {
        padding-left: 43px;
    }
}

/* Уменьшение анимаций для пользователей с соответствующей настройкой ОС */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
