/* ══════════════════════════════════════════════════════
   JackMate Docs — custom.css v2
   Apple-inspired dark design · JackMate color palette
   Fonts : Inter (UI) + JetBrains Mono (code)
   ══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Color tokens ─────────────────────────────────── */
:root {
  --jm-red:        #ef4444;
  --jm-red-dark:   #b91c1c;
  --jm-red-glow:   rgba(239, 68, 68, 0.18);
  --jm-cyan:       #22d3ee;
  --jm-violet:     #a78bfa;
  --jm-amber:      #f59e0b;
  --jm-orange:     #f97316;
  --jm-green:      #22c55e;

  --jm-bg:         #0e0e10;
  --jm-bg-card:    #16161a;
  --jm-bg-elevated:#1c1c22;
  --jm-bg-input:   #101012;

  --jm-border:     rgba(255,255,255,0.08);
  --jm-border-med: rgba(255,255,255,0.12);
  --jm-border-hi:  rgba(255,255,255,0.20);

  --jm-text:       #e2e2e6;
  --jm-text-dim:   #a1a1aa;
  --jm-muted:      #71717a;

  --jm-node-top:   #131316;
  --jm-node-bot:   #1a1a1c;

  /* Bootstrap/Quarto overrides */
  --bs-body-bg:           var(--jm-bg) !important;
  --bs-body-color:        var(--jm-text) !important;
  --bs-link-color:        var(--jm-red) !important;
  --bs-link-hover-color:  #f87171 !important;
  --bs-border-color:      var(--jm-border) !important;
  --bs-card-bg:           var(--jm-bg-card) !important;
  --bs-code-color:        var(--jm-cyan) !important;
}

/* ── Base + ambient page glow ─────────────────────── */
html, body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  background-color: var(--jm-bg-card) !important;
  color: var(--jm-text) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
}

/* Subtle red ambient glow at top of every page */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 120vw; height: 50vh;
  background: radial-gradient(ellipse 55% 35% at 50% 0%,
    rgba(239, 68, 68, 0.055) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

code, pre, .sourceCode, kbd, samp {
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
}

a {
  color: var(--jm-red);
  text-underline-offset: 3px;
  text-decoration-color: rgba(239,68,68,0.35);
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover {
  color: #f87171;
  text-decoration-color: rgba(248,113,113,0.55);
}

::selection { background: var(--jm-red-glow); color: #fff; }

.quarto-color-scheme-toggle { display: none !important; }

/* ═══════════════════════════════════════════════════
   NAVBAR — frosted glass, Apple-style
   ═══════════════════════════════════════════════════ */

.navbar {
  background: rgba(14, 14, 16, 0.40) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255,255,255,0.07) !important;
  box-shadow: none !important;
  padding-top: 0.55rem !important;
  padding-bottom: 0.55rem !important;
}

.navbar .navbar-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--jm-text) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.navbar .navbar-brand img { border-radius: 7px; width: 26px; height: 26px; }

.navbar-nav .nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--jm-text-dim) !important;
  padding: 0.3rem 0.7rem !important;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.navbar-nav .nav-link:hover {
  color: var(--jm-text) !important;
  background: rgba(255,255,255,0.06) !important;
}
.navbar-nav .nav-link.active {
  color: var(--jm-red) !important;
  background: rgba(239,68,68,0.08) !important;
}
/* Bootstrap gives every navbar .nav-link faint left/right borders (item separators) —
   drop them so no stray divider shows (e.g. between the Star pill and the GitHub icon).
   The Buy/Star pills keep their own border via the more specific :has() rules below. */
.navbar .nav-link { border-left: none !important; border-right: none !important; }

.navbar .dropdown-menu {
  background: rgba(18, 18, 24, 0.92) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid var(--jm-border-med) !important;
  border-radius: 13px !important;
  box-shadow: 0 14px 44px rgba(0,0,0,0.75), 0 1px 0 rgba(255,255,255,0.05) inset !important;
  padding: 0.4rem !important;
  min-width: 190px;
}
.navbar .dropdown-item {
  font-size: 0.875rem;
  color: var(--jm-text-dim) !important;
  border-radius: 7px;
  padding: 0.42rem 0.8rem !important;
  transition: background 0.12s, color 0.12s;
}
.navbar .dropdown-item:hover {
  background: rgba(255,255,255,0.07) !important;
  color: var(--jm-text) !important;
}

.navbar .nav-link .bi-github { color: var(--jm-muted); transition: color 0.15s; }
.navbar .nav-link:hover .bi-github { color: var(--jm-text); }

/* ── Hamburger + boutons icônes navbar (mobile) ───── */
.navbar-toggler {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  padding: 0.3rem 0.5rem !important;
  color: var(--jm-text-dim) !important;
  transition: border-color 0.15s, background 0.15s !important;
}
.navbar-toggler:hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.22) !important;
}
.navbar-toggler:focus { box-shadow: none !important; }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(226,226,230,0.85)' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
  width: 1.2em !important; height: 1.2em !important;
}

/* Navbar search as a GitHub-style pill: magnifier + "Type / to search" + a framed / keycap.
   NB: the real button is `#quarto-search .aa-DetachedSearchButton` (the old
   `.quarto-search` / `.quarto-search-button` selectors never matched it). The placeholder
   text is injected in after-body.html (Quarto ships it empty). */
/* Let the search reserve its real width instead of staying in the 40px icon slot: the
   container is a shrinkable flex item and the Algolia wrapper is width:100%, so the wider
   button overflowed to the right. Size both to content → the right nav cluster shifts left. */
#quarto-search.type-overlay { flex: 0 0 auto !important; width: auto !important; max-width: none !important; }
#quarto-search .aa-Autocomplete { display: inline-block !important; width: auto !important; }
#quarto-search .aa-DetachedSearchButton {
  display: inline-flex !important; align-items: center !important; gap: 0.5rem !important;
  padding: 0.4rem 0.7rem !important;
  border: 1px solid rgba(255,255,255,0.14) !important; border-radius: 10px !important;
  background: rgba(255,255,255,0.03) !important;
  color: var(--jm-text-dim) !important;
  font-size: 0.85rem !important; font-weight: 500 !important;
  transition: border-color 0.15s, background 0.15s, color 0.15s !important;
}
#quarto-search .aa-DetachedSearchButton:hover {
  border-color: rgba(255,255,255,0.28) !important;
  background: rgba(255,255,255,0.06) !important;
  color: var(--jm-text) !important;
}
#quarto-search .aa-DetachedSearchButtonIcon { color: inherit !important; }
#quarto-search .aa-DetachedSearchButtonIcon svg { width: 16px !important; height: 16px !important; }
#quarto-search .aa-DetachedSearchButtonPlaceholder {
  display: inline-flex !important; align-items: center !important; gap: 0.4rem !important;
  opacity: 1 !important; white-space: nowrap !important; font: inherit !important;
}
/* the / keycap inside the placeholder */
.jm-search-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.35em; height: 1.4em; padding: 0 0.3em;
  border: 1px solid rgba(255,255,255,0.30); border-radius: 5px;
  background: rgba(255,255,255,0.07);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82em; line-height: 1; color: var(--jm-text);
}
/* Roomy desktop only: below this, collapse back to the icon-only button (navbar is busy).
   Width is in CSS/logical px (retina-independent). */
@media (max-width: 1300px) {
  #quarto-search .aa-DetachedSearchButton { padding: 0.35rem 0.5rem !important; gap: 0 !important; }
  #quarto-search .aa-DetachedSearchButtonPlaceholder { display: none !important; }
}

/* ── Secondary nav — masquée complètement ────────── */
nav.quarto-secondary-nav { display: none !important; }

.quarto-title-breadcrumbs .breadcrumb,
.quarto-page-breadcrumbs .breadcrumb {
  background-image: none !important; background-color: transparent !important;
  border: none !important; text-shadow: none !important; filter: none !important;
  padding: 0 !important; margin-bottom: 0.5em !important; font-size: 0.85rem !important;
}
.quarto-title-breadcrumbs .breadcrumb-item a,
.quarto-page-breadcrumbs .breadcrumb-item a {
  color: var(--jm-text-dim) !important; text-decoration: none !important;
  font-weight: 400; transition: color 0.12s;
}
.quarto-title-breadcrumbs .breadcrumb-item a:hover,
.quarto-page-breadcrumbs .breadcrumb-item a:hover { color: var(--jm-text) !important; }
.quarto-title-breadcrumbs .breadcrumb li:last-of-type a,
.quarto-page-breadcrumbs .breadcrumb li:last-of-type a { color: var(--jm-muted) !important; }
.quarto-title-breadcrumbs .breadcrumb-item + .breadcrumb-item::before,
.quarto-page-breadcrumbs .breadcrumb-item + .breadcrumb-item::before { color: var(--jm-muted) !important; }

