/* texteditor.pro - Text Editor Pro & Firebird Editor Pro */

/* ===== Tokens ===== */

/* The light theme. The dark theme below replaces the values that differ. */
:root {
  --bg: #f5f7fb;
  --bg-raised: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --surface-3: #e7ebf3;
  --border: #dde3ee;
  --border-strong: #c3ccdc;
  --text: #0f1522;
  --text-soft: #2b3445;
  --muted: #566176;
  --dim: #7b8598;
  --grid-line: rgba(40, 60, 110, 0.07);
  --shadow: 0 24px 60px -24px rgba(30, 45, 80, 0.35);
  --shadow-soft: 0 10px 30px -16px rgba(30, 45, 80, 0.3);

  --blue: #2563eb;
  --blue-2: #0ea5e9;
  --blue-rgb: 37, 99, 235;
  --orange: #e2560d;
  --orange-2: #f59e0b;
  --orange-rgb: 226, 86, 13;
  --green: #0f9d63;
  --red: #d63c3c;
  --yellow: #b7791f;
  --violet: #7c3aed;
  --accent-ink: #ffffff;

  --button-primary-blend: 70%;
  --theme-sun-display: none;
  --theme-moon-display: block;

  --accent: var(--blue);
  --accent-2: var(--blue-2);
  --accent-rgb: var(--blue-rgb);

  --radius: 14px;
  --radius-small: 9px;
  --wrap: 1200px;
  --header-height: 64px;

  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;

  color-scheme: light dark;
}

/*
  The dark theme. The site follows the colour scheme of the system; data-theme is on the page only when the
  visitor has chosen the other theme with the theme button. A media query and a selector cannot share a rule,
  so the dark values are written twice: keep the two lists identical.
*/
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090b10;
    --bg-raised: #0e1118;
    --surface: #131722;
    --surface-2: #1a1f2d;
    --surface-3: #232a3b;
    --border: #222938;
    --border-strong: #323c52;
    --text: #e9edf5;
    --text-soft: #c3cbda;
    --muted: #93a0b6;
    --dim: #6c788f;
    --grid-line: rgba(140, 160, 200, 0.07);
    --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
    --shadow-soft: 0 10px 30px -14px rgba(0, 0, 0, 0.6);

    --blue: #4f8cff;
    --blue-2: #7fd0ff;
    --blue-rgb: 79, 140, 255;
    --orange: #ff8438;
    --orange-2: #ffc24d;
    --orange-rgb: 255, 132, 56;
    --green: #3fcf8e;
    --red: #ff6b6b;
    --yellow: #f2c14e;
    --violet: #a78bfa;
    --accent-ink: #06101f;

    --button-primary-blend: 0%;
    --theme-sun-display: block;
    --theme-moon-display: none;
  }
}

