:root {
  --paper: #f7f2e9;
  --paper-strong: rgba(255, 251, 246, 0.88);
  --paper-soft: rgba(255, 250, 245, 0.62);
  --paper-card: rgba(255, 252, 247, 0.94);
  --ink: #353733;
  --ink-soft: #676762;
  --line: rgba(188, 176, 160, 0.58);
  --line-subtle: rgba(188, 176, 160, 0.34);
  --accent-rose: #d98a89;
  --accent-gold: rgba(225, 193, 128, 0.36);
  --shadow-soft: 0 18px 40px rgba(89, 76, 57, 0.08);
  --shadow-card: 0 22px 44px rgba(89, 76, 57, 0.12);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 44px 24px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background:
    radial-gradient(circle at 18% 84%, rgba(233, 204, 141, 0.42), transparent 21%),
    radial-gradient(circle at 31% 90%, rgba(233, 191, 120, 0.18), transparent 18%),
    radial-gradient(circle at 54% 104%, rgba(244, 226, 190, 0.14), transparent 26%),
    radial-gradient(circle at 83% 14%, rgba(255, 255, 255, 0.82), transparent 26%),
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.86), transparent 28%);
  filter: blur(22px);
  transform: scale(1.08);
}

body::after {
  z-index: -1;
  opacity: 0.44;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      -28deg,
      rgba(176, 153, 108, 0.018) 0,
      rgba(176, 153, 108, 0.018) 2px,
      transparent 2px,
      transparent 14px
    ),
    repeating-linear-gradient(
      28deg,
      rgba(255, 255, 255, 0.22) 0,
      rgba(255, 255, 255, 0.22) 2px,
      transparent 2px,
      transparent 16px
    );
  mix-blend-mode: multiply;
}

.mindmap {
  position: relative;
  width: 1080px;
  height: 860px;
  --scale: 1;
  flex-shrink: 0;
  cursor: grab;
}

.mindmap::before {
  content: "";
  position: absolute;
  inset: 16% 10% 10%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.72), transparent 28%),
    radial-gradient(circle at 50% 50%, rgba(226, 202, 161, 0.16), transparent 56%);
  filter: blur(18px);
  pointer-events: none;
}

.mindmap.is-dragging {
  cursor: grabbing;
}

.connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.connections line {
  stroke: var(--line);
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: 0.62;
  transition: opacity 0.3s ease;
}

.connections line.subnode-line {
  stroke: var(--line-subtle);
  opacity: 0;
}

.connections line.subnode-line.is-visible {
  opacity: 0.68;
}

.center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.center.visible {
  opacity: 1;
}

.center-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 182px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 44% 44%, rgba(248, 229, 188, 0.76), transparent 34%),
    radial-gradient(circle at 67% 39%, rgba(234, 205, 167, 0.42), transparent 28%),
    radial-gradient(circle at 42% 70%, rgba(215, 190, 149, 0.32), transparent 30%),
    radial-gradient(circle at 58% 64%, rgba(199, 176, 143, 0.22), transparent 26%),
    linear-gradient(145deg, rgba(248, 238, 218, 0.96), rgba(238, 224, 193, 0.88));
  border: 1px solid rgba(179, 167, 150, 0.34);
  box-shadow:
    0 0 0 12px rgba(255, 252, 247, 0.65),
    0 30px 50px rgba(126, 102, 67, 0.11);
  overflow: hidden;
}

.center-badge::before,
.center-badge::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  inset: 10px;
  pointer-events: none;
}

