/* =====================================================================
   MediaFetches — design system + public site
   =====================================================================
   Committed dark theme. MediaFetches's identity was already dark slate
   with a sky-blue accent, and a media utility is overwhelmingly used in
   dim conditions, so this stays one deliberate look rather than a
   half-tuned pair of themes.

   Mobile-first throughout: every base rule targets a phone, and the
   media queries only ever add to it. The layout is reorganised for
   small screens, not shrunk — the primary action sits in thumb reach at
   the bottom of the viewport, not at the top of a scrolled page.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  /* Surfaces, darkest to lightest */
  --bg:            #0b1120;
  --surface:       #111c31;
  --surface-2:     #17233c;
  --surface-3:     #1e2c48;
  --border:        #24334f;
  --border-strong: #33456a;

  /* Text */
  --text:      #f1f5f9;
  --text-mid:  #b3c0d4;
  --text-dim:  #8496b0;

  /* Brand */
  --brand:       #38bdf8;
  --brand-deep:  #0284c7;
  --brand-soft:  rgba(56, 189, 248, 0.14);
  --accent:      #f43f5e;

  /* Status */
  --success:      #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning:      #fbbf24;
  --danger:       #fb7185;
  --danger-soft:  rgba(251, 113, 133, 0.13);

  /* Type scale */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --fs-xs:   0.75rem;
  --fs-sm:   0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md:   1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.375rem;
  --fs-2xl:  1.75rem;
  --fs-3xl:  2.25rem;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow:    0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 56px -16px rgba(0, 0, 0, 0.65);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Safe areas. Declared here so every component can use them whether
     or not the page is running inside a native shell; on the web they
     resolve to 0. */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);

  --header-h: 56px;
  --max-w: 1080px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The `hidden` attribute must win.
   The browser's own rule for it is `[hidden] { display: none }`, which
   loses to any class that sets `display` — and every button here does
   (`.btn { display: inline-flex }`), as does `.callout { display: flex }`.
   Without this, `el.hidden = true` silently does nothing on exactly the
   elements the UI toggles most: Download, Cancel, Share, Install. */
[hidden] { display: none !important; }

h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { max-width: 100%; display: block; }

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* One consistent, always-visible focus ring. Keyboard users need to be
   able to see where they are; :focus-visible keeps it off mouse clicks. */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Visually hidden but available to screen readers. */
.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;
}

.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: calc(var(--safe-top) + var(--sp-3));
  transform: translateY(-200%);
  background: var(--brand);
  color: #08111f;
  font-weight: 600;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: transform 0.18s var(--ease);
}
.skip-link:focus { transform: translateY(0); text-decoration: none; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: max(var(--sp-4), var(--safe-left));
  padding-inline-end: max(var(--sp-4), var(--safe-right));
}

main { flex: 1 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 17, 32, 0.88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
}
/* The dropdown panel is positioned against this bar. */
.site-header__bar {
  position: relative;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-inline-end: auto;
}
.logo:hover { text-decoration: none; }
.logo__mark { width: 26px; height: 26px; flex: none; }
.logo__text { color: var(--brand); }
.logo__text b { color: var(--accent); font-weight: 700; }

/* ---------- Navigation ----------
   One list, two presentations. Above 860px it is a row in the header
   bar; below that it collapses behind a button and drops down as a
   panel. The same markup and the same links either way — there is no
   second copy of the navigation to keep in sync, and nothing that is
   reachable on a desktop is unreachable on a phone. */