:root[data-theme="dark"] {
  --bg: #090b10;
  --bg-raised: #0e1118;
  --surface: #131722;
  --surface-2: #1a1f2d;
  --surface-3: #232a3b;
  --border: #222938;
  --border-strong: #323c52;
  --text: #e9edf5;
  --text-soft: #c3cbda;
  --muted: #93a0b6;
  --dim: #6c788f;
  --grid-line: rgba(140, 160, 200, 0.07);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-soft: 0 10px 30px -14px rgba(0, 0, 0, 0.6);

  --blue: #4f8cff;
  --blue-2: #7fd0ff;
  --blue-rgb: 79, 140, 255;
  --orange: #ff8438;
  --orange-2: #ffc24d;
  --orange-rgb: 255, 132, 56;
  --green: #3fcf8e;
  --red: #ff6b6b;
  --yellow: #f2c14e;
  --violet: #a78bfa;
  --accent-ink: #06101f;

  --button-primary-blend: 0%;
  --theme-sun-display: block;
  --theme-moon-display: none;

  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

.tep {
  --accent: var(--blue);
  --accent-2: var(--blue-2);
  --accent-rgb: var(--blue-rgb);
}

.fep {
  --accent: var(--orange);
  --accent-2: var(--orange-2);
  --accent-rgb: var(--orange-rgb);
}

/* ===== Base ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-height) + 72px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

button {
  font: inherit;
  color: inherit;
}

code,
kbd,
pre {
  font-family: var(--mono);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: rgba(var(--accent-rgb), 0.35);
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 48px);
  margin: 0 auto;
  padding: 0 24px;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: -0.25em;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ===== Header ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: color-mix(in oklab,var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background-color 0.2s;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand b {
  color: var(--blue);
  font-weight: 600;
}

.brand img {
  display: block;
}

/*
  On a narrow page the navigation is a popover that the menu button opens. On a wide page it is part of the
  header: it is shown whether the popover is open or not, without the frame browsers give to a popover.
*/
.site-nav {
  position: static;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto 0 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  overflow: visible;
}

.site-nav a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.90625rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.site-nav .site-nav-donate {
  display: none;
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.icon-button:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
  text-decoration: none;
}

.icon-button .icon {
  width: 20px;
  height: 20px;
  vertical-align: 0;
}

/* The theme button shows the theme it switches to; the theme tokens tell which one that is. */
.theme-sun {
  display: var(--theme-sun-display);
}

.theme-moon {
  display: var(--theme-moon-display);
}

.nav-toggle,
.nav-close {
  display: none;
}

/* ===== Buttons ===== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background-color 0.15s, border-color 0.15s, filter 0.15s;
}

.button:hover {
  text-decoration: none;
  background: var(--surface-3);
  border-color: var(--dim);
}

@media (prefers-reduced-motion: no-preference) {
  .button:active {
    transform: translateY(1px);
  }
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 10px 28px -10px rgba(var(--accent-rgb), 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.button-primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  filter: brightness(1.08);
  box-shadow: 0 16px 36px -10px rgba(var(--accent-rgb), 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

@media (prefers-reduced-motion: no-preference) {
  .button-primary:hover {
    transform: translateY(-1px);
  }
}

/* The theme tokens tell how far the end of the gradient is blended towards the accent colour. */
@supports (color: color-mix(in oklab,red, blue)) {
  .button-primary,
  .button-primary:hover {
    background: linear-gradient(135deg, var(--accent), color-mix(in oklab,var(--accent) var(--button-primary-blend), var(--accent-2)));
  }
}

.button-ghost {
  background: transparent;
  border-color: var(--border-strong);
}

.button-small {
  padding: 8px 13px;
  font-size: 0.875rem;
  border-radius: 9px;
  gap: 7px;
}

.button-small .icon {
  width: 16px;
  height: 16px;
}

.site-donate .icon {
  color: var(--red);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.text-link .icon {
  width: 17px;
  height: 17px;
  transition: transform 0.15s;
}

@media (prefers-reduced-motion: no-preference) {
  .text-link:hover .icon {
    transform: translateX(3px);
  }
}

/* ===== Download widget ===== */

.download {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.download-archs {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raised);
}

.download-archs label {
  padding: 5px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.84375rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s, background-color 0.15s;
}

.download-archs label:hover {
  color: var(--text);
}

.download-radio[value="x64"]:checked ~ .download-archs label[data-arch="x64"],
.download-radio[value="x86"]:checked ~ .download-archs label[data-arch="x86"],
.download-radio[value="arm64"]:checked ~ .download-archs label[data-arch="arm64"] {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.download-radio[value="x64"]:focus-visible ~ .download-archs label[data-arch="x64"],
.download-radio[value="x86"]:focus-visible ~ .download-archs label[data-arch="x86"],
.download-radio[value="arm64"]:focus-visible ~ .download-archs label[data-arch="arm64"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.download-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.download-radio[value="x64"]:checked ~ .download-panel[data-arch="x64"],
.download-radio[value="x86"]:checked ~ .download-panel[data-arch="x86"],
.download-radio[value="arm64"]:checked ~ .download-panel[data-arch="arm64"] {
  display: flex;
}

.button-download {
  justify-content: flex-start;
  gap: 14px;
  padding: 13px 20px;
  border-radius: 12px;
  text-align: left;
}

.button-download .icon {
  width: 26px;
  height: 26px;
}

.button-download span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.button-download strong {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.button-download small {
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.82;
}

.download-formats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
}

.download-formats span {
  margin-right: 4px;
  color: var(--dim);
}

.download-formats a {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text-soft);
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.download-formats a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.download-formats small {
  color: var(--muted);
  font-weight: 500;
}

.download-missing {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84375rem;
}

.release-version {
  padding: 3px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78125rem;
  font-weight: 600;
}

.release-version:hover {
  text-decoration: none;
  background: rgba(var(--accent-rgb), 0.2);
}

/* ===== Hero (home) ===== */

.hero {
  position: relative;
  padding: 44px 0 56px;
  isolation: isolate;
}

.hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: calc(var(--header-height) * -1) 0 0;
  z-index: -2;
  background:
    radial-gradient(60% 55% at 18% 0%, rgba(var(--blue-rgb), 0.2), transparent 70%),
    radial-gradient(55% 50% at 88% 8%, rgba(var(--orange-rgb), 0.15), transparent 70%);
  pointer-events: none;
}

.hero::after,
.page-hero::after {
  content: "";
  position: absolute;
  inset: calc(var(--header-height) * -1) 0 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 0%, #000 30%, transparent 78%);
  pointer-events: none;
}

.hero-head {
  margin: 0 auto 34px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in oklab,var(--surface) 70%, transparent);
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 600;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in oklab,var(--green) 22%, transparent);
}

.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(100deg, var(--blue-2), var(--blue) 45%, var(--orange) 78%, var(--orange-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.name-tep {
  color: var(--blue);
}

.name-fep {
  color: var(--orange);
}

/* Each sentence of the lead is a line of its own; a sentence wraps only when the window is too narrow for it. */
.hero-lead span {
  display: block;
}

.hero-lead {
  max-width: 660px;
  text-wrap: balance;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.product-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

/* The cards share the rows of the grid (subgrid), so the version line, the download button and the links of
   both cards stay on the same level even when one description takes more lines than the other. */
.product-card {
  position: relative;
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 18px;
  align-content: start;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.09), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
}

.product-card-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.product-card-head img {
  width: 60px;
  height: 60px;
  flex: none;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}

.product-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

.product-card h2 a {
  color: inherit;
}

.product-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.product-card-foot {
  display: flex;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  align-content: flex-start;
  gap: 10px 18px;
  font-size: 0.90625rem;
}

.product-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.hero-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 26px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.875rem;
}

.hero-note li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-note .icon {
  width: 17px;
  height: 17px;
  color: var(--green);
}

/* ===== Sections ===== */

.section {
  padding: 84px 0;
}

.section-tight {
  padding: 56px 0;
}

.section-alt {
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 760px;
  margin-bottom: 40px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.kicker {
  display: inline-block;
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

/* Stats */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
}

.stat {
  padding: 22px 24px;
  background: var(--surface);
}

.stat strong {
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat span {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Showcase (home) */

.showcase {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 56px;
}

.showcase.reverse > :first-child {
  order: 2;
}

.showcase-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.showcase-title img {
  width: 48px;
  height: 48px;
}

.showcase h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.showcase-lead {
  color: var(--muted);
  font-size: 1.06rem;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 22px 0 26px;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  gap: 12px;
  color: var(--text-soft);
}

.check-list .icon {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  padding: 3px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
}

.check-list strong {
  color: var(--text);
}

.showcase-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

/* Screenshot frame */

.shot {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.25), 0 40px 120px -40px rgba(var(--accent-rgb), 0.45);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.25s, box-shadow 0.25s;
}

button.shot {
  width: 100%;
}

.shot img {
  display: block;
  width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .shot:hover {
    transform: translateY(-3px);
  }
}

.shot-glow {
  position: relative;
}

.shot-glow::before {
  content: "";
  position: absolute;
  inset: 8% 6% -4%;
  z-index: -1;
  border-radius: 40px;
  background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.5), color-mix(in oklab,var(--accent-2) 40%, transparent));
  filter: blur(60px);
  opacity: 0.55;
}

/* ===== Feature cards ===== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: var(--shadow-soft);
}

@media (prefers-reduced-motion: no-preference) {
  .feature-card:hover {
    transform: translateY(-2px);
  }
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.feature-icon .icon {
  width: 21px;
  height: 21px;
  vertical-align: 0;
}

.feature-card h3 {
  font-size: 1.06rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.feature-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.90625rem;
  line-height: 1.55;
}

.feature-new {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-raised);
  color: var(--text-soft);
  font-size: 0.78125rem;
  font-weight: 500;
  line-height: 1.45;
}

/* ===== Product pages ===== */

.page-hero {
  position: relative;
  padding: 52px 0 64px;
  isolation: isolate;
}

.page-hero.tep::before {
  background: radial-gradient(65% 60% at 25% 0%, rgba(var(--blue-rgb), 0.24), transparent 70%);
}

.page-hero.fep::before {
  background: radial-gradient(65% 60% at 25% 0%, rgba(var(--orange-rgb), 0.2), transparent 70%);
}

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 52px;
}

.product-hero h1 {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.product-hero h1 img {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}

.product-hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.product-hero-lead {
  margin: 18px 0 22px;
  color: var(--muted);
  font-size: 1.1rem;
}

.product-hero .download {
  margin-top: 16px;
}

.product-hero .button-download {
  align-self: flex-start;
  min-width: 320px;
}

.product-hero-facts {
  margin: 18px 0 0;
  color: var(--dim);
  font-size: 0.84375rem;
}

.section-nav {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  background: color-mix(in oklab,var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-nav-track {
  position: relative;
}

.section-nav-inner {
  position: relative;
  display: flex;
  gap: 4px;
  padding-top: 9px;
  padding-bottom: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

/* Arrow buttons over the ends of the bar, shown by site.js when there is more to scroll in that direction. */
.section-nav-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 64px;
  padding: 0;
  border: none;
  color: var(--text);
  cursor: pointer;
}

.section-nav-arrow[hidden] {
  display: none;
}

.section-nav-previous {
  left: 0;
  justify-content: flex-start;
  background: linear-gradient(90deg, var(--bg) 45%, transparent);
}

.section-nav-next {
  right: 0;
  justify-content: flex-end;
  background: linear-gradient(270deg, var(--bg) 45%, transparent);
}

.section-nav-arrow .icon {
  width: 30px;
  height: 30px;
  padding: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-2);
  vertical-align: 0;
  transition: background-color 0.15s, border-color 0.15s;
}

.section-nav-arrow:hover .icon {
  border-color: var(--accent);
  background: var(--surface-3);
}

.section-nav-inner::-webkit-scrollbar {
  display: none;
}

.section-nav a {
  padding: 6px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}

.section-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.section-nav a[aria-current="true"] {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
}

.feature-group {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 48px;
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.feature-group:last-child {
  border-bottom: none;
}

.feature-group-head {
  position: sticky;
  top: calc(var(--header-height) + 76px);
  align-self: start;
}

.feature-group-head h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature-group-head p {
  margin: 12px 0 0;
  color: var(--muted);
}

.feature-group-number {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gallery-item {
  margin: 0;
}

.gallery-item .shot {
  aspect-ratio: 16 / 11;
  box-shadow: var(--shadow-soft);
}

.gallery-item .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.gallery-item figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84375rem;
}

/* Tag cloud (languages) */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-cloud li {
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.78125rem;
}

/* Spec table */

.spec {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin: 0;
}

.spec div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.spec dt {
  color: var(--muted);
  font-size: 0.875rem;
}

.spec dd {
  margin: 0;
  font-size: 0.90625rem;
}

/* Call to action */

.cta {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px 48px;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(70% 120% at 0% 0%, rgba(var(--accent-rgb), 0.18), transparent 60%),
    var(--surface);
  overflow: hidden;
}

.cta h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cta p {
  margin: 10px 0 0;
  color: var(--muted);
}

.cta .download {
  min-width: 340px;
}

.cta .release-meta {
  margin-top: 14px;
}

/* Link cards */

.link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
}

.link-card:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  .link-card:hover {
    transform: translateY(-2px);
  }
}

.link-card strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.90625rem;
}

.link-card strong .icon {
  width: 16px;
  height: 16px;
  color: var(--dim);
}

.link-card span {
  color: var(--muted);
  font-size: 0.84375rem;
  line-height: 1.5;
}

.donate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px 40px;
  padding: 34px 38px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(60% 140% at 100% 0%, color-mix(in oklab,var(--red) 16%, transparent), transparent 60%),
    var(--surface);
}

