*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #f4efe6;
  color: #3a2e1f;
  font-family: 'Lato', sans-serif;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e0d5c0;
  flex-shrink: 0;
  text-align: center;
}

header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 400;
  color: #5c4a2a;
  letter-spacing: 0.14em;
}

main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#graph-container {
  width: 100%;
  height: 100%;
  position: relative;
}

#graph {
  width: 100%;
  height: 100%;
  display: block;
}

#hint {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: #b09070;
  letter-spacing: 0.08em;
  pointer-events: none;
  transition: opacity 0.6s ease;
  font-style: italic;
  white-space: nowrap;
}

#hint.hidden {
  opacity: 0;
}

/* SVG */

.link.partner {
  stroke: #c17f4f;
  stroke-width: 2;
  stroke-linecap: round;
}

.link.parent-child {
  stroke: #8fa87e;
  stroke-width: 1.8;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
}

.junction {
  fill: #c17f4f;
}

.node {
  cursor: pointer;
}

.node-ring {
  stroke: #a0723e;
  pointer-events: none;
  transition: stroke-width 0.15s, stroke 0.15s;
}

.node:hover .node-ring {
  stroke: #7a5228 !important;
  stroke-width: 3.5 !important;
}

.node-label {
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  fill: #5c4a2a;
  pointer-events: none;
  user-select: none;
}

/* Panel */

#panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  background: #fffcf7;
  border-left: 1px solid #e0d5c0;
  padding: 3rem 1.5rem 2rem;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  z-index: 10;
  box-shadow: -4px 0 20px rgba(90, 60, 20, 0.06);
}

#panel.open {
  transform: translateX(0);
}

#panel-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #b09070;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.1s;
}

#panel-close:hover {
  color: #5c4a2a;
}

#panel-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.panel-avatar {
  width: 100%;
  height: 220px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #c17f4f;
  flex-shrink: 0;
}

.panel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-avatar span {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

#panel-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: #5c4a2a;
  text-align: center;
}

.panel-bio {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #6b5a3e;
  text-align: center;
  font-weight: 300;
}