.nav-desktop { display: none; }
.nav-desktop ul { display: flex; gap: var(--sp-5); }
.nav-desktop a {
  color: var(--text-dim);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: var(--sp-2) 0;
}
.nav-desktop a:hover,
.nav-desktop a[aria-current='page'] { color: var(--brand); text-decoration: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 44px is the smallest reliably tappable target on a phone. */
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.icon-btn:hover { color: var(--brand); background: var(--surface-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-3) var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
              transform 0.08s var(--ease), opacity 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: linear-gradient(180deg, #38bdf8, #0ea5e9);
  color: #062033;
  box-shadow: 0 6px 18px -8px rgba(56, 189, 248, 0.8);
}
.btn--primary:hover:not(:disabled) { background: linear-gradient(180deg, #53c8fa, #0284c7); }

.btn--success {
  background: linear-gradient(180deg, #34d399, #10b981);
  color: #03251a;
  box-shadow: 0 6px 18px -8px rgba(52, 211, 153, 0.7);
}
.btn--success:hover:not(:disabled) { background: linear-gradient(180deg, #4ade9f, #059669); }

.btn--ghost {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }

.btn--quiet {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
  padding-inline: var(--sp-3);
}
.btn--quiet:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }

.btn--block { width: 100%; }
.btn--lg { min-height: 52px; font-size: var(--fs-md); }
.btn--sm { min-height: 38px; padding-inline: var(--sp-3); font-size: var(--fs-sm); }

/* Utilities. These exist so no element needs a style="" attribute —
   which matters because the site ships a Content-Security-Policy that
   does not allow inline styles (see server.js). */
.u-min0    { min-width: 0; flex: 1 1 auto; }
.u-mt-4    { margin-top: var(--sp-4); }
.u-mb-3    { margin-bottom: var(--sp-3); }
.u-hide    { display: none !important; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: var(--sp-6) var(--sp-5);
  text-align: center;
  overflow: hidden;
}
/* A soft brand glow behind the fold. Purely decorative, so it is
   aria-hidden and does not affect layout. */
.hero__glow {
  position: absolute;
  left: 50%;
  top: -180px;
  width: min(620px, 160%);
  height: 380px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(56, 189, 248, 0.20), transparent 72%);
  pointer-events: none;
  /* Sits behind the hero's own content. A `.hero > * { position: relative }`
     rule used to do this job and silently un-absoluted the glow, which
     then took 380px of vertical space at the top of every page. */
  z-index: -1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-mid);
  font-size: var(--fs-xs);
  font-weight: 500;
  margin-bottom: var(--sp-4);
}
.eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex: none;
}

.hero h1 {
  font-size: var(--fs-2xl);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin-bottom: var(--sp-3);
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand), #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  color: var(--text-mid);
  font-size: var(--fs-base);
  max-width: 46ch;
  margin-inline: auto;
  margin-bottom: var(--sp-5);
  text-wrap: pretty;
}

/* ---------- The link box: the one thing this page is for ---------- */
.fetch {
  max-width: 640px;
  margin-inline: auto;
  text-align: start;
}
.fetch__field {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-2);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.fetch__field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.fetch__field .lead-icon {
  flex: none;
  width: 34px;
  color: var(--text-dim);
  text-align: center;
}
.fetch__input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  /* 16px minimum, or iOS Safari zooms the whole page on focus. */
  font-size: 16px;
  padding-block: var(--sp-3);
  color: var(--text);
}
.fetch__input::placeholder { color: var(--text-dim); }
.fetch__paste {
  flex: none;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-mid);
  border-radius: var(--radius-sm);
  min-height: 36px;
  padding-inline: var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.fetch__paste:hover { color: var(--brand); border-color: var(--brand); }
.fetch__clear { display: none; }
.fetch__field.has-value .fetch__clear { display: inline-flex; }

.fetch__submit { margin-top: var(--sp-3); width: 100%; }

.fetch__hint {
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-align: center;
}

/* Platform chips under the hero */
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 38px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-mid);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--text); transform: translateY(-1px); }
.chip i { font-size: 1rem; }
.chip--yt i  { color: #ff0033; }
.chip--tt i  { color: #e2e8f0; }
.chip--ig i  { color: #e4405f; }
.chip--fb i  { color: #4a9bff; }

/* ---------- Announcement + ads ---------- */
.announcement {
  display: none;
  background: linear-gradient(90deg, var(--brand-deep), #0369a1);
  color: #fff;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: var(--sp-2) var(--sp-4);
}
.announcement.is-visible { display: block; }

.ad-slot { margin: var(--sp-5) auto; text-align: center; overflow: hidden; }
.ad-slot:empty { display: none; margin: 0; }
.platform-ad-slot {
  min-height: 90px;
  display: grid;
  place-items: center;
}
.platform-ad-slot:empty {
  display: grid;
  min-height: 90px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}

/* ---------- Platform landing pages ---------- */
.platform-hero {
  padding-top: var(--sp-4);
}
.platform-hero .breadcrumbs {
  justify-content: center;
  margin-bottom: var(--sp-5);
}
.platform-hero .hero__sub {
  max-width: 62ch;
}
.platform-content {
  max-width: 860px;
  margin-inline: auto;
  padding-block: var(--sp-5) var(--sp-7);
}
.platform-content h2 {
  letter-spacing: -0.02em;
}
.platform-answer {
  border-color: var(--brand-deep);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.09), var(--surface));
}
.platform-answer .eyebrow {
  margin-bottom: var(--sp-3);
}
.platform-answer p,
.platform-explanation p {
  color: var(--text-mid);
  line-height: 1.7;
}
.platform-answer h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--sp-3);
}
.platform-steps {
  margin-top: var(--sp-4);
}
.platform-steps li {
  min-height: 58px;
}
.platform-steps p {
  color: var(--text-mid);
  line-height: 1.55;
}
.platform-explanation {
  padding-block: var(--sp-5);
  border-top: 1px solid var(--border);
}
.platform-explanation h2,
.platform-faq h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--sp-3);
}
.platform-note {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--brand);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--fs-sm);
}
.platform-note i {
  color: var(--brand);
  margin-top: 0.2em;
}
.platform-faq {
  padding-block: var(--sp-5);
  border-top: 1px solid var(--border);
}
.platform-faq details {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-3);
}
.platform-faq details:last-of-type {
  border-bottom: 1px solid var(--border);
}
.platform-faq summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  padding-right: var(--sp-4);
}
.platform-faq summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}
.platform-faq details p {
  color: var(--text-mid);
  line-height: 1.65;
  margin-top: var(--sp-3);
  max-width: 70ch;
}
.platform-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
  list-style: none;
  margin-top: var(--sp-4);
}
.platform-links a {
  display: block;
  height: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.platform-links a:hover {
  border-color: var(--brand);
  background: var(--surface-2);
}

/* ---------- Result ---------- */
.result {
  display: none;
  margin-top: var(--sp-5);
  scroll-margin-top: calc(var(--header-h) + var(--safe-top) + var(--sp-4));
}
.result.is-visible { display: block; }

.result__head {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  margin-bottom: var(--sp-4);
}
.thumb {
  position: relative;
  flex: none;
  width: 116px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-3) center / cover no-repeat;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-dim);
}
.thumb__duration {
  position: absolute;
  right: 5px; bottom: 5px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 1px 5px;
  border-radius: 4px;
}
.result__title {
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.35;
  /* Two lines then ellipsis: a 200-character YouTube title must not
     push the download controls off the screen. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--sp-2);
  overflow-wrap: anywhere;
}
.result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.result__meta .badge {
  color: var(--brand);
  font-weight: 600;
}

/* Video / Audio segmented control */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--sp-1);
  padding: var(--sp-1);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}
