:root {
  --cream: #F4EFE6;
  --cream-card: #FBF8F2;
  --ink: #2B2A26;
  --ink-soft: #6E6A62;
  --clay: #CC785C;
  --clay-dark: #A8472A;
  --slateblue: #5B6E78;
  --olive: #8C7B3F;
  --line: #DDD4C5;
  --display: 'Fraunces', Georgia, serif;
  --sans: 'Spline Sans', 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--cream);
  overflow: hidden;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

.frame {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stage {
  position: relative;
  width: 1200px;
  height: 800px;
  background: radial-gradient(circle at 50% 48%, #F8F3EA 0%, #F2ECE0 55%, #EBE2D2 100%);
  transform-origin: center center;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

svg.links {
  position: absolute;
  inset: 0;
  width: 1200px;
  height: 800px;
}

.header {
  position: absolute;
  left: 40px;
  top: 32px;
  z-index: 5;
  max-width: 540px;
}

.kicker {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--clay);
  font-weight: 700;
  margin: 0 0 8px;
}

.title {
  font-family: var(--display);
  font-size: 44px;
  line-height: .98;
  margin: 0;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--ink);
}

.title em {
  font-style: italic;
  color: var(--clay-dark);
}

.subtitle {
  font-family: var(--display);
  font-size: 16px;
  color: var(--ink-soft);
  margin: 12px 0 0;
  line-height: 1.45;
  font-style: italic;
  max-width: 430px;
}

.legend {
  position: absolute;
  right: 36px;
  top: 36px;
  z-index: 7;
  font-family: var(--sans);
  font-size: 12px;
  text-align: right;
  transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.legend .li {
  margin: 6px 0;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: color .15s ease;
}

.legend .li:hover {
  color: var(--ink);
}

.legend .li.sel {
  color: var(--clay-dark);
  font-weight: 700;
}

.legend .li i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  transition: transform .15s ease;
}

.legend .li.sel i {
  transform: scale(1.35);
}

.legend .hint {
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--ink-soft);
  opacity: .8;
  font-style: italic;
}

