@font-face {
  font-family: "Sukhumvit Web";
  src: url("fonts/SukhumvitSet-Light.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Sukhumvit Web";
  src: url("fonts/SukhumvitSet-Text.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Sukhumvit Web";
  src: url("fonts/SukhumvitSet-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  --background: #fff;
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --rule: #d2d2d7;
  --blue: #0877d1;
  --green: #22a447;
  --orange: #c76d11;
  --red: #d92d20;
  --unknown: #8e8e93;
  --content-width: 980px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --background: #050505;
  --text: #f5f5f7;
  --secondary: #a1a1a6;
  --rule: #424245;
  --blue: #2997ff;
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;
  --unknown: #8e8e93;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--text);
  font-family: "Sukhumvit Web", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--background);
}

html,
body {
  transition: background-color 220ms ease, color 220ms ease;
}

button {
  font: inherit;
}

.status-page {
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 64px;
}

.language-switch {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  color: var(--unknown);
  font-size: 16px;
  font-weight: 400;
}

.language-switch button {
  appearance: none;
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  color: var(--text);
}

.language-switch button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 38%, transparent);
  outline-offset: 5px;
  border-radius: 4px;
}

.status-panel {
  padding-top: clamp(56px, 9vh, 96px);
}

h1 {
  margin: 0 0 28px;
  text-align: center;
  font-size: clamp(40px, 5vw, 52px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.overall-status {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 4px;
  color: var(--secondary);
  font-size: 16px;
  font-weight: 400;
}

.status-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--unknown);
}

.overall-text-mobile {
  display: none;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: solid var(--rule);
  border-width: 1px 0;
}

.service-row {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  min-height: 54px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 10px 16px;
  font-size: 17px;
  line-height: 1.35;
}

.service-row:nth-child(3n) {
  border-right: 0;
}

.service-row:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.service-name {
  min-width: 0;
}

.state-label {
  color: var(--secondary);
  font-size: 14px;
  font-weight: 300;
  white-space: nowrap;
}

.service-row[data-state="operational"] .state-label {
  display: none;
}

.service-row[data-state="degraded"] .state-label {
  color: var(--orange);
}

.service-row[data-state="outage"] .state-label {
  color: var(--red);
}

.service-row[data-state="unknown"] .state-label {
  color: var(--unknown);
}

.row-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--unknown);
}

.updated-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  margin: 18px 0 0;
  color: var(--secondary);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
}

.demo-badge {
  border: 1px solid color-mix(in srgb, var(--orange) 40%, transparent);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 400;
}

.is-operational {
  background: var(--green);
}

.is-degraded {
  background: var(--orange);
}

.is-outage {
  background: var(--red);
}

.is-unknown {
  background: var(--unknown);
}

@media (max-width: 820px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-row,
  .service-row:nth-child(3n) {
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }

  .service-row:nth-child(2n) {
    border-right: 0;
  }

  .service-row:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  .status-page {
    width: calc(100% - 38px);
    padding-bottom: 48px;
  }

  .status-panel {
    padding-top: clamp(48px, 8vh, 72px);
  }

  h1 {
    margin-bottom: 28px;
  }

  .overall-status {
    justify-content: flex-start;
    min-height: 50px;
    margin-bottom: 0;
    border: solid var(--rule);
    border-width: 1px 0 0;
    padding: 8px 0;
    color: var(--text);
    font-size: 15px;
    line-height: 1.35;
  }

  .status-dot {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
  }

  .service-grid {
    grid-template-columns: 1fr;
    border-width: 0 0 1px;
  }

  .service-row,
  .service-row:nth-child(2n),
  .service-row:nth-child(3n),
  .service-row:nth-last-child(-n + 2),
  .service-row:nth-last-child(-n + 3) {
    display: flex;
    align-items: center;
    column-gap: 0;
    min-height: 39px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    margin-left: 28px;
    padding: 6px 0;
    font-size: 15px;
  }

  .service-row:first-child {
    border-top: 1px solid var(--rule);
  }

  .service-row:last-child {
    border-bottom: 0;
  }

  .row-dot {
    display: none;
  }

  .state-label::before {
    content: "-";
    display: inline-block;
    margin: 0 0.24em;
    color: var(--secondary);
  }

  .state-label {
    font-size: 15px;
    font-weight: 400;
    white-space: normal;
  }

  .service-row[data-state="operational"] .state-label {
    display: inline;
    color: var(--green);
  }

  .updated-line {
    justify-content: flex-start;
    margin-top: 20px;
    margin-left: 0;
    padding-inline: 0;
    font-size: 15px;
  }

  .overall-text-desktop {
    display: none;
  }

  .overall-text-mobile {
    display: inline;
  }
}