.segmented button {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.segmented button[aria-selected='true'] {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Quality options — a radio group styled as rows, because a table
   cannot be made comfortable on a 360px screen. Real radio inputs
   underneath so keyboard and screen-reader behaviour is free. */
.qualities { display: grid; gap: var(--sp-2); }
.quality {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  padding: var(--sp-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.quality:hover { border-color: var(--border-strong); }
.quality input { position: absolute; opacity: 0; pointer-events: none; }
.quality__radio {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  transition: border-color 0.15s var(--ease);
}
.quality__radio::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand);
  transform: scale(0);
  transition: transform 0.15s var(--ease);
}
.quality input:checked ~ .quality__radio { border-color: var(--brand); }
.quality input:checked ~ .quality__radio::after { transform: scale(1); }
.quality:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.quality input:focus-visible ~ .quality__radio { outline: 2px solid var(--brand); outline-offset: 3px; }

.quality__body { flex: 1 1 auto; min-width: 0; }
.quality__label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  font-size: var(--fs-base);
}
.quality__note {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  margin-top: 1px;
}
.quality__size {
  flex: none;
  font-size: var(--fs-xs);
  color: var(--text-mid);
  font-variant-numeric: tabular-nums;
}
.tag {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--success-soft);
  color: var(--success);
}
.tag--hd { background: var(--brand-soft); color: var(--brand); }

