/* Emoji Guardian status page: the website's flat look, status colours instead of the accent */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/inter-latin-ext-opsz-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/inter-latin-opsz-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #18191c;
    --surface: #1f2024;
    --line: #2f3036;
    --text: #fff;
    --muted: #b3b5bd;
    --faint: #8b8d97;
    --accent-fill: #dc2653;
    --up: #3ba55c;
    --degraded: #f0b232;
    --down: #f23f43;
    --nodata: #303238;
    --radius: 10px;
    --container: 760px;
    --gutter: clamp(20px, 4vw, 40px);
    color-scheme: dark;
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
}

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

h1,
h2,
h3,
p,
ul {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
    border-radius: 4px;
}

[hidden] {
    display: none !important;
}

.container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -80px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: var(--radius);
    background: var(--accent-fill);
    color: #fff;
    font-weight: 600;
}

.skip-link:focus {
    top: 12px;
}

/* Status colours */

[data-state="up"] {
    --state: var(--up);
}

[data-state="degraded"] {
    --state: var(--degraded);
}

[data-state="down"] {
    --state: var(--down);
}

[data-state="nodata"],
[data-state="loading"],
[data-state="unknown"] {
    --state: var(--nodata);
}

.dot {
    display: inline-block;
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--state, var(--nodata));
}

/* Header */

.top {
    border-bottom: 1px solid var(--line);
}

.top__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16.5px;
    font-weight: 650;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.brand img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.brand__page {
    padding-left: 10px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-weight: 500;
}

.top__links {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
    color: var(--muted);
    font-size: 15px;
}

.top__links a:not(.button):hover {
    color: var(--text);
}

.button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color 0.15s;
}

.button:hover {
    border-color: var(--faint);
}

/* Overall status */

.overall {
    padding: clamp(40px, 6vw, 64px) 0 clamp(28px, 4vw, 40px);
}

.overall h1 {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: clamp(1.6rem, 1.6vw + 1.1rem, 2.1rem);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.022em;
}

.overall h1 .dot {
    width: 14px;
    height: 14px;
}

.overall__meta {
    margin-top: 10px;
    color: var(--muted);
    font-size: 15px;
}

.overall__meta.is-late {
    color: var(--degraded);
}

.overall__notice {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--degraded);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 15px;
}

.overall__notice a,
.link {
    color: var(--text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

/* Groups */

.group {
    padding-bottom: clamp(32px, 5vw, 48px);
}

.group h2 {
    margin-bottom: 14px;
    font-size: 1.12rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.components {
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.component {
    padding: 20px 22px;
}

.component + .component {
    border-top: 1px solid var(--line);
}

.component__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.component__name {
    font-size: 16.5px;
    font-weight: 600;
}

a.component__name:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    color: var(--state);
    font-size: 15px;
    font-weight: 600;
}

.status .dot {
    align-self: center;
}

.component__facts {
    margin-top: 2px;
    color: var(--faint);
    font-size: 14.5px;
}

.component__problem {
    margin-top: 6px;
    color: var(--state);
    font-size: 14.5px;
}

.empty {
    padding: 20px 22px;
    color: var(--muted);
}

#incidents > .empty {
    padding: 0;
}

/* Daily bars */

.bars {
    display: flex;
    gap: 2px;
    height: 32px;
    margin-top: 14px;
    border-radius: 3px;
    cursor: default;
    touch-action: pan-y;
}

.bar {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 2px;
    background: var(--state);
    transition: opacity 0.1s;
}

.bars:hover .bar.is-active,
.bars:focus-visible .bar.is-active,
.bar.is-active {
    opacity: 0.6;
}

.bars:focus-visible {
    outline-offset: 4px;
}

.bars__legend {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    color: var(--faint);
    font-size: 13px;
}

.bars__legend .uptime {
    color: var(--muted);
}

/* Shards of the bot */

.shards {
    margin-top: 16px;
    font-size: 14.5px;
}

.shards summary {
    width: max-content;
    color: var(--muted);
    cursor: pointer;
}

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

.shards__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.shard {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.shard.is-match {
    border-color: var(--faint);
}

.shard__ping {
    margin-left: auto;
    color: var(--faint);
}

.shards__lookup {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.shards__lookup label {
    color: var(--muted);
}

.shards__lookup input {
    width: min(100%, 280px);
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: none;
    color: var(--text);
    font: inherit;
}

.shards__lookup input:focus {
    border-color: var(--faint);
    outline: none;
}

.shards__help {
    color: var(--faint);
    font-size: 13px;
}

.shards__result:empty {
    display: none;
}

/* Past incidents */

.incident-day + .incident-day {
    margin-top: 22px;
}

.incident-day h3 {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.incident {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.incident .dot {
    margin-top: 7px;
}

.incident__title {
    font-weight: 600;
}

.incident__meta {
    color: var(--faint);
    font-size: 14.5px;
}

/* Tooltip for a day */

.tooltip {
    position: absolute;
    z-index: 20;
    display: grid;
    gap: 2px;
    width: max-content;
    max-width: min(280px, calc(100vw - 16px));
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 13.5px;
    line-height: 1.45;
    pointer-events: none;
}

.tooltip strong {
    font-weight: 600;
}

.tooltip .is-down {
    color: var(--down);
}

.tooltip .is-degraded {
    color: var(--degraded);
}

.tooltip .is-muted {
    color: var(--faint);
}

/* Footer */

.footer {
    padding: 28px 0 36px;
    border-top: 1px solid var(--line);
    color: var(--faint);
    font-size: 14px;
}

.footer__inner {
    display: grid;
    gap: 12px;
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    color: var(--muted);
}

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

/* Error page */

.notice {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 14px;
    min-height: calc(100svh - 65px);
    padding: 64px var(--gutter);
    text-align: center;
}

.notice h1 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    letter-spacing: -0.03em;
}

.notice p {
    color: var(--muted);
}

@media (max-width: 600px) {
    .top__links > a:not(.button) {
        display: none;
    }

    .button {
        padding: 0 11px;
    }

    .component {
        padding: 16px;
    }

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

    .bars {
        height: 30px;
    }
}

@media (max-width: 440px) {
    .wide-only {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
