/* Long-form text: articles, legal pages, the About page and FAQ answers. */

.prose {
  max-width: var(--column);
  color: var(--text);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  overflow-wrap: break-word;
}

.prose > * + *,
.prose li > * + * {
  margin-top: 1.25em;
}

.prose li > :is(ul, ol) {
  margin-top: 0.5em;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--light);
  line-height: 1.2;
}

.prose h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
}

.prose h2 {
  margin-top: 2.2em;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.prose h3 {
  margin-top: 1.8em;
  font-size: 1.4rem;
}

.prose h4 {
  margin-top: 1.6em;
  font-size: 1.15rem;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + * {
  margin-top: 0.6em;
}

/* Small notes some posts and answers write as h6. */
.prose h6 {
  margin: 0.4em 0 0;
  color: var(--gray);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.6;
}

.prose p {
  color: inherit;
}

.prose strong,
.prose b {
  color: var(--contrast);
  font-weight: 700;
}

.prose a {
  color: var(--aqua);
  text-decoration: underline;
  text-decoration-color: rgba(63, 208, 200, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--ease);
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.5em;
}

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

/* A panel pointing to each game's guide: a short line, then the supported games as a row of tiles. */
.prose .game-guides {
  display: grid;
  gap: 14px;
  margin-top: 2em;
  padding: 18px 20px 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
}

.prose .game-guides p {
  color: var(--gray);
  font-size: var(--text-small);
}

.prose .game-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prose .game-guides .game-tile {
  --tile-size: 48px;
  --tile-icon: 26px;
}

.prose .game-tiles li + li {
  margin-top: 0;
}

.prose .game-tiles a {
  min-height: var(--tap);
  color: var(--light);
  text-decoration: none;
  transition: color var(--ease);
}

.prose .game-tiles a:hover {
  color: var(--aqua);
}

.prose blockquote {
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--brand);
  color: var(--contrast);
  font-style: italic;
}

.prose hr {
  height: 1px;
  margin: 2.5em 0;
  border: 0;
  background: var(--glass-border);
}

/* Inline code is mostly hotkeys ("Ctrl + P"), kept on one line. */
.prose code {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  color: var(--light);
  font: 0.88em/1.4 var(--font-mono);
  white-space: nowrap;
}

.prose pre {
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: #0d1017;
}

.prose pre code {
  padding: 0;
  background: none;
  white-space: inherit;
}

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--text-small);
}

.prose th,
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
  text-align: left;
}

.prose th {
  color: var(--light);
}

.prose img {
  display: block;
  max-width: 100%;
  margin-block: 1.5em;
  height: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.prose mark {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(254, 45, 118, 0.2);
  color: var(--light);
}

.prose .button-primary,
.prose .button-ghost {
  text-decoration: none;
}

.prose .button-primary {
  color: #fff;
}

.prose .button-ghost {
  height: auto;
  min-height: 48px;
  padding: 12px 24px;
  color: var(--contrast);
  line-height: 1.35;
  text-align: center;
  white-space: normal;
}

/* Images that open larger in the lightbox (assets/js/components/lightbox.js). */
[data-lightbox] img {
  cursor: zoom-in;
}

.lightbox {
  width: min(1200px, 94vw);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  border: 0;
  background: none;
}

.lightbox::backdrop {
  background: rgba(4, 5, 8, 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--light);
  font-size: 22px;
}

/* A list of labelled facts, as on the About page. */
.prose .facts {
  display: grid;
  grid-template-columns: minmax(140px, 0.4fr) 1fr;
  border-top: 1px solid var(--glass-border);
}

.prose .facts dt,
.prose .facts dd {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
}

.prose .facts dt {
  padding-right: 20px;
  color: var(--light);
  font-weight: 700;
}

/* Legal pages carry their own heading inside the text. */
.legal {
  max-width: var(--column-wide);
  padding-top: 64px;
  padding-bottom: var(--section-space);
}

.legal .prose {
  max-width: none;
  margin-top: 40px;
}

.legal .prose h1 {
  margin-bottom: 0.4em;
}

/* Numbered steps in a post, marked with pink counters (a post opts in with `articleClass: prose-steps`). */
.prose-steps ol {
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.prose-steps ol > li {
  position: relative;
  padding-left: 3.5rem;
  counter-increment: step;
}

.prose-steps ol > li + li {
  margin-top: 2em;
}

.prose-steps ol > li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font: 800 1.1rem/1 var(--font-display);
}

/* A long post's contents (_includes/toc.liquid, front matter `toc: true`), under its opening answer. */
.prose .toc {
  padding: 20px 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--fill-subtle);
  font-size: var(--text-small);
  line-height: 1.5;
}