.quality.is-unavailable {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
}
.quality--skeleton { min-height: 56px; border-color: transparent; }
.quality__note--empty { padding: var(--sp-3) var(--sp-1); }

/* Sticky action bar. On a phone the Download button must be reachable
   with the thumb no matter how long the quality list is. */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin: var(--sp-4) calc(var(--sp-4) * -1) calc(var(--sp-4) * -1);
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(17, 28, 49, 0), var(--surface) 28%);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------- Progress ---------- */
.progress { display: none; }
.progress.is-visible { display: block; }

.progress__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.progress__state { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.progress__pct {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.progress__track {
  position: relative;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress__fill {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand-deep), var(--brand));
  transition: width 0.3s var(--ease);
}
/* When the server genuinely cannot tell us a percentage, we sweep —
   we never invent a number. */
.progress__track.is-indeterminate .progress__fill {
  width: 35%;
  animation: sweep 1.4s ease-in-out infinite;
}
@keyframes sweep {
  0%   { left: -35%; }
  100% { left: 100%; }
}
.progress__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.progress.is-done .progress__fill { background: linear-gradient(90deg, #10b981, var(--success)); }
.progress.is-done .progress__pct { color: var(--success); }
.progress.is-error .progress__fill { background: linear-gradient(90deg, #e11d48, var(--danger)); }
.progress.is-error .progress__pct { color: var(--danger); }

.result-actions {
  display: none;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.result-actions.is-visible { display: flex; flex-wrap: wrap; }
.result-actions .btn { flex: 1 1 140px; }

/* ---------- Alerts ---------- */
.alert {
  display: none;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  border: 1px solid;
  font-size: var(--fs-sm);
  margin-top: var(--sp-4);
  text-align: start;
}
.alert.is-visible { display: flex; }
.alert i { flex: none; margin-top: 2px; font-size: 1rem; }
.alert__body { flex: 1 1 auto; min-width: 0; }
.alert__title { font-weight: 600; margin-bottom: 2px; }
/* Never colour alone: each state carries an icon and a text label too,
   so it reads correctly without colour perception. */
.alert--error   { background: var(--danger-soft); border-color: rgba(251,113,133,.4); color: #ffd9df; }
.alert--error i { color: var(--danger); }
.alert--info    { background: var(--brand-soft); border-color: rgba(56,189,248,.35); color: #d5efff; }
.alert--info i  { color: var(--brand); }
.alert--warn    { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.4); color: #ffeec2; }
.alert--warn i  { color: var(--warning); }
.alert .btn { margin-top: var(--sp-2); }

/* ---------- Sections ---------- */
.section { padding-block: var(--sp-6); }
.section__title {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
  text-align: center;
}
.section__lede {
  color: var(--text-mid);
  text-align: center;
  max-width: 52ch;
  margin: 0 auto var(--sp-5);
  font-size: var(--fs-base);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-2);
}
.resource {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 52px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-mid);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: border-color 0.15s var(--ease), transform 0.1s var(--ease), color 0.15s var(--ease);
}
.resource:hover { border-color: var(--brand); color: var(--text); transform: translateY(-2px); }
.resource__icon {
  flex: none;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}
.resource span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.steps {
  display: grid;
  gap: var(--sp-4);
  counter-reset: step;
}
.step {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}
.step__num {
  flex: none;
  counter-increment: step;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--brand);
  font-weight: 700;
  font-size: var(--fs-sm);
  display: grid;
  place-items: center;
}
.step__num::before { content: counter(step); }
.step h3 { font-size: var(--fs-base); font-weight: 600; margin-bottom: 2px; }
.step p { color: var(--text-dim); font-size: var(--fs-sm); }

/* ---------- App promo band ---------- */
.app-band {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(56, 189, 248, 0.16), transparent 60%),
    var(--surface);
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
}
.app-band h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
}
.app-band p {
  color: var(--text-mid);
  font-size: var(--fs-base);
  max-width: 42ch;
  margin: 0 auto var(--sp-4);
}
.app-band__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: 320px;
  margin-inline: auto;
}

/* ---------- /app page ---------- */
.store-grid { display: grid; gap: var(--sp-4); margin-top: var(--sp-5); }

.store-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--sp-5) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.store-card.is-primary {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), 0 20px 50px -24px rgba(56, 189, 248, 0.6);
}
.store-card__top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.store-card__glyph {
  flex: none;
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: var(--surface-3);
  color: var(--text);
}
.store-card__glyph.android { color: #3ddc84; }
.store-card__glyph.apple   { color: #f5f5f7; }
.store-card__glyph.pwa     { color: var(--brand); }
.store-card h2 { font-size: var(--fs-lg); font-weight: 700; }
.store-card__sub { color: var(--text-dim); font-size: var(--fs-sm); }
.store-card > p { color: var(--text-mid); font-size: var(--fs-sm); }

.spec-list { display: grid; gap: var(--sp-2); font-size: var(--fs-sm); }
.spec {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.spec:last-child { border-bottom: 0; }
.spec dt { color: var(--text-dim); }
.spec dd {
  margin: 0;
  font-weight: 600;
  text-align: end;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.spec dd code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-mid);
  line-height: 1.5;
}

.qr-panel {
  display: none;
  text-align: center;
  padding: var(--sp-5) var(--sp-4);
}
.qr-panel.is-visible { display: block; }
.qr-panel__frame {
  display: inline-block;
  padding: var(--sp-3);
  background: #fff;
  border-radius: var(--radius);
  line-height: 0;
}
.qr-panel__frame svg { width: 168px; height: 168px; }

.callout {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-mid);
}
.callout i { flex: none; color: var(--warning); margin-top: 3px; }
.callout strong { color: var(--text); }
.callout ol { padding-inline-start: var(--sp-5); list-style: decimal; margin-top: var(--sp-2); }
.callout ol li { margin-bottom: var(--sp-1); }
.callout p { margin-top: var(--sp-2); }
.callout > div > strong { display: block; color: var(--text); }

/* ---------- Prose (privacy / terms / 404) ---------- */
.prose { max-width: 68ch; margin-inline: auto; padding-block: var(--sp-6); }
.prose h1 { font-size: var(--fs-2xl); letter-spacing: -0.025em; margin-bottom: var(--sp-2); }
.prose .updated { color: var(--text-dim); font-size: var(--fs-sm); margin-bottom: var(--sp-6); }
.prose h2 {
  font-size: var(--fs-lg);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.prose p, .prose li { color: var(--text-mid); margin-bottom: var(--sp-3); }
.prose ul { list-style: disc; padding-inline-start: var(--sp-5); margin-bottom: var(--sp-4); }
.prose strong { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: var(--sp-5);
  padding-bottom: calc(var(--sp-5) + var(--safe-bottom));
  margin-top: var(--sp-7);
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.site-footer__grid {
  display: grid;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.site-footer h3 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mid);
  margin-bottom: var(--sp-3);
}
.site-footer li { margin-bottom: var(--sp-2); }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--brand); }
.site-footer__bar {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
}
.legal-note {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  max-width: 60ch;
  margin-bottom: var(--sp-4);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  padding-top: calc(var(--sp-4) + var(--safe-top));
  padding-bottom: calc(var(--sp-4) + var(--safe-bottom));
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
}
.modal.is-open { display: flex; }
.modal__card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 100%;
  overflow-y: auto;
}
.modal__close {
  position: absolute;
  inset-inline-end: var(--sp-2);
  inset-block-start: var(--sp-2);
}
.modal__card h2 { font-size: var(--fs-lg); margin-bottom: var(--sp-1); }
.modal__card > p { color: var(--text-dim); font-size: var(--fs-sm); margin-bottom: var(--sp-4); }