.center-badge::before {
  background:
    radial-gradient(circle at 29% 34%, rgba(255, 245, 224, 0.42), transparent 20%),
    radial-gradient(circle at 70% 67%, rgba(113, 89, 61, 0.11), transparent 22%),
    radial-gradient(circle at 54% 51%, rgba(171, 140, 97, 0.07), transparent 36%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' seed='7'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)' opacity='0.42'/%3E%3C/svg%3E");
  background-size: auto, auto, auto, 138px 138px;
  background-position: center, center, center, center;
  opacity: 0.92;
  mix-blend-mode: multiply;
}

.center-badge::after {
  inset: -10px;
  border: 1px solid rgba(189, 178, 160, 0.4);
  opacity: 0.72;
}

.center-smiley::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.2), transparent 18%),
    radial-gradient(circle at 67% 61%, rgba(139, 108, 72, 0.1), transparent 18%),
    radial-gradient(circle at 49% 52%, rgba(167, 130, 89, 0.08), transparent 30%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.045 0.22' numOctaves='3' seed='11'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23p)' opacity='0.35'/%3E%3C/svg%3E");
  background-size: auto, auto, auto, 120px 120px;
  background-position: center, center, center, center;
  opacity: 0.4;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.center-smiley {
  position: relative;
  z-index: 1;
  width: 108px;
  filter: drop-shadow(0 8px 18px rgba(90, 72, 50, 0.16));
}

.node {
  position: absolute;
  left: calc(50% + var(--x, 0px) * var(--scale, 1));
  top: calc(50% + var(--y, 0px) * var(--scale, 1));
  z-index: 1;
  cursor: pointer;
  opacity: 0;
  transform-origin: center;
  transition: opacity 0.55s ease;
}

.node.visible {
  opacity: 1;
}

.node.subnode {
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.node.subnode.is-subnode-visible {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease, visibility 0s 0s;
}

@keyframes float-a {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(calc(-50% + 3px), calc(-50% - 6px)); }
  50% { transform: translate(calc(-50% - 2px), calc(-50% - 1px)); }
  75% { transform: translate(calc(-50% + 2px), calc(-50% + 4px)); }
}

@keyframes float-b {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(calc(-50% - 4px), calc(-50% + 3px)); }
  50% { transform: translate(calc(-50% + 3px), calc(-50% - 5px)); }
  75% { transform: translate(calc(-50% - 2px), calc(-50% - 1px)); }
}

@keyframes float-c {
  0%, 100% { transform: translate(-50%, -50%); }
  33% { transform: translate(calc(-50% + 4px), calc(-50% - 3px)); }
  66% { transform: translate(calc(-50% - 4px), calc(-50% + 4px)); }
}

@keyframes float-d {
  0%, 100% { transform: translate(-50%, -50%); }
  20% { transform: translate(calc(-50% - 3px), calc(-50% - 5px)); }
  50% { transform: translate(calc(-50% + 4px), calc(-50% + 2px)); }
  80% { transform: translate(calc(-50% - 2px), calc(-50% + 4px)); }
}

.node-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 210px;
  padding: 14px 18px 12px;
  border-radius: 30px;
  border: 1px solid transparent;
  background: var(--paper-soft);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    background-color 0.28s ease;
  user-select: none;
  text-align: center;
}

.node[data-id="pictures"] > .node-label {
  background: var(--paper-strong);
  border-color: rgba(190, 181, 166, 0.28);
  box-shadow: var(--shadow-soft);
  padding-inline: 26px;
}

.node:hover > .node-label,
.node.is-group-active > .node-label,
.node.is-active > .node-label {
  background: rgba(255, 252, 248, 0.82);
  border-color: rgba(179, 164, 139, 0.36);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.node-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.node-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.node-subtitle {
  color: var(--ink-soft);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.node-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #747672;
}

.node-icon--accent {
  color: var(--accent-rose);
}

.node-icon svg {
  width: 100%;
  height: 100%;
}

.node-icon svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node.subnode .node-label {
  min-width: 180px;
  padding: 12px 16px 11px;
  background: rgba(255, 252, 247, 0.78);
}

.node.subnode .node-title {
  font-size: 18px;
}

.node.subnode .node-subtitle {
  font-size: 17px;
}

.node.subnode .node-icon {
  width: 28px;
  height: 28px;
}

.node-content {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  min-width: 240px;
  max-width: 360px;
  width: max-content;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(183, 168, 144, 0.24);
  background: var(--paper-card);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  font-size: 18px;
  line-height: 1.65;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
}

.node:hover > .node-content,
.node.is-active > .node-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0s;
}

