@font-face {
  font-family: "PxPlus IBM VGA8";
  src: url("./fonts/PxPlus_IBM_VGA8.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: "PxPlus IBM VGA8", "Courier New", monospace;
  color: #00ff00;
  background: #0a0a0a;
  background-attachment: fixed;
  margin: 0;
  padding: 20px;
  text-shadow: 0 0 3px #00ff00;
  font-size: 18px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

#page-root.is-blurred {
  filter: blur(6px);
  transition: filter 200ms ease;
}

#tree-controls {
  position: fixed;
  top: 16px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

#tree-controls button {
  background: transparent;
  border: none;
  color: #00ff00;
  padding: 4px;
  margin-top: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

#tree-controls button iconify-icon {
  font-size: 1.8em;
  transition: text-shadow 0.2s ease;
  color: #00ff00;
}

#tree-controls button:active {
  transform: scale(0.98);
}

#tree-controls button:hover iconify-icon {
  text-shadow: 0 0 8px #00ff00, 0 0 14px #00ff00;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(
      ellipse 800px 400px at 10% 20%,
      rgba(51, 0, 102, 0.35) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 600px 800px at 90% 80%,
      rgba(0, 102, 51, 0.35) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 1000px 300px at 50% 10%,
      rgba(26, 0, 51, 0.3) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 400px 1000px at 80% 30%,
      rgba(0, 61, 26, 0.3) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 700px 500px at 20% 90%,
      rgba(45, 0, 102, 0.35) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 400px 200px at 15% 85%,
      rgba(120, 255, 120, 0.18) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 300px 600px at 85% 15%,
      rgba(200, 100, 255, 0.2) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 500px 300px at 45% 45%,
      rgba(0, 255, 150, 0.15) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 250px 400px at 95% 95%,
      rgba(150, 50, 255, 0.18) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 600px 150px at 70% 25%,
      rgba(120, 255, 120, 0.12) 0%,
      transparent 75%
    ),
    radial-gradient(
      ellipse 200px 500px at 25% 60%,
      rgba(200, 100, 255, 0.14) 0%,
      transparent 60%
    );
  pointer-events: none;
  z-index: 0;
}

#page-root {
  position: relative;
  z-index: 1;
}

.main-heading {
  font-size: 2.2em;
  font-weight: bold;
  color: #00ff00;
  text-shadow: 0 0 7px #00ff00, 0 0 12px #00ff00;
}

details:not([open]) > summary.main-heading {
  animation: bounce 3s ease infinite;
}

.bio {
  font-size: 1.3em;
  color: #00ff00;
  text-shadow: 0 0 5px #00ff00;
}

.bio__cu-highlight {
  display: inline-block;
  color: #ffd700;
  font-weight: bold;
  text-shadow: 0 0 6px #ffd700, 0 0 12px #ffd700;
}

a {
  color: #c864ff;
  text-decoration: none;
  text-shadow: 0 0 5px #c864ff;
  transition: all 0.3s ease;
  font-weight: bold;
}

a:hover {
  color: #e0a3ff;
  text-shadow: 0 0 10px #c864ff, 0 0 15px #c864ff;
}

ul {
  list-style-type: none;
  line-height: 2em;
  margin: 0;
  padding-left: 18px;
}

summary {
  cursor: pointer;
  color: #00ff00;
  text-shadow: 0 0 3px #00ff00;
  transition: all 0.3s ease;
}

summary:hover {
  color: #44ff44;
  text-shadow: 0 0 10px #00ff00;
}

details > summary {
  list-style: none;
  position: relative;
  padding-left: 24px;
}

details > summary:not(.main-heading):not(.bio) {
  padding-top: 1px;
}

details > summary.main-heading {
  padding-left: 50px;
  padding-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  top: -2px;
}

details > summary.main-heading.is-avatar-expanded {
  padding-bottom: 36px;
}

