/* SemAI — 3D capability map */
.cmap {
  position: relative; display: flex; flex-direction: column; background: #050b1f; overflow: hidden; min-height: 700px;
  container-type: inline-size;
}
.cmap-top {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 20px 24px; background: linear-gradient(180deg, rgba(5,11,31,.92) 0%, rgba(5,11,31,.55) 70%, rgba(5,11,31,0) 100%); pointer-events: none;
}
.cmap-top > * { pointer-events: auto; }
.cmap-top h1 { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: clamp(22px, 2.6cqw, 34px); font-weight: 800; color: #fff; letter-spacing: -.02em; }
.gradient-text.bright { background: linear-gradient(90deg, #7ce7ff, #6aa9ff 55%, #a78bfa); -webkit-background-clip: text; background-clip: text; }
.cmap-top p { margin: 6px 0 0; color: #b9c5e6; font-size: 14.5px; }
.demo-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 500; color: #dbe4ff; border: 1px solid rgba(160,180,255,.3); background: rgba(255,255,255,.06); letter-spacing: 0; }
.demo-pill svg { width: 14px; height: 14px; }

.views { display: flex; padding: 4px; border-radius: 14px; background: rgba(12, 22, 52, .85); border: 1px solid rgba(148,163,230,.25); flex: none; }
.views button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 88px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; color: #c8d3f3; font-size: 12.5px; }
.views button svg { width: 20px; height: 20px; }
.views button:hover { color: #fff; }
.views button.is-on { background: linear-gradient(180deg, #2f7bff, #1d5cff); color: #fff; box-shadow: 0 6px 18px rgba(29,92,255,.45); }

/* stage */
.stage { position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: none; }
.stage.dragging { cursor: grabbing; }
.world { position: absolute; inset: 0; transform-origin: 50% 55%; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.world.no-anim { transition: none; }
.world.rotating { animation: tilt 14s ease-in-out infinite; }
@keyframes tilt {
  0%, 100% { transform: perspective(1400px) rotateX(0deg) rotateZ(0deg) scale(var(--z, 1)); }
  25% { transform: perspective(1400px) rotateX(14deg) rotateZ(-3deg) scale(var(--z, 1)); }
  75% { transform: perspective(1400px) rotateX(10deg) rotateZ(3deg) scale(var(--z, 1)); }
}
.map-bg { position: absolute; inset: -4%; background: url(../img/map-korea.webp) center 60% / cover no-repeat; opacity: .95; }
.map-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, rgba(5,11,31,0) 40%, rgba(5,11,31,.75) 100%); }

.links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.links path { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: .55; }
.links path.flow { stroke-dasharray: 2 10; animation: dash 3s linear infinite; opacity: .9; stroke-width: 2; }
.links path.dim { opacity: .08; }
@keyframes dash { to { stroke-dashoffset: -120; } }

.sparks span { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #9fd8ff; box-shadow: 0 0 8px 2px rgba(120,190,255,.8); animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.2); } }

.city { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; pointer-events: none; transition: opacity .3s; }
.city b { font-size: max(10px, 1.05cqw); font-weight: 500; color: #e2e8ff; text-shadow: 0 1px 6px #000; margin-bottom: 4px; padding: 2px 8px; border-radius: 6px; background: rgba(5,11,31,.55); }
.city i { width: 10px; height: 34px; border-radius: 5px; background: linear-gradient(180deg, #fff, rgba(160,200,255,.2)); box-shadow: 0 0 14px 3px rgba(150,200,255,.6); }
.city.dim { opacity: .25; }
.country { position: absolute; left: 51%; top: 53%; transform: rotate(-24deg); font-size: max(12px, 1.6cqw); letter-spacing: .3em; color: rgba(190,215,255,.55); font-weight: 600; pointer-events: none; }

/* clusters */
.cluster { position: absolute; width: 26%; transform: translate(-50%, -50%); transition: opacity .35s, filter .35s; --c: #4f8dff; }
.cluster .pf-wrap { position: relative; cursor: pointer; border: 0; background: none; padding: 0; width: 100%; display: block; }
.cluster img { width: 100%; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--c) 55%, transparent)); transition: transform .35s, filter .35s; }
.cluster .pf-wrap:hover img, .cluster.is-active img { transform: translateY(-4px) scale(1.04); filter: drop-shadow(0 0 34px var(--c)) brightness(1.15); }
.cluster .pf-wrap:focus-visible { outline: 2px solid var(--c); outline-offset: 4px; border-radius: 50%; }
.c-label {
  position: absolute; left: 50%; top: -6%; transform: translate(-50%, -50%); white-space: nowrap; z-index: 2;
  padding: .45em 1.1em; border-radius: 999px; font-size: max(11px, 1.55cqw); font-weight: 700; color: #fff;
  background: rgba(8, 16, 40, .78); border: 1.5px solid var(--c); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 60%, transparent), inset 0 0 12px color-mix(in srgb, var(--c) 30%, transparent);
  text-shadow: 0 0 10px var(--c); cursor: pointer;
}
.c-tag {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; z-index: 2;
  padding: .45em .95em; border-radius: 999px; font-size: max(9.5px, 1.05cqw); font-weight: 500; color: #fff;
  background: rgba(10, 20, 50, .82); border: 1px solid color-mix(in srgb, var(--c) 70%, #fff 0%); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent);
}
.c-tag:hover { background: color-mix(in srgb, var(--c) 35%, #0a1432); }
.c-people { position: absolute; left: 50%; top: 84%; transform: translate(-50%, -50%); display: flex; align-items: center; z-index: 2; }
.c-people span { width: max(22px, 2.3cqw); height: max(22px, 2.3cqw); border-radius: 50%; margin-left: -.55em; display: grid; place-items: center; font-size: max(8px, .8cqw); font-weight: 700; color: #fff; border: 2px solid #0b1533; }
.c-people span:first-child { margin-left: 0; }
.c-people em { font-style: normal; margin-left: .5em; padding: .25em .6em; border-radius: 999px; font-size: max(9.5px, 1cqw); font-weight: 600; color: #fff; background: rgba(10,20,50,.85); border: 1px solid rgba(255,255,255,.2); }
.cluster.dim { opacity: .18; filter: grayscale(.6); }
.cluster.is-active .c-label { background: color-mix(in srgb, var(--c) 40%, #0a1432); }

/* list view */
.list-view { position: absolute; inset: 0; padding: 120px 24px 24px; overflow: auto; background: rgba(5,11,31,.92); }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lv-card { border-radius: 14px; border: 1px solid rgba(148,163,230,.2); background: rgba(16,28,64,.7); padding: 16px; color: #dbe4ff; cursor: pointer; text-align: left; }
.lv-card:hover { border-color: var(--c); }
.lv-card h3 { margin: 0 0 6px; color: #fff; font-size: 16px; display: flex; justify-content: space-between; }
.lv-card h3 span { color: var(--c); }
.lv-card p { margin: 0 0 10px; font-size: 12.5px; color: #a9b6dc; line-height: 1.5; }
.lv-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-card .tags span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); }

/* bottom controls */
.cmap-bottom { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; flex-wrap: wrap; pointer-events: none; }
.cmap-bottom > * { pointer-events: auto; }
.legend, .seg { display: inline-flex; align-items: center; gap: 18px; height: 44px; padding: 0 16px; border-radius: 12px; background: rgba(10,18,42,.85); border: 1px solid rgba(148,163,230,.22); color: #dbe4ff; font-size: 13px; backdrop-filter: blur(8px); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.lg { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lg-spec { border: 2px solid #4f8dff; box-shadow: 0 0 8px #4f8dff; }
.lg-exp { background: #8fb3ff; }
.lg-grp { background: radial-gradient(circle, #f0c4ff, #b57bff); box-shadow: 0 0 8px #b57bff; }
.ctrl { display: flex; gap: 10px; flex-wrap: wrap; }
.seg { padding: 0; gap: 0; overflow: hidden; }
.seg button { height: 100%; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 0; background: none; color: #dbe4ff; font-size: 13px; }
.seg button + button { border-left: 1px solid rgba(148,163,230,.2); }
.seg button:hover { background: rgba(255,255,255,.07); }
.seg button.is-on { color: #7cc4ff; }
.seg svg { width: 18px; height: 18px; }
.seg.rm { padding: 0 16px; gap: 10px; cursor: pointer; }

/* panel content */
.spec-list { display: grid; gap: 10px; }
.spec-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; width: 100%; transition: .15s; }
.spec-item:hover { border-color: #b9cbf5; box-shadow: var(--shadow); }
.spec-item.is-on { border-color: var(--blue); background: #f4f7ff; }
.spec-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--blue); background: #eef3ff; flex: none; }
.spec-ic svg { width: 22px; height: 22px; }
.spec-item b { display: block; font-size: 15px; color: var(--ink); }
.spec-item small { font-size: 12.5px; color: var(--muted); }
.spec-item .go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--blue); white-space: nowrap; }
.spec-item .go svg { width: 15px; height: 15px; }

#detail { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.empty-state { text-align: center; padding: 6px 12px 4px; }
.empty-state .es-ic { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: #f1f4f9; color: #64748b; }
.empty-state .es-ic svg { width: 30px; height: 30px; }
.empty-state h3 { margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.cd-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cd-head img { width: 64px; height: 44px; object-fit: contain; background: #0b1533; border-radius: 10px; padding: 2px; }
.cd-head h3 { margin: 0; font-size: 17px; color: var(--ink); }
.cd-head small { color: var(--muted); font-size: 12.5px; }
.cd-desc { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: #475569; }
.cd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cd-tags span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #f1f4f9; color: #334155; }
.cd-people { display: grid; gap: 8px; margin-bottom: 14px; }
.cd-person { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.cd-person .avatar { width: 32px; height: 32px; font-size: 12px; }
.cd-person b { display: block; color: var(--ink); font-size: 13.5px; }
.cd-person small { color: var(--muted); }
.cd-actions { display: flex; gap: 8px; }
.cd-actions .btn { flex: 1; height: 40px; border-radius: 10px; font-size: 13.5px; padding: 0 12px; }

.gap-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: #f7f8fb; }
.gap-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed #cbd2e0; color: #94a3b8; flex: none; }
.gap-ic svg { width: 22px; height: 22px; }
.gap-item b { display: block; font-size: 15px; color: var(--ink); }
.gap-item small { color: #dc2626; font-size: 13px; }
.gap-item .btn { margin-left: auto; }

@media (max-width: 1080px) {
  .cmap { min-height: 0; aspect-ratio: 1.05; }
}
@media (max-width: 760px) {
  .cmap { aspect-ratio: auto; height: 760px; }
  .cmap-top { flex-direction: column; padding: 14px; }
  .views button { min-width: 0; flex: 1; font-size: 11px; padding: 6px 8px; }
  .views { width: 100%; }
  .world { left: -35%; right: -35%; }
  .cluster { width: 26%; }
  .legend { display: none; }
  .cmap-bottom { padding: 10px; }
  .seg button { padding: 0 10px; }
  .list-view { padding-top: 170px; }
}