.donate h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

.donate p {
  margin: 10px 0 0;
  color: var(--muted);
}

.donate .button .icon {
  color: var(--red);
}

/* ===== Simple pages ===== */

.page-head {
  padding-top: 48px;
  padding-bottom: 30px;
}

.page-head h1 {
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-head p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.page-body {
  padding-bottom: 88px;
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.90625rem;
  font-weight: 600;
}

.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}

.tabs a[aria-current="page"] {
  background: var(--surface-3);
  color: var(--text);
}

.tabs img {
  width: 20px;
  height: 20px;
}

/* Prose (support pages, license, privacy) */

.prose {
  max-width: 820px;
  color: var(--text-soft);
  overflow-wrap: break-word;
}

.prose h1 {
  margin: 0 0 20px;
  color: var(--text);
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.prose h2 {
  margin: 44px 0 14px;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 650;
}

.prose h3 {
  margin: 32px 0 10px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 650;
}

.prose h4 {
  margin: 26px 0 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 650;
}

/* The questions of the FAQ pages are second-level headings in the size of the third level. */
.prose .question {
  margin: 32px 0 10px;
  font-size: 1.1rem;
}

.prose p,
.prose li {
  max-width: 76ch;
}

.prose ul,
.prose ol {
  padding-left: 24px;
}

.prose li {
  margin: 4px 0;
}

.prose hr {
  margin: 28px 0;
  border: none;
  border-top: 1px solid var(--border);
}

.prose code,
.prose kbd {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  font-size: 0.86em;
}

.prose pre {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.84375rem;
  line-height: 1.6;
  overflow-x: auto;
}

.prose pre code {
  padding: 0;
  border: none;
  background: none;
  font-size: inherit;
}

.prose .note,
.note {
  max-width: 76ch;
  margin: 18px 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: 8px;
  background: var(--surface);
}

.prose img.shot {
  max-width: 100%;
  margin: 12px 0 22px;
  box-shadow: var(--shadow-soft);
  cursor: default;
}

.prose img.shot:hover {
  transform: none;
}

.cols-2 {
  columns: 2;
  column-gap: 40px;
}

/* Tables */

.table-wrap {
  margin: 16px 0 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.90625rem;
}

th,
td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:hover {
  background: color-mix(in oklab,var(--surface-2) 60%, transparent);
}

.mono-first td:first-child {
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 0.84375rem;
  white-space: nowrap;
}

.mono-first td:first-child a {
  color: inherit;
}

/* Support layout */

.support-switch {
  padding-top: 20px;
}

.support-switch .tabs {
  margin-top: 0;
}

.support-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 28px;
}

