/* The portfolio network explorer. Other Intelligence sections use the site stylesheet. */
#map {
  --map-ink: #0a1020;
  --map-surface: #101a2e;
  --map-surface-raised: #16223a;
  --map-line: #2b3b55;
  --map-text: #f4f2ed;
  --map-muted: #abb9ce;
  --map-gold: #ffca69;
  --map-mint: #7ee0c7;
  --map-violet: #c6adfa;
  --map-blue: #9bc1fb;
  --map-radius: 20px;
  --map-height: clamp(560px, 47vw, 640px);
  padding-block: clamp(3.25rem, 5.3vw, 5.5rem);
  background: radial-gradient(ellipse at 40% 30%, #15213a 0%, transparent 62%), var(--map-ink);
}

#map .section-head {
  gap: .8rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

#map .di-toolbar,
#map .di-map-board,
#map .di-panel {
  border: 1px solid var(--map-line);
  border-radius: var(--map-radius);
  box-shadow: 0 18px 45px -28px #030611;
}

#map .di-toolbar {
  gap: .45rem 1rem;
  margin-bottom: .75rem;
  padding: .45rem .55rem .45rem .65rem;
  background: linear-gradient(122deg, #152138, #111a2c 70%);
}

#map .di-toolbar-path {
  display: flex;
  flex: 1 1 19rem;
  min-width: 0;
  align-items: center;
  gap: .55rem;
}

#map .di-map-home,
#map .di-map-control {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-inline-size: 40px;
  min-block-size: 40px;
  padding: .25rem .6rem;
  border: 1px solid var(--map-line);
  border-radius: 10px;
  background: var(--map-surface);
  color: var(--map-text);
  font: 650 .84rem/1 var(--font-body);
  cursor: pointer;
}

#map .di-map-home {
  color: var(--map-gold);
}

#map .di-map-home svg,
#map .di-map-control svg {
  width: 16px;
  height: 16px;
  flex: none;
}

#map .di-map-control:disabled {
  opacity: .48;
  cursor: default;
}

#map :is(.di-map-home, .di-map-control:not(:disabled)):hover {
  border-color: var(--map-gold);
  background: var(--map-surface-raised);
  color: var(--map-gold);
}

#map .di-trail {
  min-width: 0;
  gap: .1rem .18rem;
  line-height: 1.35;
}

#map .di-trail li {
  min-width: 0;
  color: var(--map-muted);
}

#map .di-trail button,
#map .di-trail [aria-current] {
  padding-inline: .4rem;
  overflow-wrap: anywhere;
}

#map .di-trail button {
  color: var(--map-muted);
  line-height: 1.25;
  text-decoration: none;
}

#map .di-trail button:hover {
  background: var(--map-surface-raised);
  color: var(--map-text);
}

#map .di-trail [aria-current] {
  color: var(--map-text);
  font-weight: 700;
}

#map .di-view {
  flex: none;
  padding: 3px;
  border: 1px solid var(--map-line);
  border-radius: 12px;
  background: var(--map-ink);
  box-shadow: none;
}

#map .di-view-btn {
  min-block-size: 36px;
  border-radius: 8px;
  color: var(--map-muted);
}

#map .di-view-btn:hover {
  color: var(--map-text);
}

#map .di-view-btn[aria-pressed="true"] {
  background: var(--map-gold);
  color: #24190b;
  font-weight: 700;
}

#map .di-explore {
  grid-template-columns: minmax(0, 2.1fr) minmax(300px, 1fr);
  gap: .75rem;
}

#map .di-explore.is-list {
  grid-template-columns: minmax(0, 1fr);
}

#map .di-explore.is-list .di-map-board {
  display: none;
}

#map .di-map-board {
  min-width: 0;
  overflow: hidden;
  background: var(--map-ink);
}

#map .di-stage {
  height: var(--map-height);
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 50% 49%, #26314a 0%, #17243a 29%, #0c1527 69%, #0a1020 100%);
  box-shadow: none;
  touch-action: pan-y;
}

#map .di-stage::before {
  z-index: 0;
  background: radial-gradient(circle, #98abce 0.7px, transparent 1px) 0 0 / 23px 23px;
  opacity: .22;
  mask-image: radial-gradient(ellipse, #000, #0009 65%, transparent);
}

#map .di-stage[data-more]::after {
  content: none;
}

