@font-face {
  font-family: "PPSupplyMono";
  src: url("https://assets.codepen.io/7558/PPSupplyMono-Regular.ttf")
    format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --color--background: rgb(60, 60, 60);
  --color--foreground: #c4d5bc;
  --color--accent: rgb(170, 170, 170);
  --font-primary: "PPSupplyMono", "Courier New", monospace;
  --font-secondary: "PPSupplyMono", "Courier New", monospace;
  --margin: 32px;
  --gutter: 16px;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  background: radial-gradient(
    circle at 10% 20%,
    rgb(230, 230, 230) 0%,
    rgb(180, 180, 180) 45%,
    rgb(100, 100, 100) 90%
  );
  color: var(--color--foreground);
  letter-spacing: -0.03em;
  position: relative;
  overflow: hidden;
}

body.loading-active {
  overflow: hidden !important;
}

body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: transparent url("https://assets.codepen.io/7558/noise.png") repeat
    0 0;
  background-size: 300px 300px;
  -webkit-animation: noise-animation 0.3s steps(5) infinite;
  animation: noise-animation 0.3s steps(5) infinite;
  opacity: 0.9;
  will-change: transform;
  z-index: 100;
  pointer-events: none;
}

@-webkit-keyframes noise-animation {
  0% {
    transform: translate(0, 0);
  }

  10% {
    transform: translate(-2%, -3%);
  }

  20% {
    transform: translate(-4%, 2%);
  }

  30% {
    transform: translate(2%, -4%);
  }

  40% {
    transform: translate(-2%, 5%);
  }

  50% {
    transform: translate(-4%, 2%);
  }

  60% {
    transform: translate(3%, 0);
  }

  70% {
    transform: translate(0, 3%);
  }

  80% {
    transform: translate(-3%, 0);
  }

  90% {
    transform: translate(2%, 2%);
  }

  100% {
    transform: translate(1%, 0);
  }
}

@keyframes noise-animation {
  0% {
    transform: translate(0, 0);
  }

  10% {
    transform: translate(-2%, -3%);
  }

  20% {
    transform: translate(-4%, 2%);
  }

  30% {
    transform: translate(2%, -4%);
  }

  40% {
    transform: translate(-2%, 5%);
  }

  50% {
    transform: translate(-4%, 2%);
  }

  60% {
    transform: translate(3%, 0);
  }

  70% {
    transform: translate(0, 3%);
  }

  80% {
    transform: translate(-3%, 0);
  }

  90% {
    transform: translate(2%, 2%);
  }

  100% {
    transform: translate(1%, 0);
  }
}

#canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  background: transparent;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

#canvas.ready {
  opacity: 1;
}

.fallback-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("bg.png");
  background-size: cover;
  background-position: center;
  z-index: 0;
  opacity: 0;
  transition: opacity 1s ease-out;
}

.fallback-bg.active {
  opacity: 1;
}

.container {
  display: flex;
  width: 100%;
  height: 100vh;
  padding: var(--gutter);
  position: relative;
  z-index: 10;
  transition: filter 0.1s ease-out;
}

.text-element {
  position: fixed;
  font-family: var(--font-primary);
  color: var(--color--foreground);
  text-transform: uppercase;
  z-index: 10;
  opacity: 0;
  transform: translateY(30px);
}

.logo-overlay {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5; /* di atas canvas tapi di bawah teks */
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; /* agar tidak ganggu interaksi */
}

.logo-overlay img {
  width: 750px; /* ubah sesuai kebutuhan */
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 0 15px rgba(255, 220, 100, 0.6)) brightness(1.1);
  animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(255, 220, 100, 0.4)) brightness(1);
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(255, 220, 100, 0.8)) brightness(1.2);
  }
}

.audio-enable {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  font-family: var(--font-primary);
  font-size: 12px;
  color: #c4d5bc;
  text-transform: uppercase;
  gap: 2rem;
  text-align: center;
  padding: 1rem;
}

.enable-button {
  border: 1px solid #c4d5bc;
  background: transparent;
  color: #c4d5bc;
  padding: 1rem 2rem;
  font-family: var(--font-primary);
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
}

.enable-button:hover {
  background: #c4d5bc;
  color: #0a0a0a;
}

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0a0a0a;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  font-family: var(--font-primary);
  font-size: 12px;
  color: #c4d5bc;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 1;
  transition: opacity 0.8s ease-out;
}

.preloader.fade-out {
  opacity: 0;
}

.error-message {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  padding: 10px;
  font-size: 12px;
  display: none;
  z-index: 3000;
}

.description {
  top: 120px;
  left: 50px;
  width: 360px;
  font-size: 0.75rem;
  line-height: 1.2;
}

.nav-links {
  top: 50%;
  left: 50px;
  transform: translateY(-50%);
}

.nav-links a {
  position: relative;
  display: block;
  margin-bottom: 8px;
  color: var(--color--foreground);
  text-decoration: none;
  z-index: 1;
  transition: color 0.3s ease;
  padding: 4px 8px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: var(--color--foreground);
  z-index: -1;
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: #1a1a1a;
}

.footer {
  bottom: 120px;
  right: 50px;
  font-size: 0.625rem;
}

.division {
  bottom: 120px;
  left: 50px;
  font-size: 0.625rem;
}