.support-nav h2:not(:first-child) {
  margin-top: 22px;
}

.support {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 56px;
  padding-top: 32px;
  padding-bottom: 88px;
}

.support-nav {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.support-nav h2 {
  margin: 0 0 10px 12px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.support-nav a {
  padding: 7px 12px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  font-size: 0.90625rem;
  font-weight: 500;
}

.support-nav a:hover {
  color: var(--text);
  text-decoration: none;
  border-left-color: var(--border-strong);
}

.support-nav a[aria-current="page"] {
  border-left-color: var(--accent);
  color: var(--text);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.12), transparent);
}

/* ===== Downloads page ===== */

.downloads-product {
  margin-bottom: 64px;
}

.downloads-product > .release-meta {
  margin-bottom: 18px;
}

/* The notes and the texts under the subheadings span the same width as the package cards above and below them. */
.downloads-product .note,
.downloads-product .subhead + p {
  max-width: none;
}

.downloads-product-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-bottom: 22px;
}

.downloads-product-head img {
  width: 52px;
  height: 52px;
}

.downloads-product-head h2 {
  font-size: 1.8rem;
  font-weight: 700;
}

.downloads-product-head .release-meta {
  margin-left: auto;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.package-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.package-card.is-recommended {
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.25), 0 20px 50px -30px rgba(var(--accent-rgb), 0.8);
}