.field { margin-bottom: var(--sp-4); }
.field label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-mid);
  font-weight: 500;
  margin-bottom: var(--sp-2);
}
.field input[type='text'],
.field input[type='password'],
.field textarea,
.field select {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s var(--ease);
}
/* A textarea does not inherit the page font on its own — browsers
   default it to monospace — so the contact form and every admin
   textarea rendered in a different typeface from the inputs beside
   them. */
.field textarea, .field select { font-family: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); }

/* Fields in a row start at the same line, whatever hint text sits
   underneath one of them. */
.form-row { align-items: start; }
.field--password { position: relative; }
.field--password input { padding-inline-end: 46px; }
.field--password .icon-btn {
  position: absolute;
  inset-inline-end: 2px;
  bottom: 2px;
  width: 40px; height: 40px;
}
.checkline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-mid);
  cursor: pointer;
  min-height: 32px;
}
.checkline input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-error {
  min-height: 20px;
  color: var(--danger);
  font-size: var(--fs-xs);
  margin-top: var(--sp-2);
}
.modal__actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.modal__actions .btn { flex: 1; }

/* ---------- Toast ---------- */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sp-5) + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 400;
  display: grid;
  gap: var(--sp-2);
  width: min(420px, calc(100vw - var(--sp-6)));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.toast.is-shown { opacity: 1; transform: translateY(0); }