.signal {
  top: 50%;
  right: 100px;
  font-size: 0.625rem;
  transform: translateY(-50%);
}

.central-text {
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  text-align: center;
  font-size: 1.25rem;
  line-height: 1.1;
  white-space: nowrap;
  width: -webkit-max-content;
  width: -moz-max-content;
  width: max-content;
}

.dg.ac {
  z-index: 3000 !important;
  position: fixed !important;
  top: 10px !important;
  right: 10px !important;
}

.contract-address {
  position: relative;
  margin: 20px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 215, 0, 0.1); /* soft gold glow */
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 12px;
  padding: 10px 20px;
  max-width: 420px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
  text-align: center;
  color: #ffd700;
  font-family: "Courier New", monospace;
  animation: pulseGlow 2.5s ease-in-out infinite;
}

.contract-address span {
  font-size: 0.9rem;
  letter-spacing: 1px;
  opacity: 0.8;
}

.contract-address p {
  font-size: 0.85rem;
  margin: 4px 0 0 0;
  word-break: break-all;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
  }
  100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
  }
}


/* === Popup Overlay === */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 4000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.popup-overlay.active {
  display: flex;
  opacity: 1;
}

/* === Popup Box === */
.popup-content {
  background: #0d0d0d;
  border: 1px solid rgba(255, 215, 100, 0.25);
  border-radius: 20px;
  padding: 40px;
  width: 90%;
  max-width: 900px;
  color: #f5f5f5;
  box-shadow: 0 0 40px rgba(255, 235, 150, 0.15);
  animation: popupFade 0.4s ease;
  position: relative;
}

@keyframes popupFade {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Close Button === */
.popup-close {
  position: absolute;
  top: 20px;
  right: 25px;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #fff8c2;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.3s;
}
.popup-close:hover {
  color: #ffe873;
  transform: scale(1.2);
}

/* === Title === */
.popup-content h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #fff9c2;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* === Features Grid === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}

/* === Feature Card === */
.feature-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 215, 100, 0.15);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 25px rgba(255, 215, 100, 0.2);
  border-color: rgba(255, 215, 100, 0.35);
}

/* Icon */
.feature-card .icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
  color: #ffd86f;
}

/* Title */
.feature-card h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 8px;
}

/* Text */
.feature-card p {
  font-size: 0.85rem;
  color: #d7d7d7;
  line-height: 1.4;
}

/* ===== Coming Soon Popup ===== */
.coming-soon-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.coming-soon-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease-in-out;
}

.coming-soon-content {
  text-align: center;
  color: #fdfdfd;
  border: 1px solid #ffea00;
  padding: 2rem 3rem;
  border-radius: 12px;
  background: rgba(20, 20, 20, 0.8);
  box-shadow: 0 0 20px #ffea00aa;
  font-family: "Courier New", monospace;
}

.coming-soon-content h2 {
  color: #ffea00;
  font-size: 2rem;
  margin: 0.8rem 0;
  text-shadow: 0 0 15px #ffea00;
  letter-spacing: 3px;
  animation: glitch 1.5s infinite;
}

.coming-soon-content p {
  font-size: 0.8rem;
  opacity: 0.8;
  color: #ccc;
}

/* Loading spinner */
.loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top: 3px solid #ffea00;
  border-radius: 50%;
  margin: 0 auto 15px;
  animation: spin 1s linear infinite;
}

/* Animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes glitch {
  0% {
    text-shadow: 2px 2px #ffea00, -2px -2px #00ffff;
  }
  50% {
    text-shadow: -2px -2px #ffea00, 2px 2px #00ffff;
  }
  100% {
    text-shadow: 2px 2px #ffea00, -2px -2px #00ffff;
  }
}

/* Footer Center Box */
.footer-center {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.footer-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 16px;
  padding: 10px 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.footer-link {
  color: #ffd700;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: #fff;
  transform: scale(1.1);
}

.footer-icon {
  width: 22px;
  height: 22px;
}

.footer-box span,
.footer-box a[href*="four.meme"] {
  color: #ffd700;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
  cursor: pointer;
}

.footer-box span:hover,
.footer-box a[href*="four.meme"]:hover {
  color: #fff;
}


/* Responsive design */
@media (max-width: 768px) {
  .description,
  .nav-links,
  .division,
  .performance {
    left: 20px;
  }

  .footer,
  .signal {
    right: 20px;
  }

  .central-text {
    font-size: 1rem;
    white-space: normal;
    max-width: 90%;
  }

  .description {
    width: calc(100vw - 40px);
    max-width: 300px;
  }

  /* Optimize GUI for mobile */
  .dg.ac {
    transform: scale(0.8);
    transform-origin: top right;
  }
}

@media (max-width: 480px) {
  .central-text {
    font-size: 0.9rem;
  }

  .description {
    font-size: 0.7rem;
  }

  /* Further scale down GUI on very small screens */
  .dg.ac {
    transform: scale(0.7);
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .nav-links a:hover::after {
    width: 0;
  }

  .nav-links a:active::after {
    width: 100%;
  }

  .enable-button:hover {
    background: transparent;
    color: #c4d5bc;
  }

  .enable-button:active {
    background: #c4d5bc;
    color: #0a0a0a;
  }
}
