/* ═══════════════════════════════════════════════════════════════
   رأس الصفحة: الكلام + خريطة العراق (iraqmap.js)
   كل الوجوه نفس الحجم — ماكو أحد فوق أحد. الألوان من tokens الثيم (فاتح / ليلي / ميكس)
   ═══════════════════════════════════════════════════════════════ */
.hm-hero { padding: 14px 0 34px; overflow: hidden; }
.hm-hero__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); grid-template-areas: "copy map" "say map" "how map"; column-gap: 48px; align-items: center; }
.hm-copy { grid-area: copy; align-self: end; }
.hm-map { grid-area: map; width: 100%; max-width: 640px; justify-self: center; }
.hm-say { grid-area: say; align-self: start; display: grid; gap: 10px; min-width: 0; margin-top: 24px; }
.hm-steps { grid-area: how; align-self: start; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13.5px; }
.hm-steps li { display: inline-flex; align-items: center; gap: 7px; }
.hm-steps i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text); font: 800 12px var(--font-head); font-style: normal; }
.hm-steps b { font-weight: 700; color: var(--text); }

/* ─── الكلام تحت/جنب الخريطة: «اضغط على محافظتك» + المحافظات ─── */
.im-say { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 11px 12px 11px 14px; border-radius: 22px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.im-say__ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #ffb23f, #ff5c8a 60%, #8b5cf6); box-shadow: 0 10px 20px -12px rgba(255, 92, 138, .9); }
.im-say__ic svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.im-say__t { flex: 1; min-width: 0; display: grid; }
.im-say__t b { font: 800 17px/1.35 var(--font-head); }
.im-say__t small { color: var(--muted); font-size: 13.5px; }
.im-say.is-pick .im-say__t b { font-size: 22px; }
.im-say.is-pick .im-say__ic { animation: im-bob .5s var(--spring); }
.im-say__go { display: inline-flex; align-items: center; gap: 4px; flex: none; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(105deg, #ff9f1c, #ff5c8a); color: #fff; font: 800 15px var(--font-head); box-shadow: 0 12px 22px -14px rgba(255, 92, 138, .9); }
.im-say__go svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.im-say__x { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.im-say__x svg { width: 15px; height: 15px; fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; }
@keyframes im-bob { 40% { transform: translateY(-5px) rotate(-6deg); } }
/* المحافظات: صف واحد يتمرر — بديل الضغط على الخريطة */
.im-govs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(to left, #000 82%, transparent); mask-image: linear-gradient(to left, #000 82%, transparent); }
.im-govs::-webkit-scrollbar { display: none; }
.im-govs button { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; padding: 3px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text); font: 700 13.5px var(--font-head); transition: background .15s, border-color .15s, color .15s; }
.im-govs button b { color: var(--muted); font-size: 12px; }
.im-govs button:hover { border-color: #ff5c8a; }
.im-govs button.is-on { background: #ff5c8a; border-color: #ff5c8a; color: #fff; }
.im-govs button.is-on b { color: rgba(255, 255, 255, .85); }

/* ─── الخريطة ─── */
.im__stage { position: relative; width: 100%; aspect-ratio: 838 / 851; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.im__stage.is-hot { cursor: pointer; }
.im__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.im__land { fill: url(#imInk); opacity: .08; }
.im__dots { opacity: .9; }
.im__edge { fill: none; stroke: url(#imInk); stroke-width: 2.6; stroke-linejoin: round; opacity: .7; }
.im__river { fill: none; stroke: #38bdf8; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; opacity: .6; }
.im__flow { fill: none; stroke: #e6f8ff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: .012 .045; opacity: .85; animation: im-flow 14s linear infinite; }
@keyframes im-flow { to { stroke-dashoffset: -.57; } }
.im__link { stroke: var(--muted); stroke-width: 1.1; vector-effect: non-scaling-stroke; opacity: .45; transition: opacity .3s; }
.im__link.is-off { opacity: .08; }
.im { --arc: #fff; }
html[data-theme="sunny"] .im { --arc: #2b1a46; }
.im__arc { fill: none; stroke: var(--arc); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(255, 92, 138, .95)); }
.im__arc.is-fly { stroke-dasharray: .24 1.3; stroke-dashoffset: .24; animation: im-comet 2.3s cubic-bezier(.45, 0, .25, 1) forwards; }
@keyframes im-comet { 80% { opacity: 1; } to { stroke-dashoffset: -1; opacity: 0; } }
/* الأقواس الثابتة باينة حتى بدون حركة؛ الحركة بس ترسمها */
.im__arc.is-stay { stroke-width: 3.2; stroke-dasharray: 1; opacity: .9; animation: im-draw .9s var(--d, 0s) ease-out both; }
@keyframes im-draw { from { stroke-dashoffset: 1; } }

/* المحافظات (نقاط): اللي بيها ناس عليها حلقة */
.im__cities, .im__faces { position: absolute; inset: 0; pointer-events: none; }
.im__city { position: absolute; left: var(--x); top: var(--y); width: 7px; height: 7px; translate: -50% -50%; border-radius: 50%; background: var(--muted); opacity: .6; transition: transform .2s var(--spring), background .2s, box-shadow .2s; }
.im__city.is-home { width: 8px; height: 8px; background: #ff5c8a; box-shadow: 0 0 0 2px var(--surface); opacity: 1; }
.im__city.is-hover, .im__city.is-sel { transform: scale(1.5); background: #ff5c8a; opacity: 1; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px #ff5c8a; }
.im__label { position: absolute; z-index: 8; left: var(--x); top: var(--y); translate: -50% calc(-100% - 14px); display: grid; justify-items: center; padding: 6px 13px; border-radius: 13px; pointer-events: none; white-space: nowrap;
  background: var(--surface); color: var(--text); box-shadow: 0 14px 30px -14px rgba(20, 10, 40, .55), inset 0 0 0 1px var(--line); }
.im__label[hidden] { display: none; }
.im__label.is-soft { padding: 3px 10px; opacity: .92; animation: im-fade .3s both; }
.im__label.is-soft b { font-size: 13px; }
.im__label b { font: 800 15px/1.3 var(--font-head); }
.im__label small { color: var(--muted); font-size: 12px; }
.im__ping { position: absolute; z-index: 2; left: var(--x); top: var(--y); width: 18px; height: 18px; translate: -50% -50%; pointer-events: none; }
.im__ping[hidden] { display: none; }
.im__ping::before, .im__ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #ff5c8a; opacity: 0; }
.im__ping.is-go::before { animation: im-ping 1.3s .95s ease-out both; }
.im__ping.is-go::after { animation: im-ping 1.3s 1.25s ease-out both; }
.im__ping.is-stay::before { animation: im-ping 1.8s ease-out infinite; }
.im__ping.is-stay::after { animation: im-ping 1.8s .9s ease-out infinite; }
@keyframes im-ping { from { transform: scale(.5); opacity: 1; } to { transform: scale(3.4); opacity: 0; } }

/* الوجوه: كلها نفس الحجم */
.im__face { position: absolute; z-index: 1; left: var(--x); top: var(--y); width: var(--face, 40px); height: var(--face, 40px); translate: -50% -50%; padding: 0; border: 0; border-radius: 50%; cursor: pointer; pointer-events: auto;
  background: color-mix(in srgb, var(--lane) 30%, var(--surface));
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--lane) 85%, transparent), 0 10px 18px -10px rgba(20, 10, 40, .7);
  transition: transform .25s var(--spring), opacity .3s, filter .3s, box-shadow .3s; }
.im__face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.im__face > i { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--lane); color: #fff; font: 900 15px var(--font-head); font-style: normal; }
.im__face:hover, .im__face:focus-visible { z-index: 6; transform: scale(1.16); outline: none; }
.im__face.is-go { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #ffb23f, 0 0 22px 5px rgba(255, 178, 63, .55); }
.im.is-pick .im__face.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #ff5c8a, 0 0 22px 4px rgba(255, 92, 138, .5); }
.im.is-pick .im__face.is-off { opacity: .22; filter: grayscale(1); transform: scale(.8); }
.im__tip { position: absolute; bottom: calc(100% + 10px); left: 50%; translate: -50% 4px; display: grid; justify-items: center; padding: 6px 11px; border-radius: 12px; opacity: 0; pointer-events: none; white-space: nowrap;
  background: var(--surface); color: var(--text); box-shadow: 0 14px 30px -14px rgba(20, 10, 40, .55), inset 0 0 0 1px var(--line); transition: opacity .15s, translate .15s; }
.im__tip b { font: 800 13.5px/1.3 var(--font-head); }
.im__tip small { color: var(--muted); font-size: 11.5px; }
.im__face:hover .im__tip, .im__face:focus-visible .im__tip { opacity: 1; translate: -50% 0; }

/* البداية: الخريطة تنرسم من بغداد كموجة، والوجوه تطلع لما توصلها الموجة */
.im.is-intro .im__ripple { transform-box: view-box; transform-origin: 481px 417px; animation: im-reveal 1.7s cubic-bezier(.4, .2, .3, 1) both; }
@keyframes im-reveal { from { transform: scale(0); } }
.im.is-intro .im__edge { stroke-dasharray: 1; animation: im-edge 2.2s ease-out both; }
@keyframes im-edge { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.im.is-intro .im__river { stroke-dasharray: 1; animation: im-edge 1.8s .6s ease-out both; }
.im.is-intro .im__flow, .im.is-intro .im__link { animation: im-fade .8s 1.8s both; }
.im.is-intro .im__city { animation: im-fade .5s .3s both; }
.im.is-intro .im__face { animation: im-pop .7s var(--d, .5s) var(--spring) both; }
@keyframes im-fade { from { opacity: 0; } }
@keyframes im-pop { from { opacity: 0; scale: .2; } }

@media (max-width: 900px) {
  .hm-hero__in { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "map" "say" "how"; }
  .hm-map { max-width: 520px; margin-top: 10px; }
  .hm-say { margin-top: 6px; }
  .hm-steps { margin-top: 14px; }
}
@media (max-width: 640px) {
  .hm-hero { padding-top: 8px; }
  .im-say { min-height: 60px; padding: 9px 10px 9px 12px; border-radius: 20px; }
  .im-say__ic { width: 38px; height: 38px; }
  .im-say__go { padding: 0 14px; }
  .im-govs { margin-inline: -16px; padding-inline: 16px; }
  .hm-steps { font-size: 12.5px; gap: 6px 12px; }
  .im__label b { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .im__flow { animation: none; }
  .im__face, .im__city, .im-say.is-pick .im-say__ic { animation: none !important; }
}