.toast i { flex: none; }
.toast--ok i { color: var(--success); }
.toast--err i { color: var(--danger); }

/* ---------- Skeleton loading ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Offline banner ---------- */
.net-banner {
  display: none;
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 350;
  background: var(--warning);
  color: #2b1d00;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
  padding: var(--sp-2) var(--sp-4);
  padding-bottom: calc(var(--sp-2) + var(--safe-bottom));
}
body.is-offline .net-banner { display: block; }

/* =====================================================================
   Larger screens — additive only
   ===================================================================== */
@media (min-width: 600px) {
  :root { --header-h: 64px; }
  .hero { padding-block: var(--sp-7) var(--sp-6); }
  .hero h1 { font-size: var(--fs-3xl); }
  .hero__sub { font-size: var(--fs-md); }
  .fetch__field { padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3); }
  .thumb { width: 168px; }
  .result__title { font-size: var(--fs-lg); -webkit-line-clamp: 2; line-clamp: 2; }
  .store-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .app-band { padding: var(--sp-6); }
  .app-band__actions { flex-direction: row; max-width: none; justify-content: center; }
  .app-band__actions .btn { flex: 0 1 220px; }
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; }
}

/* The menu button, and the panel it opens. Below 860px only. */
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-mid);
  font-size: var(--fs-md);
  cursor: pointer;
}
.nav-toggle:hover { color: var(--brand); border-color: var(--brand); }

/* Below the breakpoint the header is the logo and the menu button, and
   nothing else. The call-to-action next to them ("Get the app", "Back
   to downloader") is a link the panel already carries, and at 320px the
   two together overflowed the bar by a couple of pixels — which is all
   it takes to give the whole page a horizontal scrollbar. */
.site-header__bar > .btn { display: none; }
.nav-toggle[aria-expanded='true'] { color: var(--brand); border-color: var(--brand); }