.node-content::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 18px;
}

.node-content--expand-up::before {
  bottom: auto;
  top: 100%;
}

.node-content--expand-up {
  top: auto;
  bottom: calc(100% + 14px);
  transform: translateX(-50%) translateY(8px);
}

.node:hover > .node-content--expand-up,
.node.is-active > .node-content--expand-up {
  transform: translateX(-50%) translateY(0);
}

.node-content--wide {
  max-width: 410px;
}

.node-content p {
  margin-bottom: 10px;
}

.node-content p:last-child {
  margin-bottom: 0;
}

.node-content a {
  color: #6f8168;
  text-decoration: none;
  transition: color 0.2s ease;
}

.node-content a:hover {
  color: #455a40;
  text-decoration: underline;
}

.content-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: #6f8168;
  font-size: 18px;
  text-decoration: none;
}

.content-link .icon {
  flex-shrink: 0;
}

.content-note {
  color: #96938d;
  font-style: italic;
}

.picture-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.picture-item {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: #ede9e3;
  transform: rotate(var(--rot, 0deg));
  box-shadow: 0 10px 20px rgba(90, 76, 57, 0.14);
  cursor: pointer;
}

.gathering-section h3 {
  margin-bottom: 8px;
  color: #a28e77;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gathering-section + .gathering-section {
  margin-top: 12px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.84);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease, visibility 0s 0s;
}

.lightbox-img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
  transition: opacity 0.2s ease;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: none;
  background: none;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  opacity: 0.76;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close {
  top: 20px;
  right: 24px;
  font-size: 36px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  padding: 8px 14px;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

@media (max-width: 1100px) and (min-width: 701px) {
  .mindmap {
    --scale: 0.82;
    width: 900px;
    height: 720px;
  }

  .node-label {
    min-width: 188px;
  }

  .node-title {
    font-size: 20px;
  }
}

@media (max-width: 700px) {
  body {
    padding: 28px 16px 36px;
    align-items: flex-start;
  }

  body::before {
    background:
      radial-gradient(circle at 18% 92%, rgba(233, 204, 141, 0.42), transparent 28%),
      radial-gradient(circle at 50% 120%, rgba(233, 191, 120, 0.14), transparent 24%),
      radial-gradient(circle at 84% 16%, rgba(255, 255, 255, 0.82), transparent 24%);
  }

  .mindmap {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .mindmap::before,
  .connections {
    display: none;
  }

  .center {
    position: static;
    transform: none;
    margin-bottom: 8px;
  }

  .center-badge {
    width: 154px;
  }

  .center-smiley {
    width: 92px;
  }

  .node {
    position: static !important;
    animation: none !important;
    transform: none !important;
    width: 100%;
    max-width: 360px;
  }

  .node.subnode {
    display: block;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: none;
  }

  .node-label {
    display: flex;
    width: 100%;
    min-width: 0;
    padding: 16px 18px 14px;
  }

  .node-content {
    position: static;
    min-width: 0;
    width: 100%;
    max-width: none;
    margin-top: 0;
    padding: 0 16px;
    border-width: 0;
    box-shadow: none;
    background: rgba(255, 252, 247, 0.66);
    backdrop-filter: blur(0);
    transform: none !important;
    visibility: visible;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.35s ease, opacity 0.28s ease, padding 0.28s ease, margin 0.28s ease;
  }

  .node:hover > .node-content,
  .node.is-active > .node-content {
    opacity: 1;
    max-height: 600px;
    pointer-events: auto;
    padding: 14px 16px 16px;
    margin-top: 6px;
  }

  .node-content::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .node {
    animation: none !important;
  }

  .node-label,
  .node-content,
  .lightbox,
  .center {
    transition-duration: 0.01ms !important;
  }
}