.package-card h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 650;
}

.package-card h2 small {
  display: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.package-card.is-recommended h2 small {
  display: inline-block;
}

.package-card > p {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 0.84375rem;
}

.package-card .button {
  width: 100%;
  margin-bottom: 12px;
}

.package-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.package-list li {
  border-top: 1px solid var(--border);
}

.package-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
  color: var(--text-soft);
  font-size: 0.875rem;
}

.package-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

.package-list span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.package-list .icon {
  width: 16px;
  height: 16px;
  color: var(--dim);
}

.package-list small {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

.subhead {
  margin: 44px 0 6px;
  font-size: 1.25rem;
  font-weight: 650;
}

.subhead + p {
  max-width: 760px;
  color: var(--muted);
}

.addon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.addon {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.addon .feature-icon {
  flex: none;
  margin: 0;
}

.addon h3 {
  font-size: 1rem;
  font-weight: 650;
}

.addon p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 0.84375rem;
  line-height: 1.5;
}

.addon-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.addon-files a {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text-soft);
  font-size: 0.78125rem;
  font-weight: 600;
}

.addon-files a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.addon-files small {
  margin-left: 4px;
  color: var(--dim);
  font-weight: 500;
}

/* ===== Change log ===== */

.changelog {
  max-width: 900px;
}

