:root {
  color: #c9ced2;
  background: #0e1013;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --bg: #0e1013;
  --editor: #14171a;
  --hairline: #1e2226;
  --text: #c9ced2;
  --muted: #6f777d;
  --faint: #4a5157;
  --peer: #b0584c;
  --keyword: #8f9aa8;
  --string: #8ba888;
  --comment: #5d656b;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  padding: 72px 24px 90px;
  font-size: 14px;
}

button,
input {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 2px;
}

.page {
  width: min(100%, 720px);
  margin: 0 auto;
}

.top {
  display: flex;
  gap: 18px;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 42px;
}

.brand {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.brand b {
  color: var(--text);
  font-weight: 600;
}

.languages {
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  font-size: 12px;
}

.languages a {
  color: var(--faint);
  text-decoration: none;
}

.languages a:hover {
  color: var(--muted);
}

.languages a[aria-current="page"] {
  color: var(--text);
}

.kicker {
  margin: 0 0 14px;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #e4e8ea;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lead {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 34px;
}

.new-workspace {
  padding: 10px 16px;
  color: var(--text);
  background: #1b1f23;
  border: 0;
  border-left: 2px solid var(--peer);
  cursor: pointer;
}

.new-workspace:hover {
  background: #23282d;
}

.or {
  color: var(--faint);
  font-size: 12px;
}

.join {
  display: flex;
  flex: 1;
  gap: 10px;
  min-width: 0;
}

.join input {
  width: 100%;
  padding: 10px 2px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  outline: none;
}

.join input::placeholder {
  color: var(--faint);
}

.join input:focus {
  border-bottom-color: var(--muted);
}

.open {
  padding: 10px 14px;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

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

.form-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--peer);
  font-size: 12px;
}

.note {
  margin: 26px 0 0;
  color: var(--faint);
  font-size: 12px;
}

.preview {
  margin-top: 44px;
  background: var(--editor);
}

.preview-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 18px;
  color: var(--faint);
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
}

.preview-head .right {
  margin-left: auto;
}

.code {
  padding: 14px 0;
  counter-reset: ln;
  font-size: 13px;
  line-height: 1.7;
}

.line {
  display: grid;
  grid-template-columns: 52px 1fr;
  min-height: 1.7em;
  white-space: pre;
}

.line::before {
  padding-right: 16px;
  color: #333a3e;
  content: counter(ln);
  counter-increment: ln;
  text-align: right;
}

.heading {
  color: var(--keyword);
}

.comment {
  color: var(--comment);
}

.caret {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  background: var(--text);
  vertical-align: -0.15em;
  animation: blink 1.1s steps(1) infinite;
}

.peer-selection {
  background: rgba(176, 88, 76, 0.18);
}

.peer-caret {
  position: relative;
  display: inline-block;
  height: 1.1em;
  border-left: 2px solid var(--peer);
  vertical-align: -0.15em;
}

.peer-caret::after {
  position: absolute;
  bottom: calc(100% + 2px);
  left: -2px;
  padding: 1px 4px;
  color: #e8d7d4;
  background: rgba(176, 88, 76, 0.85);
  border-radius: 2px;
  content: "peer";
  font-size: 9px;
  line-height: 1.4;
  white-space: nowrap;
}

.preview .peer-caret:not(.named):not(.merged):not(:hover)::after {
  width: 7px;
  height: 7px;
  padding: 0;
  content: "";
}

.peer-caret.merged::after {
  content: "you + peer";
  transform-origin: left bottom;
  animation: pop 0.3s ease-out;
}

.section {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--hairline);
}

.section h2 {
  margin: 0;
  color: #e4e8ea;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.grid {
  display: grid;
  gap: 26px;
  margin-top: 30px;
}

.grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.item-mark {
  color: var(--faint);
  font-size: 12px;
}

.item h3 {
  margin: 8px 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.join-section {
  max-width: 520px;
  margin-top: 26px;
}

.faq {
  margin-top: 26px;
}

.faq details {
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.faq details:first-child {
  border-top: 1px solid var(--hairline);
}

.faq summary {
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

.faq p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.page-foot {
  display: flex;
  gap: 14px;
  margin-top: 64px;
  padding-top: 24px;
  color: var(--faint);
  border-top: 1px solid var(--hairline);
  font-size: 12px;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes pop {
  0% {
    transform: scale(0.6);
  }

  60% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .peer-caret.merged::after {
    animation: none;
  }
}

@media (max-width: 720px) {
  body {
    padding: 40px 16px 64px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .or {
    display: none;
  }

  .grid.three,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .join-section .join {
    flex-direction: column;
  }

  .preview .line {
    grid-template-columns: 34px 1fr;
  }
}

@media (pointer: coarse) {
  .new-workspace,
  .open {
    min-height: 44px;
  }
}
