:root {
  color-scheme: dark;
  --bg: #202020;
  --panel: #101010;
  --panel-soft: #2a2a2a;
  --text: #f5f5f5;
  --muted: #c7c7c7;
  --faint: #8d8d8d;
  --line: #3d3d3d;
  --red: #ff5b62;
  --green: #61d394;
  --link: #58a6d6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.55;
}

.page {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 18px;
}

.language-picker {
  position: fixed;
  z-index: 10;
  top: 16px;
  right: 18px;
  display: inline-block;
  width: max-content;
  margin: 0;
}

.language-picker select {
  min-width: 132px;
  height: 34px;
  padding: 0 34px 0 10px;
  border: 1px solid #505050;
  border-radius: 6px;
  appearance: none;
  color: var(--text);
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 16px) 14px / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 10px) 14px / 6px 6px no-repeat,
    var(--panel-soft);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
}

.language-picker select:hover,
.language-picker select:focus-visible {
  border-color: var(--muted);
  outline: none;
}

.masthead {
  margin-bottom: 28px;
  text-align: center;
}

.domain {
  margin: 0 0 4px;
  color: var(--faint);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 4rem;
  line-height: 1;
  letter-spacing: 0;
}

.tagline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.intro {
  max-width: 820px;
  margin: 0 auto 32px;
}

.intro h2 {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.22;
  text-align: center;
}

.intro p,
.copy p,
.example p,
footer p {
  color: var(--muted);
}

.examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  gap: 28px;
  align-items: start;
  margin-bottom: 32px;
}

.example {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  min-height: 0;
}

.example h2,
.copy h2 {
  margin-bottom: 12px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.mark {
  display: inline-grid;
  width: 1.55em;
  height: 1.25em;
  place-items: center;
  margin-right: 4px;
  border-radius: 4px;
  color: var(--panel);
  font-size: 0.88em;
  font-weight: 700;
  line-height: 1;
}

.mark--bad {
  background: var(--red);
}

.mark--good {
  background: var(--green);
}

.chat {
  display: grid;
  height: 100%;
  min-height: 188px;
  margin-bottom: 14px;
  padding: 16px;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0d0d0d;
}

.timestamp {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 0.74rem;
  line-height: 1.2;
  text-align: center;
}

.message-row {
  display: flex;
  width: 100%;
}

.message-row--them {
  justify-content: flex-start;
}

.message-row--me {
  justify-content: flex-end;
}

.bubble {
  margin: 0;
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 18px;
  color: #ffffff;
  font-weight: bold;
  font-size: 0.92rem;
  line-height: 1.38;
  animation: message-in 420ms ease both;
}

.bubble--them {
  border-bottom-left-radius: 5px;
  background: #303030;
}

.bubble--me {
  border-bottom-right-radius: 5px;
  background: #0a84ff;
  color: #ffffff;
  animation-delay: 180ms;
}

.bubble--bad {
  background: #3a2a2a;
}

.bubble--good {
  background: #20382b;
}

.copy {
  max-width: 820px;
  margin: 0 auto 24px;
}

blockquote {
  margin: 0 0 14px;
  padding: 14px 18px;
  border-left: 8px solid var(--line);
  background: var(--panel);
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.95rem;
}

blockquote p {
  margin-bottom: 6px;
  color: var(--text);
}

blockquote p:last-child,
.copy p:last-child,
.example p:last-child {
  margin-bottom: 0;
}

strong {
  color: var(--text);
}

footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 32px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}

footer p {
  margin-bottom: 0;
}

.footer-info {
  display: flex;
  max-width: 390px;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}

.footer-info a {
  color: var(--link);
  text-decoration: none;
}

.footer-info a:hover,
.footer-info a:focus-visible {
  text-decoration: underline;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .page {
    width: min(100% - 28px, 620px);
    padding-top: 24px;
  }

  .language-picker {
    position: static;
    margin: 0;
  }

  .language-picker select {
    min-width: 112px;
    height: 28px;
    padding-right: 28px;
    border-radius: 5px;
    background:
      linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 14px) 12px / 5px 5px no-repeat,
      linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 9px) 12px / 5px 5px no-repeat,
      var(--panel-soft);
    font-size: 0.72rem;
  }

  h1 {
    font-size: 3rem;
  }

  .intro h2 {
    font-size: 1.55rem;
    text-align: left;
  }

  .examples {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 22px;
  }

  .example {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .chat {
    height: auto;
    min-height: 0;
  }

  footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  .footer-info {
    max-width: 180px;
    align-items: flex-end;
    text-align: right;
  }

  .footer-info a {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 2.45rem;
  }

  .chat {
    padding: 12px;
  }

  .bubble {
    max-width: 92%;
  }
}

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