.release {
  position: relative;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.release-head {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
}

.release-head h2,
.release-head h3 {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.release-head time,
.release-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84375rem;
}

.release-latest {
  display: inline-block !important;
  margin-top: 10px !important;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in oklab,var(--green) 16%, transparent);
  color: var(--green) !important;
  font-family: var(--mono);
  font-size: 0.6875rem !important;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.changes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.changes li > span:last-child,
.release-note {
  min-width: 0;
  overflow-wrap: break-word;
}

.changes li {
  display: grid;
  grid-template-columns: 4.875rem minmax(0, 1fr);
  gap: 12px;
  padding: 4px 0;
  color: var(--text-soft);
  font-size: 0.90625rem;
}

.change-kind {
  align-self: start;
  margin-top: 2px;
  padding: 1px 0;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.71875rem;
  font-weight: 600;
  text-align: center;
}

.change-added .change-kind {
  background: color-mix(in oklab,var(--green) 15%, transparent);
  color: var(--green);
}

.change-fixed .change-kind {
  background: color-mix(in oklab,var(--blue) 15%, transparent);
  color: var(--blue);
}

.change-updated .change-kind {
  background: color-mix(in oklab,var(--violet) 16%, transparent);
  color: var(--violet);
}

.change-improved .change-kind,
.change-changed .change-kind {
  background: color-mix(in oklab,var(--yellow) 15%, transparent);
  color: var(--yellow);
}

.change-removed .change-kind {
  background: color-mix(in oklab,var(--red) 15%, transparent);
  color: var(--red);
}

.release-note {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--yellow);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.875rem;
}

.release-group {
  border-top: 1px solid var(--border);
}

.release-group > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.release-group > summary::-webkit-details-marker {
  display: none;
}

.release-group > summary .icon {
  color: var(--dim);
}

@media (prefers-reduced-motion: no-preference) {
  .release-group > summary .icon {
    transition: transform 0.2s;
  }
}

.release-group[open] > summary .icon {
  transform: rotate(180deg);
}

.release-group > summary small {
  margin-left: auto;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 0.84375rem;
  font-weight: 500;
}

.release-group > summary:hover {
  color: var(--accent);
}

/* ===== Footer ===== */

.site-footer {
  padding: 60px 0 30px;
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  font-size: 0.90625rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 36px;
}

.footer-about p {
  max-width: 290px;
  margin: 16px 0 0;
  color: var(--muted);
}

