/* Matt Download Manager — self-contained stylesheet.
   No external fonts, no CDN, no trackers. Light and dark themes.
   Accessibility: 4.5:1+ text contrast, visible focus rings, skip link,
   reduced-motion support, responsive down to 320px. */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --bg-glow-1: rgba(22, 163, 74, 0.14);
  --bg-glow-2: rgba(37, 99, 235, 0.12);
  --surface: #ffffff;
  --surface-2: #f1f5fb;
  --surface-3: #e7eef8;
  --text: #0c1726;
  --text-muted: #43566d;
  --text-faint: #5d7189;
  --border: #d7e1ee;
  --border-strong: #b6c6da;
  --brand: #15803d;
  --brand-strong: #116932;
  --brand-soft: #dcfce7;
  --brand-ink: #ffffff;
  --accent: #1d4ed8;
  --accent-soft: #dbeafe;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --warn: #92400e;
  --warn-soft: #fef3c7;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --shadow-sm: 0 1px 2px rgba(12, 23, 38, 0.06);
  --shadow: 0 10px 30px rgba(12, 23, 38, 0.1);
  --shadow-lg: 0 24px 70px rgba(12, 23, 38, 0.16);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --container: 1120px;
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono",
    monospace;
  --header-h: 68px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080e1a;
  --bg-glow-1: rgba(52, 211, 153, 0.16);
  --bg-glow-2: rgba(59, 130, 246, 0.18);
  --surface: #0f1828;
  --surface-2: #131e31;
  --surface-3: #1a2942;
  --text: #e9f0fa;
  --text-muted: #a9b8cd;
  --text-faint: #8b9cb3;
  --border: #24344d;
  --border-strong: #35496a;
  --brand: #34d399;
  --brand-strong: #6ee7b7;
  --brand-soft: rgba(52, 211, 153, 0.14);
  --brand-ink: #04120a;
  --accent: #7aa7ff;
  --accent-soft: rgba(122, 167, 255, 0.15);
  --danger: #fca5a5;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.13);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.6);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(60rem 30rem at 15% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(50rem 28rem at 100% 0%, var(--bg-glow-2), transparent 55%);
  background-repeat: no-repeat;
  min-height: 100vh;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

img {
  display: block;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 750;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
  max-width: 68ch;
}

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

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

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

::selection {
  background: var(--brand-soft);
  color: var(--text);
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}

ul,
ol {
  padding-left: 1.3em;
}

