@font-face {
  font-family: "Instrument Sans";
  src: local("Instrument Sans"), url("fonts/InstrumentSans-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --ground: rgb(21, 21, 21);
  --text: rgb(236, 236, 234);
  --muted: rgb(138, 138, 134);
  --faint: rgb(96, 96, 93);
  --line: rgba(255, 255, 255, 0.075);
  --control: rgba(255, 255, 255, 0.06);
  --control-on: rgba(255, 255, 255, 0.11);
  --control-line: rgba(255, 255, 255, 0.1);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-on: rgba(255, 255, 255, 0.07);
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html { background: var(--ground); color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: "Instrument Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Top bar */
header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 0;
}
.wordmark { font-size: 18px; font-weight: 600; letter-spacing: -0.005em; }
.pages { display: flex; gap: 2px; margin-right: auto; }
.pages a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  transition: color 140ms ease, background 140ms ease;
}
.pages a:hover { color: var(--text); background: var(--control); }
.pages a[aria-current="page"] { color: var(--text); }
.actions { display: flex; gap: 8px; }

/* Controls: quiet filled shapes, one radius, no colour */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius);
  background: var(--control);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 140ms ease, transform 90ms ease;
}
.button:hover { background: var(--control-on); }
.button:active { transform: scale(0.975); }
.button.primary { background: var(--text); color: var(--ground); }
.button.primary:hover { background: #fff; }
.button.unavailable, .button.unavailable:hover {
  position: relative;
  background: rgba(236, 236, 234, 0.4);
  color: rgba(21, 21, 21, 0.7);
  cursor: not-allowed;
}
.button.unavailable:active { transform: none; }
.button.unavailable::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 6px 10px;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: rgb(31, 31, 31);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease, visibility 0s 140ms;
}
.button.unavailable:hover::after, .button.unavailable:focus-visible::after { opacity: 1; visibility: visible; transition-delay: 0s; }
.button .price { opacity: 0.55; font-variant-numeric: tabular-nums; }
.button:focus-visible, .segments label:focus-within, .info:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Segmented control with a thumb that glides to the chosen option */
.segments {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--control);
}
.segments .thumb {
  position: absolute;
  top: 3px;
  left: 0;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--control-line);
  background: var(--control-on);
  transition: transform 260ms var(--ease), width 260ms var(--ease);
  pointer-events: none;
}
.segments input { position: absolute; opacity: 0; pointer-events: none; }
.segments label {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 180ms ease;
}
.segments label:hover { color: var(--text); }
.segments input:checked + label { color: var(--text); }
.segments label:active { transform: scale(0.98); }

/* Opening */
.opening { padding: clamp(44px, 7vh, 76px) 0 clamp(40px, 6vh, 60px); }
h1 {
  margin: 0;
  max-width: 17ch;
  font-size: clamp(34px, 5vw, 50px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.opening p { margin: 20px 0 0; max-width: 50ch; color: var(--muted); font-size: 18px; text-wrap: pretty; }

/* Comparison */
figure { margin: 0; }
.note { margin: 0 0 14px; max-width: 78ch; color: var(--faint); font-size: 14px; text-wrap: pretty; }
.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(25, 25, 25);
  cursor: zoom-in;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.frame:focus-visible { outline: none; }
.frame.zoomed { cursor: zoom-out; touch-action: none; }
.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
}
.layer.gliding { transition: transform 320ms var(--ease); will-change: transform; }
.layer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 0 0;
  opacity: 0;
  -webkit-user-drag: none;
}
.layer img.shown { opacity: 1; }
.frame.native .layer img.full { image-rendering: pixelated; }
.missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 14px;
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}
.missing.shown { opacity: 1; }

figcaption {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 14px;
}
.readout { display: flex; align-items: baseline; gap: 12px; min-height: 20px; }
.zoom {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.zoom:empty { display: none; }
.hint { color: var(--faint); }
kbd {
  font: inherit;
  padding: 1px 6px;
  border: 1px solid var(--control-line);
  border-radius: 5px;
  color: var(--muted);
}

/* The comparison's controls, and the note on how the frames were made */
.tools { display: flex; align-items: center; gap: 8px; max-width: 100%; }
.tools .segments { min-width: 0; }
.info {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--control);
  color: var(--muted);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 90ms ease;
}
.info svg { fill: currentColor; }
.info:hover, .info[aria-expanded="true"] { background: var(--control-on); color: var(--text); }
.info:active { transform: scale(0.94); }
.info .exit, .expanded .info .enter { display: none; }
.expanded .info .exit { display: block; }
.locked { overflow: hidden; }
.expanded {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: rgb(0, 0, 0);
}
.expanded .frame { width: min(100%, calc((100vh - 76px) * 16 / 9)); width: min(100%, calc((100dvh - 76px) * 16 / 9)); }
.expanded figcaption { width: min(100%, calc((100vh - 76px) * 16 / 9)); width: min(100%, calc((100dvh - 76px) * 16 / 9)); }
.about {
  position: absolute;
  bottom: calc(100% - 4px);
  right: 0;
  z-index: 5;
  width: min(372px, 100%);
  padding: 18px 20px;
  border: 1px solid var(--control-line);
  border-radius: 14px;
  background: rgb(31, 31, 31);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(0.98);
  transform-origin: 100% 100%;
  transition: opacity 140ms ease, transform 200ms var(--ease), visibility 0s 200ms;
}
.about.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.about dl { margin: 0; }
.about dt { color: var(--faint); font-size: 13px; }
.about dd { margin: 3px 0 0; color: var(--text); font-size: 14.5px; line-height: 1.45; text-wrap: pretty; }
.about dd + dt { margin-top: 14px; }
.about .pair { display: flex; justify-content: space-between; gap: 16px; }
.about .pair span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Groups. Nothing is ruled off: space separates the groups, and a quiet surface holds each item. */
.group { padding-top: clamp(44px, 7vh, 68px); scroll-margin-top: 8px; }
.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 38px;
  padding-bottom: 12px;
}
.group-head h2 { margin: 0; color: var(--muted); font-size: 15px; font-weight: 500; }
.status { color: var(--faint); font-size: 15px; white-space: nowrap; }

