/* qutty.org. The palette is Qutty's own: Sea Glass (the app's default dark theme) for the dark
   scheme, and for light, Cloud's surfaces with Paper's sea-glass teal, so the accent stays the
   app's in both. Tiles here are drawn the way the app draws them: a header strip, hairline
   borders, and the focused tile wears the accent ring. */

@font-face {
  font-family: "Martian Mono";
  src: url("/fonts/martian-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  color-scheme: dark light;
  --bg: #0d1015;
  --bg-2: #10141a;
  --tile: #0d1117;
  --head: #141a22;
  --line: #222a35;
  --line-2: #2d3744;
  --text: #d9e0e8;
  --text-2: #8e99a8;
  --text-3: #5f6a78;
  --accent: #7fd8c2;
  --accent-ink: #0b1513;
  --accent-rgb: 127, 216, 194;
  --amber: #f3c37a;
  --red: #e07a74;
  --green: #8fd19e;
  --blue: #7fb4e6;
  --violet: #c7a3e8;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);

  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial,
    sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 8px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 68ch;
  --wide: 1240px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef1f5;
    --bg-2: #e5e9ef;
    --tile: #f8fafc;
    --head: #e8ecf2;
    --line: #d5dbe4;
    --line-2: #c3cbd7;
    --text: #1f2733;
    --text-2: #4d5968;
    --text-3: #8791a0;
    --accent: #1a7f6b;
    --accent-ink: #ffffff;
    --accent-rgb: 26, 127, 107;
    --amber: #96600a;
    --red: #b8392f;
    --green: #3d7f2a;
    --blue: #2f62b0;
    --violet: #8e4aa6;
    --shadow: 0 24px 50px -28px rgba(20, 32, 56, 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

code,
kbd,
pre {
  font-family: var(--mono);
  font-size: 0.82em;
  font-stretch: 87.5%;
}

code {
  background: var(--head);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

kbd {
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 0.35em;
  background: var(--tile);
}

h1,
h2,
h3 {
  font-family: var(--mono);
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 8px;
  z-index: 10;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 6px 12px;
  border-radius: var(--radius);
}

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- site chrome: the header is the app's switcher bar --------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.bar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 52px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 700;
  font-stretch: 112.5%;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand img {
  width: 28px;
  height: 28px;
}

.bar-inner > nav {
  margin-left: auto;
}

.chips {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-stretch: 87.5%;
  white-space: nowrap;
}

.chip:hover {
  color: var(--text);
  background: var(--head);
}

.chip[aria-current="page"] {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.1);
}

.chip-n {
  color: var(--text-3);
}

.chip[aria-current="page"] .chip-n {
  color: inherit;
  opacity: 0.7;
}

@media (max-width: 640px) {
  .bar-inner {
    gap: 8px;
  }

  .brand span {
    display: none;
  }

  .chips {
    gap: 0;
  }

  .chip {
    padding: 0 8px;
  }

  .chip-n,
  .chip-ext {
    display: none;
  }
}

.foot {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 0.9rem;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 28px;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot a {
  color: var(--text-2);
}

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

/* ---- tiles ----------------------------------------------------------------------------- */

.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.tile-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  background: var(--head);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-stretch: 87.5%;
  white-space: nowrap;
  overflow: hidden;
}

.tile-head .when {
  margin-left: auto;
  color: var(--text-3);
}

.tile-body {
  flex: 1;
  padding: 18px;
  min-width: 0;
}

.tile.is-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35), 0 0 0 5px rgba(var(--accent-rgb), 0.12);
}

.tile.is-focused > .tile-head {
  color: var(--text);
}

/* Activity colours, as the app uses them on an unfocused tile's header. */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  flex: none;
}

.dot.accent {
  background: var(--accent);
}

.dot.amber {
  background: var(--amber);
}

.dot.green {
  background: var(--green);
}

/* ---- the hero: a cascade --------------------------------------------------------------- */

