:root {
  color-scheme: dark;
  --bg: #090909;
  --line: #262626;
  --text: #f2f2ee;
  --muted: #969691;
  --faint: #686863;
  --accent: #c9f36d;
  --other-accent: #8ecbff;
  --other-accent-light: #d2efff;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

::selection {
  color: var(--bg);
  background: var(--accent);
}

.presence {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  width: min(1080px, calc(100% - 56px));
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(72px, 15vh, 156px) 0 64px;
}

.lane {
  min-width: 0;
}

.lane-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-height: 118px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.lane-title {
  min-width: 0;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 430;
  letter-spacing: -0.08em;
  line-height: 1;
}

.lane-average {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.01em;
}

.model-wrap {
  display: grid;
  justify-items: end;
  gap: 10px;
  width: min(100%, 560px);
  max-width: 560px;
  padding-top: 4px;
}

.model-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  min-height: 36px;
  max-width: 560px;
  overflow: visible;
}

.model-block {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  background: var(--accent);
  border: 1px solid rgba(201, 243, 109, 0.75);
  border-radius: 3px;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.model-block:hover,
.model-block:focus,
.model-block.is-open {
  background: #ecffb0;
  box-shadow: 0 0 16px rgba(201, 243, 109, 0.55);
  transform: translateY(-2px);
}

.model-block:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.model-block-other {
  background: var(--other-accent);
  border-color: rgba(142, 203, 255, 0.78);
}

.model-block-other:hover,
.model-block-other:focus,
.model-block-other.is-open {
  background: var(--other-accent-light);
  box-shadow: 0 0 16px rgba(142, 203, 255, 0.52);
}

.model-block-other:focus-visible {
  outline-color: var(--other-accent);
}

.model-tooltip {
  position: absolute;
  z-index: 5;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 36px));
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 12px 13px;
  color: var(--text);
  background: #171717;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  visibility: hidden;
}

.model-tooltip::before {
  position: absolute;
  top: -5px;
  right: 6px;
  width: 8px;
  height: 8px;
  content: "";
  background: #171717;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  transform: rotate(45deg);
}

.model-tooltip-name {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.model-block-other .model-tooltip-name {
  color: var(--other-accent);
}

.model-tooltip-task {
  display: block;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.model-block[data-translation-state="loading"] .model-tooltip-task {
  color: var(--muted);
}

.model-block[data-translation-state="error"] .model-tooltip-task {
  color: #ffb5a8;
}

.model-block:hover .model-tooltip,
.model-block:focus .model-tooltip,
.model-block.is-open .model-tooltip {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

@media (max-width: 680px) {
  .presence {
    grid-template-columns: 1fr;
    gap: 48px;
    width: min(100% - 36px, 520px);
    padding: 44px 0 48px;
  }

  .lane-heading {
    min-height: 104px;
  }

  .model-wrap,
  .model-grid {
    max-width: 100%;
  }

  .model-block {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  h1,
  h2 {
    font-size: 38px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
