/* Colors are taken from the app's own UI (see the screenshots). */
:root {
  --bg: #1a1b20;
  --surface: #202127;
  --line: #2c2d36;
  --text: #e6e6ec;
  --muted: #9a9cab;
  --link: #bab6fc;
  --control: #363955;
  --control-line: #45486a;
  --green: #5ca356;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* Keep anchor targets clear of the sticky header */
html { scroll-padding-top: 76px; }

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

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }
code { font: 0.9em var(--mono); }
b { font-weight: 600; color: var(--text); }

.wrap { width: min(1040px, 100% - 48px); margin-inline: auto; }

.mobile-only { display: none; }
.is-mobile .desktop-only { display: none !important; }
.is-mobile .mobile-only { display: block; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(26 27 32 / 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.top nav { display: flex; gap: 24px; font-size: 15px; }
.top nav a { color: var(--muted); }
.top nav a:hover { color: var(--text); text-decoration: none; }

/* Intro */
.intro { padding: 24px 0 40px; }
.app-icon { width: 88px; height: 88px; margin: 0 0 20px -6px; filter: drop-shadow(0 10px 18px rgb(0 0 0 / 0.45)); }
h1 {
  max-width: 15em;
  margin: 0 0 20px;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.022em;
}
.lede { max-width: 34em; margin: 0 0 32px; font-size: 19px; color: var(--muted); }
.meta { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

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

.button {
  display: inline-block;
  padding: 10px 18px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font: 600 15px/1.4 var(--sans);
  cursor: pointer;
}
.button:hover { background: #66ad60; text-decoration: none; }

/* Download dropdowns, styled like the app's "Sort by" select */
.dl-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dl-select { position: relative; display: inline-flex; }
.dl-select select {
  appearance: none;
  -webkit-appearance: none;
  padding: 7px 30px 7px 11px;
  border: 1px solid var(--control-line);
  border-radius: 7px;
  background: var(--control);
  color: var(--text);
  font: 14px var(--sans);
  cursor: pointer;
}
.dl-select select:hover:not(:disabled) { background: #3e4162; }
.dl-select select:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.dl-select select:disabled { padding-right: 11px; border-color: var(--line); background: transparent; color: var(--muted); opacity: 1; cursor: default; }
.dl-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 6px;
  height: 6px;
  margin-top: -5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.dl-select:has(select:disabled)::after { display: none; }
.dl-size { margin-left: 4px; font: 13px var(--mono); color: var(--muted); }

/* Screenshots */
.hero-shot { margin-top: 0; margin-bottom: 0; }
.hero-shot img, .shot img { border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 24px 48px -24px rgb(0 0 0 / 0.6); }
.shot figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* Sections: heading in a left column, content on the right */
.section {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px 48px;
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.section > * { grid-column: 2; }
.section > h2 { grid-column: 1; grid-row: 1; align-self: start; position: sticky; top: 84px; display: flex; align-items: center; gap: 12px; }

/* Section headings carry a version node, so the page reads like a history */
.vnode {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px dashed #6c6f96;
  border-radius: 7px;
  background: linear-gradient(#3e4064, #383b60);
  color: #f0f0f8;
  font: 700 12px var(--mono);
}
.vnode.current { border: 1.5px solid #c4efbe; background: var(--green); box-shadow: 0 0 12px rgb(140 230 140 / 0.35); }
.shot.section { display: block; border-top: 0; padding-top: 0; margin-top: 72px; }
h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.5; }
h2 .version { font: 15px var(--mono); color: var(--muted); }
h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.section p, .section li, .section dd { color: var(--muted); }
.aside { margin: 8px 0 0; font-size: 14px; }

/* Graph diagram */
.diagram { display: grid; gap: 20px; }
.graph-figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.graph .node { cursor: pointer; outline: none; }
.graph .node:hover rect { stroke: #a9a6e8; }
.graph .node.selected.selected rect { stroke: #bab6fc; stroke-width: 2.5; stroke-dasharray: none; }
.graph .node.current.selected rect { stroke: #e3ffde; }
.graph .node:focus-visible rect { stroke: #fff; stroke-width: 2.5; }
.graph-detail { padding: 12px 14px 14px; border-top: 1px solid var(--line); background: #282933; }
.graph-detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.graph-detail-head b { margin-left: 6px; font-family: var(--mono); }
.graph-detail .current-tag { margin-left: 8px; color: #6fd36a; }
.graph-detail .current-tag[hidden] { display: none; }
.graph-detail p { margin: 8px 0 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #1f2027; color: var(--text); font-size: 15px; }
.hint { margin: -8px 0 0; font-size: 13px; }
.graph { display: block; width: 100%; height: auto; }
.graph .edge { fill: none; stroke: #bab6fc; stroke-width: 2; }
.graph .edge.muted { stroke: #616384; stroke-width: 1.5; }
.graph .node rect { fill: url(#node-fill); stroke: #6c6f96; stroke-width: 1; }
.graph .node.dashed rect { stroke-dasharray: 3 2; }
.graph .node text { fill: #f0f0f8; font: 700 15px var(--mono); text-anchor: middle; }
.graph .node text.sub { font: 400 10.5px var(--mono); fill: #c0c0d8; }
.graph .node.current rect { fill: var(--green); stroke: #c4efbe; stroke-width: 2; }
.graph .node.current text.sub { fill: #eaffea; }
.graph .marker circle { fill: var(--text); }
.graph .marker text { fill: var(--bg); font: 700 11px var(--sans); text-anchor: middle; }

.legend, .steps { margin: 0; padding: 0; list-style: none; counter-reset: n; }
.legend li, .steps li { position: relative; padding-left: 34px; counter-increment: n; }
.legend li + li, .steps li + li { margin-top: 10px; }
.legend li::before, .steps li::before {
  content: counter(n);
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font: 700 11px/20px var(--sans);
  text-align: center;
}
.legend li::before { background: var(--text); color: var(--bg); }
.steps li::before { border: 1px solid var(--line); color: var(--muted); line-height: 18px; }

/* Details */
.facts { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px 24px; margin: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }

/* Supported apps */
.apps { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; }
.apps p { margin: 0; font-size: 15px; }

/* Downloads */
.dl-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}
.dl-row + .dl-row { border-top: 1px solid var(--line); }
.dl-os { font-weight: 600; }
.dl-os small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.dl-row .button { justify-self: end; }

/* Footer */
.bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 96px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.bottom nav { display: flex; gap: 20px; }
.bottom nav a { color: var(--muted); }

@media (max-width: 760px) {
  .intro { padding-top: 40px; }
  .section { grid-template-columns: minmax(0, 1fr); margin-top: 56px; }
  .section > *, .section > h2 { grid-column: 1; grid-row: auto; position: static; }
  .apps, .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dd { margin-bottom: 8px; }
  .dl-row { grid-template-columns: minmax(0, 1fr); }
  .dl-row .button { justify-self: start; }
}
