/* Seven equal centers: MashIA at the heart, six fields around it. */
.tree-lines circle {
  fill: none;
  stroke: rgba(230, 189, 103, 0.09);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.tree-node {
  --node-accent: #67d7a2;
  width: 132px;
  height: 132px;
  border-color: color-mix(in srgb, var(--node-accent) 42%, transparent);
}

.node-wisdom { --node-accent: #a879ff; left: 50%; top: 20%; }
.node-self { --node-accent: #67aef8; left: 76%; top: 35%; }
.node-learning { --node-accent: #f29b5b; left: 76%; top: 65%; }
.node-world { --node-accent: #e66565; left: 50%; top: 80%; }
.node-community { --node-accent: #efc768; left: 24%; top: 65%; }
.node-immersive { --node-accent: #6f6ee8; left: 24%; top: 35%; }
.node-mashia {
  --node-accent: #67d7a2;
  left: 50%;
  top: 50%;
  width: 132px;
  height: 132px;
}

.tree-node i {
  background: var(--node-accent);
  box-shadow: 0 0 20px var(--node-accent);
}

body[data-scene="wisdom"] .journey-camera {
  transform: translate3d(-2%, -10%, 0) scale(0.86);
}

body[data-scene="self"] .journey-camera {
  transform: translate3d(-8%, -11%, 0) scale(0.88);
}

body[data-scene="tools"] .journey-camera {
  transform: translate3d(-6%, -13%, 0) scale(0.86);
}

body[data-scene="community"] .journey-camera {
  transform: translate3d(0, -16%, 0) scale(0.86);
}

body[data-scene="wisdom"] .node-wisdom,
body[data-scene="self"] .node-self,
body[data-scene="community"] .node-community,
body[data-scene="community"] .node-world,
body[data-scene="tools"] .node-mashia,
body[data-scene="tools"] .node-learning,
body[data-scene="tools"] .node-immersive {
  z-index: 3;
  border-color: var(--node-accent);
  color: var(--paper);
  box-shadow: 0 0 50px color-mix(in srgb, var(--node-accent) 22%, transparent), inset 0 0 30px color-mix(in srgb, var(--node-accent) 7%, transparent);
}

.primary-link i {
  font-style: normal;
  transition: transform 180ms ease;
}

.primary-link:hover i {
  transform: translateY(3px);
}

.universe-intro > p {
  max-width: 550px;
  margin: 0;
  color: var(--paper-soft);
  font-size: 1rem;
  line-height: 1.7;
}

.universe-intro .universe-hint {
  margin-top: 13px;
  color: rgba(230, 189, 103, 0.72);
  font-size: 0.72rem;
}

.universe-layout {
  grid-template-columns: minmax(610px, 1.1fr) minmax(420px, 0.9fr);
  gap: 3vw;
  align-items: start;
}

.universe-map {
  width: 100%;
  min-height: 0;
  aspect-ratio: 9 / 8;
  isolation: isolate;
}

.flower-geometry,
.satellite-links,
.constellation-nodes,
.project-orbit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.flower-geometry {
  z-index: 0;
  overflow: visible;
}

.flower-geometry circle {
  fill: rgba(7, 8, 6, 0.2);
  stroke: rgba(230, 189, 103, 0.11);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: stroke 400ms ease, opacity 400ms ease;
}

.flower-geometry path {
  fill: none;
  stroke: rgba(244, 240, 231, 0.1);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.universe-map::before,
.universe-map::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.universe-map::before {
  width: 72%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(170, 145, 200, 0.1), transparent 68%);
  filter: blur(12px);
}

.universe-map::after {
  width: 11%;
  aspect-ratio: 1;
  box-shadow: 0 0 100px rgba(230, 189, 103, 0.16);
}

.constellation-nodes {
  z-index: 6;
}

.constellation-node,
.project-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  border: 1px solid color-mix(in srgb, var(--branch-accent) 56%, transparent);
  border-radius: 50%;
  background: rgba(7, 8, 6, 0.84);
  color: rgba(244, 240, 231, 0.7);
  text-align: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.constellation-node {
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  padding: 18px;
  box-shadow: 0 0 0 13px color-mix(in srgb, var(--branch-accent) 3%, transparent);
  transition: opacity 320ms ease, transform 320ms ease, border-color 320ms ease, box-shadow 320ms ease, color 320ms ease;
}

.constellation-node::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid color-mix(in srgb, var(--branch-accent) 18%, transparent);
  border-radius: inherit;
}

.constellation-node i {
  position: absolute;
  left: 50%;
  top: 31%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--branch-accent);
  box-shadow: 0 0 22px var(--branch-accent);
  transform: translate(-50%, -50%);
}

.constellation-node span {
  position: relative;
  top: 19px;
  max-width: 12ch;
  font-family: var(--serif);
  font-size: 0.78rem;
  line-height: 1.12;
}

.constellation-node.core {
  z-index: 3;
  width: 112px;
  height: 112px;
  border-color: rgba(245, 217, 149, 0.74);
  color: var(--gold-light);
  background: radial-gradient(circle, rgba(35, 29, 18, 0.94), rgba(7, 8, 6, 0.88) 68%);
}

.constellation-node:hover,
.constellation-node:focus-visible,
.constellation-node.active {
  z-index: 7;
  border-color: var(--branch-accent);
  color: var(--paper);
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 0 46px color-mix(in srgb, var(--branch-accent) 26%, transparent), inset 0 0 30px color-mix(in srgb, var(--branch-accent) 8%, transparent);
}

.universe-map:not(.has-active-branch) .constellation-node {
  border-color: color-mix(in srgb, var(--branch-accent) 86%, transparent);
  color: var(--paper);
  box-shadow: 0 0 34px color-mix(in srgb, var(--branch-accent) 20%, transparent), inset 0 0 24px color-mix(in srgb, var(--branch-accent) 7%, transparent);
}

.has-active-branch .constellation-node:not(.active) {
  z-index: 2;
  opacity: 0.24;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(0.9);
}

.has-active-branch .constellation-nodes {
  z-index: 3;
}

.has-active-branch .satellite-links {
  z-index: 5;
}

.has-active-branch .project-orbit {
  z-index: 7;
}

.satellite-links {
  z-index: 4;
  overflow: visible;
  pointer-events: none;
}

.satellite-links line {
  stroke: color-mix(in srgb, var(--branch-accent) 46%, transparent);
  stroke-width: 1;
  stroke-dasharray: 2 7;
  vector-effect: non-scaling-stroke;
  animation: reveal-link 420ms ease both;
}

.project-orbit {
  z-index: 5;
  pointer-events: none;
}

.project-node {
  left: var(--sx);
  top: var(--sy);
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  padding: 10px;
  color: rgba(244, 240, 231, 0.8);
  font-family: var(--serif);
  font-size: 0.62rem;
  line-height: 1.08;
  overflow-wrap: normal;
  word-break: normal;
  pointer-events: auto;
  box-shadow: 0 0 26px rgba(0, 0, 0, 0.38), inset 0 0 20px color-mix(in srgb, var(--branch-accent) 5%, transparent);
  animation: reveal-project 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: opacity 220ms ease, transform 220ms ease, border-color 220ms ease, color 220ms ease, background 220ms ease;
}

.project-node.dense {
  width: 70px;
  height: 70px;
  padding: 7px;
  font-size: 0.54rem;
}

.project-node.compact-label {
  font-size: 0.52rem;
}

.project-node.core-project {
  width: 60px;
  height: 60px;
  padding: 6px;
  font-size: 0.55rem;
}

.project-node:hover,
.project-node:focus-visible,
.project-node.active {
  z-index: 9;
  border-color: var(--branch-accent);
  background: color-mix(in srgb, #070806 88%, var(--branch-accent));
  color: #fff;
  transform: translate(-50%, -50%) scale(1.12);
}

.has-active-project .project-node:not(.active) {
  opacity: 0.3;
  transform: translate(-50%, -50%) scale(0.88);
}

.branch-detail {
  position: sticky;
  top: calc(var(--header-height) + 36px);
  min-height: 610px;
  max-height: calc(100svh - var(--header-height) - 70px);
  overflow-y: auto;
  padding: 8px 58px 34px 34px;
  border-left-color: color-mix(in srgb, var(--branch-accent) 42%, transparent);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--branch-accent) 42%, transparent) transparent;
}

.detail-lock-button {
  position: sticky;
  z-index: 4;
  top: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-right: -40px;
  margin-bottom: -34px;
  margin-left: auto;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--branch-accent) 48%, transparent);
  border-radius: 50%;
  background: rgba(7, 7, 11, 0.76);
  color: color-mix(in srgb, var(--branch-accent) 78%, var(--paper));
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.detail-lock-button[hidden] {
  display: none;
}

.detail-lock-button:hover,
.detail-lock-button:focus-visible {
  border-color: var(--branch-accent);
  background: color-mix(in srgb, var(--branch-accent) 12%, rgba(7, 7, 11, 0.9));
  color: var(--paper);
  outline: none;
}

.detail-lock-icon {
  position: relative;
  width: 12px;
  height: 10px;
  margin-top: 5px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.detail-lock-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -7px;
  width: 6px;
  height: 7px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  transform-origin: left bottom;
  transition: transform 160ms ease;
}

.detail-lock-button:hover .detail-lock-icon::before,
.detail-lock-button:focus-visible .detail-lock-icon::before {
  transform: translate(-1px, -1px) rotate(-12deg);
}

.branch-detail h3 {
  font-size: clamp(2.7rem, 3.3vw, 4.25rem);
}

.branch-detail > .detail-tagline {
  margin-top: 20px;
  color: color-mix(in srgb, var(--branch-accent) 76%, var(--paper));
  font-family: var(--serif);
  font-size: 1.04rem;
  line-height: 1.45;
}

.detail-copy,
.detail-extras {
  margin-top: 27px;
}

.detail-copy section,
.detail-extras section {
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.detail-copy h4,
.detail-extras h4 {
  margin: 0 0 9px;
  color: color-mix(in srgb, var(--branch-accent) 78%, var(--paper));
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: uppercase;
}

.detail-copy h4:empty {
  display: none;
}

.detail-copy p,
.detail-extras p {
  margin: 0;
  color: var(--paper-soft);
  font-size: 0.9rem;
  line-height: 1.66;
}

.detail-extras ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-extras li {
  position: relative;
  padding-left: 15px;
  color: rgba(244, 240, 231, 0.72);
  font-size: 0.82rem;
  line-height: 1.45;
}

.detail-extras li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.56em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--branch-accent);
}

.detail-project-index ul {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.detail-project-index li {
  padding: 9px 10px 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-related article {
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-related strong {
  display: block;
  margin-bottom: 5px;
  color: rgba(244, 240, 231, 0.88);
  font-family: var(--serif);
  font-size: 0.88rem;
  font-weight: 400;
}

.satellite-spheres {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.satellite-sphere {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 108px;
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--branch-accent) 42%, transparent);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 43%, color-mix(in srgb, var(--branch-accent) 13%, transparent), transparent 62%),
    rgba(7, 7, 11, 0.62);
  color: rgba(244, 240, 231, 0.76);
  font-family: var(--serif);
  font-size: 0.67rem;
  line-height: 1.08;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.satellite-sphere::before {
  content: "";
  position: absolute;
  top: 18%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--branch-accent);
  box-shadow: 0 0 13px color-mix(in srgb, var(--branch-accent) 78%, transparent);
}

.satellite-sphere:hover,
.satellite-sphere:focus-visible,
.satellite-sphere.active {
  border-color: var(--branch-accent);
  color: var(--paper);
  outline: none;
  transform: translateY(-2px);
}

.satellite-sphere.active {
  background:
    radial-gradient(circle at 50% 43%, color-mix(in srgb, var(--branch-accent) 23%, transparent), transparent 66%),
    rgba(7, 7, 11, 0.82);
}

.satellite-focus {
  min-height: 94px;
  margin-top: 18px;
  padding: 15px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--branch-accent) 24%, transparent);
}

.satellite-focus a {
  display: inline-block;
  margin-top: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--branch-accent);
  color: var(--paper);
  font-size: 0.75rem;
  text-decoration: none;
}