.prose .toc-title {
  color: var(--light);
  font-weight: 700;
}

.prose .toc ol {
  margin-top: 10px;
  padding-left: 1.4em;
}

.prose .toc li + li {
  margin-top: 0.35em;
}

.prose .toc a {
  color: var(--text);
  text-decoration: none;
}

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

/* Figures in a post (_includes/post-figure.liquid): a panel holding one of the diagrams below and its caption.
   Stretches on a provider's route are gray, Arrive's are aqua, and time spent waiting in a queue is striped. */
.post-figure {
  --figure-path: rgba(255, 255, 255, 0.24);
  --figure-queue: repeating-linear-gradient(135deg, var(--gray) 0 4px, rgba(154, 165, 173, 0.25) 4px 8px);
  --figure-arrive: var(--aqua);
  --figure-stop: #1a1d26;
  --figure-bar: 14px;
  --figure-dot: 12px;
  /* The least room a stop on a hop track gets, so a short path with many stops never crowds its dots. */
  --figure-stop-space: 24px;
  margin-inline: 0;
  padding: 28px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--panel-bg);
}

.prose > .post-figure {
  margin-block: 2em;
}

.post-figure :is(ol, ul) {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-figure p {
  margin: 0;
}

.post-figure small {
  margin-left: 2px;
  color: var(--gray);
  font: 400 var(--text-meta) var(--font-body);
}

.post-figure figcaption {
  margin-top: 22px;
  /* Room for the bunny beside it. */
  padding-right: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  color: var(--gray);
  font-size: var(--text-meta);
  line-height: 1.5;
}

/* The game a figure is about, as its tile in the top corner, and the Arrive bunny in the bottom one. */
.prose .post-figure {
  position: relative;
}

.post-figure-game {
  --tile-size: 40px;
  --tile-icon: 22px;
  position: absolute;
  top: 20px;
  right: 20px;
  border-radius: var(--radius-sm);
  color: var(--light);
}

/* A spiky line over a smooth one (visuals/jitter), kept short in a post. */
.post-figure .jitter-chart {
  display: block;
  max-width: 460px;
  margin: 8px auto 20px;
}

.post-figure-brand {
  position: absolute;
  right: 24px;
  bottom: 20px;
  width: 30px;
  color: var(--gray);
  opacity: 0.5;
}

.post-figure-brand svg {
  display: block;
  width: 100%;
  height: auto;
}

/* A ping scale (visuals/ping-scale): zones blend from aqua at low ping to pink at high ping. */
.ping-scale {
  display: grid;
  gap: 10px;
}

/* Blended through hue, so the middle zones pass through violet instead of gray. */
.ping-scale-bar span,
.ping-scale-zones li {
  --zone-color: color-mix(in hsl, var(--brand) var(--mix), var(--aqua));
}

/* Centred over its spot on the bar, with a short stem down to it. Doubled to outrank `.post-figure p`. */
.ping-scale .ping-scale-marker {
  display: grid;
  justify-items: center;
  width: max-content;
  max-width: 240px;
  margin-left: var(--at);
  color: var(--gray);
  font-size: var(--text-meta);
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
}

.ping-scale-marker::after {
  content: '';
  width: 2px;
  height: 12px;
  margin-top: 6px;
  border-radius: 1px;
  background: var(--light);
}

.ping-scale-marker b {
  color: var(--light);
  font: 800 var(--text-lead) / 1.2 var(--font-display);
}

.ping-scale-bar {
  position: relative;
  display: flex;
  gap: 3px;
  height: var(--figure-bar);
}

.ping-scale-bar span {
  flex: 0 0 calc(var(--width) - 3px);
  border-radius: 4px;
  background: var(--zone-color);
}

.ping-scale-zones {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 20px;
}

/* Each zone: the dot level with its ping range, and the label under the range. */
.ping-scale .ping-scale-zones li {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
}

/* Beats the prose spacing between list items' children. */
.ping-scale .ping-scale-zones li > * {
  margin: 0;
}

.ping-scale-zones i {
  grid-row: 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--zone-color);
}