.footer-social {
  display: flex;
  gap: 4px;
  margin-left: -9px !important;
}

.site-footer nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer nav h2 {
  margin-bottom: 6px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer nav a {
  color: var(--text-soft);
}

.site-footer nav a:hover {
  color: var(--accent);
}

/* A name followed by links to the formats it comes in: "C++ Notebook (html, pdf)". The formats wrap as one piece. */
.footer-formats {
  color: var(--muted);
}

.footer-formats span {
  white-space: nowrap;
}

.footer-bottom {
  text-align: center;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 0.84375rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom a {
  color: var(--muted);
}

/* ===== Lightbox ===== */

/*
  The dialog is only as large as the picture and its caption. Everything around it is the backdrop, and a click
  on the backdrop closes the dialog (closedby="any"). The buttons stand on the backdrop, beside the picture.
*/
.lightbox {
  max-width: calc(100dvw - 128px);
  max-height: 100dvh;
  padding: 0;
  border: none;
  background: none;
  color: #e9edf5;
}

/* Keeps the page behind the dialog from scrolling. The backdrop scrolls nothing, but it has to be a scroll container for this. */
.lightbox:modal {
  overscroll-behavior: contain;
}

.lightbox::backdrop {
  background: rgba(5, 7, 11, 0.97);
  overflow: hidden;
  overscroll-behavior: contain;
}

.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100dvh - 140px);
}

.lightbox figcaption {
  max-width: 760px;
  padding: 0 16px;
  color: #c3cbda;
  font-size: 0.90625rem;
  text-align: center;
}

.lightbox .icon-button {
  position: fixed;
  color: #c3cbda;
}

.lightbox .icon-button:hover {
  background: #1a1f2d;
  border-color: #323c52;
  color: #ffffff;
}

.lightbox-close {
  top: 14px;
  right: 14px;
}

.lightbox-previous,
.lightbox-next {
  top: calc(50% - 19px);
}

.lightbox-previous {
  left: 13px;
}

.lightbox-next {
  right: 13px;
}

/* Set by site.js while it preselects the download packages. */
.no-transition *,
.no-transition *::before,
.no-transition *::after {
  transition: none !important;
}

/* ===== Reveal on scroll ===== */

/* A scroll-driven animation needs no script: where the browser has none, the content is simply there. */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes reveal {
      from {
        opacity: 0;
        translate: 0 18px;
      }
    }

    .reveal {
      animation: reveal auto linear backwards;
      animation-timeline: view();
      animation-range: entry;
    }
  }
}

/* ===== Responsive ===== */

@media (max-width: 68.75em) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .feature-group-head {
    position: static;
    max-width: 720px;
  }

  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-about {
    grid-column: 1 / -1;
  }

  .site-donate {
    display: none;
  }
}