/* Group info card — visible in interactive mode when a tier is selected */
.group-info-card {
  position: absolute;
  right: 36px;
  top: 158px;
  z-index: 7;
  width: 214px;
  background: rgba(251, 248, 242, 0.92);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px 16px;
  box-shadow: 0 4px 18px rgba(43, 42, 38, 0.09);
  text-align: right;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.group-info-card.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.stage.static-mode .group-info-card {
  opacity: 0;
  pointer-events: none;
}

.group-info-card-tagline {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.group-info-card-text {
  font-family: var(--display);
  font-size: 12px;
  line-height: 1.52;
  color: var(--ink);
  margin: 0;
  font-style: italic;
}

.node {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 108px;
  transition: opacity .25s ease;
}

.node.dim {
  opacity: .15;
  filter: saturate(.35);
}

.avwrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctag {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: rgba(251, 248, 242, .88);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 6px;
}

.ctag.logo {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  padding: 3px 6px;
  border: 1px solid var(--line);
}

.ctag.logo img {
  height: 18px;
  width: auto;
  display: block;
}

.ctag.logo .t {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 2px 7px rgba(43, 42, 38, .20);
  border: 2px solid var(--cream-card);
  transition: transform .18s ease, box-shadow .18s ease;
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.node:hover .avatar,
.node.active .avatar {
  transform: scale(1.2);
  box-shadow: 0 5px 16px rgba(43, 42, 38, .30);
}

.nlabel {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 6px;
  text-align: center;
  line-height: 1.15;
  background: rgba(251, 248, 242, .80);
  padding: 1px 6px;
  border-radius: 5px;
}

.center {
  position: absolute;
  left: 600px;
  top: 420px;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.core {
  width: 138px;
  height: 138px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #E69277 0%, var(--clay) 46%, var(--clay-dark) 100%);
  box-shadow: 0 0 0 11px rgba(204, 120, 92, .12), 0 0 44px rgba(204, 120, 92, .34);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 3.6s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 11px rgba(204, 120, 92, .12), 0 0 44px rgba(204, 120, 92, .30);
  }

  50% {
    box-shadow: 0 0 0 18px rgba(204, 120, 92, .06), 0 0 66px rgba(204, 120, 92, .46);
  }
}

.core svg,
.core img {
  width: 76px;
  height: 76px;
}

.corelabel {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.panel {
  position: absolute;
  left: 40px;
  bottom: 32px;
  z-index: 6;
  width: 352px;
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--clay);
  border-radius: 9px;
  padding: 19px 22px;
  box-shadow: 0 7px 24px rgba(43, 42, 38, .11);
  min-height: 140px;
}

.p-tier {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 7px;
}

.p-name {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 3px;
  letter-spacing: -.4px;
}

.p-prev {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0;
}

.p-new {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--clay-dark);
  font-weight: 700;
  margin: 3px 0 9px;
}

.p-bio {
  font-family: var(--display);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}

.p-hint {
  font-family: var(--display);
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.credit {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 16px;
  line-height: 1.6;
  opacity: 0.85;
}

/* Interactive / Static mode toggle */
.toggle-mode-btn {
  position: absolute;
  right: 36px;
  bottom: 28px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: rgba(251, 248, 242, 0.88);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(43, 42, 38, 0.08);
  transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.toggle-mode-btn:hover {
  background: #fff;
  border-color: var(--clay);
  color: var(--clay-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43, 42, 38, 0.12);
}

.stage.static-mode .panel {
  display: none;
}

.stage.static-mode .links circle {
  display: none;
}

.stage.static-mode .legend {
  right: 440px;
}

.stage.static-mode .toggle-mode-btn {
  right: 436px;
}

/* Gravity well visualization container */
.gravity-well-viz {
  position: absolute;
  inset: 0;
  width: 1200px;
  height: 800px;
  transform-origin: center center;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.gravity-well-viz * {
  pointer-events: auto;
}

.gravity-well-viz .center {
  pointer-events: none;
}

.stage.static-mode .gravity-well-viz {
  transform: translate(-200px, 60px) scale(0.93);
}

/* Roster index list on the right in static mode */
.static-list {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 400px;
  overflow: hidden;
  z-index: 8;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  background: rgba(251, 248, 242, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid var(--line);
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(43, 42, 38, 0);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stage.static-mode .static-list {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  box-shadow: -8px 0 32px rgba(43, 42, 38, 0.05);
}

.sl-items-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 14px 28px;
  min-height: 0;
}

.sl-items-wrapper::-webkit-scrollbar {
  width: 6px;
}

.sl-items-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.sl-items-wrapper::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.sl-items-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--ink-soft);
}

.sl-tier-desc {
  flex-shrink: 0;
  padding: 16px 28px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 239, 230, 0.7);
}

.sl-tier-desc-tagline {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin: 0 0 7px;
}

.sl-tier-desc-text {
  font-family: var(--display);
  font-size: 11.5px;
  line-height: 1.58;
  color: var(--ink);
  margin: 0;
  font-style: italic;
}

.sl-title {
  font-family: var(--display);
  font-size: 16.5px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.sl-item {
  margin-bottom: 2px;
  font-size: 9.5px;
  line-height: 1.3;
  padding-top: 3px;
  padding-bottom: 3px;
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -8px;
  margin-right: -8px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.sl-item:last-child {
  margin-bottom: 0;
}

.sl-item:hover {
  background: rgba(221, 212, 197, 0.15);
}

.sl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1px;
}

.sl-name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
}

.sl-name-container {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 4px;
  max-width: 82%;
}

.sl-new-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 9.5px;
  color: var(--clay-dark);
}

.sl-badge {
  font-size: 6.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  letter-spacing: 0.5px;
}

.sl-prev {
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 9.5px;
  margin-top: 2px;
}

/* Focus mode minimal fullscreen view */
.stage.focus-mode .header,
.stage.focus-mode .legend,
.stage.focus-mode .group-info-card,
.stage.focus-mode .panel,
.stage.focus-mode .toggle-mode-btn,
.stage.focus-mode .static-list {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.stage.focus-mode .links circle {
  display: none !important;
}

.stage.focus-mode .core {
  animation: none !important;
}

/* Center, stretch horizontally, and squish vertically */
.stage.focus-mode .gravity-well-viz {
  transform: translate(0px, 20px) scaleX(1.4) scaleY(0.7) !important;
}

/* Apply inverse scale to nodes and center so they do not distort */
.stage.focus-mode .node,
.stage.focus-mode .center {
  transform: translate(-50%, -50%) scaleX(0.714) scaleY(1.428) !important;
}