.ping-scale-zones strong {
  grid-row: 1;
  grid-column: 2;
}

.ping-scale-zones span {
  grid-row: 2;
  grid-column: 2;
  align-self: start;
}

.ping-scale-zones strong {
  color: var(--light);
  font: 700 var(--text-body) / 1.3 var(--font-display);
}

.ping-scale-zones span {
  color: var(--gray);
  font-size: var(--text-meta);
  line-height: 1.4;
}

/* A route as stops (visuals/route): a post has room for each stop's note on one line. */
.post-figure .route-diagram {
  width: min(100%, 480px);
}

/* Routes as bars of time (visuals/route-time). */
.post-figure .route-time {
  display: grid;
  gap: 26px;
}

.post-figure .route-time li + li,
.post-figure .route-time-row > * + * {
  margin-top: 0;
}

.post-figure .route-time-head,
.post-figure .hop-path-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--light);
  font-size: var(--text-small);
  font-weight: 700;
  line-height: 1.3;
}

.post-figure :is(.route-time-head, .hop-path-head) strong {
  margin-left: auto;
  color: var(--light);
  font: 700 1.4rem/1 var(--font-mono);
  white-space: nowrap;
}

.post-figure .is-arrive .route-time-head strong,
.post-figure .is-best .hop-path-head strong {
  color: var(--aqua);
}

.post-figure .route-time-bar {
  display: flex;
  gap: 3px;
  width: var(--share);
  height: var(--figure-bar);
  margin-top: 12px;
}

.route-time-segment {
  flex: var(--ms) 1 0;
  min-width: 4px;
  border-radius: 4px;
  background: var(--segment);
}

.route-time-row .is-path {
  --segment: var(--figure-path);
}

.route-time-row .is-queue {
  --segment: var(--figure-queue);
}

.route-time-row.is-arrive .is-path {
  --segment: var(--figure-arrive);
}

.route-time-row .is-server {
  --segment: var(--light);
  box-shadow: var(--aqua-glow);
}

.post-figure .route-time-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 10px;
  color: var(--gray);
  font-size: var(--text-meta);
  line-height: 1.5;
}

.post-figure .route-time-legend li {
  margin: 0;
}

.route-time-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 3px;
  background: var(--segment);
}

.route-time-legend span {
  color: var(--contrast);
  white-space: nowrap;
}

/* Paths as a line of network stops, as long as their ping (visuals/hops). */
.post-figure .hop-paths {
  display: grid;
  gap: 28px;
}

.post-figure .hop-paths li + li,
.post-figure .hop-path > * + * {
  margin-top: 0;
}

.post-figure .hop-path-head em {
  padding: 2px 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  color: var(--gray);
  font-size: var(--text-meta);
  font-style: normal;
  white-space: nowrap;
}

.post-figure .is-best .hop-path-head em {
  border-color: transparent;
  background: var(--aqua-soft);
  color: var(--aqua);
}

.post-figure .hop-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--share);
  min-width: calc(var(--stops) * var(--figure-stop-space));
  height: 20px;
  margin-top: 14px;
}