/* ── Page title block ─────────────────────────────── */
#title-block-header.quarto-title-block.default {
  border-bottom: 1px solid;
  border-image: linear-gradient(90deg,
    rgba(239,68,68,0.25) 0%,
    rgba(255,255,255,0.08) 28%,
    transparent 100%) 1;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
}
#title-block-header .quarto-title h1.title {
  font-size: 2.3rem; font-weight: 700; letter-spacing: -0.035em;
  color: #ffffff; margin-bottom: 0.3rem;
}
#title-block-header .description,
#title-block-header .quarto-title .description { font-size: 0.9rem; color: var(--jm-muted); margin: 0; }
/* Breathing room between a page title and its description. Bootstrap forces the
   description's margin-top to 0 at a higher specificity (id + .quarto-title-block.default
   + .description), so we match that specificity here to win the cascade. */
#title-block-header.quarto-title-block.default .description { margin-top: 0.85rem; }

/* ── Sidebar ──────────────────────────────────────── */
nav.sidebar.sidebar-navigation:not(.rollup),
div.sidebar.sidebar-navigation.rollup.quarto-sidebar-toggle-contents,
.quarto-sidebar-toggle-contents { background-color: var(--jm-bg) !important; }
#quarto-sidebar { background: transparent !important; border-right: 1px solid var(--jm-border) !important; }
.sidebar-navigation .sidebar-section > .sidebar-section-item {
  font-size: 0.69rem; font-weight: 600; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--jm-muted) !important;
  padding: 0.6rem 0.5rem 0.3rem !important;
}
.sidebar-navigation .sidebar-item .sidebar-item-text { font-size: 0.875rem; font-weight: 400; }
.sidebar-navigation .sidebar-item a {
  color: var(--jm-text-dim) !important; border-radius: 7px;
  padding: 0.3rem 0.6rem !important; text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.sidebar-navigation .sidebar-item a:hover { background: rgba(255,255,255,0.05) !important; color: var(--jm-text) !important; }

/* Page active — sidebar gauche uniquement
   La classe .active est sur le <a>, pas sur le <li> */
#quarto-sidebar a.sidebar-link.active {
  background: rgba(239,68,68,0.14) !important;
  color: var(--jm-red) !important;
  font-weight: 600 !important;
  border-left: 2px solid var(--jm-red) !important;
  padding-left: calc(0.6rem - 2px) !important;
  box-shadow: inset 3px 0 12px rgba(239,68,68,0.10);
}
#quarto-search .aa-Autocomplete input {
  background: var(--jm-bg-card) !important; border-color: var(--jm-border-med) !important;
  color: var(--jm-text) !important; border-radius: 7px; font-size: 0.85rem;
}

/* ── TOC ──────────────────────────────────────────── */
#TOC { border-left: 1px solid var(--jm-border) !important; font-size: 0.82rem; }
#TOC .active { color: var(--jm-red) !important; border-left-color: var(--jm-red) !important; }
#TOC a { color: var(--jm-muted) !important; text-decoration: none; transition: color 0.12s; }
#TOC a:hover { color: var(--jm-text) !important; }
#TOC .toc-title {
  font-size: 0.69rem; font-weight: 600; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--jm-muted) !important;
}

/* ── Colonne centrale élargie × 1.5 (desktop uniquement) ── */
/* Quarto floating : body-content était minmax(500px, calc(800px - 3em)).
   Limité à ≥ 992px où les deux sidebars sont visibles.
   En dessous, Quarto gère lui-même le layout mobile. */
@media (min-width: 992px) {
  body.floating .page-columns {
    grid-template-columns:
      [screen-start] 1.5em
      [screen-start-inset] 5fr
      [page-start] 35px
      [page-start-inset] minmax(0px, 175px)
      [body-start-outset] 35px
      [body-start] 1.5em
      [body-content-start] minmax(0, calc(1200px - 4.5em))
      [body-content-end] 1.5em
      [body-end] 50px
      [body-end-outset] minmax(0px, 175px)
      [page-end-inset] 35px
      [page-end] 5fr
      [screen-end-inset] 1.5em
      [screen-end] !important;
  }
}

/* ── Content layout ───────────────────────────────── */
#quarto-content main { background: transparent !important; }
.page-layout-full .quarto-title-banner { background: var(--jm-bg) !important; }

/* ═══════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════ */

h1 { font-weight: 700; letter-spacing: -0.035em; font-size: 2.4rem; color: #ffffff; }

h2 {
  font-weight: 600; letter-spacing: -0.025em; font-size: 1.8rem;
  margin-top: 3.4rem; margin-bottom: 1.05rem;
  color: var(--jm-text); padding-bottom: 0.55rem;
  border-bottom: 1px solid;
  border-image: linear-gradient(90deg,
    rgba(239,68,68,0.28) 0%,
    rgba(255,255,255,0.09) 28%,
    transparent 100%) 1;
  scroll-margin-top: 5rem;
}
h3 {
  font-weight: 500; font-size: 1.5rem; margin-top: 2.35rem; margin-bottom: 0.55rem;
  color: rgba(255,255,255,0.72); letter-spacing: -0.01em;
  scroll-margin-top: 5rem;
}
h4 { font-size: 0.84rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--jm-muted); }

p { line-height: 1.72; color: var(--jm-text-dim); margin-bottom: 1.2rem; }
strong { color: var(--jm-text); font-weight: 600; }

hr {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--jm-border-med) 20%, var(--jm-border-med) 80%, transparent);
  margin: 2.25rem 0;
}

/* ── Code ─────────────────────────────────────────── */
code:not(.sourceCode) {
  background: rgba(239,68,68,0.09);
  color: var(--jm-red);
  padding: 0.12em 0.42em; border-radius: 5px;
  font-size: 0.82em;
  border: 1px solid rgba(239,68,68,0.22);
}
/* Copyable code blocks — Quarto wraps them in .code-copy-outer-scaffold, with the
   copy button as a SIBLING of div.sourceCode inside that scaffold. Narrow the
   SCAFFOLD (not the inner div) so the code box AND its copy button shift together,
   matching the callouts; the button (position:absolute; right:0) then anchors to
   the narrowed scaffold instead of the full content column. */
.code-copy-outer-scaffold {
  width: auto !important;
  margin: 2.4rem 20% 2.4rem 10% !important;
  position: relative !important;
}
.code-copy-outer-scaffold > div.sourceCode { width: auto !important; margin: 0 !important; }
.sourceCode pre, pre.sourceCode {
  background: var(--jm-bg-input) !important;
  border: 1px solid var(--jm-border-med) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04) !important;
  font-size: 0.85rem !important;
  margin: 0 !important;   /* the 2.4rem lives on div.sourceCode, avoid doubling */
}
.code-copy-button {
  background: var(--jm-bg-elevated) !important; border-color: var(--jm-border-med) !important;
  color: var(--jm-muted) !important; border-radius: 7px !important;
}

/* ── Tables ───────────────────────────────────────── */
/* Quarto émet <table class="caption-top table"> sans wrapper .table-responsive.
   Les lignes ont des classes .odd / .even (pas Bootstrap nth-of-type).
   border-collapse: separate + border-spacing:0 est nécessaire pour que
   border-radius fonctionne sur l'élément <table> lui-même. */
.table {
  color: var(--jm-text-dim) !important;
  font-size: 0.875rem;
  width: 100%;
  margin: 1.5rem 0 !important;
  background: var(--jm-bg) !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  border: 1px solid var(--jm-border-med) !important;
}
.table thead th {
  background: rgba(255,255,255,0.035) !important;
  color: var(--jm-muted) !important;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.13) !important;
  border-top: none !important; border-left: none !important; border-right: none !important;
  padding: 0.6rem 0.85rem !important;
}
.table td {
  border-top: 1px solid rgba(255,255,255,0.07) !important;
  border-bottom: none !important; border-left: none !important; border-right: none !important;
  padding: 0.55rem 0.85rem !important;
  vertical-align: middle;
  background: var(--jm-bg) !important;
}
/* Pas de bordure sur la première ligne body */
.table tbody tr:first-child > td { border-top: none !important; }
/* Écraser les classes .odd/.even de Quarto/Bootstrap — fond uniforme */
.table tbody tr.odd > td,
.table tbody tr.even > td { background: var(--jm-bg) !important; }
.table tbody tr:hover > td { background: rgba(255,255,255,0.03) !important; }

