html, body {
  width: 100%;
  height: 100%;
  margin: 0;
    background: 
        linear-gradient(
            180deg,
            rgba(60, 0, 90, 0.9) 0%,  
            rgba(120, 0, 70, 0.85) 100% 
        );
  overflow: hidden;
  animation: fadeIn 0.6s ease both;
  color: #f1f1f1;
  font-family: sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(
            180deg,
            rgba(128, 0, 255, 0.25) 0%,
            rgba(255, 50, 200, 0.2) 50%, 
            rgba(0, 0, 0, 0.6) 100%
        ),
        radial-gradient(
            at 20% 25%,
            rgba(200, 100, 255, 0.3),
            transparent 60%
        ),
        radial-gradient(
            at 75% 70%,
            rgba(255, 150, 200, 0.25),
            transparent 65%
        ),
        radial-gradient(
            at 50% 80%,
            rgba(255, 200, 255, 0.2),
            transparent 70%
        );
    background-repeat: no-repeat;
    background-size: cover;
    mix-blend-mode: overlay;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 1;
    pointer-events: none;
    box-shadow:
      10vw 5vh #fff,
      20vw 15vh #fff,
      30vw 40vh #fff,
      50vw 20vh #fff,
      70vw 70vh #fff,
      85vw 30vh #fff,
      90vw 90vh #fff,
      40vw 60vh #fff;
    animation: twinkle 3s infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.bg-frame {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1a0a1a;
  padding: 22px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.3),
    0 40px 120px rgba(0,0,0,0.9);
  z-index: -2;
}

.bg-frame img {
  display: block;
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 120px);
  height: auto;
  width: auto;
}

.bg-frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  pointer-events: none;
}

.background {
  position: fixed;
  inset: 0;
  background: url("head.jpeg") center/cover no-repeat;
  filter: brightness(0.75);
  z-index: -1;
}

h1 {
  font-size: clamp(2.2rem, 3vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  background: linear-gradient(120deg, #e0b3ff, #ff8ae0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

b, strong {
  font-weight: 600;
  color: #ffccff;
}

i, em {
  font-style: italic;
  color: #e5c1ff;
}

a {
  color: #ff99ff;
  text-decoration: none;
  position: relative;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.15),
    rgba(255,255,255,0.05)
  );
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dark-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.menu-core {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #330033, #000);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: transform 0.4s ease;
}

.menu-core:hover {
  transform: scale(1.05);
}

.core-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(255,200,255,0.15), transparent 70%);
  filter: blur(25px);
}

.core-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: #f0e0ff;
  z-index: 1;
}

.menu-panel {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(20,10,20,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  z-index: 2;
  flex-wrap: wrap;
}

.menu-panel a {
  position: relative;
  color: #e0b3ff;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  transition: color 0.3s ease;
}

.menu-panel a::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.menu-panel a:hover {
  color: #ff99ff;
}

.menu-panel a:hover::after {
  transform: scaleX(1);
}

.menu-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter>\
<rect width='100%' height='100%' filter='url(%23n)' opacity='0.06'/>\
</svg>");
  pointer-events: none;
  mix-blend-mode: overlay;
}

.popup {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.popup-content {
  width: min(900px, 80vw);
  height: min(600px, 75vh);
  background: #0a001a;
  color: #f1f1f1;
  border: 6px solid #f5f5f5;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.25), 0 30px 90px rgba(0,0,0,0.85);
  animation: popupEnter 0.5s cubic-bezier(.2,.8,.2,1);
}

.popup-content::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255,255,255,0.25);
  pointer-events: none;
}

.popup-content::after {
  content: "";
  position: absolute;
  inset: 14px;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter>\
<rect width='100%' height='100%' filter='url(%23n)' opacity='0.05'/>\
</svg>");
  mix-blend-mode: overlay;
  pointer-events: none;
}

.popup iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

.close {
  position: absolute;
  top: 8px;
  right: 12px;
  cursor: pointer;
  color: white;
  font-size: 1.2rem;
}

@keyframes popupEnter {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
