/* Two skins on one page: [data-view="recruiter"] (default, shipment tracking)
   and [data-view="engineer"] (pull requests and CI). */
:root {
  --paper: #F4F6F9; --surface: #FFFFFF; --ink: #13203A; --muted: #56627A; --line: #D6DCE5;
  --signal: #F2B705; --on-signal: #13203A; --ok: #1C7F53; --accent: #2F5BD3; --focus: #2F5BD3;
  --radius: 14px; --shadow: 0 1px 2px rgba(19,32,58,.06), 0 8px 28px rgba(19,32,58,.07);
  --font: "Archivo", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
/* Themes: the inline script in index.html sets data-theme from the saved choice or the system setting. */
:root[data-theme="dark"]:not([data-view="engineer"]):not([data-view="game"]) { --paper: #0F1726; --surface: #162036; --ink: #E8ECF2; --muted: #9AA5B8; --line: #2A3651; --ok: #3BB27D; --accent: #8AA8FF; --focus: #8AA8FF; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25); color-scheme: dark; }
[data-view="engineer"] {
  --paper: #0D1117; --surface: #161B22; --ink: #E6EDF3; --muted: #8D96A0; --line: #30363D;
  --signal: #3FB950; --on-signal: #0D1117; --ok: #3FB950; --accent: #2F81F7; --focus: #2F81F7;
  --merged: #A371F7; --warn: #D29922; --shadow: none; color-scheme: dark;
  --code-bg: #010409; --code-k: #79C0FF; --code-s: #A5D6FF; --on-ok: #0D1117;
}
[data-view="engineer"][data-theme="light"] {
  --paper: #FFFFFF; --surface: #F6F8FA; --ink: #1F2328; --muted: #59636E; --line: #D1D9E0;
  --signal: #1A7F37; --on-signal: #FFFFFF; --ok: #1A7F37; --accent: #0969DA; --focus: #0969DA;
  --merged: #8250DF; --warn: #9A6700; color-scheme: light;
  --code-bg: #F6F8FA; --code-k: #0550AE; --code-s: #0A3069; --on-ok: #FFFFFF;
}
[data-view="game"] {
  --paper: #120B2E; --surface: #1D1442; --ink: #F4EEFF; --muted: #B6A8D9; --line: #3A2C6E;
  --signal: #FFD23F; --on-signal: #120B2E; --ok: #3DDC97; --accent: #7CF6FF; --focus: #7CF6FF;
  --pop: #FF5CA8; --on-pop: #120B2E; --shadow: 0 6px 0 rgba(0,0,0,.35); --pixel: "Press Start 2P", var(--mono); color-scheme: dark;
}
[data-view="game"][data-theme="light"] {
  --paper: #FFF6E5; --surface: #FFFFFF; --ink: #2A1E5C; --muted: #66598C; --line: #E6D7BC;
  --signal: #FF8A00; --on-signal: #2A1E5C; --ok: #0E7A55; --accent: #5B3DF5; --focus: #5B3DF5;
  --pop: #C81E5B; --on-pop: #FFFFFF; --shadow: 0 6px 0 rgba(42,30,92,.12); color-scheme: light;
}
:root[lang="ar"] .stop .st, :root[lang="ar"] .kicker, :root[lang="ar"] .label-card .head { font-family: var(--font); letter-spacing: 0; }
:root[lang="ar"] { --font: "IBM Plex Sans Arabic", "Archivo", system-ui, sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; transition: background .35s, color .35s; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 clamp(14px, 2.6vw, 36px); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; z-index: 60; }
.skip:focus { top: 12px; }
.mono { font-family: var(--mono); }
section { padding: 72px 0; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; margin: 0 0 8px; font-weight: 800; font-stretch: 110%; letter-spacing: -0.015em; }
:root[lang="ar"] h2 { letter-spacing: 0; font-weight: 700; }
.intro { color: var(--muted); margin: 0 0 32px; max-width: 68ch; }
.kicker { display: inline-block; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
[data-view="engineer"] h2::before { content: "## "; color: var(--muted); font-family: var(--mono); font-weight: 500; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { font-weight: 800; font-stretch: 115%; text-decoration: none; font-size: 18px; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand .logo { width: 30px; height: 30px; }
.nav { display: flex; gap: 22px; margin-inline-start: auto; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.pop { position: relative; flex-shrink: 0; }
.pill, .tool { border: 1.5px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; }
.pill:hover, .tool:hover { border-color: var(--muted); }
.view-btn .k { color: var(--muted); font-weight: 600; }
.view-btn .car { font-size: 11px; color: var(--muted); }
.tools { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; height: 36px; flex-shrink: 0; overflow: hidden; }
.tools .tool { border: 0; border-radius: 0; height: 100%; padding: 0 12px; }
.tools .tool + .tool { border-inline-start: 1.5px solid var(--line); }
.tools #theme { width: 40px; padding: 0; }
.pop-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; min-width: 250px; background: var(--surface, var(--paper)); color: var(--ink); border: 1.5px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.14); display: grid; gap: 2px; }
.pop-menu[hidden] { display: none; }
.pop-menu button, .pop-menu a { display: grid; gap: 2px; text-align: start; border: 0; background: transparent; color: var(--ink); padding: 9px 12px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.pop-menu button:hover, .pop-menu a:hover, .pop-menu button:focus-visible, .pop-menu a:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.pop-menu small { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.views-menu button[aria-checked="true"] { background: color-mix(in srgb, var(--signal, #F2B705) 18%, transparent); }
.views-menu button[aria-checked="true"] b::after { content: " ✓"; }
.menu-pop { display: none; }
.tool-menu { width: 36px; padding: 0; justify-content: center; font-size: 16px; }
@media (max-width: 1100px) { .nav { display: none; } .bar .pop[data-pop="view"] { margin-inline-start: auto; } .menu-pop { display: block; } }
@media (max-width: 560px) {
  .bar .wrap { gap: 6px; }
  .brand span { display: none; }
  .view-btn .k { display: none; }
  .pill { padding: 0 11px; font-size: 13px; } .tools .tool { padding: 0 9px; font-size: 13px; } .tools #theme { width: 34px; }
  .pop-menu { position: fixed; top: 70px; inset-inline: 12px; min-width: 0; }
}

/* hero */
.hero { padding: 40px 0 40px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; } }
.hero h1 { font-size: clamp(48px, 8vw, 96px); line-height: .95; margin: 0 0 18px; font-weight: 800; font-stretch: 120%; letter-spacing: -0.025em; }
:root[lang="ar"] .hero h1 { font-weight: 700; letter-spacing: 0; line-height: 1.15; }
.hero .role { font-size: 22px; font-weight: 700; margin: 0 0 12px; }
.hero .pitch { color: var(--muted); max-width: 58ch; margin: 0 0 14px; font-size: 18px; }
.hero .seeking { max-width: 60ch; margin: 0 0 26px; font-size: 15.5px; padding: 10px 14px; border-inline-start: 3px solid var(--signal); background: color-mix(in srgb, var(--signal) 10%, transparent); border-radius: 0 10px 10px 0; }
:root[dir="rtl"] .hero .seeking { border-radius: 10px 0 0 10px; }
.hero .seeking b { font-weight: 700; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; text-decoration: none; padding: 11px 18px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .15s, border-color .15s; }
.btn:hover { transform: translateY(-2px); border-color: var(--ink); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.label-card { background: var(--surface); border: 2px dashed var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); position: relative; }
.label-card .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.label-top { display: grid; grid-template-columns: 104px 1fr; gap: 16px; align-items: center; margin: 4px 0 16px; }
.label-photo { width: 104px; height: 104px; object-fit: cover; border-radius: 10px; border: 2px solid var(--ink); filter: grayscale(1) contrast(1.05); }
.label-top .barcode { margin: 0; height: 64px; }
.avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ok); }
.handle { color: var(--muted); font-size: 15px; }
.barcode { height: 44px; margin: 6px 0 14px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 12px); border-radius: 2px; opacity: .85; }
.label-card dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: 15px; }
.label-card dt { color: var(--muted); }
.label-card dd { margin: 0; font-weight: 700; }
.dot-live { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); margin-inline-end: 8px; animation: ping 2.2s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 9px transparent; } }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 8px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } .stats .stat:last-child { grid-column: 1 / -1; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 34px; line-height: 1; font-weight: 800; font-stretch: 112%; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }
:root[dir="rtl"] .stat b { direction: ltr; text-align: right; }

/* terminal (engineer hero) */
.term { background: var(--code-bg, #010409); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-family: var(--mono); font-size: 14px; line-height: 1.7; }
.term .tbar { display: flex; gap: 7px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.term .tbar i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.term .tbar i:nth-child(2) { background: #FEBC2E; } .term .tbar i:nth-child(3) { background: #28C840; }
.term pre { margin: 0; padding: 16px 18px; white-space: pre-wrap; min-height: 300px; direction: ltr; text-align: left; }
.term .p { color: var(--ok); } .term .c { color: var(--muted); } .term .k { color: var(--code-k, #79C0FF); } .term .s { color: var(--code-s, #A5D6FF); } .term .y { color: var(--warn); } .term .m { color: var(--merged); }
.caret::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--ok); }
@keyframes blink { 50% { opacity: 0; } }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.badge { display: inline-flex; font-family: var(--mono); font-size: 12px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.badge span { padding: 3px 8px; background: var(--surface); color: var(--ink); }
.badge span + span { background: var(--ok); color: var(--on-ok, #0D1117); font-weight: 600; }
.badge.b span + span { background: var(--accent); color: #fff; } .badge.p span + span { background: var(--merged); color: #fff; } .badge.y span + span { background: var(--warn); color: var(--on-ok, #0D1117); }

/* route: shipment (recruiter) and pipeline (engineer) share markup */
.route { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 30px 0 10px; }
.route::before { content: ""; position: absolute; inset-inline: 10%; top: 58px; height: 4px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--line) 0 14px, transparent 14px 22px); }
.route .fill { position: absolute; inset-inline-start: 10%; top: 58px; height: 4px; border-radius: 4px; background: var(--signal); width: 0; transition: width 1.6s cubic-bezier(.3,.7,.2,1); }
.stop { position: relative; text-align: center; padding: 0 6px; background: none; border: 0; cursor: pointer; }
.stop .node { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 3px solid var(--line); position: relative; z-index: 1; transition: transform .2s, border-color .3s, background .3s; font-size: 24px; }
.stop:hover .node { transform: scale(1.08); }
.stop.on .node { border-color: var(--signal); }
.stop.done .node { background: var(--ok); border-color: var(--ok); color: #fff; }
.stop.now .node { background: var(--signal); border-color: var(--signal); color: var(--on-signal); animation: pulse 2.4s ease-out infinite; }
.stop.next .node { border-style: dashed; border-color: var(--muted); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 16px transparent; } }
.stop .st { display: block; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stop .sn { display: block; font-weight: 800; font-size: 17px; margin: 2px 0; }
.stop .sw { display: block; font-size: 13px; color: var(--muted); }
.truck { position: absolute; top: -12px; inset-inline-start: 10%; width: 46px; height: 40px; z-index: 2; transition: inset-inline-start 1.6s cubic-bezier(.3,.7,.2,1); pointer-events: none; translate: -50% 0; }
:root[dir="rtl"] .truck { translate: 50% 0; }
.truck svg { width: 46px; height: 40px; animation: bob .5s ease-in-out infinite alternate; }
:root[dir="rtl"] .truck svg { transform: scaleX(-1); }
@keyframes bob { to { translate: 0 -3px; } }
@media (max-width: 760px) {
  .route { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; }
  .route::before, .route .fill { inset-inline-start: 29px; inset-inline-end: auto; top: 30px; bottom: 30px; width: 4px; height: auto; background: repeating-linear-gradient(180deg, var(--line) 0 14px, transparent 14px 22px); }
  .route .fill { background: var(--signal); height: 0; transition: height 1.6s cubic-bezier(.3,.7,.2,1); }
  .stop { display: grid; grid-template-columns: 60px 1fr; gap: 0 16px; text-align: start; align-items: center; padding: 6px 0; }
  .stop .node { margin: 0; grid-row: span 3; }
  .truck { display: none; }
}
/* engineer pipeline skin */
[data-view="engineer"] .route::before { background: var(--line); }
[data-view="engineer"] .stop .node { border-radius: 10px; font-family: var(--mono); font-size: 20px; }
[data-view="engineer"] .stop.now .node { background: transparent; color: var(--warn); border-color: var(--warn); animation: none; }
[data-view="engineer"] .stop.now .node::after { content: ""; position: absolute; inset: -3px; border-radius: 10px; border: 3px solid transparent; border-top-color: var(--warn); animation: spin 1s linear infinite; }
[data-view="engineer"] .stop.next .node { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

/* company blocks */
.company { margin-bottom: 64px; }
.co-head { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.co-mark { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; font-size: 26px; font-stretch: 115%; background: var(--ink); color: var(--paper); }
.co-head .chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.chip { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--muted); }
.chip.now { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.chip.done { color: var(--ok); border-color: currentColor; }
.co-head h3 { margin: 0; font-size: clamp(26px, 3.4vw, 34px); line-height: 1.15; font-weight: 800; font-stretch: 110%; }
.co-head .role { font-weight: 700; margin: 2px 0 10px; }
.co-head .about { color: var(--muted); margin: 0 0 12px; max-width: 78ch; }
.links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 15px; font-weight: 700; }
.co-mark.long { font-size: 17px; letter-spacing: -.01em; }
@media (max-width: 600px) { .co-head { grid-template-columns: 1fr; padding: 18px; } .co-mark { width: 52px; height: 52px; font-size: 21px; } .co-mark.long { font-size: 14px; } }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 16px; }
.filters button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 700; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; margin-top: 18px; align-items: start; }
.card.wide:has(details[open]) { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, border-color .2s, opacity .3s; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.card[hidden] { display: none; }
.card .top { padding: 18px 18px 0; }
.card .impact { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 8px; background: color-mix(in srgb, var(--signal) 22%, transparent); margin-bottom: 10px; }
.card h4, .card h3.card-h { margin: 0 0 6px; font-size: 19px; line-height: 1.25; }
.card .tag { color: var(--muted); margin: 0 0 10px; font-size: 15.5px; }
.card .myrole { font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.card .myrole::before { content: "▸ "; color: var(--signal); }
.card details { margin-top: auto; border-top: 1px solid var(--line); }
.card summary { list-style: none; cursor: pointer; padding: 12px 18px; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.card summary::-webkit-details-marker { display: none; }
.card summary::after { content: "+"; font-size: 20px; line-height: 1; transition: transform .25s; }
.card details[open] summary::after { transform: rotate(45deg); }
.card .body { padding: 0 18px 16px; font-size: 15px; animation: drop .3s ease; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.card .body ul { margin: 0 0 10px; padding-inline-start: 18px; }
.card .body li { margin-bottom: 6px; }
.stack { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.card .links { font-size: 14px; }
.private { font-size: 13px; color: var(--muted); font-weight: 700; }
.flash { animation: flash 1.8s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 4px var(--signal); } 100% { box-shadow: 0 0 0 4px transparent; } }

/* moderation flow diagram */
.flowd { margin: 8px 0 12px; overflow-x: auto; }
.flowd svg { width: 100%; min-width: 560px; max-width: 760px; height: auto; display: block; }
.flowd .n rect { fill: var(--paper); stroke: var(--line); stroke-width: 1.5; }
.flowd text { fill: var(--ink); font-family: var(--font); font-size: 12px; }
.flowd .e { stroke: var(--muted); stroke-width: 1.5; fill: none; stroke-dasharray: 5 5; animation: dash 1.2s linear infinite; }
.flowd .pkt { fill: var(--signal); }
@keyframes dash { to { stroke-dashoffset: -20; } }

/* engineer skin: PR cards and commits */
.pr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pr-head { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.pr-title { font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; margin: 0 0 10px; line-height: 1.3; }
.pr-title .num { color: var(--muted); font-weight: 400; }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; padding: 5px 12px; border-radius: 999px; color: #fff; background: var(--merged); margin-inline-end: 10px; }
.state.open { background: #238636; }
.state.draft { background: #6E7681; }
.pr-meta { color: var(--muted); font-size: 14px; }
.pr-meta code, .branch { font-family: var(--mono); font-size: 12.5px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--code-k, #79C0FF); padding: 2px 6px; border-radius: 6px; }
.pr-body { padding: 18px 22px; display: grid; grid-template-columns: 1fr 280px; gap: 22px; }
@media (max-width: 860px) { .pr-body { grid-template-columns: 1fr; } }
.pr-desc { color: var(--ink); margin: 0 0 14px; }
.checks { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; }
.checks .ch-h { padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--line); background: var(--paper); }
.checks .ch { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.checks .ch:last-child { border-bottom: 0; }
.ic { width: 16px; height: 16px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--on-ok, #0D1117); background: var(--muted); }
.ic.ok { background: var(--ok); } .ic.run { background: transparent; border: 2px solid var(--warn); border-top-color: transparent; animation: spin .9s linear infinite; }
.comment { border: 1px solid var(--line); border-radius: 10px; margin-top: 12px; font-size: 14px; }
.comment .who { padding: 8px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--muted); }
.comment .who b { color: var(--ink); }
.comment p { margin: 0; padding: 10px 12px; }
.commits { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.commit { border-bottom: 1px solid var(--line); }
.commit:last-child { border-bottom: 0; }
.commit[hidden] { display: none; }
.commit summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 12px 14px; align-items: center; }
.commit summary::-webkit-details-marker { display: none; }
.commit summary:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.commit .msg { font-family: var(--mono); font-size: 14px; direction: ltr; text-align: start; overflow-wrap: anywhere; }
.commit .msg b { color: var(--ok); font-weight: 600; }
.commit .sha { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.commit .sub { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
.commit .diff { font-family: var(--mono); font-size: 12.5px; }
.commit .diff .add { color: var(--ok); }
.commit .body { padding: 2px 14px 14px 30px; font-size: 15px; border-inline-start: 3px solid var(--merged); margin: 0 14px 12px; animation: drop .3s ease; }
.commit .body ul { margin: 6px 0 10px; padding-inline-start: 18px; }
.merge-box { border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; background: var(--surface); }
.merge-box .big { width: 44px; height: 44px; border-radius: 50%; background: #238636; display: grid; place-items: center; color: #fff; font-size: 22px; }
.merge-box h3 { margin: 0 0 4px; font-size: 20px; }
.merge-box p { margin: 0; color: var(--muted); }
.merge-btn { background: #238636; color: #fff; border: 1px solid rgba(240,246,252,.1); border-radius: 8px; padding: 10px 18px; font-weight: 700; cursor: pointer; }
.merge-btn:hover { background: #2EA043; }
.pkgjson { background: var(--code-bg, #010409); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; font-family: var(--mono); font-size: 14px; line-height: 1.75; overflow-x: auto; direction: ltr; text-align: left; }
.pkgjson .k { color: var(--code-k, #79C0FF); } .pkgjson .s { color: var(--code-s, #A5D6FF); } .pkgjson .c { color: var(--muted); }


.yt-wrap { margin: 4px 0 12px; }
.yt, .yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; overflow: hidden; background: #000; }
.yt { position: relative; padding: 0; cursor: pointer; }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s, opacity .3s; opacity: .92; }
.yt:hover img { transform: scale(1.03); opacity: 1; }
.yt-play { position: absolute; inset: 0; display: grid; place-items: center; }
.yt-play svg { width: 68px; height: 48px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.4)); transition: transform .2s; }
.yt:hover .yt-play svg { transform: scale(1.1); }
.yt-wrap figcaption { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.co-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 380px)); gap: 12px; margin-top: 14px; }

/* infrastructure showcase */
.note { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: start; background: color-mix(in srgb, var(--signal) 12%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--signal) 60%, var(--line)); border-radius: 14px; padding: 14px 18px; margin: 0 0 22px; font-size: 15.5px; }
.note b { font-weight: 800; }
.note p { margin: 0; max-width: 92ch; }
.note.eng { grid-template-columns: 1fr; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-inline-start-width: 4px; }
.note.eng b { color: var(--code-k, var(--accent)); font-family: var(--mono); font-weight: 600; }
.itabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.itabs button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14.5px; font-weight: 700; cursor: pointer; min-height: 40px; }
.itabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
[data-view="engineer"] .itabs { gap: 0; border-bottom: 1px solid var(--line); }
[data-view="engineer"] .itabs button { border-radius: 8px 8px 0 0; border-bottom: 0; margin-bottom: -1px; font-weight: 500; }
[data-view="engineer"] .itabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); border-top: 2px solid var(--warn); }
.ipanel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow); animation: drop .35s ease; }
[data-view="engineer"] .ipanel { border-radius: 0 0 12px 12px; }
.ipanel h3 { margin: 8px 0 6px; font-size: clamp(22px, 3vw, 30px); line-height: 1.2; font-weight: 800; }
.isum { color: var(--muted); margin: 0 0 16px; max-width: 80ch; }
.plan { font-size: 13.5px; margin: -6px 0 14px; color: var(--muted); }
.plan .p { color: var(--ok); } .plan .okc { color: var(--ok); }
.ifig { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 6px; }
.ifig svg { display: block; height: auto; max-width: 100%; min-width: 640px; margin: 0 auto; }
@media (max-width: 700px) { .ifig svg { max-width: none; width: 760px; } }
.ifig .nd rect { fill: var(--surface); stroke-width: 1.6; }
.ifig .k-edge rect { stroke: #D64C7A; } .ifig .k-compute rect { stroke: var(--accent); } .ifig .k-data rect { stroke: var(--muted); } .ifig .k-ext rect { stroke: var(--signal); stroke-dasharray: 5 3; }
.ifig .nt { font: 700 13.5px var(--font); fill: var(--ink); }
.ifig .ns { font: 400 11.5px var(--font); fill: var(--muted); }
.ifig .ed { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.ifig .ed.dash { stroke-dasharray: 6 5; stroke: var(--ok); }
.ifig .ed.learn { stroke: var(--signal); stroke-dasharray: 3 4; }
.ifig .ah { fill: var(--muted); }
.ifig .el { font: 600 11px var(--font); fill: var(--muted); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.ifig .lane { font: 700 12px var(--mono); fill: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.ifig .pkt { fill: var(--signal); stroke: var(--ink); stroke-width: 2; }
.ilegend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); margin: 10px 2px 18px; }
.ilegend .sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; border: 2px solid; margin-inline-end: 6px; vertical-align: -1px; }
.sw.k-edge { border-color: #D64C7A; } .sw.k-compute { border-color: var(--accent); } .sw.k-data { border-color: var(--muted); } .sw.k-ext { border-color: var(--signal); border-style: dashed; }
.icols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
@media (max-width: 860px) { .icols { grid-template-columns: 1fr; } }
.icols h4 { margin: 0 0 8px; font-size: 16px; }
.icols ul { margin: 0; padding-inline-start: 20px; } .icols li { margin-bottom: 8px; }
.mypart { border-inline-start: 4px solid var(--signal); background: var(--paper); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.mypart b { display: block; margin-bottom: 4px; }
.mypart p { margin: 0; }

/* skills (recruiter) */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.skill-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.skill-group h3 { margin: 0 0 12px; font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 14px; padding: 4px 10px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); transition: background .2s, transform .2s; }
.tags span:hover { background: color-mix(in srgb, var(--signal) 25%, var(--paper)); transform: translateY(-1px); }

/* contact */
.deliver { background: var(--ink); color: var(--paper); border-radius: 24px; padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; }
@media (max-width: 860px) { .deliver { grid-template-columns: 1fr; } }
.deliver h2 { color: inherit; }
.deliver p { opacity: .85; margin: 0 0 20px; }
.deliver .btn { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--paper) 40%, transparent); }
.deliver .btn.primary { background: var(--signal); color: var(--on-signal); border-color: var(--signal); }
[data-view="engineer"] .deliver { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
footer { padding: 36px 0 110px; color: var(--muted); font-size: 14px; }

/* ask panel */
.ask { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 45; display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; padding: 13px 20px; border-radius: 999px; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.ask .ask-s { display: none; }
.ask i { width: 10px; height: 10px; border-radius: 50%; background: var(--signal); }
.panel { position: fixed; inset-inline-end: 20px; bottom: 84px; z-index: 50; width: min(420px, calc(100vw - 24px)); max-height: min(72vh, 640px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.3); padding: 18px; transform-origin: bottom right; transition: transform .25s, opacity .25s; }
:root[dir="rtl"] .panel { transform-origin: bottom left; }
.panel[hidden] { display: block; visibility: hidden; opacity: 0; transform: scale(.92) translateY(10px); }
.panel header { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 12px; }
.panel h2 { font-size: 20px; margin: 0; } .panel h2::before { content: none; }
.panel .hint { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.x { font-size: 26px; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; }
.answer { background: var(--paper); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; border-inline-start: 4px solid var(--signal); font-size: 15.5px; }
.answer .aq { font-weight: 700; color: var(--muted); margin: 0 0 4px; font-size: 14px; }
.answer p { margin: 0; }
.typing::after { content: "▍"; animation: blink 1s steps(1) infinite; }
.q { display: block; width: 100%; text-align: start; font-size: 15px; padding: 9px 12px; margin-bottom: 6px; border-radius: 10px; border: 1.5px solid var(--line); background: transparent; cursor: pointer; }
.q:hover { border-color: var(--ink); }
.q.seen::after { content: " ✓"; color: var(--ok); }
@media (max-width: 520px) { .ask { inset-inline-end: 12px; bottom: 12px; padding: 10px 15px; font-size: 14px; gap: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); } .ask .ask-l { display: none; } .ask .ask-s { display: inline; } .panel { inset-inline: 12px; width: auto; bottom: 66px; } }

/* reveal on scroll */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.rv.in { opacity: 1; transform: none; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
}
@media print { .bar, .ask, .panel { display: none; } .rv { opacity: 1; transform: none; } }

/* theme button */

/* ===== game view ===== */
.pix { font-family: var(--pixel, var(--mono)); letter-spacing: .02em; }
[data-view="game"] body { background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 0); background-size: 22px 22px; }
[data-view="game"] h2.pix { font-size: clamp(18px, 2.6vw, 26px); line-height: 1.5; font-weight: 400; }
[data-view="game"] h2.pix::before { content: "▸ "; color: var(--signal); }
:root[lang="ar"][data-view="game"] .pix { font-family: var(--font); font-weight: 700; letter-spacing: 0; }
.pixbtn { font-family: var(--pixel, var(--mono)); font-size: 12px !important; letter-spacing: .04em; }
[data-view="game"] .btn { border-width: 3px; border-radius: 4px; box-shadow: 0 4px 0 color-mix(in srgb, var(--ink) 30%, transparent); }
[data-view="game"] .btn:active { transform: translateY(3px); box-shadow: none; }
.game-hero { grid-template-columns: 1.1fr 1fr; align-items: start; }
.char, .howto { background: var(--surface); border: 3px solid var(--line); border-radius: 8px; padding: 22px; box-shadow: var(--shadow); }
.char-top { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; }
.portrait { position: relative; flex: none; }
.portrait img { width: 132px; height: 132px; object-fit: cover; image-rendering: pixelated; border: 4px solid var(--signal); border-radius: 6px; filter: grayscale(1) contrast(1.1); }
.lvl { position: absolute; bottom: -10px; inset-inline-start: 50%; translate: -50% 0; background: var(--pop); color: var(--on-pop, #fff); font-size: 11px; padding: 5px 8px; border-radius: 3px; white-space: nowrap; }
.game-hero h1.pix { font-size: clamp(20px, 3.4vw, 34px); line-height: 1.35; font-weight: 400; margin: 0 0 8px; letter-spacing: 0; font-stretch: normal; }
.cls { font-weight: 700; margin: 0 0 4px; }
.lvnote { color: var(--muted); font-size: 14px; margin: 0; }
.char-stats { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 18px; font-size: 15px; }
.char-stats dt { color: var(--muted); } .char-stats dd { margin: 0; font-weight: 700; }
.howto h2.pix { font-size: 15px; margin-bottom: 10px; }
.howto h2.pix::before { content: none; }
.howto ol { margin: 0 0 16px; padding-inline-start: 22px; }
.howto li { margin-bottom: 6px; }
.hud-card { border: 2px dashed var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 14px; }
.hud-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin: 4px 0; }
.hud-row .pix { font-size: 10px; color: var(--muted); }
.xpbar { height: 14px; background: var(--paper); border: 2px solid var(--line); border-radius: 3px; overflow: hidden; margin: 4px 0 8px; }
.xpbar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--ok) 0 10px, color-mix(in srgb, var(--ok) 70%, #fff) 10px 12px); transition: width .6s cubic-bezier(.3,.7,.2,1); }
.howto h3.small { font-size: 11px; margin: 0 0 8px; color: var(--muted); font-weight: 400; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 10px; }
.ach { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--line); border-radius: 6px; opacity: .55; filter: grayscale(1); transition: all .4s; }
.ach.on { opacity: 1; filter: none; border-color: var(--signal); background: color-mix(in srgb, var(--signal) 10%, transparent); }
.ach .ai { font-size: 22px; }
.ach b { display: block; font-size: 14px; } .ach small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 0; }
@media (max-width: 900px) { .game-hero { grid-template-columns: 1fr; } }

.map { position: relative; background: var(--surface); border: 3px solid var(--line); border-radius: 8px; padding: 10px; overflow: hidden; min-height: 300px; }
.map svg { width: 100%; height: auto; display: block; }
.map .trail { fill: none; stroke: var(--muted); stroke-width: 5; stroke-dasharray: 2 14; stroke-linecap: round; opacity: .7; }
.castle circle { fill: var(--paper); stroke: var(--line); stroke-width: 4; }
.castle.clear circle { stroke: var(--ok); } .castle.cur circle { stroke: var(--signal); } .castle.lock circle { stroke-dasharray: 6 5; }
.castle text { font-size: 24px; }
.hero-sprite { position: absolute; width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--signal); object-fit: cover; translate: -50% 0; transition: left .7s cubic-bezier(.3,.7,.2,1), top .7s cubic-bezier(.3,.7,.2,1); animation: hop .6s ease-in-out infinite alternate; filter: grayscale(1); box-shadow: 0 6px 0 rgba(0,0,0,.25); }
@keyframes hop { to { translate: -50% -6px; } }
.map-labels { position: absolute; inset: 10px; pointer-events: none; }
.world-btn { position: absolute; translate: -50% 0; pointer-events: auto; background: var(--paper); border: 2px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; text-align: center; min-width: 120px; }
.world-btn .pix { display: block; font-size: 9px; color: var(--muted); }
.world-btn b { display: block; font-size: 14px; } .world-btn small { display: block; color: var(--muted); font-size: 11.5px; }
.world-btn.sel { border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 35%, transparent); }
@media (max-width: 760px) {
  .map { min-height: 0; } .map svg, .hero-sprite { display: none; }
  .map-labels { position: static; display: grid; gap: 8px; }
  .world-btn { position: static; translate: none; text-align: start; }
}
.world { margin-bottom: 56px; }
.lore { background: var(--surface); border: 3px solid var(--line); border-radius: 8px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.lore .world-no { font-size: 10px; color: var(--signal); }
.lore h3.pix { font-size: clamp(16px, 2.4vw, 22px); line-height: 1.5; margin: 8px 0 4px; font-weight: 400; }
.lore .role { font-weight: 700; margin: 0 0 10px; }
.lore .about { color: var(--muted); margin: 0 0 12px; max-width: 80ch; }
.lore .about b { color: var(--ink); }
.quests { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; align-items: start; }
.quest { background: var(--surface); border: 3px solid var(--line); border-radius: 8px; padding: 16px; box-shadow: var(--shadow); transition: border-color .3s, transform .2s; }
.quest:hover { transform: translateY(-3px); }
.quest.done { border-color: var(--ok); }
.quest.pop { animation: qpop .5s ease; }
@keyframes qpop { 40% { transform: scale(1.03); } }
.q-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.q-badge { font-size: 9px; color: var(--muted); }
.q-xp { font-size: 10px; color: var(--on-signal); background: var(--signal); padding: 4px 7px; border-radius: 3px; white-space: nowrap; }
.quest.done .q-xp { background: var(--ok); }
.quest h4, .quest .q-h { margin: 0 0 6px; font-size: 18px; }
.quest .tag { color: var(--muted); margin: 0 0 12px; font-size: 15px; }
.quest summary { list-style: none; cursor: pointer; display: inline-block; padding: 9px 12px; border: 3px solid var(--ink); border-radius: 4px; background: var(--paper); }
.quest summary::-webkit-details-marker { display: none; }
.quest.done summary { border-color: var(--ok); color: var(--ok); }
.quest .body { margin-top: 12px; font-size: 15px; animation: drop .3s ease; }
.quest .body ul { margin: 0 0 10px; padding-inline-start: 18px; }
.quest .myrole { font-weight: 700; margin: 0 0 8px; }
.tree { display: grid; gap: 10px; margin-bottom: 22px; }
.branch { background: var(--surface); border: 3px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.b-head { display: flex; justify-content: space-between; margin-bottom: 8px; } .b-head .pix { font-size: 10px; color: var(--muted); }
.pips { display: flex; gap: 4px; }
.pips i { flex: 1; height: 14px; border-radius: 2px; background: var(--paper); border: 2px solid var(--line); }
.pips i.on { background: var(--signal); border-color: var(--signal); animation: pip .4s var(--d) both; }
@keyframes pip { from { transform: scaleY(0); } }
.boss { background: var(--surface); border: 3px solid var(--line); border-radius: 8px; padding: clamp(20px, 4vw, 40px); box-shadow: var(--shadow); text-align: center; }
.boss h2.pix::before { content: none; }
.boss-arena { display: flex; justify-content: center; align-items: center; gap: clamp(16px, 5vw, 60px); margin: 26px 0; flex-wrap: wrap; }
.fighter { display: grid; justify-items: center; gap: 8px; }
.fighter img { width: 96px; height: 96px; border-radius: 6px; border: 4px solid var(--signal); object-fit: cover; filter: grayscale(1); }
.fighter b.pix { font-size: 11px; }
.vs { font-size: 22px; color: var(--pop); }
.boss-icon { font-size: 70px; line-height: 1; display: block; }
.enemy.hit .boss-icon { animation: shake .5s ease 2; }
@keyframes shake { 25% { transform: translateX(-8px) rotate(-6deg); } 75% { transform: translateX(8px) rotate(6deg); } }
.hp { width: 160px; height: 14px; border: 2px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--paper); }
.hp i { display: block; height: 100%; background: var(--pop); transition: width .7s ease; }
.boss .ctas { justify-content: center; }
.win { color: var(--ok); font-size: 13px; margin-top: 18px; line-height: 1.6; }
.toasts { position: fixed; top: 78px; inset-inline-end: 16px; z-index: 65; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--surface); color: var(--ink); border: 3px solid var(--signal); border-radius: 6px; padding: 10px 14px; min-width: 240px; max-width: 320px; box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: tin .35s ease; transition: opacity .5s, transform .5s; }
.toast b { display: block; font-size: 10px; margin-bottom: 4px; color: var(--signal); }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } }
@media (max-width: 560px) {
  .char-top { flex-wrap: wrap; } .lvnote { margin-top: 8px; }
}
:root[lang="ar"] .pixbtn { font-family: var(--font); font-size: 14px !important; letter-spacing: 0; font-weight: 700; }

.map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; margin-bottom: 8px; }
.map-head h2 { margin: 0; }
.order-switch button { font-size: 13px; }

/* plain-text profile shown before the script runs (for crawlers and no-JS visitors) */
.static-hero { padding: 56px 0 24px; max-width: 760px; display: grid; gap: 10px; }
.static-hero h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.05; }

/* Minly: selected projects first, the rest behind "Show all" */
.more-row { display: flex; justify-content: center; margin-top: 18px; }
.more-row[hidden] { display: none; }
.btn.more { white-space: nowrap; }
.card .body.flat { padding: 12px 18px 16px; display: grid; gap: 8px; margin-top: auto; border-top: 1px solid var(--line); animation: none; }
.card .body.flat .point { margin: 0; font-size: 14.5px; }
.card .body.flat .stack, .card .body.flat .links { margin: 0; }

/* view switcher at the top of the page */
#modes { padding-top: 22px; }
.modes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.modes-h { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
:root[lang="ar"] .modes-h { text-transform: none; letter-spacing: 0; }
.modes-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; flex: 1 1 560px; max-width: 820px; }
.mode { display: flex; align-items: center; gap: 12px; text-align: start; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; min-width: 0; transition: border-color .2s, transform .2s, box-shadow .2s; }
.mode:hover { border-color: var(--muted); transform: translateY(-1px); }
.mode[aria-pressed="true"] { border-color: var(--signal); background: color-mix(in srgb, var(--signal) 9%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 22%, transparent); }
.mode .mi { font-size: 22px; line-height: 1; flex-shrink: 0; }
.mode .mt { display: grid; gap: 1px; min-width: 0; }
.mode b { font-size: 15px; white-space: nowrap; }
.mode small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-view="game"] .mode { border-width: 2px; border-radius: 6px; }
@media (max-width: 700px) {
  .modes-h { font-size: 12px; }
  .modes-row { flex-basis: 100%; gap: 8px; }
  .mode { flex-direction: column; gap: 4px; padding: 10px 6px; text-align: center; }
  .mode .mt { justify-items: center; }
  .mode small { display: none; }
  .mode b { font-size: 14px; }
}

/* why gamification */
.fun-intro { font-size: 18px; max-width: 70ch; }
.fun-ideas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.fun-idea { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.fun-idea .fi { font-size: 26px; line-height: 1; display: block; margin-bottom: 10px; }
.fun-idea h3 { margin: 0 0 6px; font-size: 16px; }
.fun-idea p { margin: 0; color: var(--muted); font-size: 14.5px; }
.fun-sub { margin: 32px 0 12px; font-size: 18px; }
.fun-uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.fun-used { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--signal); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 8px; justify-items: start; box-shadow: var(--shadow); }
.fun-used h4 { margin: 0; font-size: 16px; }
.fun-used p { margin: 0; color: var(--muted); font-size: 14.5px; }
.fun-used .btn { white-space: nowrap; margin-top: 4px; }
.fun-now { font-weight: 700; color: var(--ok); font-size: 14px; margin-top: 4px; }
.fun-outro { margin: 22px 0 0; color: var(--muted); max-width: 72ch; }
[data-view="game"] .fun-idea, [data-view="game"] .fun-used { border-width: 2px; border-radius: 6px; }
[data-view="engineer"] .fun-idea h3::before { content: "## "; color: var(--muted); font-family: var(--mono); font-size: 13px; }
@media (max-width: 560px) { .fun-ideas { grid-template-columns: 1fr 1fr; gap: 10px; } .fun-idea { padding: 14px; } .fun-idea p { font-size: 13.5px; } .fun-intro { font-size: 16.5px; } }

/* footer: skill pages */
footer .hire { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 12px; }
footer .hire b { color: var(--ink); white-space: nowrap; }
footer .hire a { white-space: nowrap; color: var(--muted); }
footer .hire a:hover { color: var(--ink); }
footer p { margin: 0; }

/* the plain-text profile is for crawlers and no-JS visitors; the script draws the real hero */
.js .static-hero { display: none; }
.bar { min-height: 65px; }
.ask:empty { visibility: hidden; }

/* stat count-up: the text stays the final value; ::after draws the animation */
.stat b[data-count] { position: relative; }
.stat b.counting { color: transparent; }
.stat b.counting::after { content: attr(data-prefix) counter(cv) attr(data-suffix); counter-reset: cv var(--cv); position: absolute; top: 0; left: 0; right: 0; text-align: inherit; color: var(--ink); animation: cv 1.2s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes cv { from { --cv: 0; } to { --cv: var(--target); } }

/* ===== game view: arcade, boss rounds, toggles, secret ===== */
#arcade:empty { display: none; }
.portrait { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 6px; }
.portrait.boop img { animation: boop .25s ease; }
@keyframes boop { 50% { transform: scale(.94) rotate(-3deg); } }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chipbtn { font: inherit; font-size: 13px; color: var(--ink); background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
.chipbtn[aria-pressed="true"] { border-color: var(--signal); background: color-mix(in srgb, var(--signal) 14%, transparent); }
.hud-card.lvup { animation: lvup 1s ease; }
@keyframes lvup { 30% { box-shadow: 0 0 0 4px var(--signal); transform: scale(1.02); } }
.hud-lv { color: var(--signal); }
.map:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.map-keys { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.coin circle { fill: var(--signal); stroke: color-mix(in srgb, var(--ink) 40%, transparent); stroke-width: 2; }
.coin text { font-size: 12px; font-weight: 700; fill: var(--on-signal); font-family: var(--mono); }
.coin { transition: opacity .4s, transform .4s; }
.coin.got { opacity: 0; transform-box: fill-box; }
.castle.seen circle { fill: color-mix(in srgb, var(--ok) 18%, var(--paper)); }
.hero-sprite.walk { animation: walk .35s steps(2) 2; }
@keyframes walk { 50% { translate: -50% -8px; } }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid currentColor; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; margin-inline-start: 6px; opacity: .75; }

.cabinets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 18px; }
.cab { background: var(--surface); border: 3px solid var(--line); border-radius: 10px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.cab.running { border-color: var(--signal); }
.cab.shake { animation: cabshake .3s ease; }
@keyframes cabshake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.cab-head { display: flex; gap: 12px; align-items: center; }
.cab-icon { font-size: 34px; line-height: 1; }
.cab-title { flex: 1; min-width: 0; }
.cab-title h3.pix { font-size: 15px; font-weight: 400; margin: 0 0 4px; line-height: 1.4; }
.cab-based { margin: 0; font-size: 13px; color: var(--muted); }
.cab-best { flex: none; font-size: 10px; color: var(--on-signal); background: var(--signal); padding: 5px 8px; border-radius: 3px; white-space: nowrap; }
.cab-how { margin: 0; font-size: 14.5px; color: var(--muted); }
.screen { position: relative; height: 300px; background: var(--paper); border: 3px solid var(--ink); border-radius: 8px; padding: 12px; overflow: hidden; display: flex; flex-direction: column; gap: 8px;
  background-image: linear-gradient(color-mix(in srgb, var(--ink) 4%, transparent) 1px, transparent 1px); background-size: 100% 4px; }
.title-scr { margin: auto; text-align: center; display: grid; justify-items: center; gap: 10px; }
.title-scr .big { font-size: 56px; line-height: 1; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.title-scr .goal, .title-scr .final { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.6; }
.title-scr .big-t { font-size: 18px; color: var(--pop); margin: 0; }
.title-scr.won .big-t { color: var(--ok); }
.title-scr p { margin: 0; max-width: 36ch; }
.won-mark { font-size: 10px; color: var(--ok); }
.g-top { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--muted); flex-wrap: wrap; }
.g-top b { color: var(--ink); font-weight: 400; }
.g-fb { min-height: 1.5em; margin: 0; font-size: 13.5px; text-align: center; }
.g-fb.good { color: var(--ok); } .g-fb.bad { color: var(--pop); }
.pad { display: flex; flex-wrap: wrap; gap: 8px; }
.pad:empty { display: none; }
.pad .move { flex: 1 1 0; min-width: 0; justify-content: center; white-space: nowrap; }
.btn.move.ok { border-color: var(--ok); } .btn.move.no { border-color: var(--pop); }

.chat { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; overflow: hidden; }
.msg { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 2px solid var(--line); font-size: 14px; opacity: .55; animation: msgin .25s ease; }
.msg .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .vd { flex: none; font-weight: 700; }
.msg.cur { opacity: 1; border-color: var(--signal); }
.msg.allowed .vd { color: var(--ok); } .msg.flagged .tx { text-decoration: line-through; } .msg.flagged .vd { color: var(--pop); }
.msg.wrong { border-color: var(--pop); }
@keyframes msgin { from { transform: translateY(12px); opacity: 0; } }
.mbar { height: 8px; border: 2px solid var(--line); border-radius: 3px; overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--signal); transition: width .1s linear; }

.belt { height: 10px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--line) 0 14px, transparent 14px 22px); animation: belt 1s linear infinite; }
@keyframes belt { to { background-position: 22px 0; } }
:root[dir="rtl"] .belt { animation-direction: reverse; }
.order { flex: 1; display: grid; place-items: center; }
.parcel { width: min(100%, 360px); background: var(--surface); border: 3px dashed var(--signal); border-radius: 8px; padding: 12px 14px; display: grid; gap: 4px; }
.parcel.slide { animation: slide .35s cubic-bezier(.3,.7,.2,1); }
@keyframes slide { from { transform: translateX(-60px); opacity: 0; } }
:root[dir="rtl"] .parcel.slide { animation-name: slide-rtl; }
@keyframes slide-rtl { from { transform: translateX(60px); opacity: 0; } }
.o-no { font-size: 9px; color: var(--muted); }
.o-film { font-size: 16px; }
.parcel small { color: var(--muted); font-size: 13px; }
.steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.steps li { font-size: 12.5px; padding: 3px 9px; border: 2px solid var(--line); border-radius: 999px; white-space: nowrap; }
.steps li.ok { border-color: var(--ok); color: var(--ok); }

.round { font-size: 9px; color: var(--muted); }
.hearts { display: flex; gap: 4px; font-size: 18px; }
.hearts i { font-style: normal; color: var(--line); }
.hearts i.on { color: var(--pop); }
.fighter.hurt img { animation: shake .4s ease 2; }
.enemy.faint .boss-icon { animation: none; transform: rotate(90deg); opacity: .6; transition: transform .6s, opacity .6s; }
.dialog { max-width: 680px; margin: 0 auto 14px; text-align: start; background: var(--paper); border: 3px solid var(--ink); border-radius: 8px; padding: 14px 16px; min-height: 64px; font-size: 16px; }
.dialog .who { font-size: 10px; color: var(--signal); display: block; margin-bottom: 6px; }
.dialog b.pix { font-size: 12px; } .dialog .good { color: var(--ok); } .dialog .bad { color: var(--pop); }
.moves { max-width: 680px; margin: 0 auto 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 8px; }
.moves .move { justify-content: flex-start; text-align: start; white-space: normal; }
.moves .move.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, var(--surface)); }
.moves .move.wrong { border-color: var(--pop); background: color-mix(in srgb, var(--pop) 15%, var(--surface)); }
.moves .move.special { border-color: var(--signal); }
.moves .move.special small { color: var(--muted); margin-inline-start: auto; font-size: 11px; }
.reward .small-t { font-size: 10px; color: var(--muted); }
.reward .linkbtn { margin-top: 12px; }

/* secret retro screen */
[data-view="game"].crt body::after { content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.35)); }
@media (prefers-reduced-motion: reduce) {
  .title-scr .big, .belt, .hero-sprite.walk, .parcel.slide, .msg { animation: none; }
}
.moves[hidden], .reward[hidden], .boss-ctas[hidden] { display: none !important; }
@media (max-width: 560px) { .pad { display: grid; grid-template-columns: 1fr 1fr; } .pad .move { padding: 10px 8px; font-size: 14px; } .pad kbd { display: none; } .screen { height: 320px; } }
@media (hover: none) { kbd { display: none; } }