details > summary.main-heading .folder-icon {
  top: 50%;
  transform: translateY(-50%);
}

details > summary.bio {
  padding-left: 32px;
  padding-top: 1px;
}

details > summary.bio .folder-icon {
  top: 50%;
  transform: translateY(-60%);
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary .folder-icon {
  position: absolute;
  left: -3px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
  text-align: center;
  color: #00ff00;
  text-shadow: 0 0 3px #00ff00;
  transition: color 0.3s ease, text-shadow 0.3s ease, opacity 0.2s ease;
  line-height: 1;
  transform-origin: left center;
}

.main-heading__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: 8px;
  border: 2px solid #00ff00;
  box-shadow: 0 0 6px rgba(0, 255, 0, 0.6);
  cursor: pointer;
  position: relative;
  transform-origin: left top;
  transform: scale(1);
  will-change: transform;
  transition: transform 260ms ease, box-shadow 220ms ease;
}

.main-heading__avatar.is-expanded {
  transform: translateY(14px) scale(2.4);
  z-index: 2;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.8), 0 0 16px rgba(0, 255, 0, 0.6);
}

.avatar-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 220ms ease;
}

.avatar-modal.is-open {
  display: flex;
  opacity: 1;
}

.avatar-modal__img {
  width: min(70vw, 420px);
  height: min(70vw, 420px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #00ff00;
  box-shadow: 0 0 16px rgba(0, 255, 0, 0.8), 0 0 24px rgba(0, 255, 0, 0.6);
  transform: scale(0.96);
  transition: transform 220ms ease;
}

.avatar-modal.is-open .avatar-modal__img {
  transform: scale(1);
}

details > summary .folder-closed {
  opacity: 1;
}
details > summary .folder-open {
  opacity: 0;
}
details[open] > summary .folder-closed {
  opacity: 0;
}
details[open] > summary .folder-open {
  opacity: 1;
}

details > summary:hover .folder-icon {
  color: #44ff44;
  text-shadow: 0 0 10px #00ff00;
}

details > ul {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  will-change: max-height, opacity;
  overflow-anchor: none;
  transition: max-height 300ms ease, opacity 600ms ease;
}

details[open] > ul {
  max-height: none;
  opacity: 1;
}

body.instant-toggle details > ul {
  transition: none !important;
  max-height: none !important;
  opacity: 1 !important;
  overflow: visible !important;
}

ul li {
  position: relative;
}

ul li::before {
  position: absolute;
  left: -18px;
  top: 0px;
  border-left: 2px solid #00ff00;
  border-bottom: 2px solid #00ff00;
  content: "";
  width: 16px;
  height: 1em;
}

ul li::after {
  position: absolute;
  left: -18px;
  bottom: 0px;
  border-left: 2px solid #00ff00;
  content: "";
  width: 8px;
  height: 100%;
}

ul li:last-child::after {
  display: none;
}

summary {
  transition: color 0.1s ease, text-shadow 0.1s ease;
}

iconify-icon {
  display: inline-block;
  margin-right: 8px;
  color: initial;
  transition: all 0.3s ease;
  font-size: 1em;
  text-shadow: none;
  vertical-align: middle;
}

iconify-icon:hover {
  transform: scale(1.05);
}

.chain-icon {
  color: #ff0000 !important;
}

.github-icon,
.betterauth-icon {
  color: #d3d3d3 !important;
}

@media (max-width: 768px) {
  body {
    color: #88ff88;
    text-shadow: 0 0 2px #88ff88;
    font-size: 16px;
  }

  body::before {
    background: radial-gradient(
        ellipse 800px 400px at 10% 20%,
        rgba(51, 0, 102, 0.35) 0%,
        transparent 50%
      ),
      radial-gradient(
        ellipse 600px 800px at 90% 80%,
        rgba(0, 102, 51, 0.16) 0%,
        transparent 50%
      ),
      radial-gradient(
        ellipse 1000px 300px at 50% 10%,
        rgba(26, 0, 51, 0.3) 0%,
        transparent 60%
      ),
      radial-gradient(
        ellipse 400px 1000px at 80% 30%,
        rgba(0, 61, 26, 0.12) 0%,
        transparent 70%
      ),
      radial-gradient(
        ellipse 700px 500px at 20% 90%,
        rgba(45, 0, 102, 0.35) 0%,
        transparent 50%
      ),
      radial-gradient(
        ellipse 400px 200px at 15% 85%,
        rgba(120, 255, 120, 0.12) 0%,
        transparent 60%
      ),
      radial-gradient(
        ellipse 300px 600px at 85% 15%,
        rgba(200, 100, 255, 0.2) 0%,
        transparent 70%
      ),
      radial-gradient(
        ellipse 500px 300px at 45% 45%,
        rgba(0, 255, 150, 0.1) 0%,
        transparent 65%
      ),
      radial-gradient(
        ellipse 250px 400px at 95% 95%,
        rgba(150, 50, 255, 0.18) 0%,
        transparent 55%
      ),
      radial-gradient(
        ellipse 600px 150px at 70% 25%,
        rgba(120, 255, 120, 0.05) 0%,
        transparent 75%
      ),
      radial-gradient(
        ellipse 200px 500px at 25% 60%,
        rgba(200, 100, 255, 0.14) 0%,
        transparent 60%
      );
  }

  #tree-controls {
    display: flex;
    position: fixed;
    bottom: 16px;
    right: 12px;
    top: auto;
  }

  .bio {
    color: #88ff88;
    text-shadow: 0 0 3px #88ff88;
    font-size: 1.15em;
  }

  summary {
    color: #88ff88;
    text-shadow: 0 0 2px #88ff88;
  }

  summary:hover {
    color: #aaffaa;
    text-shadow: 0 0 1px #88ff88;
  }

  details[open] > summary {
    color: #bbffbb !important;
    transition: color 0.1s ease, text-shadow 0.1s ease;
    text-shadow: 0 0 1px #88ff88;
  }

  iconify-icon {
    font-size: 0.9em;
    margin-right: 6px;
  }

  iconify-icon:hover {
    transform: none;
  }

  details > summary::before,
  details > summary.main-heading::before,
  details > summary.bio::before {
    font-size: 0.9em;
    margin-right: 6px;
    vertical-align: text-top;
    line-height: 1;
    display: inline-block;
    margin-top: -1px;
  }

  details > summary.bio .folder-icon {
    top: 23%;
    transform: translateY(-72%);
  }

  details > summary:hover::before {
    text-shadow: 0 0 1px #00ff00;
  }

  .bio__cu-highlight {
    color: #ffd700;
    text-shadow: 0 0 2px #ffd700;
    font-size: 0.9em;
  }

  a {
    color: #9966cc;
    text-shadow: 0 0 2px #9966cc;
  }

  a:hover {
    color: #b388d6;
    text-shadow: 0 0 3px #9966cc;
  }

  .main-heading {
    color: #88ff88;
    text-shadow: none !important;
  }

  details > summary.main-heading .folder-icon {
    color: #00ff00;
    text-shadow: none !important;
  }

  details > summary.main-heading:hover {
    text-shadow: none !important;
  }

  details[open] > summary.main-heading {
    text-shadow: none !important;
  }

  details > summary.main-heading .folder-icon.first-folder {
    color: #00ff00 !important;
    text-shadow: none !important;
  }
  details > summary.main-heading:hover .folder-icon.first-folder,
  details[open] > summary.main-heading .folder-icon.first-folder {
    color: #00ff00 !important;
    text-shadow: none !important;
  }

  details[open] > summary {
    color: #00ff00 !important;
    transition: color 0.1s ease, text-shadow 0.1s ease;
    text-shadow: 0 0 1px #00ff00;
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}