.hero {
  padding-top: clamp(20px, 4vw, 40px);
}

/* Cascade (dwindle): tile 1 takes the left, tile 2 the top right, tile 3 the bottom right's
   left, tiles 4 and 5 split what is left, the same way the app splits its cluster. */
.cascade {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.62fr) minmax(0, 0.38fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 0.62fr) minmax(0, 0.5fr);
  grid-template-areas:
    "t1 t2 t2"
    "t1 t3 t4"
    "t1 t3 t5";
  min-height: min(78vh, 680px);
}

.cascade > :nth-child(1) {
  grid-area: t1;
}

.cascade > :nth-child(2) {
  grid-area: t2;
}

.cascade > :nth-child(3) {
  grid-area: t3;
}

.cascade > :nth-child(4) {
  grid-area: t4;
}

.cascade > :nth-child(5) {
  grid-area: t5;
}

.pitch {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4.5vw, 64px);
}

.pitch h1 {
  font-size: clamp(2.1rem, 4.6vw, 4.1rem);
  font-weight: 760;
  font-stretch: 100%;
  letter-spacing: -0.045em;
  line-height: 1.02;
  max-width: 13ch;
}

.pitch .lead {
  margin: 24px 0 32px;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--text-2);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
}

.button:hover {
  filter: brightness(1.08);
}

.button svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.button.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}

.cta-note {
  color: var(--text-2);
  font-size: 0.88rem;
}

.term {
  margin: 0;
  padding: 14px 16px;
  font-size: 0.78rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

.term .p {
  color: var(--green);
}

.term .c {
  color: var(--text-3);
}

.mini {
  padding: 14px 16px;
  font-size: 0.86rem;
  color: var(--text-2);
}

.mini strong {
  display: block;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.patterns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  list-style: none;
}

.patterns li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-stretch: 87.5%;
  color: var(--text-2);
}

.patterns svg {
  width: 100%;
  max-width: 64px;
  aspect-ratio: 16 / 10;
}

.patterns rect {
  fill: rgba(var(--accent-rgb), 0.12);
  stroke: var(--line-2);
  stroke-width: 1;
}

.patterns rect.f {
  fill: rgba(var(--accent-rgb), 0.35);
  stroke: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  /* One moment: the cluster settles the way Qutty's layout animates a new tile in. */
  .cascade > .tile:not(.is-focused) {
    animation: settle 640ms var(--ease) both;
  }

  .cascade > :nth-child(2) {
    animation-delay: 80ms;
  }

  .cascade > :nth-child(3) {
    animation-delay: 160ms;
  }

  .cascade > :nth-child(4) {
    animation-delay: 230ms;
  }

  .cascade > :nth-child(5) {
    animation-delay: 290ms;
  }

  @keyframes settle {
    from {
      opacity: 0;
      transform: translate(-14px, 0) scale(0.97);
    }
  }
}

@media (max-width: 900px) {
  .cascade {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      "t1 t1"
      "t2 t2"
      "t3 t3"
      "t4 t5";
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .cascade {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "t1" "t2" "t3" "t4" "t5";
  }

  .patterns {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}

/* ---- sections ------------------------------------------------------------------------- */

.section {
  margin-top: clamp(72px, 10vw, 128px);
}

.section-head {
  max-width: var(--measure);
  margin-bottom: 32px;
}

.section-head p {
  color: var(--text-2);
  margin-top: 14px;
}

.window {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--tile);
  box-shadow: var(--shadow);
}

.window img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

figcaption {
  color: var(--text-2);
  font-size: 0.9rem;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--head);
}

.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

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

/* The highlights: one row per feature, a hairline between. */
.highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.highlights li {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.highlights h3 {
  margin-bottom: 6px;
}

.highlights p {
  margin: 0;
  color: var(--text-2);
  max-width: 54ch;
}

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

.highlights h3 a {
  color: var(--text);
  text-decoration: none;
}

.highlights h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.more {
  margin-top: 28px;
}

/* ---- inner pages ----------------------------------------------------------------------- */

.page-head {
  padding-top: clamp(40px, 7vw, 88px);
  max-width: var(--measure);
}

.page-head h1 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 720;
  letter-spacing: -0.04em;
}

