@font-face { font-family: "Maghribi Assile"; src: url("./fonts/maghribi-assile.ttf") format("truetype"); font-style: normal; font-weight: 100 900; font-display: swap; }
/* Jamal repository pages, v5: one consolidated stylesheet. No external fonts, scripts or images.
   Layout rule: every hero is one CSS grid with named areas (media | id | lead | extra); no absolute positioning, no magic offsets. */
:root {
  --paper: #f6f0e3; --surface: #fffdf8; --ink: #15233a; --ink-2: #5b6578; --line: #e0d3b4; --line-gold: #cfb06a;
  --accent: #8a6420; --lapis: #14294a; --ochre: #b8872b; --ochre-soft: rgba(184,135,43,.16);
  --code-bg: #f8f2e4; --danger: #a33a3a; --ok: #2f6b4f;
  --btn-bg: var(--lapis); --btn-ink: #f3d98b; --h2-ink: var(--lapis); --nav-on: var(--lapis);
  --gold: linear-gradient(135deg, #8f6a1f 0%, #e6c36a 45%, #b8872b 70%, #f0d78c 100%);
  --title: linear-gradient(135deg, #6d4c12, #b8872b 50%, #7a5614);
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 12px 32px -16px rgba(20,41,74,.28);
  --r: 14px; --r-sm: 10px; --nav-h: 46px;
  --font: "Maghribi Assile", serif;
  --font-head: "Maghribi Assile", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Roboto Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a1424; --surface: #101f38; --ink: #f1e8d0; --ink-2: #a9b3c4; --line: #2b3d5e; --line-gold: #8a7340;
    --accent: #e6c36a; --ochre: #e6c36a; --ochre-soft: rgba(230,195,106,.16); --code-bg: #0c1a30; --danger: #ff8a8e; --ok: #8fd6b0;
    --btn-bg: var(--gold); --btn-ink: #1a1405; --h2-ink: #f1e3b2; --nav-on: #f1e3b2;
    --title: linear-gradient(135deg, #f6e4a6, #d6a93f 55%, #f6e4a6);
    --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 16px 36px -18px rgba(0,0,0,.8);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 14px); }
body {
  margin: 0; position: relative; min-height: 100vh; color: var(--ink);
  font: 400 16px/1.8 var(--font);
  background: radial-gradient(900px 420px at 85% -80px, rgba(230,195,106,.20), transparent 70%),
              radial-gradient(700px 380px at 5% 0, rgba(20,41,74,.10), transparent 70%), var(--paper);
}
body::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 640px; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'><g fill='none' stroke='%23b8872b' stroke-opacity='.16' stroke-width='1'><rect x='18' y='18' width='36' height='36'/><rect x='18' y='18' width='36' height='36' transform='rotate(45 36 36)'/><circle cx='36' cy='36' r='9'/></g></svg>");
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent); mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(100% - 32px, 1040px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header + sticky tabs (identical on every page) ---------- */
.bar { padding-block: 12px; }
.bar-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.brand { display: inline-flex; flex: none; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 21px/1.3 var(--font-head); }
.brand img { width: 36px; height: 36px; flex: none; border-radius: 10px; display: block; box-shadow: 0 0 0 1.5px #d9b45a, 0 6px 14px -6px rgba(20,41,74,.5); }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.langs { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); box-shadow: var(--shadow); }
.langs button { appearance: none; border: 0; background: transparent; color: var(--ink-2); font: 600 13px/1 var(--font); padding: 8px 12px; border-radius: 999px; cursor: pointer; min-height: 34px; }
.langs button[aria-pressed="true"] { background: var(--lapis); color: #f3d98b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .langs button[aria-pressed="true"] { background: var(--gold); color: #1a1405; } }

@media (max-width: 479px) { /* four language buttons (GitLab build) must not squeeze the brand */
  .brand { font-size: 18px; gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .langs button { padding: 8px 9px; font-size: 12.5px; }
}

.nav { position: sticky; top: 0; z-index: 30; background: var(--paper); border-top: 1px solid var(--line); }
@supports (background: color-mix(in srgb, red, blue)) {
  .nav { background: color-mix(in srgb, var(--paper) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}
.nav::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: linear-gradient(90deg, transparent, var(--line-gold) 15%, #f0d78c 50%, var(--line-gold) 85%, transparent); }
.nav-in { display: flex; height: var(--nav-h); overflow-x: auto; scrollbar-width: none; }
.nav-in::-webkit-scrollbar { display: none; }
.nav a { position: relative; flex: 1 1 auto; display: grid; place-items: center; padding-inline: 12px; white-space: nowrap; text-decoration: none; color: var(--ink-2); font: 700 14.5px/1 var(--font); }
.nav a::after { content: ""; position: absolute; inset: auto 10px 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold); transform: scaleX(0); transition: transform .25s; }
.nav a:hover, .nav a[aria-current="page"], .nav a[aria-current="true"] { color: var(--nav-on); }
.nav a:hover::after, .nav a[aria-current="page"]::after, .nav a[aria-current="true"]::after { transform: scaleX(1); }

/* ---------- hero: one grid, three variants ---------- */
.hero {
  --media: 84px; --gap: 14px;
  position: relative; display: grid; align-items: center; column-gap: var(--gap); row-gap: 16px;
  grid-template-columns: var(--media) minmax(0, 1fr);
  grid-template-areas: "media id" "lead lead" "extra extra";
  margin-top: 18px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line-gold); border-radius: 22px; box-shadow: var(--shadow);
}
@supports (background: color-mix(in srgb, red, blue)) { .hero { background: linear-gradient(160deg, var(--surface), color-mix(in srgb, var(--surface) 72%, var(--paper))); } }
.hero::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(184,135,43,.30); border-radius: 17px; pointer-events: none; }
body[data-page="ext"] .hero { --media: 76px; grid-template-areas: "crumb crumb" "media id" "lead lead" "extra extra"; }
body[data-page="about"] .hero { --media: 84px; }

.hero-media { grid-area: media; min-width: 0; }
.hero-id { grid-area: id; justify-self: start; min-width: 96px; max-width: 100%; }
.hero > .lead { grid-area: lead; }
.hero-extra { grid-area: extra; min-width: 0; }
.hero > .crumb { grid-area: crumb; justify-self: start; }
.hero-media img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 22%; box-shadow: 0 0 0 2px #d9b45a, 0 12px 26px -12px rgba(20,41,74,.6); }

.hero h1 {
  margin: 0; font: 700 clamp(26px, 5.2vw, 46px)/1.45 var(--font-head); letter-spacing: 0; color: var(--lapis);
  background: var(--title); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
body[data-page="ext"] .hero h1 { font-size: clamp(22px, 4.4vw, 38px); }
/* ornament: its width is the title's width, because .hero-id shrink-wraps the h1 */
.orn { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.orn::before, .orn::after { content: ""; flex: 1; height: 1px; }
.orn::before { background: linear-gradient(90deg, transparent, var(--line-gold)); }
.orn::after { background: linear-gradient(270deg, transparent, var(--line-gold)); }
[dir="rtl"] .orn::before { background: linear-gradient(270deg, transparent, var(--line-gold)); }
[dir="rtl"] .orn::after { background: linear-gradient(90deg, transparent, var(--line-gold)); }
.orn i { flex: none; width: 8px; height: 8px; background: var(--ochre); transform: rotate(45deg); }

.lead { margin: 0; max-width: 58ch; color: var(--ink-2); font-size: clamp(16px, 2.4vw, 19px); line-height: 1.9; }
.crumb { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font: 700 14px/1.2 var(--font); }
[dir="rtl"] .crumb .arrow { transform: scaleX(-1); }

@media (min-width: 720px) {
  .hero { --gap: 28px; padding: 40px; row-gap: 14px; }
  .hero::before { inset: 8px; }
  body[data-page="repo"] .hero { --media: 172px; grid-template-columns: minmax(0, 1fr) var(--media); grid-template-areas: "id media" "lead media" "extra media"; }
  body[data-page="ext"] .hero { --media: 104px; grid-template-areas: "crumb crumb" "media id" "media lead" "media extra"; }
  body[data-page="about"] .hero { --media: 128px; grid-template-areas: "media id" "media lead" "media extra"; }
  body[data-page="ext"] .hero-media, body[data-page="about"] .hero-media { align-self: start; }
}

/* ---------- seal ---------- */
.seal { display: block; width: 100%; height: auto; aspect-ratio: 1; color: var(--ink-2); direction: ltr; unicode-bidi: isolate; filter: drop-shadow(0 10px 18px rgba(184,135,43,.35)); }
.seal .ring { fill: none; stroke: currentColor; stroke-width: 2; }
.seal .ring-dash { fill: none; stroke: currentColor; stroke-width: 1; stroke-dasharray: 2 5; opacity: .7; }
.seal .star { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.seal .ringtext { font: 600 10.5px var(--mono); fill: currentColor; }
.seal .core { font: 800 19px var(--font-head); fill: currentColor; text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.seal .core.small { font-size: 14px; }
.seal[data-state="verified"] { color: var(--ochre); }
.seal[data-state="verified"] .star { fill: rgba(230,195,106,.28); stroke-dasharray: 400; animation: draw 1.1s ease-out both; }
.seal[data-state="verified"] .ring { stroke-width: 3; }
.seal[data-state="pending"] .ring, .seal[data-state="unknown"] .ring { stroke-dasharray: 6 5; }
@keyframes draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
/* Preserve the full ornamental verification seal at normal mobile zoom.
   Previously the ring inscription disappeared below 720px, so the badge
   looked different at 100% than at 67% browser zoom. */
@media (max-width: 719px) {
  body[data-page="repo"] .hero { --media: clamp(96px, 26vw, 116px); }
  .seal .ringtext { visibility: visible; }
  .seal .core { font-size: 19px; }
  .seal .core.small { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .seal[data-state="verified"] .star { animation: none; } }

/* ---------- address box, buttons, status ---------- */
.address { display: flex; align-items: stretch; max-width: 640px; background: var(--surface); border: 1px solid var(--line-gold); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.address-field { flex: 1; min-width: 0; align-self: center; padding: 12px 14px; font: 500 13px/1.6 var(--mono); direction: ltr; text-align: left; overflow-wrap: anywhere; }
.btn {
  appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px; border-radius: var(--r-sm); background: var(--btn-bg); color: var(--btn-ink);
  font: 700 14.5px/1 var(--font); white-space: nowrap; text-decoration: none; transition: filter .2s, transform .2s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line-gold); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[data-done="1"] { background: var(--ok); color: #fff; }
.address .btn { border-radius: 0; min-height: 0; min-width: 96px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.status { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font: 600 14px/1.5 var(--font); color: var(--ink-2); }
.status::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.status[data-state="verified"] { color: var(--ink); }
.status[data-state="verified"]::before { background: var(--ochre); box-shadow: 0 0 0 4px var(--ochre-soft); }
.status[data-state="pending"]::before { background: transparent; border: 2px dashed var(--ink-2); }
.status[data-state="unknown"]::before { background: var(--danger); opacity: .7; }

/* ---------- sections ---------- */
section { margin-top: clamp(30px, 6vw, 52px); }
h2 { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; font: 700 clamp(24px, 4.4vw, 34px)/1.4 var(--font-head); color: var(--h2-ink); }
h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-gold), transparent); }
[dir="rtl"] h2::after { background: linear-gradient(270deg, var(--line-gold), transparent); }
h3 { margin: 0; font: 700 20px/1.4 var(--font-head); }
.hint { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #1a1405; font: 700 18px/1 var(--font-head); box-shadow: 0 6px 14px -6px rgba(184,135,43,.7); }
.steps p { margin: 0; }
@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps li { grid-template-columns: 1fr; align-items: start; gap: 10px; padding: 18px; }
}

.list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.row { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; color: inherit; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); transition: transform .25s, border-color .25s, box-shadow .25s; }
.row:hover { transform: translateY(-3px); border-color: var(--line-gold); box-shadow: 0 18px 36px -18px rgba(184,135,43,.5); }
.row img { display: block; width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 0 0 1.5px #d9b45a, 0 10px 22px -10px rgba(20,41,74,.5); }
.row .meta { margin-top: 8px; }
.row p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chev { color: var(--ochre); font-size: 22px; line-height: 1; }
[dir="rtl"] .chev { transform: scaleX(-1); }
@media (min-width: 720px) { .row { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; padding: 20px; } .row img { width: 64px; height: 64px; } }
.empty { padding: 18px; color: var(--ink-2); border: 1px dashed var(--line); border-radius: var(--r); }

.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; padding: 7px 12px; font: 700 12.5px/1 var(--font); color: var(--accent); background: rgba(184,135,43,.08); border: 1px solid #d9bf7f; border-radius: 999px; unicode-bidi: plaintext; }
.tag.safe { color: var(--ok); background: rgba(47,107,79,.10); border-color: rgba(47,107,79,.45); }
.tag.safe::before { content: "✓"; margin-inline-end: 6px; font-weight: 800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.safe { background: rgba(143,214,176,.08); border-color: rgba(143,214,176,.45); } }

dl.facts { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); margin: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line-gold); border-radius: var(--r); box-shadow: var(--shadow); }
dl.facts dt, dl.facts dd { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
dl.facts dt { background: var(--ochre-soft); color: var(--ink); font-weight: 700; font-size: 14px; }
dl.facts dd { min-width: 0; overflow-wrap: anywhere; }
dl.facts dt:nth-last-of-type(1), dl.facts dt:nth-last-of-type(1) + dd { border-bottom: 0; }
.mono { font: 13.5px var(--mono); direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] dd.mono { text-align: right; }
.hash { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hash .mono { word-break: break-all; }
@media (max-width: 640px) {
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dt { border-bottom: 0; padding-bottom: 4px; }
  dl.facts dd { padding-top: 10px; }
}

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.card { display: grid; gap: 2px; padding: 16px 18px; color: inherit; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); transition: transform .25s, border-color .25s; }
a.card:hover { transform: translateY(-3px); border-color: var(--line-gold); }
.card small { color: var(--accent); font: 700 13px/1.6 var(--font); }
.card b { font: 700 17px/1.5 var(--mono); direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }
[dir="rtl"] .card b { text-align: right; }

.tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.tools input { flex: 1; min-width: 200px; padding: 14px 16px; font: 500 15px/1 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.tools input:focus { outline: 3px solid var(--ochre-soft); border-color: var(--line-gold); }
.tools .count { align-self: center; color: var(--ink-2); font: 600 13px/1 var(--font); }

/* extension content blocks (snippets, commands, terminal theme) */
.panel { background: var(--surface); border: 1px solid var(--line-gold); border-radius: var(--r); box-shadow: var(--shadow); }
.snip { display: grid; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.snip:last-child { border-bottom: 0; }
.snip-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.snip small { color: var(--ink-2); }
.trigger { padding: 6px 10px; font: 700 14px/1 var(--mono); direction: ltr; color: #f3d98b; background: var(--lapis); border-radius: 6px; }
pre.code { margin: 0; padding: 12px 14px; overflow-x: auto; font: 13px/1.6 var(--mono); direction: ltr; text-align: left; tab-size: 2; background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; }
.term { padding: 18px; overflow-x: auto; font: 14px/1.7 var(--mono); direction: ltr; text-align: left; border-radius: var(--r); }
.term .cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; }
.swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.swatches span { aspect-ratio: 1; border-radius: 6px; border: 1px solid rgba(127,127,127,.35); }

/* ---------- footer ---------- */
footer { margin-top: clamp(36px, 7vw, 64px); color: #c9d2e3; font-size: 14px; background: var(--lapis); border-top: 3px solid transparent; border-image: var(--gold) 1; }
footer a { color: #f3d98b; }
.foot { display: grid; gap: 10px; padding-block: 24px 30px; }
.foot .links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (min-width: 720px) { .foot { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .foot small { grid-column: 1 / -1; } }

/* Extension screenshots: one swipeable row */
.shots { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.shots figure { flex: 0 0 auto; margin: 0; width: min(78vw, 300px); scroll-snap-align: start; }
.shots a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.shots img { display: block; width: 100%; height: auto; }
.shots figcaption { margin-top: 8px; color: var(--muted, inherit); font-size: 13px; line-height: 1.6; }

/* Single default Maghribi Assile font for Arabic and English site text. */

/* Shared typography for both language modes. */
html, body, button, input, select, textarea { font-family: var(--font); }
html code, html pre, html kbd, html samp, html .mono, html .address-field, html .trigger, html .term, html .card b { font-family: var(--mono); }