li + li {
  margin-top: 0.3em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* --------------------------------------------------------------- layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

main {
  display: block;
  padding-bottom: 4rem;
}

section {
  padding-block: clamp(2.2rem, 5vw, 3.6rem);
}

section.tight {
  padding-block: 1.4rem;
}

.section-head {
  max-width: 62ch;
  margin-bottom: 2rem;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.06rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.9rem;
}

.eyebrow::before {
  content: "";
  width: 1.8rem;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.875rem;
}

.center {
  text-align: center;
}

.center p {
  margin-inline: auto;
}

.stack > * + * {
  margin-top: 1rem;
}

/* --------------------------------------------------------------- header */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .site-header {
    background: var(--bg);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 750;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.brand-text strong {
  color: var(--brand);
  font-weight: 850;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a:not(.btn) {
  display: inline-block;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:not(.btn):hover {
  background: var(--surface-2);
  color: var(--text);
}

.site-nav a.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.nav-toggle {
  display: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.4rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle-label {
  display: none;
}

.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

.nav-cta {
  margin-left: 0.5rem;
}

@media (max-width: 1060px) {
  .theme-toggle-label {
    display: inline;
  }
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }

  .nav-toggle svg {
    width: 22px;
    height: 22px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem clamp(1rem, 4vw, 2rem) 1.4rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
  }

  .site-nav a:not(.btn) {
    display: block;
    padding: 0.7rem 0.8rem;
  }

  .theme-toggle {
    align-self: flex-start;
    margin: 0.4rem 0.6rem 0;
  }

  .nav-cta {
    margin: 0.4rem 0.6rem 0;
    justify-content: center;
  }
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease,
    border-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: none;
}

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

.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
  box-shadow: 0 8px 22px rgba(22, 163, 74, 0.28);
}

.btn-primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding-inline: 0.5rem;
}

.btn-sm {
  padding: 0.55rem 0.95rem;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 1rem 1.7rem;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn[aria-disabled="true"],
.btn-disabled {
  background: var(--surface-2);
  color: var(--text-faint);
  border-color: var(--border);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

/* --------------------------------------------------------------- hero */
.hero {
  padding-block: clamp(2.4rem, 6vw, 4.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero h1 {
  margin-bottom: 0.35rem;
}

.hero .lead {
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  color: var(--text-muted);
  max-width: 56ch;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.3rem 0 1.5rem;
  list-style: none;
  padding: 0;
}

.hero-badges li {
  margin: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.pill svg {
  width: 14px;
  height: 14px;
}

.hero-media {
  position: relative;
}

.hero-media img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}

.hero-appicon {
  position: absolute;
  right: -14px;
  bottom: -22px;
  width: clamp(76px, 12vw, 112px);
  height: auto;
  border-radius: 24px;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.28));
}

.hero-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* --------------------------------------------------------------- grids/cards */
.grid {
  display: grid;
  gap: 1.1rem;
}

.grid > *,
.hero-grid > *,
.footer-grid > * {
  min-width: 0;
}

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

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.15rem, 2.4vw, 1.6rem);
  box-shadow: var(--shadow-sm);
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-muted {
  background: var(--surface-2);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 0.9rem;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.feature-icon svg {
  width: 23px;
  height: 23px;
}

.card-link {
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.card-link::after {
  content: "→";
  transition: transform 120ms ease;
}

.card-link:hover::after {
  transform: translateX(3px);
}

/* --------------------------------------------------------------- callouts */
.callout {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 1.05rem 1.25rem;
  margin: 1.4rem 0;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 750;
  margin-bottom: 0.35rem;
}

.callout-title svg {
  width: 19px;
  height: 19px;
  flex: none;
}

.callout-info {
  border-left-color: var(--accent);
}

.callout-ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

.callout-warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.callout-danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

[data-theme="dark"] .callout-ok,
[data-theme="dark"] .callout-warn,
[data-theme="dark"] .callout-danger {
  background: var(--surface);
}

/* --------------------------------------------------------------- prose */
.prose {
  max-width: 75ch;
}

.prose h2 {
  margin-top: 2.2rem;
}

.prose h3 {
  margin-top: 1.6rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.2rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose table {
  margin-bottom: 1.4rem;
}

/* --------------------------------------------------------------- tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 40rem;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td code {
  white-space: nowrap;
}

.sha-cell code {
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

/* --------------------------------------------------------------- download cards */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.1rem;
  margin: 2rem 0;
}

.dl-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.dl-card.recommended {
  border-color: var(--brand);
  box-shadow: 0 12px 30px var(--bg-glow-1);
}

.dl-card .tag {
  position: absolute;
  top: -0.7rem;
  left: 1.2rem;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

.dl-card h3 {
  margin: 0;
}

.dl-card .dl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.dl-card .dl-btn {
  margin-top: auto;
}

.dl-card .dl-sha {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
  margin: 0;
}

/* --------------------------------------------------------------- pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.2rem;
  align-items: stretch;
  margin-top: 2rem;
}

.price-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.price-card.featured {
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.price-card .badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
}

.price-card h3 {
  font-size: 1.05rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.price {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.price-note {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4rem;
  display: grid;
  gap: 0.55rem;
}

.price-card li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.94rem;
  margin: 0;
  color: var(--text-muted);
}

.price-card li svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--brand);
  margin-top: 0.2rem;
}

.price-card .btn {
  margin-top: auto;
}

.price-card .fineprint {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin: 0.8rem 0 0;
  text-align: center;
}

/* --------------------------------------------------------------- timeline (changelog) */
.timeline {
  display: grid;
  gap: 1.4rem;
  margin-top: 2rem;
}

.release {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow-sm);
}

.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.9rem;
  margin-bottom: 0.6rem;
}

.release-head h2 {
  font-size: 1.35rem;
  margin: 0;
}

.release-date {
  font-size: 0.85rem;
  color: var(--text-faint);
  font-weight: 600;
}

.release .badge {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.release ul {
  margin-bottom: 0;
}

/* --------------------------------------------------------------- forms / details */
details.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 1.2rem;
  margin-bottom: 0.7rem;
  box-shadow: var(--shadow-sm);
}

details.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 1rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

details.faq summary::-webkit-details-marker {
  display: none;
}

details.faq summary::after {
  content: "+";
  font-size: 1.35rem;
  color: var(--text-muted);
  line-height: 1;
}

details.faq[open] summary::after {
  content: "−";
}

details.faq .faq-body {
  padding-bottom: 1rem;
  color: var(--text-muted);
}

details.faq .faq-body > :last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------- screenshots */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.1rem;
}

.shot {
  margin: 0;
}

.shot img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface-2);
}

.shot figcaption {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-top: 0.6rem;
  text-align: center;
}

/* --------------------------------------------------------------- copy blocks */
.key-block {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}

.key-block code {
  background: none;
  border: 0;
  padding: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.copy-btn:hover {
  color: var(--text);
}

/* --------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 2.6rem 2rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
}

.footer-grid h2 {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.7rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.footer-grid li {
  margin: 0;
}

.footer-grid a:not(.brand) {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.93rem;
}

.footer-grid a:not(.brand):hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------- utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nowrap {
  white-space: nowrap;
}

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 2rem 0;
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-media {
    order: -1;
    max-width: 34rem;
    min-width: 0;
  }

  .hero-media img {
    width: 100%;
    height: auto;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
  }

  .btn-row .btn {
    width: 100%;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .theme-toggle,
  .nav-toggle {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