.nav-desktop.is-open {
  display: block;
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: var(--surface);
  border-block: 1px solid var(--border);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  z-index: 40;
}
.nav-desktop.is-open ul {
  flex-direction: column;
  gap: 0;
  padding: var(--sp-2) max(var(--sp-4), var(--safe-left));
}
.nav-desktop.is-open li { border-bottom: 1px solid var(--border); }
.nav-desktop.is-open li:last-child { border-bottom: 0; }
.nav-desktop.is-open a {
  display: block;
  padding: var(--sp-3) 0;
  font-size: var(--fs-md);
  /* A comfortable target on a phone; 44px is the smallest size both
     platform guidelines call reliably tappable. */
  min-height: 44px;
}

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-header__bar > .btn { display: inline-flex; }
  .nav-desktop { display: block; }
  .nav-desktop.is-open {
    position: static;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .nav-desktop.is-open ul { flex-direction: row; gap: var(--sp-5); padding: 0; }
  .nav-desktop.is-open li { border: 0; }
  .nav-desktop.is-open a { padding: 0; min-height: 0; font-size: var(--fs-sm); }
  .hero { padding-block: calc(var(--sp-7) + var(--sp-4)) var(--sp-6); }
  .card { padding: var(--sp-5); }
  .result__head { gap: var(--sp-5); }
  /* On a desktop the button is right there next to the field — no need
     for the field to stack. */
  .fetch__submit { margin-top: 0; width: auto; flex: none; }
  .fetch__field { padding-inline-end: var(--sp-2); }
  .fetch__row { display: flex; gap: var(--sp-3); align-items: stretch; }
  .fetch__row .fetch__field { flex: 1 1 auto; }
  /* Sticky bottom bar is a small-screen affordance; on a desktop the
     button just sits in the flow. */
  .action-bar {
    position: static;
    margin: var(--sp-4) 0 0;
    padding: var(--sp-4) 0 0;
    background: none;
    border-radius: 0;
  }
  .action-bar .btn { max-width: 320px; }
  .qualities { grid-template-columns: repeat(2, 1fr); }
  .store-grid { grid-template-columns: repeat(3, 1fr); }
}

/* High-contrast / forced-colors: make sure the selected state survives
   when the user's OS overrides our palette. */
@media (forced-colors: active) {
  .quality:has(input:checked) { border: 2px solid Highlight; }
  .btn { border: 1px solid ButtonText; }
}


/* =====================================================================
   Blog, contact, cookie consent
   ===================================================================== */

.wrap--narrow { max-width: 780px; }

.page-head {
  padding-block: var(--sp-6) var(--sp-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}
.page-head h1 { font-size: var(--fs-3xl); letter-spacing: -0.03em; }
.lede {
  color: var(--text-mid);
  font-size: var(--fs-lg);
  margin-top: var(--sp-3);
  max-width: 62ch;
}
.prose .lede { margin-bottom: var(--sp-5); }

/* ---------- Blog index ---------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
  padding-bottom: var(--sp-7);
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.post-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.post-card__link { display: block; color: inherit; text-decoration: none; height: 100%; }
.post-card__media { aspect-ratio: 16 / 9; background: var(--surface-2); }
.post-card__media picture, .post-card__media img { width: 100%; height: 100%; display: block; }
.post-card__media img { object-fit: cover; }
.post-card__body { padding: var(--sp-4); }
.post-card__body h2 {
  font-size: var(--fs-lg);
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin-bottom: var(--sp-2);
}
.post-card__body p {
  color: var(--text-mid);
  font-size: var(--fs-sm);
  line-height: 1.6;
  margin-bottom: var(--sp-3);
}
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-dim);
  font-size: var(--fs-xs);
}
.post-card__tag {
  color: var(--brand);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.empty-note {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-dim);
}
.empty-note h2 { color: var(--text-mid); font-size: var(--fs-lg); margin-bottom: var(--sp-2); }

/* ---------- Article ---------- */

.post { padding-block: var(--sp-6) var(--sp-7); }
.post__head { margin-bottom: var(--sp-5); }
.post__tag {
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
}
.post__head h1 {
  font-size: var(--fs-3xl);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  margin-top: var(--sp-3);
}
.post__figure {
  width: 100%;
  margin-bottom: var(--sp-5);
}
.post__figure picture, .post__figure img { display: block; width: 100%; }
.post__figure img {
  height: auto;
  max-height: 620px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.post__figure figcaption {
  color: var(--text-dim);
  font-size: var(--fs-sm);
  margin-top: var(--sp-2);
  text-align: center;
}
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
}
.breadcrumbs a { color: var(--brand); }
.post__navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}
.post__navigation a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
}
.post__navigation a:last-child { text-align: right; }
.post__navigation span { color: var(--text-dim); font-size: var(--fs-xs); text-transform: uppercase; }
.post__related { margin-top: var(--sp-7); }
.post__related h2 { font-size: var(--fs-xl); margin-bottom: var(--sp-4); }

