/* The rtm website. Colours follow the app icon (#ce422b) and the system light or dark theme. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --fg: #1f2328;
  --muted: #59636e;
  --border: #d8dee4;
  --accent: #ce422b;
  --accent-fg: #ffffff;
  --link: #b33520;
  --shadow: 0 4px 24px rgb(0 0 0 / 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --bg-alt: #1e2127;
    --fg: #e6e8eb;
    --muted: #9aa3ad;
    --border: #30363d;
    --link: #f0806b;
    --shadow: 0 4px 24px rgb(0 0 0 / 0.4);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif;
}

a { color: var(--link); }

a:focus-visible, .button:focus-visible, .zoom:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; }

main > section, main > article {
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

/* Header and footer */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

/* Wraps on phones rather than running off the screen. */
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--fg); }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 1rem;
}

/* Hero */

.hero { text-align: center; }
.hero .logo { display: block; margin: 0 auto 1rem; }
.release-notice {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 100%;
  margin: 0 0 1.5rem;
  padding: 0.35rem 0.9rem 0.35rem 0.35rem;
  border: 1px solid var(--border);
  /* A pill on one line, a rounded box when it wraps on narrow screens. */
  border-radius: 1.25rem;
  background: var(--bg-alt);
  color: var(--fg);
  text-decoration: none;
}
.release-notice:hover { border-color: var(--accent); }
.release-notice .label {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 0.85rem;
  font-weight: 600;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.15; margin: 0 0 0.5rem; }
.tagline { font-size: 1.25rem; color: var(--muted); margin: 0 0 1.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

.button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  background: var(--bg-alt);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

/* Screenshots: two columns, stacked on narrow screens */

.screenshots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.screenshots .wide { grid-column: 1 / -1; max-width: 807px; justify-self: center; }
.screenshots figure { margin: 0; }
.screenshots img {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.screenshots figcaption { color: var(--muted); font-size: 0.9rem; text-align: center; margin-top: 0.5rem; }

@media (max-width: 720px) {
  .screenshots { grid-template-columns: minmax(0, 1fr); }
}

/* Screenshot viewer: the script wraps each screenshot in a .zoom button that opens .viewer */

.zoom {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: zoom-in;
}

.viewer {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: none;
  overflow: visible;
}
.viewer::backdrop { background: rgb(0 0 0 / 0.8); animation: fade-in 250ms ease-out; }
.viewer img {
  display: block;
  width: auto;
  height: auto;
  max-width: 96vw;
  max-height: 92dvh;
  border-radius: 8px;
  transform-origin: 0 0;
}
.viewer .close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.6);
  color: #ffffff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.viewer .close:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

body:has(.viewer[open]) { overflow: hidden; }

@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .viewer::backdrop { animation: none; }
}

/* Features */

.features { max-width: 760px; }
.features ul { padding-left: 1.25rem; }
.features li { margin-bottom: 0.6rem; }

/* Pages (the install guide) */

.page { max-width: 760px; }
.page h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.2; margin: 0 0 1.5rem; }
.page h2 { margin: 2.5rem 0 0.75rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
.page li { margin-bottom: 0.4rem; }
.page pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}
.page pre code { background: none; padding: 0; }
.page blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-alt);
  color: var(--muted);
}

/* Download */

.download { text-align: center; }
.download h2 { font-size: 2rem; margin: 0 0 0.5rem; }
.platforms {
  --gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  container-type: inline-size;
}
.platforms li {
  flex: 1 1 240px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.platforms h3 { margin: 0 0 0.5rem; }
.platforms p { color: var(--muted); margin: 0 0 1rem; }
.platforms .button { margin: 0 0.4rem 0.4rem 0; }
.platforms .cli { margin: 0.6rem 0 0; }
/* Cap each box at one column's width once two or three fit in a row, so every row has boxes of the
   same width and a box alone in the last row sits centered instead of stretching. */
@container (min-width: calc(480px + 1.25rem)) {
  .platforms li { max-width: calc((100% - var(--gap)) / 2); }
}
@container (min-width: calc(720px + 2.5rem)) {
  .platforms li { max-width: calc((100% - 2 * var(--gap)) / 3); }
}

/* The download links inside a page (a release post, the install guide): a compact block above the text. */
.page .release-downloads { text-align: center; margin: 0 0 2.5rem; }
.page .release-downloads h2 { margin: 0; padding: 0; border: 0; font-size: 1.4rem; }
.page .release-downloads .platforms { margin: 1rem 0; --gap: 0.75rem; }
.page .release-downloads .platforms li { padding: 1rem; margin: 0; }
/* The smaller gap lets two boxes share a row a little sooner than the caps above assume. */
@container (min-width: calc(480px + 0.75rem)) and (max-width: calc(480px + 1.25rem)) {
  .page .release-downloads .platforms li { max-width: calc((100% - var(--gap)) / 2); }
}

/* News */

.date { color: var(--muted); margin: -1rem 0 1.5rem; }
.news { list-style: none; padding: 0; }
/* A beta release's label, in the news list and on its post. */
.badge {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.news li { margin-bottom: 1.25rem; }
.news a { font-weight: 600; }
.news time { color: var(--muted); margin-left: 0.5rem; }
.news p { margin: 0.25rem 0 0; color: var(--muted); }
.more { color: var(--muted); }