#map .di-stage.is-pannable {
  cursor: grab;
}

#map .di-stage.is-dragging,
#map .di-stage.is-dragging .di-node {
  cursor: grabbing;
}

#map .di-map-world {
  position: absolute;
  inset: 0;
  transform-origin: center;
}

#map .di-orbit,
#map .di-edge,
#map .di-junction {
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

#map .di-orbit {
  fill: none;
  stroke: #a9bbdd;
  stroke-opacity: .12;
  stroke-width: 1;
}

#map .di-orbit:nth-child(even) {
  stroke-dasharray: 2 6;
}

#map .di-edge {
  fill: none;
  stroke: var(--map-edge, #9ab0d7);
  stroke-opacity: .42;
  stroke-width: 1.3;
  transition: stroke .22s, stroke-opacity .22s, stroke-width .22s;
}

#map .di-e-live {
  --map-edge: var(--map-mint);
}

#map .di-e-record {
  --map-edge: var(--map-violet);
}

#map .di-edge.is-hot {
  stroke: var(--map-gold);
  stroke-opacity: .95;
  stroke-width: 2;
}

#map .di-junction {
  fill: var(--map-gold);
  fill-opacity: .5;
  stroke: var(--map-ink);
  stroke-width: 1;
}

#map .di-node,
#map .di-map-key [data-kind] {
  --map-node-rgb: 255 202 105;
  --map-node-color: rgb(var(--map-node-rgb));
}

#map .di-t-proj,
#map .di-map-key [data-kind="proj"] {
  --map-node-rgb: 126 224 199;
}

#map .di-t-role,
#map .di-t-edu,
#map .di-t-report,
#map .di-t-train,
#map .di-t-bscp,
#map .di-t-research,
#map .di-t-prog,
#map .di-t-goal,
#map .di-map-key [data-kind="record"] {
  --map-node-rgb: 198 173 250;
}

#map .di-t-tech,
#map .di-map-key [data-kind="tool"] {
  --map-node-rgb: 155 193 251;
}

#map .di-node {
  width: 130px;
  max-width: none;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .34rem;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  box-shadow: none;
  outline: none;
  color: var(--map-text);
  font: 550 .8rem/1.15 var(--font-body);
  text-align: center;
  transition: left .42s var(--ease-out), top .42s var(--ease-out), opacity .28s, transform .32s var(--ease-out);
}

#map .di-node-symbol {
  display: grid;
  width: 46px;
  height: 46px;
  flex: none;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(var(--map-node-rgb) / .72);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, rgb(var(--map-node-rgb) / .2), transparent 72%), #101b30;
  box-shadow: inset 0 0 0 3px rgb(var(--map-node-rgb) / .08), 0 0 0 4px rgb(var(--map-node-rgb) / .055), 0 4px 14px #050a175e;
  color: var(--map-node-color);
  transition: background-color .2s, border-color .2s, box-shadow .2s, color .2s;
}

#map .di-node-symbol img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
}

#map .di-node-symbol .di-mark-icon {
  grid-area: 1 / 1;
  width: 21px;
  height: 21px;
  flex: none;
}

#map .di-node .di-node-t {
  display: -webkit-box;
  width: max-content;
  max-width: 100%;
  min-height: 1.45rem;
  padding: .25rem .4rem;
  border: 1px solid #344660;
  border-radius: 7px;
  background: #111c2f;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
}

#map .di-node.is-center {
  max-width: none;
  gap: .55rem;
  padding: 0;
  background: none;
  box-shadow: none;
  color: var(--map-text);
  font: 750 .89rem/1.15 var(--font-body);
  letter-spacing: 0;
}

#map .di-node.is-center .di-node-symbol {
  width: 74px;
  height: 74px;
  border: 2px solid var(--map-node-color);
  box-shadow: 0 0 0 4px #0e1729, 0 0 0 6px rgb(var(--map-node-rgb) / .38), 0 0 0 12px rgb(var(--map-node-rgb) / .08), 0 0 38px rgb(var(--map-node-rgb) / .28);
}

#map .di-node.is-center .di-mark-icon {
  width: 32px;
  height: 32px;
}

#map .di-node.is-center .di-node-t {
  border-color: rgb(var(--map-node-rgb) / .7);
  background: var(--map-node-color);
  color: #121925;
}

#map .di-node:is(.di-l-stated, .di-l-goal) .di-node-symbol {
  border-style: dashed;
}