/* ── LED indicators ───────────────────────────────── */
.led {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  vertical-align: middle;
  flex-shrink: 0;
}
.led-green {
  background: #22c55e;
  box-shadow: 0 0 4px 1px rgba(34,197,94,0.50), 0 0 8px 2px rgba(34,197,94,0.20);
}
.led-amber {
  background: var(--jm-amber);
  box-shadow: 0 0 4px 1px rgba(245,158,11,0.50), 0 0 8px 2px rgba(245,158,11,0.20);
}
.led-red {
  background: #ef4444;
  box-shadow: 0 0 4px 1px rgba(239,68,68,0.50), 0 0 8px 2px rgba(239,68,68,0.20);
}
.led-off {
  background: rgba(255,255,255,0.15);
  box-shadow: none;
}

/* ── Callouts — vivid, iOS-badge icon, homepage palette ── */
.callout {
  border-radius: 13px !important;
  font-size: 0.875rem;
  overflow: hidden;
  border-style: solid !important;
  border-width: 1px 1px 1px 2.5px !important;
  width: auto !important;
  margin: 2.4rem 20% 2.4rem 10% !important;   /* left-shifted: 10% left, 20% right → 70% wide */
}
/* Variantes couleur — bordure gauche vive + gradient bg + inset glow */
.callout-note {
  border-color: rgba(34,211,238,0.32) rgba(34,211,238,0.12) rgba(34,211,238,0.12) var(--jm-cyan) !important;
  background: linear-gradient(135deg, rgba(34,211,238,0.09) 0%, rgba(14,14,16,0) 60%) !important;
  box-shadow: inset 5px 0 18px rgba(34,211,238,0.10) !important;
}
.callout-tip {
  border-color: rgba(74,222,128,0.42) rgba(74,222,128,0.14) rgba(74,222,128,0.14) #4ade80 !important;
  background: linear-gradient(135deg, rgba(74,222,128,0.13) 0%, rgba(14,14,16,0) 60%) !important;
  box-shadow: inset 5px 0 18px rgba(74,222,128,0.14) !important;
}
.callout-warning {
  border-color: rgba(245,158,11,0.32) rgba(245,158,11,0.12) rgba(245,158,11,0.12) var(--jm-amber) !important;
  background: linear-gradient(135deg, rgba(245,158,11,0.09) 0%, rgba(14,14,16,0) 60%) !important;
  box-shadow: inset 5px 0 18px rgba(245,158,11,0.10) !important;
}
.callout-important {
  border-color: rgba(239,68,68,0.32) rgba(239,68,68,0.12) rgba(239,68,68,0.12) var(--jm-red) !important;
  background: linear-gradient(135deg, rgba(239,68,68,0.09) 0%, rgba(14,14,16,0) 60%) !important;
  box-shadow: inset 5px 0 18px rgba(239,68,68,0.10) !important;
}

/* Header — fond légèrement teinté, titre coloré */
.callout-header {
  font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em;
  padding-top: 0.6rem !important; padding-bottom: 0.6rem !important;
}
.callout-note     .callout-header { background: rgba(34,211,238,0.10) !important; color: var(--jm-cyan)   !important; }
.callout-tip      .callout-header { background: rgba(74,222,128,0.16) !important; color: #4ade80         !important; }
.callout-warning  .callout-header { background: rgba(245,158,11,0.10) !important; color: var(--jm-amber)  !important; }
.callout-important.callout-header { background: rgba(239,68,68,0.10)  !important; color: var(--jm-red)    !important; }

/* Icon container — fond teinté discret, icône Quarto inchangée */
.callout-icon-container {
  position: relative !important;
  width: 1.75rem !important; height: 1.75rem !important;
  border-radius: 8px !important; margin-right: 0.6rem !important;
  flex-shrink: 0 !important;
}
.callout-note      .callout-icon-container { background: rgba(34,211,238,0.18) !important; }
.callout-tip       .callout-icon-container { background: rgba(74,222,128,0.24)  !important; }
.callout-warning   .callout-icon-container { background: rgba(245,158,11,0.18) !important; }
.callout-important .callout-icon-container { background: rgba(239,68,68,0.18)  !important; }
/* Centrage absolu — fiable quelle que soit la nature de l'élément <i> */
.callout-icon-container .callout-icon {
  position: absolute !important;
  top: 50% !important; left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important; padding: 0 !important;
  line-height: 0 !important;
  filter: brightness(0) invert(1) !important;   /* white glyph — visible on the tinted badge */
}

/* ── Figures / screenshots ────────────────────────── */
.quarto-figure { margin-top: 2.6rem !important; margin-bottom: 2.6rem !important; text-align: center; }
.quarto-figure img, figure img, .lightbox img {
  border-radius: 13px;
  border: 1px solid var(--jm-border-med);
  box-shadow: 0 8px 32px rgba(0,0,0,0.65), 0 1px 0 rgba(255,255,255,0.07) inset;
  transition: box-shadow 0.25s, transform 0.25s;
  display: block;
  margin-left: auto; margin-right: auto;   /* centre in the content column */
}
.quarto-figure img:hover, figure img:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,0.8), 0 0 0 1px var(--jm-border-hi);
  transform: translateY(-2px);
}
figcaption, .figure-caption {
  font-size: 0.8rem; color: var(--jm-muted); text-align: center; margin-top: 0.6rem; font-style: italic;
}

/* ── Screenshot placeholders ──────────────────────── */
.screenshot-placeholder {
  border: 1px dashed rgba(255,255,255,0.11);
  border-radius: 14px;
  background: linear-gradient(160deg, var(--jm-node-top) 0%, var(--jm-node-bot) 100%);
  overflow: hidden; margin: 1.75rem 0; position: relative;
}
.screenshot-placeholder::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}
.placeholder-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 3rem 2rem; text-align: center; min-height: 200px;
}
.placeholder-icon { font-size: 1.75rem; opacity: 0.35; margin-bottom: 0.1rem; }
.placeholder-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--jm-red); opacity: 0.85; margin: 0;
}
.placeholder-desc {
  font-size: 0.82rem; color: var(--jm-muted); max-width: 480px;
  line-height: 1.65; margin: 0; font-family: 'JetBrains Mono', monospace;
}
.screenshot-placeholder figcaption {
  font-size: 0.78rem; color: var(--jm-muted); text-align: center;
  padding: 0.55rem 1rem; border-top: 1px solid var(--jm-border);
  font-style: italic; background: var(--jm-bg-input);
}

/* ═══════════════════════════════════════════════════
   HERO — animations + gradient border
   ═══════════════════════════════════════════════════ */

@keyframes hero-pulse {
  0%, 100% { opacity: 0.50; transform: translateX(-50%) scale(1);    }
  50%       { opacity: 0.95; transform: translateX(-50%) scale(1.20); }
}
@keyframes icon-float {
  0%,  100% { transform: translateY(0px)   rotate(0deg);   }
  33%        { transform: translateY(-6px) rotate(-1.5deg); }
  66%        { transform: translateY(-3px) rotate( 0.8deg); }
}