.detail-website a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 14px;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--branch-accent);
  color: var(--paper);
  font-size: 0.82rem;
  text-decoration: none;
}

.detail-website strong {
  font-family: var(--serif);
  font-size: 0.94rem;
  font-weight: 400;
}

.detail-website small {
  grid-column: 1;
  margin-top: 3px;
  color: rgba(244, 240, 231, 0.58);
  font-size: 0.69rem;
}

.detail-website a > span {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.detail-website a:hover,
.detail-website a:focus-visible {
  color: color-mix(in srgb, var(--branch-accent) 78%, white);
}

.video-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 11px 0 9px;
  border: 0;
  border-bottom: 1px solid var(--branch-accent);
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}

.video-button[hidden] {
  display: none;
}

.video-dialog {
  width: min(920px, calc(100vw - 36px));
  padding: 0;
  border: 1px solid rgba(230, 189, 103, 0.34);
  border-radius: 6px;
  background: #050604;
  color: var(--paper);
}

.video-dialog::backdrop {
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(8px);
}

.video-close {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(7, 8, 6, 0.8);
  color: var(--paper);
  cursor: pointer;
}

.video-frame {
  aspect-ratio: 16 / 9;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@keyframes reveal-project {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.42); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes reveal-link {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1120px) {
  .universe-layout {
    grid-template-columns: 1fr;
  }

  .universe-map {
    width: min(820px, 100%);
    margin-inline: auto;
  }

  .branch-detail {
    position: relative;
    top: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: 4px 48px 0 28px;
  }
}

@media (max-width: 760px) {
  body[data-scene="wisdom"] .journey-camera {
    transform: translate3d(-50%, 8%, 0) scale(0.82);
  }

  body[data-scene="self"] .journey-camera {
    transform: translate3d(-50%, 4%, 0) scale(0.82);
  }

  body[data-scene="tools"] .journey-camera {
    transform: translate3d(-50%, 0, 0) scale(0.82);
  }

  body[data-scene="community"] .journey-camera {
    transform: translate3d(-50%, -6%, 0) scale(0.82);
  }

  .tree-node,
  .node-wisdom,
  .node-mashia {
    width: 94px;
    height: 94px;
  }

  .node-wisdom { left: 50%; top: 20%; }
  .node-self { left: 76%; top: 35%; }
  .node-learning { left: 76%; top: 65%; }
  .node-world { left: 50%; top: 80%; }
  .node-community { left: 24%; top: 65%; }
  .node-immersive { left: 24%; top: 35%; }
  .node-mashia { left: 50%; top: 50%; }

  .tree-node span {
    top: 26px;
    max-width: 12ch;
    font-size: 0.66rem;
  }

  .universe-intro > p {
    margin-top: 24px;
    font-size: 0.94rem;
    line-height: 1.6;
  }

  .universe-intro .universe-hint {
    margin-top: 12px;
    font-size: 0.66rem;
  }

  .universe-layout {
    gap: 34px;
  }

  .universe-map {
    width: calc(100vw - 20px);
    margin-left: calc(50% - 50vw + 10px);
  }

  .constellation-node {
    width: 58px;
    height: 58px;
    padding: 6px;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--branch-accent) 3%, transparent);
  }

  .constellation-node::before {
    inset: 5px;
  }

  .constellation-node i {
    top: 25%;
    width: 4px;
    height: 4px;
  }

  .constellation-node span {
    top: 10px;
    max-width: 11ch;
    font-size: 0.48rem;
    line-height: 1.03;
  }

  .constellation-node.core {
    width: 54px;
    height: 54px;
  }

  .project-node {
    width: 44px;
    height: 44px;
    padding: 4px;
    font-family: var(--sans);
    font-size: 0.42rem;
    line-height: 1.02;
  }

  .project-node.dense {
    width: 42px;
    height: 42px;
    padding: 3px;
    font-size: 0.38rem;
  }

  .project-node.compact-label {
    font-size: 0.36rem;
  }

  .project-node.core-project {
    width: 34px;
    height: 34px;
    padding: 3px;
    font-size: 0.34rem;
  }

  .branch-detail {
    min-height: 0;
    padding: 0 44px 0 18px;
  }

  .branch-detail h3 {
    font-size: 2.65rem;
  }

  .detail-tagline {
    font-size: 0.96rem;
  }

  .detail-project-index ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .constellation-node {
    width: 54px;
    height: 54px;
  }

  .constellation-node.core {
    width: 50px;
    height: 50px;
  }

  .project-node {
    width: 41px;
    height: 41px;
    font-size: 0.39rem;
  }

  .satellite-spheres {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .satellite-sphere {
    max-width: 96px;
    font-size: 0.61rem;
  }
}