.hop-track::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 2px;
  border-radius: 1px;
  background: var(--figure-path);
  transform: translateY(-50%);
}

.is-best .hop-track::before {
  background: linear-gradient(90deg, var(--aqua), var(--light), var(--brand));
  box-shadow: 0 0 10px rgba(254, 45, 118, 0.3);
}

.hop-track i {
  position: relative;
  width: var(--figure-dot);
  height: var(--figure-dot);
  border: 2px solid var(--figure-stop);
  border-radius: 50%;
  background: var(--light);
  box-sizing: content-box;
}

.hop-track .is-you {
  background: var(--aqua);
}

.hop-track .is-server {
  background: var(--brand);
  box-shadow: var(--brand-glow);
}

/* Game servers with their ping without and with Arrive, like the app's server list (visuals/server-pings). */
.post-figure .server-pings {
  display: grid;
  gap: 8px;
}

.post-figure .server-pings li + li {
  margin-top: 0;
}

.post-figure .server-ping {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xs);
  background: var(--fill-subtle);
}

.post-figure .server-ping > * + * {
  margin-top: 0;
}

.server-ping p:first-child {
  display: grid;
  line-height: 1.4;
}

.server-ping p:first-child strong {
  color: var(--light);
}

.server-ping p:first-child span {
  color: var(--gray);
  font-size: var(--text-meta);
}

.post-figure .server-ping-ms {
  color: var(--gray);
  font: 700 var(--text-small) var(--font-mono);
  white-space: nowrap;
}

.server-ping-ms b {
  color: var(--aqua);
  font-size: 1.4rem;
}

.post-figure .server-ping:not(.is-better) .server-ping-ms {
  font: 400 var(--text-meta) var(--font-body);
}

/* A side-by-side comparison, with Arrive's column tinted aqua (visuals/compare). */
.post-figure .compare {
  display: grid;
  font-size: var(--text-small);
  line-height: 1.45;
}

.compare-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
}

.compare-head {
  padding-top: 0;
  border-top: 0;
  color: var(--light);
  font: 700 1.1rem/1.3 var(--font-display);
}

.compare-label {
  color: var(--light);
  font-weight: 700;
}

.compare-cell {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text);
}

.compare-head .is-arrive {
  color: var(--aqua);
}

/* The column name repeats inside each cell for phones, where the header row is hidden. */
.compare-cell b {
  display: none;
}

.compare-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--fill-hover);
}

.compare-mark svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compare-mark.is-yes {
  background: var(--aqua-soft);
  color: var(--aqua);
}

.compare-mark.is-no::before,
.compare-mark.is-maybe::before {
  content: '';
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: var(--gray);
}

.compare-mark.is-maybe::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

/* Where each kind of traffic goes: a tunnel, Arrive's route or the normal path (visuals/traffic-split). */
/* Side by side while each panel keeps room for its lines, stacked below that. */
.post-figure .traffic-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: 16px;
}

.traffic-lane {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--fill-subtle);
}

.post-figure .traffic-title {
  color: var(--light);
  font: 700 1.1rem/1.3 var(--font-display);
}

.post-figure .traffic-flows {
  display: grid;
  gap: 10px;
}

.post-figure .traffic-flows li,
.post-figure .traffic-flow > * {
  margin: 0;
}

.traffic-flow {
  --line: var(--figure-path);
  --line-height: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-meta);
  line-height: 1.3;
}

.traffic-flow i {
  flex: 1 1 24px;
  height: var(--line-height);
  border-radius: var(--radius-pill);
  background: var(--line);
}

.traffic-flow.is-tunnel {
  --line: repeating-linear-gradient(90deg, var(--gray) 0 6px, transparent 6px 10px);
  --line-height: 6px;
}

.traffic-flow.is-tunnel i {
  outline: 1px solid var(--glass-border);
  outline-offset: 2px;
}