.page-head p {
  margin-top: 18px;
  color: var(--text-2);
  font-size: 1.1rem;
}

.with-toc {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  margin-top: 56px;
}

.toc {
  position: sticky;
  top: 76px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-stretch: 87.5%;
}

.toc ol,
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.toc a {
  display: block;
  padding: 5px 0 5px 14px;
  color: var(--text-2);
  text-decoration: none;
}

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

@media (max-width: 900px) {
  .with-toc {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-top: 32px;
  }

  .toc {
    position: static;
  }

  .toc ol,
  .toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    border: 0;
  }

  .toc a {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
  }
}

.prose {
  max-width: var(--measure);
}

.prose h2 {
  margin: 0 0 18px;
  scroll-margin-top: 72px;
}

.prose h3 {
  margin: 28px 0 8px;
}

.prose ul {
  padding-left: 1.2em;
}

.prose li {
  margin: 0.35em 0;
}

.prose li::marker {
  color: var(--text-3);
}

.feature {
  padding-bottom: 64px;
  margin-bottom: 64px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 72px;
}

.feature:last-child {
  border-bottom: 0;
}

.feature .window {
  margin: 28px 0 8px;
  max-width: 100%;
}

.feature-body {
  max-width: var(--measure);
}

/* ---- download ------------------------------------------------------------------------- */

.platforms {
  display: grid;
  gap: 24px;
  margin-top: 48px;
}

.platform {
  scroll-margin-top: 72px;
}

.platform > .tile-body {
  padding: clamp(20px, 3vw, 32px);
}

.platform h2 {
  margin-bottom: 8px;
}

.platform .sub {
  color: var(--text-2);
  margin-bottom: 24px;
}

.files {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.files th,
.files td {
  text-align: left;
  padding: 12px 12px 12px 0;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.files th {
  font-weight: 600;
}

.files thead th {
  border-top: 0;
  color: var(--text-2);
  font-weight: 500;
  font-size: 0.85rem;
  padding-top: 0;
}

.files .size {
  color: var(--text-2);
  white-space: nowrap;
}

.files a.file {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-stretch: 87.5%;
  overflow-wrap: anywhere;
}

.files .sum {
  font-size: 0.8rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .files thead {
    display: none;
  }

  .files tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }

  .files th,
  .files td {
    border: 0;
    padding: 0;
  }

  .files th {
    grid-column: 1 / -1;
  }
}

.grid-2 h3 {
  margin-bottom: 8px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

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

pre.code {
  margin: 8px 0 18px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

pre.code .c {
  color: var(--text-3);
}

.note {
  color: var(--text-2);
  font-size: 0.92rem;
}

/* ---- changelog ------------------------------------------------------------------------ */

.release {
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 72px;
}

.release:last-child {
  border-bottom: 0;
}

.release h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.release h2 a {
  color: inherit;
  text-decoration: none;
}

.release .summary {
  color: var(--text-2);
  font-size: 1.05rem;
  margin: 10px 0 18px;
}

.md ul {
  padding-left: 1.2em;
}

.md li {
  margin: 0.5em 0;
}

.md li::marker {
  color: var(--text-3);
}

.md p {
  margin: 0.6em 0;
}

/* ---- 404 ------------------------------------------------------------------------------- */

.lost {
  max-width: 640px;
  margin: clamp(48px, 10vw, 120px) auto 0;
}

.lost .term {
  font-size: 0.85rem;
}

.lost h1 {
  font-size: 1.6rem;
}

.lost p {
  margin-top: 12px;
  color: var(--text-2);
}

.after-table {
  margin-top: 28px;
}

.foot-note {
  margin: 0;
}