.hero {
  background: linear-gradient(158deg, #0c0c13 0%, #12101e 45%, #160d1c 100%);
  border-radius: 24px;
  padding: 5.5rem 4.5rem 4.5rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* gradient border via mask trick */
.hero::before {
  content: '';
  position: absolute; inset: 0; border-radius: 24px; padding: 1px;
  background: linear-gradient(145deg,
    rgba(239,68,68,0.60) 0%,
    rgba(255,255,255,0.08) 35%,
    rgba(255,255,255,0.04) 65%,
    rgba(167,139,250,0.25) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none; z-index: 1;
}

/* animated ambient glow orb */
.hero::after {
  content: '';
  position: absolute; top: -130px; left: 50%; transform: translateX(-50%);
  width: 750px; height: 480px;
  background: radial-gradient(ellipse at center,
    rgba(239,68,68,0.14) 0%,
    rgba(167,139,250,0.05) 45%,
    transparent 70%);
  animation: hero-pulse 8s ease-in-out infinite;
  pointer-events: none; z-index: 0;
}

.hero-inner { display: flex; align-items: center; gap: 3rem; position: relative; z-index: 2; }

.hero-icon {
  flex-shrink: 0;
  width: 106px; height: 106px; border-radius: 26px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.14),
    0 10px 36px rgba(239,68,68,0.38),
    0 3px 10px rgba(0,0,0,0.55);
  animation: icon-float 7s ease-in-out infinite;
}

.hero-text h1 {
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: -0.048em;
  background: linear-gradient(140deg, #ffffff 15%, #fca5a5 55%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  line-height: 1.04;
}
.hero-text .subtitle {
  font-size: 1.1rem;
  color: rgba(161, 161, 170, 0.92);
  max-width: 520px;
  line-height: 1.66;
  margin-bottom: 1.85rem;
  letter-spacing: -0.01em;
}
.hero-text .hero-pills { display: flex; gap: 0.65rem; flex-wrap: wrap; }

/* Trust badge — "Signed & notarized by Apple" with a green verified seal + check */
.hero-trust {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--jm-text-dim);
}
.hero-seal { font-size: 0.72rem; }                          /* sizes the fa-stack seal */
.hero-seal .fa-certificate { color: #fbbf24; }              /* vivid golden seal */
.hero-seal .fa-check { color: #241a02; }                    /* dark check on the gold seal */

.hero-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.85rem; font-weight: 500; padding: 0.5rem 1.15rem;
  border-radius: 99px; text-decoration: none; border: 1px solid;
  letter-spacing: -0.01em;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hero-pill-primary {
  background: var(--jm-red); border-color: transparent;
  color: #fff !important;
  box-shadow: 0 3px 14px rgba(239,68,68,0.40);
}
/* The Apple brand glyph is optically smaller than the other icons — bump it so it reads clearly as "macOS". */
.hero-pill-primary i.fa-apple { font-size: 1.3em; }
.hero-pill-primary { gap: 0.55rem; }
.hero-pill-primary:hover {
  background: #f87171; box-shadow: 0 6px 28px rgba(239,68,68,0.60);
  transform: translateY(-2px) scale(1.03); color: #fff !important; text-decoration: none;
}
.hero-pill-secondary {
  background: rgba(20,20,20,0.60);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-color: var(--jm-border-med); color: var(--jm-text-dim) !important;
}
.hero-pill-secondary:hover {
  background: rgba(20,20,20,0.90); border-color: var(--jm-border-hi);
  color: var(--jm-text) !important; transform: translateY(-2px) scale(1.03); text-decoration: none;
}
.hero-pill-sponsor {
  background: rgba(20,20,20,0.60);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-color: var(--jm-border-med); color: var(--jm-text-dim) !important;
}
.hero-pill-sponsor:hover {
  background: rgba(20,20,20,0.90); border-color: var(--jm-border-hi);
  color: var(--jm-text) !important; transform: translateY(-2px) scale(1.03); text-decoration: none;
}
.bmc-pill-icon {
  width: 16px; height: 16px; object-fit: contain;
}

/* ═══════════════════════════════════════════════════
   FEATURE GRID — bento 3 + 2 layout
   ═══════════════════════════════════════════════════ */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin: 1.75rem 0 2.5rem;
}
/* Row 1: 3 equal cards */
.feature-card:nth-child(1),
.feature-card:nth-child(2),
.feature-card:nth-child(3) { grid-column: span 2; }
/* Row 2: 2 cards centred */
.feature-card:nth-child(4) { grid-column: 2 / span 2; }
.feature-card:nth-child(5) { grid-column: 4 / span 2; }

/* ── Feature card ─────────────────────────────────── */
.feature-card {
  position: relative;
  background: linear-gradient(160deg, #16151e 0%, #111019 100%);
  border-radius: 20px;
  padding: 1.75rem 1.85rem 1.6rem;
  text-decoration: none !important;
  display: block;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow  0.25s ease;
}

/* gradient border via mask trick */
.feature-card::before {
  content: '';
  position: absolute; inset: 0; border-radius: 20px; padding: 1px;
  background: linear-gradient(145deg,
    rgba(255,255,255,0.17) 0%,
    rgba(255,255,255,0.04) 50%,
    rgba(255,255,255,0.10) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background 0.30s ease;
  z-index: 1;
}

/* shimmer highlight at top */
.feature-card::after {
  content: '';
  position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.20), transparent);
  pointer-events: none; z-index: 2;
}

.feature-card:hover { transform: translateY(-5px) scale(1.018); text-decoration: none !important; }

/* Per-accent hover — border lights up with card's colour */
.feature-card[data-accent="red"]:hover {
  box-shadow: 0 20px 56px rgba(239,68,68,0.20), 0 5px 18px rgba(0,0,0,0.55);
}
.feature-card[data-accent="red"]:hover::before {
  background: linear-gradient(145deg, rgba(239,68,68,0.60) 0%, rgba(239,68,68,0.06) 55%, rgba(255,255,255,0.07) 100%);
}
.feature-card[data-accent="cyan"]:hover {
  box-shadow: 0 20px 56px rgba(34,211,238,0.17), 0 5px 18px rgba(0,0,0,0.55);
}
.feature-card[data-accent="cyan"]:hover::before {
  background: linear-gradient(145deg, rgba(34,211,238,0.55) 0%, rgba(34,211,238,0.05) 55%, rgba(255,255,255,0.07) 100%);
}
.feature-card[data-accent="violet"]:hover {
  box-shadow: 0 20px 56px rgba(167,139,250,0.18), 0 5px 18px rgba(0,0,0,0.55);
}
.feature-card[data-accent="violet"]:hover::before {
  background: linear-gradient(145deg, rgba(167,139,250,0.55) 0%, rgba(167,139,250,0.05) 55%, rgba(255,255,255,0.07) 100%);
}
.feature-card[data-accent="amber"]:hover {
  box-shadow: 0 20px 56px rgba(245,158,11,0.16), 0 5px 18px rgba(0,0,0,0.55);
}
.feature-card[data-accent="amber"]:hover::before {
  background: linear-gradient(145deg, rgba(245,158,11,0.52) 0%, rgba(245,158,11,0.05) 55%, rgba(255,255,255,0.07) 100%);
}
.feature-card[data-accent="green"]:hover {
  box-shadow: 0 20px 56px rgba(34,197,94,0.16), 0 5px 18px rgba(0,0,0,0.55);
}
.feature-card[data-accent="green"]:hover::before {
  background: linear-gradient(145deg, rgba(34,197,94,0.55) 0%, rgba(34,197,94,0.05) 55%, rgba(255,255,255,0.07) 100%);
}

/* Card text */
.feature-card h3 {
  font-size: 0.97rem; font-weight: 600;
  color: var(--jm-text); margin: 0 0 0.45rem; letter-spacing: -0.01em;
}
.feature-card p { font-size: 0.85rem; color: var(--jm-muted); line-height: 1.63; margin: 0; }

/* ── Icon badges — iOS app icon style ─────────────── */

.card-icon-wrap {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 3.4rem; height: 3.4rem;
  border-radius: 17px;
  font-size: 1.35rem;
  margin-bottom: 1.15rem;
  flex-shrink: 0;
  position: relative; z-index: 3;
  transition: transform 0.30s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.feature-card:hover .card-icon-wrap { transform: scale(1.10) rotate(-3deg); }

/* White icon on vivid gradient — every icon colour */
.card-icon-wrap i { color: #fff !important; }

.icon-bg-red {
  background: linear-gradient(145deg, #f87171 0%, #b91c1c 100%);
  box-shadow: 0 6px 20px rgba(239,68,68,0.55), inset 0 1px 0 rgba(255,255,255,0.28);
}
.icon-bg-cyan {
  background: linear-gradient(145deg, #67e8f9 0%, #0891b2 100%);
  box-shadow: 0 6px 20px rgba(34,211,238,0.48), inset 0 1px 0 rgba(255,255,255,0.28);
}
.icon-bg-violet {
  background: linear-gradient(145deg, #c4b5fd 0%, #7c3aed 100%);
  box-shadow: 0 6px 20px rgba(167,139,250,0.48), inset 0 1px 0 rgba(255,255,255,0.22);
}
.icon-bg-amber {
  background: linear-gradient(145deg, #fcd34d 0%, #d97706 100%);
  box-shadow: 0 6px 20px rgba(245,158,11,0.48), inset 0 1px 0 rgba(255,255,255,0.28);
}
.icon-bg-orange {
  background: linear-gradient(145deg, #fb923c 0%, #c2410c 100%);
  box-shadow: 0 6px 20px rgba(249,115,22,0.48), inset 0 1px 0 rgba(255,255,255,0.22);
}
.icon-bg-green {
  background: linear-gradient(145deg, #4ade80 0%, #15803d 100%);
  box-shadow: 0 6px 20px rgba(34,197,94,0.48), inset 0 1px 0 rgba(255,255,255,0.24);
}

/* "New in 2.0" indicator — orange star + label, matches the hero highlight */
.badge-new {
  color: var(--jm-orange);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Inline accent colours (body text) */
.icon-red    { color: var(--jm-red);    }
.icon-cyan   { color: var(--jm-cyan);   }
.icon-violet { color: var(--jm-violet); }
.icon-amber  { color: var(--jm-amber);  }
.icon-orange { color: var(--jm-orange); }
.icon-green  { color: var(--jm-green);  }

/* ── Page title banner ────────────────────────────── */
.quarto-title-banner { background: var(--jm-bg) !important; padding-top: 1.5rem !important; padding-bottom: 0.5rem !important; }
.quarto-title h1.title { font-size: 2.3rem; font-weight: 700; letter-spacing: -0.035em; color: #fff; }
.quarto-title .description { color: var(--jm-muted); font-size: 0.92rem; }

/* ── Back to top ──────────────────────────────────── */
#quarto-back-to-top {
  /* Ne pas forcer display — Quarto le met à none/block via JS selon le scroll */
  position: fixed !important;
  bottom: 4% !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  max-width: fit-content !important;
  padding: 0.42rem 0.9rem !important;
  border-radius: 99px !important;
  background: rgba(14,14,16,0.78) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(239,68,68,0.28) !important;
  color: var(--jm-red) !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
  align-items: center !important;
  gap: 0.35rem !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.55), 0 0 18px rgba(239,68,68,0.08) !important;
  text-decoration: none !important;
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease !important;
  z-index: 1020 !important;
  white-space: nowrap !important;
}
#quarto-back-to-top:hover {
  background: rgba(239,68,68,0.11) !important;
  border-color: rgba(239,68,68,0.55) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.55), 0 0 28px rgba(239,68,68,0.22) !important;
  color: var(--jm-red) !important;
  text-decoration: none !important;
}

/* ── Footer ───────────────────────────────────────── */
.nav-footer {
  position: fixed !important;
  bottom: 0 !important; left: 0 !important; right: 0 !important;
  z-index: 1010 !important;
  background: rgba(14,14,16,0.55) !important;
  backdrop-filter: blur(24px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
  border-top: 1px solid var(--jm-border) !important;
  font-size: 0.8rem;
  color: var(--jm-muted) !important;
}
.nav-footer a { color: var(--jm-muted) !important; }
body { padding-bottom: 3rem !important; }

/* ── Search — liquid glass (detached overlay) ─────── */
/* light dark veil over the page, like the download modal */
.aa-DetachedOverlay {
  background: rgba(0, 0, 0, 0.64) !important;
  -webkit-backdrop-filter: blur(5px) !important; backdrop-filter: blur(5px) !important;
}
/* kill the solid container blocks so the bar & results read as floating glass */
.aa-DetachedContainer,
.aa-DetachedContainer--modal,
.aa-DetachedFormContainer { background: transparent !important; box-shadow: none !important; border-radius: 0 !important; }
/* the floating glass search bar (was a plain white box) */
.aa-Form {
  background: linear-gradient(145deg, rgba(74,73,72,0.50), rgba(50,49,48,0.40)) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.4) brightness(1.18) !important; backdrop-filter: blur(22px) saturate(1.4) brightness(1.18) !important;
  border: 1px solid rgba(255,255,255,0.32) !important; border-radius: 16px !important;
  box-shadow: var(--glass-shadow), 0 2px 10px rgba(0,0,0,0.45), 0 20px 56px rgba(0,0,0,0.65) !important;
}
.aa-Input { color: var(--jm-text) !important; }
.aa-Input::placeholder { color: var(--jm-muted) !important; }
.aa-SubmitButton svg, .aa-ClearButton svg { color: var(--jm-text-dim) !important; fill: var(--jm-text-dim) !important; }
.aa-DetachedCancelButton {
  background: color-mix(in srgb, #cfd6e2 10%, transparent) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.4) !important; backdrop-filter: blur(10px) saturate(1.4) !important;
  border: 1px solid rgba(255,255,255,0.24) !important; color: var(--jm-text) !important;
  border-radius: 12px !important; box-shadow: var(--glass-shadow) !important; padding: 0.4rem 0.9rem !important;
}
.aa-DetachedCancelButton:hover { color: #fff !important; }
/* the results box: neutral, see-through liquid glass (was near-opaque) */
.aa-Panel {
  background: linear-gradient(145deg, rgba(52,51,50,0.56), rgba(33,32,31,0.46)) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.3) brightness(1.14) !important; backdrop-filter: blur(30px) saturate(1.3) brightness(1.14) !important;
  border: 1px solid rgba(255,255,255,0.26) !important; border-radius: 16px !important;
  box-shadow: var(--glass-shadow), 0 4px 14px rgba(0,0,0,0.45), 0 26px 70px rgba(0,0,0,0.6) !important;
}
/* result rows + their inner containers transparent so the panel glass shows through;
   Quarto otherwise fills these with an opaque grey on hover (ugly two-tone blocks). */
.aa-Panel .search-result-header,
.aa-Panel .search-item,
.aa-Panel .search-result-doc,
.aa-Panel .search-result-doc-section,
.aa-Panel .search-result-more,
.aa-Panel .search-result-container,
.aa-Panel .search-result-link,
.aa-Panel .search-result-title-container,
.aa-Panel .search-result-text-container,
.aa-Panel .search-result-section,
.aa-Panel .search-result-text { background: transparent !important; }
/* the hover/selected highlight is a soft rounded inset pill, not a full-width hard block */
.aa-Panel .aa-Item { border-radius: 11px !important; margin: 2px 6px !important; overflow: hidden !important; }
/* the matched term: a subtle violet pill (the same violet as the "important" info callout) */
.aa-Panel mark.search-match {
  background: rgba(167,139,250,0.28) !important; color: inherit !important;
  border-radius: 4px !important; padding: 0 2px !important;
}
/* The IN-PAGE highlight after clicking a result: Quarto wraps the term in a bare <mark> (no
   class) inside the article, so it otherwise inherits Bootstrap's beige `mark`. Override with
   the brand violet, made clearly legible with a crisp rim + bold light text. */
main mark {
  /* No !important here: `main mark` (0,0,2) already beats Bootstrap/theme `mark` (0,0,1), and
     staying !important-free lets the attention animation below drive background & box-shadow. */
  background: rgba(167,139,250,0.32);
  color: #ece7ff;
  font-weight: 600;
  border-radius: 4px;
  padding: 0 3px;
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.80);
  /* Quarto scrolls the match to the viewport CENTRE (scrollIntoView block:"center"); on iOS
     the dynamic toolbar + fixed navbar make it land a touch low. A bottom scroll-margin shifts
     that centring upward, so the page scrolls a bit further. Tune on-device (bigger = higher). */
  scroll-margin-bottom: 8rem;
  /* Draw the eye on arrival: two quick violet pulses (glow + fill), then settle to the pill. */
  animation: search-hit 0.95s ease-out 4;
}
@keyframes search-hit {
  0%   { background: rgba(167,139,250,0.72); box-shadow: inset 0 0 0 1px rgba(167,139,250,0.95), 0 0 0 0 rgba(167,139,250,0.55); }
  55%  { background: rgba(167,139,250,0.50); box-shadow: inset 0 0 0 1px rgba(167,139,250,0.90), 0 0 18px 4px rgba(167,139,250,0.55); }
  100% { background: rgba(167,139,250,0.32); box-shadow: inset 0 0 0 1px rgba(167,139,250,0.80), 0 0 0 0 rgba(167,139,250,0); }
}
/* respect reduced-motion: no pulse, just the resting pill */
@media (prefers-reduced-motion: reduce) { main mark { animation: none; } }
/* On phones the detached search overflowed the screen on real iOS: a fixed/absolute
   overlay there inherits the LAYOUT viewport, which grows past the visible width as soon
   as anything on the page overflows horizontally. Clamp the page to the screen so layout
   == visual, pin the overlay to 100vw, and let the bar/panel shrink inside it. */
@media (max-width: 768px) {
  html, body { overflow-x: hidden !important; }
  .aa-DetachedOverlay {
    width: 100vw !important; max-width: 100vw !important; left: 0 !important; right: auto !important;
    box-sizing: border-box !important;
  }
  .aa-DetachedContainer,
  .aa-DetachedContainer--modal {
    left: 0 !important; right: 0 !important; width: auto !important;
    max-width: 100vw !important; transform: none !important;
    padding-left: 0.6rem !important; padding-right: 0.6rem !important;
    box-sizing: border-box !important;
  }
  .aa-DetachedFormContainer,
  .aa-Form,
  .aa-Panel,
  .aa-PanelLayout { width: 100% !important; max-width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
  .aa-InputWrapper, .aa-Input { min-width: 0 !important; }
  /* iOS auto-zooms (and shifts/re-zooms the whole page) when a focused input is < 16px.
     Force the search field to exactly 16px on phones to stop that zoom. */
  .aa-DetachedFormContainer .aa-Form .aa-InputWrapper .aa-Input,
  #quarto-search .aa-Autocomplete input,
  .aa-Input { font-size: 16px !important; }
}

/* ── Breadcrumbs ──────────────────────────────────── */
.quarto-breadcrumbs .breadcrumb-item,
.quarto-breadcrumbs .breadcrumb-item a { color: var(--jm-muted) !important; font-size: 0.8rem; }
.quarto-breadcrumbs .breadcrumb-item.active { color: var(--jm-text-dim) !important; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

@media (max-width: 1000px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-card:nth-child(1),
  .feature-card:nth-child(2),
  .feature-card:nth-child(3),
  .feature-card:nth-child(4),
  .feature-card:nth-child(5) { grid-column: span 1; }
}
@media (max-width: 768px) {
  .hero-inner  { flex-direction: column; gap: 1.5rem; }
  .hero-icon   { width: 82px; height: 82px; }
  .hero-text h1 { font-size: 2.5rem; }
  .hero { padding: 3rem 1.75rem 2.5rem; border-radius: 18px; }
  /* NB: the share widget's own mobile overrides live in a @media block AFTER its base
     rules (below), not here — placed here they'd lose the source-order tie-break and die. */
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card:nth-child(n) { grid-column: span 1; }
  /* Slimmer fixed footer on mobile — glass + fixed position kept, just less
     height (tighter padding + smaller text) so it stops eating the viewport.
     Aligned with the JackMate site's footer treatment. */
  .nav-footer {
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
    font-size: 0.7rem !important;
    line-height: 1.3 !important;
    min-height: 0 !important;
  }
  /* The real height came from Quarto stacking the 3 footer regions vertically on
     mobile: the empty left/right rows (flex:100% + margin-bottom:1em) and the
     center's margin-top:3em + min-height:3em. Collapse it to the centered text. */
  .nav-footer-left,
  .nav-footer-right { display: none !important; }
  .nav-footer-center {
    margin: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
  }
  body { padding-bottom: 2.4rem !important; }
}
/* ── Navbar — Buy Me A Coffee icon ───────────────────── */
.navbar-bmc-icon {
  display: inline-block;
  width: 11px;
  height: 16px;
  /* Path resolved relative to this CSS file → always finds assets/bmc-icon.svg */
  background: url('bmc-icon.svg') no-repeat center / contain;
  vertical-align: middle;
  opacity: 0.65;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.navbar a:has(.navbar-bmc-icon):hover .navbar-bmc-icon {
  opacity: 1;
  transform: scale(1.10);
}

/* Back-to-top : sidebar masquée sous 992px → bord gauche viewport */
@media (max-width: 991.98px) {
  #quarto-back-to-top { left: 50% !important; transform: translateX(-50%) !important; }
}

/* ══════════════════════════════════════════════════════
   DOWNLOAD MODAL — non-notarized app help
   ══════════════════════════════════════════════════════ */

.dm-overlay {
  display: none !important;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dm-overlay.is-open {
  display: flex !important;
  animation: dm-fade-in 0.18s ease;
}
@keyframes dm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.dm-dialog {
  position: relative;
  background: linear-gradient(145deg, rgba(30,28,46,0.58), rgba(18,16,28,0.52));
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  border: none;
  border-radius: 20px;
  box-shadow: var(--glass-shadow), 0 32px 80px rgba(0,0,0,0.80);   /* liquid-glass rim + float shadow */
  max-width: 560px;
  width: 100%;
  padding: 2rem 2rem 1.5rem;
  animation: dm-slide-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes dm-slide-in {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Close × button */
.dm-x-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--jm-border);
  border-radius: 8px;
  color: var(--jm-muted);
  font-size: 1rem;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
  line-height: 1;
}
.dm-x-close:hover { background: rgba(255,255,255,0.11); color: var(--jm-text); }

/* Header */
.dm-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.dm-header-icon {
  width: 2.8rem; height: 2.8rem;
  border-radius: 13px;
  font-size: 1.15rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dm-header-icon i { color: #fff !important; }
.dm-title {
  font-size: 1.12rem; font-weight: 700;
  color: #fff; margin: 0 0 0.3rem;
  letter-spacing: -0.02em; border: none; padding: 0;
}
.dm-title::after { display: none; }  /* suppress Quarto heading underline if any */
.dm-intro {
  font-size: 0.875rem; color: var(--jm-text-dim);
  line-height: 1.55; margin: 0;
}

/* Pre-step */
.dm-prestep {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(167,139,250,0.07);
  border: 1px solid rgba(167,139,250,0.20);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.75rem;
  font-size: 0.84rem;
  color: var(--jm-text-dim);
  line-height: 1.55;
}
.dm-prestep strong { color: var(--jm-text); }
.dm-prestep-icon {
  color: var(--jm-violet);
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Tabs — segmented control style */
.dm-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  background: var(--jm-bg-input);
  border: 1px solid var(--jm-border-med);
  border-radius: 11px;
  padding: 0.28rem;
}
.dm-tab {
  display: flex; align-items: center; gap: 0.45rem;
  flex: 1; justify-content: center;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--jm-muted);
  font-size: 0.84rem; font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.dm-tab:hover { color: var(--jm-text-dim); background: rgba(255,255,255,0.04); }
.dm-tab.is-active {
  color: #fff;
  background: var(--jm-bg-elevated);
  border-color: var(--jm-border-hi);
  box-shadow: 0 2px 8px rgba(0,0,0,0.40);
}
.dm-tab-badge {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--jm-green);
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 5px; padding: 0.1rem 0.35rem;
}

/* Panels */
.dm-panel {
  display: none;
  background: var(--jm-bg-card);
  border: 1px solid var(--jm-border);
  border-radius: 11px;
  padding: 1rem 1.1rem 0.9rem;
  margin-bottom: 0.75rem;
}
.dm-panel.is-active { display: block; }

/* Code block */
.dm-code-wrap {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--jm-bg-input);
  border: 1px solid var(--jm-border-med);
  border-radius: 9px;
  padding: 0.55rem 0.7rem 0.55rem 0.85rem;
  margin-bottom: 0.45rem;
}
.dm-pre {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.78rem; color: #fff;
  margin: 0; flex: 1; white-space: nowrap; overflow-x: auto;
  background: none; border: none; padding: 0;
}
.dm-pre code { color: #fff !important; background: none !important; }
.dm-copy {
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--jm-border);
  border-radius: 7px;
  color: var(--jm-muted);
  font-size: 0.78rem;
  width: 1.9rem; height: 1.9rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.dm-copy:hover { background: rgba(34,211,238,0.10); color: var(--jm-cyan); border-color: rgba(34,211,238,0.30); }
.dm-code-hint {
  font-size: 0.76rem; color: var(--jm-muted); margin: 0;
}

/* Steps list */
.dm-steps {
  padding-left: 1.3rem; margin: 0 0 0.5rem;
}
.dm-steps li {
  font-size: 0.84rem; color: var(--jm-text-dim);
  line-height: 1.6; margin-bottom: 0.3rem;
}
.dm-steps li strong { color: var(--jm-text); }
.dm-warning {
  font-size: 0.76rem; color: var(--jm-amber);
  margin: 0.5rem 0 0; display: flex; align-items: flex-start; gap: 0.4rem;
}
.dm-warning i { margin-top: 0.12rem; flex-shrink: 0; }

/* Compact dialog variant (confirm + mobile modals) */
.dm-dialog-sm { max-width: 400px; }

/* Cancel button */
.dm-cancel-btn {
  background: rgba(255,255,255,0.05);
  color: var(--jm-muted);
  border: 1px solid var(--jm-border);
  border-radius: 9px;
  font-size: 0.875rem; font-weight: 500;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.dm-cancel-btn:hover { background: rgba(255,255,255,0.09); color: var(--jm-text); }

/* Footer */
.dm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.1rem;
  gap: 1rem;
}
.dm-bmac-note {
  font-size: 0.76rem; color: var(--jm-muted);
  line-height: 1.5; margin: 0; flex: 1;
}
.dm-bmac-note a { color: var(--jm-muted); text-decoration: underline; text-underline-offset: 2px; }
.dm-bmac-note a:hover { color: var(--jm-text-dim); }
.dm-footer-end { justify-content: flex-end; }
.dm-close-btn {
  background: rgba(34,211,238,0.12);
  color: var(--jm-cyan);
  border: 1px solid rgba(34,211,238,0.30);
  border-radius: 9px;
  font-size: 0.875rem; font-weight: 600;
  padding: 0.55rem 1.4rem;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s;
  box-shadow: 0 2px 10px rgba(34,211,238,0.10);
}
.dm-close-btn:hover {
  background: rgba(34,211,238,0.20);
  border-color: rgba(34,211,238,0.55);
  box-shadow: 0 4px 18px rgba(34,211,238,0.22);
}

/* Responsive */
@media (max-width: 600px) {
  .dm-dialog { padding: 1.5rem 1.2rem 1.2rem; }
  .dm-header { gap: 0.75rem; }
  .dm-pre { font-size: 0.70rem; }
}

/* ══════════════════════════════════════════════════════════════════
   JackMoebius theme — CYAN-dominant (JackMate is red-branded).
   Remaps the PRIMARY brand accent (links, navbar, sidebar, TOC, code,
   back-to-top, section filets, hero) from red to cyan. SEMANTIC red
   stays red: .led-red, .callout-important, .icon-red, .icon-bg-red,
   feature-card[data-accent="red"].
   ══════════════════════════════════════════════════════════════════ */

:root {
  --bs-link-color:       var(--jm-cyan) !important;
  --bs-link-hover-color: #67e8f9 !important;
}

/* Links */
a        { color: var(--jm-cyan); text-decoration-color: rgba(34,211,238,0.35); }
a:hover  { color: #67e8f9; text-decoration-color: rgba(103,232,249,0.55); }

/* Ambient page halo (top of every page) */
body::before {
  background: radial-gradient(ellipse 55% 35% at 50% 0%,
    rgba(34,211,238,0.055) 0%, transparent 100%) !important;
}

/* Navbar active item */
.navbar-nav .nav-link.active {
  color: var(--jm-cyan) !important;
  background: rgba(34,211,238,0.08) !important;
}

/* Page-title and section (h2) underline filets */
#title-block-header.quarto-title-block.default {
  border-image: linear-gradient(90deg,
    rgba(34,211,238,0.25) 0%, rgba(255,255,255,0.08) 28%, transparent 100%) 1 !important;
}
h2 {
  border-image: linear-gradient(90deg,
    rgba(34,211,238,0.28) 0%, rgba(255,255,255,0.09) 28%, transparent 100%) 1 !important;
}

/* Sidebar active page */
#quarto-sidebar a.sidebar-link.active {
  background: rgba(34,211,238,0.14) !important;
  color: var(--jm-cyan) !important;
  border-left: 2px solid var(--jm-cyan) !important;
  box-shadow: inset 3px 0 12px rgba(34,211,238,0.10) !important;
}

/* TOC active */
#TOC .active { color: var(--jm-cyan) !important; border-left-color: var(--jm-cyan) !important; }

/* Inline code */
code:not(.sourceCode) {
  background: rgba(34,211,238,0.09) !important;
  color: var(--jm-cyan) !important;
  border: 1px solid rgba(34,211,238,0.22) !important;
}

/* Search result hovered/selected — soft pill over the glass panel */
.aa-Item[aria-selected="true"] { background: rgba(255,255,255,0.10) !important; }

/* Back to top */
#quarto-back-to-top {
  border: 1px solid rgba(34,211,238,0.28) !important;
  color: var(--jm-cyan) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.55), 0 0 18px rgba(34,211,238,0.08) !important;
}
#quarto-back-to-top:hover {
  background: rgba(34,211,238,0.11) !important;
  border-color: rgba(34,211,238,0.55) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.55), 0 0 28px rgba(34,211,238,0.22) !important;
  color: var(--jm-cyan) !important;
}

/* Hero — halo, icon glow, title gradient, Download pill */
.hero::before {
  background: linear-gradient(145deg,
    rgba(34,211,238,0.60) 0%, rgba(255,255,255,0.08) 35%,
    rgba(255,255,255,0.04) 65%, transparent 100%) !important;
}
.hero::after {
  background: radial-gradient(ellipse at center,
    rgba(34,211,238,0.14) 0%, rgba(167,139,250,0.05) 45%, transparent 70%) !important;
}
.hero-icon {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.14),
    0 10px 36px rgba(34,211,238,0.38), 0 3px 10px rgba(0,0,0,0.55) !important;
}
.hero-text h1 {
  background: linear-gradient(140deg, #ffffff 15%, #a5f3fc 55%, #22d3ee 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;   /* was showing the gradient as a box otherwise */
}

/* Hero icon — larger still (the detailed icon reads well big) */
.hero-icon { width: 224px !important; height: 224px !important; }

/* Navbar icon — macOS-app-style tile: a SQUARE black rounded square + a discreet cyan hairline */
.navbar .navbar-brand img {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;   /* neutralise le max-height du thème qui écrasait la hauteur → vraie tuile carrée */
  object-fit: contain !important;
  background: #0a0a0c !important;
  border: 1px solid rgba(34,211,238,0.22) !important;
  border-radius: 7px !important;
  padding: 2px !important;
  box-sizing: border-box !important;
  box-shadow: 0 0 6px rgba(34,211,238,0.18) !important;   /* discreet cyan halo */
}

.hero-pill-primary {
  background: var(--jm-cyan) !important; color: #06181d !important;
  border-color: transparent !important;
  box-shadow: 0 3px 14px rgba(34,211,238,0.40) !important;
}
.hero-pill-primary:hover {
  background: #67e8f9 !important; color: #06181d !important;
  box-shadow: 0 6px 28px rgba(34,211,238,0.60) !important;
}

/* Buy-a-license pill — the money button: prominent amber with a yellow halo */
.hero-pill-buy {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: #241a02 !important; border-color: transparent !important; font-weight: 600 !important;
  box-shadow: 0 3px 14px rgba(245,158,11,0.45), 0 0 26px rgba(251,191,36,0.38) !important;
}
.hero-pill-buy:hover {
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%) !important; color: #241a02 !important;
  box-shadow: 0 6px 30px rgba(245,158,11,0.60), 0 0 40px rgba(251,191,36,0.55) !important;
  transform: translateY(-2px) scale(1.03);
}

/* Navbar "Buy a license" — same amber pill, next to search / GitHub */
.navbar-nav .nav-link:has(.nav-buy) {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  border-radius: 999px !important;
  padding: 0.24rem 0.85rem !important;
  margin: 0 0.2rem !important;
  box-shadow: 0 0 16px rgba(251,191,36,0.35) !important;
  transition: box-shadow .18s ease, transform .18s ease !important;
}
.navbar-nav .nav-link:has(.nav-buy) .nav-buy { color: #241a02 !important; font-weight: 600 !important; }
.navbar-nav .nav-link:has(.nav-buy):hover {
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%) !important;
  box-shadow: 0 0 26px rgba(251,191,36,0.55) !important;
  transform: translateY(-1px) !important;
}

/* Navbar "Star on GitHub" — outlined pill with a gold star that pops on hover */
.navbar-nav .nav-link:has(.nav-star) {
  border: 1px solid rgba(255,255,255,0.22) !important;
  border-radius: 999px !important;
  padding: 0.24rem 0.85rem !important;
  margin: 0 0.2rem !important;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
}
.nav-star { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.nav-star .nav-star-ic { color: #fbbf24; transition: transform .2s ease, filter .2s ease; }
.navbar-nav .nav-link:has(.nav-star):hover {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(251,191,36,0.65) !important;
  box-shadow: 0 0 20px rgba(251,191,36,0.28) !important;
  transform: translateY(-1px) !important;
}
.navbar-nav .nav-link:has(.nav-star):hover .nav-star-ic {
  transform: scale(1.15) rotate(-8deg);
  filter: drop-shadow(0 0 6px rgba(251,191,36,0.7));
}

/* Replay pill for non-looping scroll-videos — created by assets/after-body.html,
   shown once the clip ends so the viewer can watch it again without scrolling. */
.scroll-video-replay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(14, 14, 16, 0.6);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(3px);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
  z-index: 3;
}
.scroll-video-replay:hover {
  background: rgba(14, 14, 16, 0.8);
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.45);
}
.scroll-video-replay[hidden] { display: none; }

/* Enlarge affordance on scroll-videos — reveals on hover, opens the lightbox. */
.scroll-video-expand {
  position: absolute;
  top: .55rem;
  right: .55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(14, 14, 16, 0.55);
  color: #fff;
  font-size: .9rem;
  cursor: zoom-in;
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity .15s ease, background .15s ease;
  z-index: 3;
}
figure:hover > .scroll-video-expand,
.scroll-video-expand:focus-visible { opacity: 1; }
.scroll-video-expand:hover { background: rgba(14, 14, 16, 0.85); }
/* Touch devices can't hover — keep the button visible so the clip reads as tappable. */
@media (hover: none) { .scroll-video-expand { opacity: 1; } }

/* Fullscreen lightbox for scroll-videos (created by assets/after-body.html).
   Styling inspired by martinomagnifico's quarto-multimodal: white hairline
   frame, rounded corners, soft shadow, and a fade + scale-in on open. */
.sv-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;                 /* always in flow; shown via opacity/visibility */
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease;
}
.sv-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.sv-lightbox video {
  max-width: 92vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border: 2px solid rgba(255, 255, 255, 0.9);   /* white liseré */
  border-radius: 14px;
  background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  transform: scale(0.92);
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
}
.sv-lightbox.is-open video { transform: scale(1); }
.sv-lightbox-close {
  position: absolute;
  top: 1.1rem;
  right: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(3px);
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
  z-index: 2;
}
.sv-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.08);
}
@media (prefers-reduced-motion: reduce) {
  .sv-lightbox, .sv-lightbox video { transition: none; }
  .sv-lightbox video { transform: none; }
}

/* On phones the coverflow slides are narrow, so the overlay caption bar grows to
   cover most of the image — hide captions there (the carousel stays a visual
   showcase; full captions remain on wider screens). */
@media (max-width: 600px) {
  .easycarousel--coverflow .easycarousel__caption { display: none; }
}

/* ═══════════════════════════════════════════════════
   LIQUID GLASS — reusable multi-layer inset bevel (adapted from the CodePen
   "liquid glass" box-shadow trick). Any glass surface uses box-shadow: var(--glass-shadow).
   ═══════════════════════════════════════════════════ */
:root {
  --c-light: #fff; --c-dark: #000;
  --glass-reflex-light: 0.35; --glass-reflex-dark: 1.0;   /* softer rim (was 0.6 / 1.4) */
  --glass-shadow:
    /* hairline edge */
    inset 0 0 0 1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 14%), transparent),
    /* light mostly from the TOP-LEFT: bright inner highlight + soft glow */
    inset 2px 2px 1px -1px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 95%), transparent),
    inset 3px 4px 10px -4px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 55%), transparent),
    /* ...with a faint catch on the top-right edge (slightly off-axis / "de travers") */
    inset -2px 2px 2px -2px color-mix(in srgb, var(--c-light) calc(var(--glass-reflex-light) * 42%), transparent),
    /* shadow on the BOTTOM-RIGHT (away from the light) */
    inset -2px -2px 2px -2px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 24%), transparent),
    inset -4px -5px 10px -6px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 16%), transparent),
    /* ambient drop */
    0px 6px 16px 0px color-mix(in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
}