#map .di-node:is(:hover, :focus-visible) .di-node-symbol {
  border-color: var(--map-node-color);
  background-color: var(--map-surface-raised);
  box-shadow: 0 0 0 4px rgb(var(--map-node-rgb) / .2), 0 0 28px rgb(var(--map-node-rgb) / .25);
}

#map .di-node:is(:hover, :focus-visible) .di-node-t {
  border-color: var(--map-node-color);
}

#map :is(.di-node, .di-map-control, .di-map-home, .di-view-btn, .di-trail button, .di-panel button, .di-panel a):focus-visible {
  outline: 2px solid var(--map-gold);
  outline-offset: 3px;
}

#map .di-map-float {
  position: absolute;
  z-index: 4;
  inset: .7rem .7rem auto auto;
  display: flex;
  align-items: center;
  gap: .2rem;
  padding: .22rem;
  border: 1px solid var(--map-line);
  border-radius: 14px;
  background: #0a1223eb;
  box-shadow: 0 6px 22px #03071257;
}

#map .di-map-float .di-map-control {
  border-color: transparent;
}

#map .di-map-float .di-map-control:not(:disabled):hover {
  border-color: var(--map-gold);
}

#map .di-map-scale {
  min-width: 2.7rem;
  color: var(--map-muted);
  font: 650 .73rem/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

#map .di-map-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .42rem .9rem;
  min-height: 3.15rem;
  padding: .6rem .85rem;
  border-top: 1px solid var(--map-line);
  background: #111b2d;
  color: var(--map-muted);
  font: 500 .74rem/1.4 var(--font-body);
}

#map .di-map-key,
#map .di-map-key [data-kind] {
  display: flex;
  align-items: center;
}

#map .di-map-key {
  flex-wrap: wrap;
  gap: .3rem .8rem;
}

#map .di-map-key [data-kind] {
  gap: .34rem;
}

#map .di-map-key i {
  width: .48rem;
  height: .48rem;
  flex: none;
  border-radius: 50%;
  background: var(--map-node-color, var(--map-gold));
}

#map .di-map-note {
  font-variant-numeric: tabular-nums;
}

#map .di-map-inspect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: .3rem;
  min-height: 34px;
  padding: .3rem .55rem;
  border: 1px solid var(--map-line);
  border-radius: 8px;
  background: var(--map-ink);
  color: var(--map-text);
  font: 650 .76rem/1 var(--font-body);
  cursor: pointer;
}

#map .di-map-inspect:hover {
  border-color: var(--map-gold);
  color: var(--map-gold);
}

#map .di-map-inspect:focus-visible {
  outline: 2px solid var(--map-gold);
  outline-offset: 3px;
}

#map .di-map-inspect svg {
  width: 15px;
  height: 15px;
}

#map .di-panel {
  min-width: 0;
  max-height: min(calc(var(--map-height) + 3.15rem), calc(100vh - var(--header-h) - 2rem));
  padding: 0;
  border-top-color: #536077;
  background: linear-gradient(140deg, #19263d 0%, #121d31 50%, #10192a 100%);
  color: var(--map-text);
  backdrop-filter: none;
  scrollbar-color: #485b77 transparent;
  scrollbar-width: thin;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

#map .di-panel-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  border-bottom: 1px solid var(--map-line);
  background: var(--map-ink);
}

#map img.di-panel-cover,
#map .di-panel-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

#map img.di-panel-cover {
  height: auto;
}

#map .di-panel-head,
#map .di-panel-body {
  padding-inline: clamp(.95rem, 1.8vw, 1.4rem);
}

#map .di-panel-head {
  padding-top: 1.2rem;
  padding-bottom: 1rem;
}

#map .di-panel-body {
  padding-bottom: 1.2rem;
}

#map .di-p-type {
  gap: .35rem .6rem;
  color: var(--map-muted);
  letter-spacing: .09em;
}

#map .di-p-type .di-lv {
  max-width: 100%;
  margin-block: .1rem;
  background: #253752;
  color: var(--map-text);
  box-shadow: none;
  white-space: normal;
}

#map .di-p-type :is(.di-lv-live, .di-lv-record)::before {
  background: var(--map-gold);
}

#map .di-p-title {
  margin-top: .55rem;
  font-size: clamp(1.48rem, 1.1rem + .85vw, 1.9rem);
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

