:root {
  color-scheme: dark;
  --ground: #101614;
  --surface: #18211e;
  --surface-strong: #22302b;
  --ink: #edf3eb;
  --muted: #a8b7ae;
  --accent: #b9f34a;
  --danger: #ff8b7c;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ground);
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--accent);
  color: #15200d;
  font-weight: 700;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.55;
}

button.secondary {
  background: var(--surface-strong);
  color: var(--ink);
}

.shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 20px max(34px, env(safe-area-inset-bottom));
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 64px;
}

.wordmark {
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.connection::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #707d75;
  content: "";
}

.connection[data-state="online"]::before {
  background: var(--accent);
}

.connection[data-state="error"]::before {
  background: var(--danger);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 16px;
  font-size: clamp(38px, 12vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.pairing {
  max-width: 480px;
}

.pairing p,
.lede {
  max-width: 38ch;
  color: var(--muted);
  font-size: 18px;
}

#pair-form {
  display: grid;
  gap: 12px;
  margin-top: 36px;
}

label {
  color: var(--muted);
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: 2px solid transparent;
  transition: outline-color 160ms ease;
}

input:focus,
textarea:focus {
  outline-color: var(--accent);
}

input {
  min-height: 56px;
  padding: 12px 18px;
  font-size: 26px;
  letter-spacing: 0.28em;
}

textarea {
  min-height: 136px;
  resize: vertical;
  padding: 18px;
  font-size: 17px;
}

.error {
  min-height: 24px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.intro {
  margin-bottom: 56px;
}

.context {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 15px;
}

.composer {
  display: grid;
  gap: 14px;
  margin-bottom: 72px;
  padding: 20px;
  border-radius: 28px;
  background: var(--surface);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-text {
  color: var(--muted);
  font-size: 14px;
}

.screen-section {
  margin-bottom: 72px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.screen-preview {
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface);
}

.screen-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #0b0f0e;
}

details {
  padding: 16px 18px;
}

summary {
  color: var(--muted);
  cursor: pointer;
}

pre {
  overflow: auto;
  max-height: 300px;
  margin: 14px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.install-note {
  padding: 26px;
  border-radius: 24px;
  background: var(--surface-strong);
}

.install-note p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 520px) {
  .masthead {
    margin-bottom: 48px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

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

  .composer-actions button {
    width: 100%;
  }
}

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