/* Items that stand beside each other are alternatives; a single item takes the full width. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--surface);
  transition: background 160ms ease;
}
.tile:only-child { flex-direction: row; align-items: center; gap: 40px; }
.tile h3 { margin: 0; font-size: 17px; font-weight: 500; }
.tile p { margin: 4px 0 0; max-width: 56ch; color: var(--muted); font-size: 15.5px; text-wrap: pretty; }
.tile .side { flex: none; }

/* Features: a plain list on one quiet surface */
.features {
  columns: 2;
  column-gap: 32px;
  margin: 0;
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--surface);
  list-style: none;
  font-size: 16px;
}
.features li { padding: 5px 0; break-inside: avoid; }
@media (max-width: 720px) { .features { columns: 1; padding: 16px 20px; } }

/* The download tiles change with the system; the height follows */
.panels { overflow: hidden; border-radius: 14px; transition: height 280ms var(--ease); }
.panel[hidden] { display: none; }
.panel.arriving .tile { animation: arrive 320ms var(--ease) both; }
.panel.arriving .tile:nth-child(2) { animation-delay: 50ms; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: clamp(40px, 6vh, 60px);
  padding: 28px 0 56px;
  color: var(--faint);
  font-size: 14px;
}
footer nav { display: flex; gap: 22px; color: var(--muted); }
footer a { transition: color 140ms ease; }
footer a:hover { color: var(--text); }
.small { flex-basis: 100%; max-width: 78ch; }

@media (max-width: 720px) {
  .page { padding: 0 20px; }
  header { padding: 20px 0; }
  .button { height: 36px; padding: 0 13px; font-size: 14px; }
  .opening { padding: 36px 0 32px; }
  .opening p { font-size: 17px; }
  figcaption { flex-direction: column-reverse; align-items: flex-start; }
  .segments { max-width: 100%; overflow-x: auto; }
  .segments label { padding: 0 11px; font-size: 14px; }
  .tile:only-child { flex-direction: column; align-items: flex-start; gap: 18px; }
  .tile { gap: 18px; padding: 20px; }
  .hint .keys { display: none; }
}

@media (max-width: 600px) {
  header { gap: 12px; }
  header .actions .button:not(.primary) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .layer.gliding, .segments .thumb, .layer img, .missing, .button, .panels, .about, .info { transition: none; }
  .panel.arriving .tile { animation: none; }
}

/* Roadmap and version log page */
.opening.short { padding-bottom: 0; }
.opening.short h1 { font-size: clamp(30px, 4vw, 40px); }
.entry {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 8px 40px;
  padding: 10px 0 26px;
}
.entry .version { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.entry .date { margin-top: 4px; color: var(--faint); font-size: 14px; }
.entry ul { margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 15.5px; }
.entry li { padding: 2px 0; }
.entry li:first-child { color: var(--text); font-size: 17px; padding-bottom: 6px; }
@media (max-width: 720px) {
  .entry { grid-template-columns: 1fr; }
}

/* A plain crossfade between the two pages, where the browser supports it */
@view-transition { navigation: auto; }

/* Licence agreement: a contents list beside one readable column */
.legal {
  display: grid;
  grid-template-columns: 200px minmax(0, 68ch);
  gap: 40px;
  padding-top: clamp(36px, 6vh, 56px);
}
.contents {
  position: sticky;
  top: 24px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-left: -10px;
}
.contents a {
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--faint);
  font-size: 14px;
  transition: color 140ms ease, background 140ms ease;
}
.contents a:hover { color: var(--text); background: var(--control); }
.terms { font-size: 16px; line-height: 1.6; color: var(--muted); }
.terms .lead { margin: 0; color: var(--text); font-size: 17px; text-wrap: pretty; }
.terms section { padding-top: 36px; scroll-margin-top: 16px; }
.terms h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
}
.terms h2 .n { min-width: 1.4em; color: var(--faint); font-variant-numeric: tabular-nums; }
.terms p { margin: 0 0 12px; text-wrap: pretty; }
.terms ul { margin: 0 0 12px; padding: 0; list-style: none; }
.terms li { position: relative; padding: 3px 0 3px 20px; text-wrap: pretty; }
.terms li::before { content: "–"; position: absolute; left: 2px; color: var(--faint); }
.terms code { font: inherit; color: var(--text); }
.terms .blank { color: var(--text); background: var(--control-on); border-radius: 4px; padding: 0 4px; }
footer a[aria-current="page"] { color: var(--text); }
@media (max-width: 860px) {
  .legal { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .contents { display: none; }
}
.terms a { color: var(--text); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.terms a:hover { text-decoration-color: var(--text); }