/* ── SOCIAL SHARE — a glass "Share" pill that morphs into a bigger glass card ── */
.jm-share-wrap { display: flex; justify-content: flex-end; margin: 0 0 1.5rem; padding-right: 3rem; }
.jm-share-pop { position: relative; display: inline-flex; }

/* the glass "Share" pill (toggle) */
.jm-share-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.1rem; border-radius: 14px; border: none;
  background-color: color-mix(in srgb, #cfd6e2 10%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.6); backdrop-filter: blur(10px) saturate(1.6);
  box-shadow: var(--glass-shadow);
  color: #cfd6e2; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: color .18s ease, transform .18s ease, opacity .25s ease;
}
.jm-share-toggle:hover { color: #fff; transform: translateY(-1px); }
.jm-share-pop.is-open .jm-share-toggle { opacity: 0; pointer-events: none; }  /* the pill "becomes" the card */

/* the morphed card — grows from the pill's top-right corner, overlays content below */
.jm-share-card {
  position: absolute; top: 0; right: 0; z-index: 60;
  width: max-content; max-width: min(360px, calc(100vw - 2rem));
  padding: 1.1rem 1.2rem 1.25rem;
  border-radius: 20px; border: none;
  background: linear-gradient(145deg, rgba(40,38,60,0.14), rgba(26,24,40,0.10));
  -webkit-backdrop-filter: blur(20px) saturate(1.7); backdrop-filter: blur(20px) saturate(1.7);
  box-shadow: var(--glass-shadow), 0 24px 60px rgba(0,0,0,0.6);   /* glass rim + float shadow */
  transform: scale(0.82); transform-origin: top right;
  opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.2,.8,.2,1.2), opacity .24s ease;
}
.jm-share-card::before {   /* glass sheen */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 45% at 25% 0%, rgba(255,255,255,0.16), transparent 60%);
}
.jm-share-pop.is-open .jm-share-card { transform: scale(1); opacity: 1; pointer-events: auto; }
.jm-share-card > * { position: relative; z-index: 1; }
.jm-share-card .dm-header { margin-bottom: 0.9rem; gap: 0.7rem; }
.jm-share-card .dm-header-icon { width: 2.1rem; height: 2.1rem; font-size: 0.92rem; border-radius: 10px; }
.jm-share-card .dm-title { font-size: 0.98rem; }
.jm-share-card .dm-intro { font-size: 0.8rem; }
.jm-share-card-x {
  position: absolute; top: 0.55rem; right: 0.7rem; z-index: 2;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--jm-muted);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.jm-share-card-x:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* icons row inside the card */