@media (max-width: 61.25em) {
  .site-header-inner {
    gap: 12px;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: auto;
    max-height: calc(100dvh - var(--header-height));
    margin: 0;
    padding: 12px 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    box-shadow: var(--shadow);
    overflow-y: auto;
  }

  /* is-open is set by site.js in browsers that have no popovers. */
  :is(.site-nav:popover-open, .site-header.is-open .site-nav) {
    display: flex;
  }

  .site-nav a {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .site-nav .site-nav-donate {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .site-nav .site-nav-donate .icon {
    color: var(--red);
  }

  .site-actions {
    margin-left: auto;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .site-header:is(.is-open, :has(.site-nav:popover-open)) .nav-open {
    display: none;
  }

  .site-header:is(.is-open, :has(.site-nav:popover-open)) .nav-close {
    display: block;
  }

  .product-cards,
  .showcase,
  .product-hero,
  .cta,
  .donate {
    grid-template-columns: minmax(0, 1fr);
  }

  .showcase {
    gap: 36px;
  }

  .showcase.reverse > :first-child {
    order: 0;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .package-grid,
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 24px;
  }

  .support-nav {
    position: static;
    flex-direction: row;
    gap: 6px;
    margin: 0 -24px;
    padding: 0 24px 4px;
    overflow-x: auto;
  }

  .support-nav h2 {
    display: none;
  }

  .support-nav a {
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    white-space: nowrap;
  }

  .support-nav a[aria-current="page"] {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.12);
  }

  .section {
    padding: 64px 0;
  }

  .spec {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-hero .button-download,
  .cta .download {
    min-width: 0;
  }
}

@media (max-width: 42.5em) {
  .wrap {
    padding: 0 16px;
  }

  .hero {
    padding: 28px 0 44px;
  }

  .product-card {
    padding: 20px;
  }

  .feature-grid,
  .feature-grid.two,
  .package-grid,
  .gallery,
  .addon-grid,
  .link-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .button-download {
    width: 100%;
  }

  .product-hero .button-download {
    align-self: stretch;
  }

  .release {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .release-head {
    position: static;
  }

  .cta,
  .donate {
    padding: 26px 22px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cols-2 {
    columns: 1;
  }

  .spec div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .downloads-product-head .release-meta {
    margin-left: 0;
  }

  .lightbox {
    max-width: calc(100dvw - 88px);
  }

  .lightbox-previous {
    left: 3px;
  }

  .lightbox-next {
    right: 3px;
  }

  .support-nav {
    margin: 0 -16px;
    padding: 0 16px 4px;
  }
}

/* The architecture labels do not fit side by side on a narrow phone with their normal padding. */
@media (max-width: 25em) {
  .download-archs {
    align-self: stretch;
  }

  .download-archs label {
    flex: 1 1 auto;
    padding-right: 4px;
    padding-left: 4px;
    text-align: center;
    white-space: nowrap;
  }
}

/* ===== Touch screens ===== */

/*
  A fingertip needs a target of 44 by 44 pixels. Links and buttons that are plain text grow to that height.
  Compact controls (icon buttons, pills, chips) keep their look and get an invisible ::after that enlarges the
  area that reacts to a touch. The gaps around them are wide enough to keep those areas from overlapping.
*/
@media (pointer: coarse) {
  .brand,
  .button,
  .text-link,
  .tabs a,
  .package-list a {
    min-height: 44px;
  }

  .site-nav a,
  .support-nav a,
  .site-footer nav a,
  .product-card-links a,
  .release-meta a:not(.release-version) {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .site-footer nav {
    gap: 0;
  }

  /* The links of a format list stay in their line of text, and every line of the list is as high as a link. */
  .footer-formats {
    line-height: 44px;
  }

  .site-footer .footer-formats a {
    display: inline-flex;
  }

  .footer-social {
    gap: 6px;
  }

  .download-formats,
  .addon-files,
  .release-meta {
    row-gap: 16px;
  }

  .icon-button,
  .section-nav a,
  .download-archs label,
  .download-formats a,
  .addon-files a,
  .release-version,
  .product-card h2 a {
    position: relative;
  }

  .icon-button::after,
  .section-nav a::after,
  .download-archs label::after,
  .download-formats a::after,
  .addon-files a::after,
  .release-version::after,
  .product-card h2 a::after {
    content: "";
    position: absolute;
    inset: -9px 0;
  }

  .icon-button::after {
    inset: -4px;
  }

  .section-nav a::after {
    inset: -5px 0;
  }
}

/* ===== Contrast themes of Windows ===== */

/*
  A contrast theme replaces the colours of the page and drops shadows and gradients. The selected item of a
  navigation or a switch is marked with its background, so it gets the selection colours of the system here.
  These rules are the last ones in the file, so that no layout rule above takes the background back.
*/
@media (forced-colors: active) {
  .site-nav a[aria-current="page"],
  .tabs a[aria-current="page"],
  .support-nav a[aria-current="page"],
  .section-nav a[aria-current="true"],
  .download-radio[value="x64"]:checked ~ .download-archs label[data-arch="x64"],
  .download-radio[value="x86"]:checked ~ .download-archs label[data-arch="x86"],
  .download-radio[value="arm64"]:checked ~ .download-archs label[data-arch="arm64"] {
    background: Highlight;
    color: HighlightText;
  }
}