#map .di-p-meta,
#map .di-p-role,
#map .di-p-points,
#map .di-p-none,
#map .di-p-gk,
#map .di-rel {
  color: var(--map-muted);
}

#map .di-p-sum {
  margin-top: .65rem;
  color: var(--map-text);
  font-size: .93rem;
  line-height: 1.58;
}

#map .di-panel h4 {
  margin-top: .9rem;
  padding-top: .85rem;
  border-color: var(--map-line);
  color: var(--map-gold);
  font-size: .72rem;
}

#map .di-panel h4:first-child {
  margin-top: 0;
}

#map .di-panel h4 span {
  min-width: 1.2rem;
  display: inline-block;
  padding: .14rem .28rem;
  border-radius: 5px;
  background: #243450;
  color: var(--map-text);
  letter-spacing: 0;
  text-align: center;
}

#map .di-p-ev {
  gap: .3rem;
}

#map .di-p-ev a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: .35rem;
  padding: .35rem .6rem;
  border: 1px solid var(--map-line);
  border-radius: 8px;
  background: var(--map-surface);
  font-size: .86rem;
  text-decoration: none;
}

#map .di-p-ev a:hover {
  border-color: var(--map-gold);
  color: var(--map-gold);
}

#map .di-p-gk {
  font-weight: 700;
}

#map .di-p-conn {
  gap: .25rem;
}

#map .di-p-conn li {
  position: relative;
  min-width: 0;
  gap: .3rem;
  padding-inline: .47rem;
  border: 1px solid #2a3a54;
  border-radius: 8px;
  background: #0d182b;
}

#map .di-p-conn li:is(:hover, :focus-within) {
  border-color: #5e6f8b;
  background: #17243b;
}

#map .di-p-conn button {
  min-width: 0;
  min-height: 38px;
  padding-block: .3rem;
  color: var(--map-text);
  font-size: .83rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#map .di-p-conn button::after {
  content: "";
  position: absolute;
  inset: 0;
}

#map .di-p-conn button:hover {
  color: var(--map-gold);
}

#map .di-rel {
  max-width: 35%;
  font-size: .7rem;
  line-height: 1.15;
  text-align: right;
  overflow-wrap: anywhere;
}

#map .di-p-brief {
  margin-top: 1rem;
}

@media (max-width: 980px) {
  #map .di-explore {
    grid-template-columns: minmax(0, 1fr);
  }

  #map .di-panel {
    position: static;
    max-height: none;
  }

  #map .di-panel-cover {
    aspect-ratio: 16 / 7;
  }
}

@media (max-width: 650px) {
  #map {
    --map-height: 590px;
    --map-radius: 15px;
  }

  #map .di-toolbar {
    padding: .4rem;
  }

  #map .di-toolbar-path {
    flex-basis: 10.6rem;
  }

  #map .di-view {
    margin-inline-start: auto;
  }

  #map .di-map-float {
    inset: .45rem .45rem auto auto;
  }

  #map .di-node {
    width: 96px;
    gap: .26rem;
    font-size: .71rem;
  }

  #map .di-node .di-node-t {
    padding-inline: .28rem;
    -webkit-line-clamp: 3;
  }

  #map .di-node-symbol {
    width: 38px;
    height: 38px;
  }

  #map .di-node-symbol .di-mark-icon {
    width: 17px;
    height: 17px;
  }

  #map .di-node.is-center {
    gap: .45rem;
    font-size: .78rem;
  }

  #map .di-node.is-center .di-node-symbol {
    width: 62px;
    height: 62px;
  }

  #map .di-node.is-center .di-mark-icon {
    width: 27px;
    height: 27px;
  }

  #map .di-map-caption {
    padding-inline: .6rem;
  }
}

@media (max-width: 390px) {
  #map .di-node {
    width: 86px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  #map .di-edge {
    animation: di-map-edge-in .38s var(--ease-out) both;
  }

  #map .di-node {
    animation: di-map-node-in .32s var(--ease-out) both;
    animation-delay: calc(var(--order, 0) * 14ms);
  }

  @keyframes di-map-edge-in {
    from { opacity: 0; }
  }

  @keyframes di-map-node-in {
    from { opacity: 0; scale: .88; }
    to { opacity: 1; scale: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  #map :is(.di-node, .di-node-symbol, .di-map-world, .di-edge) {
    transition: none;
    animation: none;
  }
}