.traffic-flow.is-arrive {
  --line: linear-gradient(90deg, var(--aqua), var(--light));
}

.traffic-flow.is-arrive i {
  box-shadow: var(--aqua-glow);
}

.traffic-from,
.traffic-to {
  flex: none;
  padding: 3px 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  color: var(--contrast);
  white-space: nowrap;
}

.traffic-flow.is-arrive .traffic-to {
  border-color: transparent;
  background: var(--aqua-soft);
  color: var(--aqua);
}

.traffic-flow.is-normal .traffic-to {
  border-color: transparent;
  color: var(--gray);
}

.post-figure .traffic-note {
  color: var(--gray);
  font-size: var(--text-meta);
  line-height: 1.5;
}

/* Software layers, each handing off to the one below (visuals/stack). */
.post-figure .layer-stack {
  --layer-gap: 22px;
  display: grid;
  gap: var(--layer-gap);
}

.post-figure .layer-stack li,
.post-figure .layer > * {
  margin: 0;
}

.layer {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xs);
  background: var(--fill-subtle);
  line-height: 1.45;
}

.layer.is-arrive {
  border-color: rgba(63, 208, 200, 0.35);
  background: var(--aqua-soft);
}

.layer strong {
  color: var(--light);
}

.layer.is-arrive strong {
  color: var(--aqua);
}

.layer span {
  color: var(--gray);
  font-size: var(--text-meta);
}

/* The hand-off line between two layers. */
.layer:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 28px;
  width: 2px;
  height: var(--layer-gap);
  background: linear-gradient(180deg, var(--aqua), var(--figure-path));
}

/* No room beside the graphic for the game's tile, so it gets its own strip at the top. */
@media (max-width: 760px) {
  .post-figure.has-game {
    padding-top: 76px;
  }
}

@media (max-width: 560px) {
  .ping-scale-zones {
    grid-template-columns: repeat(2, 1fr);
  }

  .prose h1 {
    font-size: 1.5rem;
  }

  .post-figure {
    padding: 20px 16px;
  }

  .post-figure {
    --figure-dot: 10px;
    --figure-stop-space: 22px;
  }

  /* The label wraps beside its total; a hop path's tag drops to the next line instead. */
  .post-figure :is(.route-time-head, .hop-path-head) {
    font-size: var(--text-meta);
  }

  .post-figure .hop-path-head {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .post-figure .hop-path-head em {
    order: 1;
  }

  .post-figure :is(.route-time-head, .hop-path-head) strong {
    font-size: 1.2rem;
  }

  .post-figure .server-ping {
    padding: 12px 14px;
  }

  .server-ping-ms b {
    font-size: 1.2rem;
  }

  /* A comparison row on a phone: its label on top, then one line per column, named inline. */
  .compare-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .compare-head {
    display: none;
  }

  .compare-row:nth-child(2) {
    padding-top: 0;
    border-top: 0;
  }

  .compare-cell b {
    display: inline;
    color: var(--light);
  }

  .compare-cell.is-arrive b {
    color: var(--aqua);
  }

  .traffic-lane {
    padding: 14px;
  }

  .prose .game-guides {
    padding: 16px;
  }

  .prose .game-guides .game-tiles {
    gap: 8px 12px;
  }

  .prose .game-guides .game-tile {
    --tile-size: 44px;
    --tile-icon: 24px;
  }

  .prose h2 {
    font-size: 1.1875rem;
  }

  .prose h3 {
    font-size: 1.0625rem;
  }

  /* On a phone the number sits above its step, so the step's text and screenshots keep the full width. */
  .prose-steps ol > li {
    padding-left: 0;
  }

  .prose-steps ol > li::before {
    position: static;
    margin-bottom: 0.75rem;
  }

  .prose .facts {
    grid-template-columns: 1fr;
  }

  .prose .facts dt {
    padding-bottom: 0;
    border-bottom: 0;
  }
}