.jm-share-icons { display: flex; justify-content: center; align-items: center; gap: 0.5rem; }

/* icons — plain coloured glyphs (desaturated at rest, brand colour on hover) */
.jm-pop-ic {
  --glyph: #cfd6e2; --glow: rgba(255,255,255,0.16);
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  color: var(--glyph) !important; text-decoration: none !important;
  font-size: 1.15rem;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  transition: color .18s ease, transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  animation: jm-float 4s ease-in-out infinite;
}
.jm-pop-ic:hover {
  animation: none;
  transform: translateY(-2px) scale(1.1);
  border-color: rgba(255,255,255,0.42);
  background: rgba(0,0,0,0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 0 16px var(--glow);
}
.jm-pop-ic.x      { --glyph:#c3cad4; --glow:rgba(255,255,255,0.22); }                     .jm-pop-ic.x:hover      { color:#ffffff !important; }
.jm-pop-ic.bsky   { --glyph:#8198b2; --glow:rgba(17,133,254,0.40); animation-delay:.2s; } .jm-pop-ic.bsky:hover   { color:#4aa8ff !important; }
.jm-pop-ic.masto  { --glyph:#9496b8; --glow:rgba(99,100,255,0.40); animation-delay:.4s; } .jm-pop-ic.masto:hover  { color:#9aa0ff !important; }
.jm-pop-ic.reddit { --glyph:#c58b76; --glow:rgba(255,69,0,0.40);   animation-delay:.6s; } .jm-pop-ic.reddit:hover { color:#ff6a3d !important; }
.jm-pop-ic.hn     { --glyph:#c39a75; --glow:rgba(255,102,0,0.40);  animation-delay:.8s; } .jm-pop-ic.hn:hover     { color:#ff9148 !important; }
.jm-pop-ic.mail   { --glyph:#83ac9b; --glow:rgba(52,211,153,0.40); animation-delay:1s; }  .jm-pop-ic.mail:hover   { color:#34d399 !important; }

@keyframes jm-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .jm-pop-ic { animation: none; } }

/* Share on phones — MUST sit after the base .jm-share-* rules above: a @media block has
   the same specificity, so only its later source position wins the tie-break. The expanded
   card is anchored to the pill's right edge (itself inset from the screen); the full-size
   6-icon row pushed the card to ~338px and its left edge bled off-screen. Tighten the row
   + padding so the card lands ~290px, comfortably clear of the left edge. */
@media (max-width: 768px) {
  .jm-share-wrap { padding-right: 0.75rem; }
  .jm-share-card { padding: 1rem 0.9rem 1.1rem; }
  .jm-share-icons { gap: 0.4rem; }
  .jm-pop-ic { width: 2.2rem; height: 2.2rem; font-size: 1rem; }
}