/* The article body is rendered from a restricted Markdown subset, so
   this is the complete list of elements that can appear here. */
.post__body { color: var(--text-mid); line-height: 1.75; }
.post__body > * + * { margin-top: var(--sp-4); }
.post__body h2 {
  color: var(--text);
  font-size: var(--fs-xl);
  letter-spacing: -0.02em;
  margin-top: var(--sp-6);
}
.post__body h3 { color: var(--text); font-size: var(--fs-lg); margin-top: var(--sp-5); }
/* The renderer shifts author headings down one level so the article
   title keeps the page's only h1, which is how `###` reaches h4. */
.post__body h4 { color: var(--text); font-size: var(--fs-md); margin-top: var(--sp-5); }
.post__body h5 { color: var(--text-mid); font-size: var(--fs-base); font-weight: 600; margin-top: var(--sp-4); }
.post__body h2[id], .post__body h3[id], .post__body h4[id] { scroll-margin-top: 90px; }
.post__body ul, .post__body ol { padding-inline-start: var(--sp-5); }
.post__body ul { list-style: disc; }
.post__body ol { list-style: decimal; }
.post__body li + li { margin-top: var(--sp-2); }
.post__body strong { color: var(--text); }
.post__body a { color: var(--brand); }
.post__body code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.post__body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  overflow-x: auto;
}
.post__body pre code { background: none; border: 0; padding: 0; }
.post__body blockquote {
  border-inline-start: 3px solid var(--brand);
  padding-inline-start: var(--sp-4);
  color: var(--text-dim);
  font-style: italic;
}
.post__body img { border-radius: var(--radius); border: 1px solid var(--border); }
.post__foot {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}

/* ---------- Contact ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  padding-block: var(--sp-6) var(--sp-7);
  align-items: start;
}
@media (min-width: 900px) {
  .contact-layout { grid-template-columns: 1fr 1fr; gap: var(--sp-7); }
  .contact-layout .prose { margin-inline: 0; padding-block: 0; }
}
.contact-card { padding: var(--sp-5); }
.contact-card textarea { resize: vertical; min-height: 140px; line-height: 1.6; }

.field__hint {
  color: var(--text-dim);
  font-size: var(--fs-xs);
  margin-top: var(--sp-2);
}
.field__hint.is-over { color: var(--danger); }
.field__optional { color: var(--text-dim); font-weight: 400; }
.field__error {
  color: var(--danger);
  font-size: var(--fs-xs);
  margin-top: var(--sp-2);
}
.field__error:empty { display: none; }
.field--invalid input,
.field--invalid textarea { border-color: var(--danger); }

/* The honeypot. Kept out of the layout without display:none, which some
   bots specifically check for. */
.hp-field {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-status {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
}
.form-status:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.form-status.is-ok {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}
.form-status.is-error {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- Cookie consent ---------- */

.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.4);
  padding: var(--sp-4);
  padding-bottom: max(var(--sp-4), var(--safe-bottom));
  transform: translateY(110%);
  transition: transform 0.25s var(--ease);
}
.cookie-banner.is-open { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: none; }
}

.cookie-banner__inner {
  max-width: 1120px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
@media (min-width: 760px) {
  .cookie-banner__inner { flex-direction: row; align-items: center; gap: var(--sp-5); }
}
.cookie-banner__text {
  color: var(--text-mid);
  font-size: var(--fs-sm);
  line-height: 1.6;
  flex: 1;
}
.cookie-banner__text a { color: var(--brand); }
.cookie-banner__actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}
.cookie-banner__actions .btn { flex: 1; white-space: nowrap; }
@media (min-width: 760px) {
  .cookie-banner__actions .btn { flex: 0 0 auto; }
}

/* Keeps the banner from covering the last line of a page. */
.has-cookie-banner .site-footer { padding-bottom: 140px; }

/* Print: nobody prints this, but a blank page would be worse. */
@media print {
  .site-header, .action-bar, .app-band, .site-footer, .toast-host,
  .cookie-banner, .announcement { display: none !important; }
  body { background: #fff; color: #000; }
}
