:root {
  --bg1: #fdfdfd;
  --bg2: #000000;
  --accent1: #7c5cff;
  --accent2: #3bd1ff;
  --card-bg: rgba(255,255,255,0.04);
  --text: #e8eef8;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background: linear-gradient(-45deg, var(--bg1), var(--bg2), #191f3f, #0b1020);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Canvas */
#wave-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: transparent;
  pointer-events: none;
}

/* Background fog layers */
.animated-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
}

.animated-bg.layer1 {
  background: radial-gradient(circle at 25% 30%, rgba(124,92,255,0.14) 0%, transparent 55%);
  animation: fogDrift1 18s linear infinite;
}
.animated-bg.layer2 {
  background: radial-gradient(circle at 80% 70%, rgba(59,209,255,0.12) 0%, transparent 55%);
  animation: fogDrift2 26s linear infinite;
  opacity: 0.95;
}

@keyframes fogDrift1 {
  0% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(-4%,2%,0) scale(1.06); }
  100% { transform: translate3d(0,0,0) scale(1); }
}
@keyframes fogDrift2 {
  0% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(3%,-2%,0) scale(1.03); }
  100% { transform: translate3d(0,0,0) scale(1); }
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 60px auto;
  padding: 0 24px;
  position: relative;
  z-index: 5;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}
.hero h1 { font-size: 2.5rem; margin: 0; }
#subtitle { color: rgba(255,255,255,0.7); margin: 6px 0; }
#about { color: rgba(255,255,255,0.8); max-width: 700px; margin: 10px auto 0; line-height: 1.5; }

.section-title { text-align: center; font-size: 1.2rem; margin-bottom: 24px; color: rgba(255,255,255,0.85); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

/* Cards */
.card {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s ease;
}
.card.in-view { opacity: 1; transform: translateY(0); }

.card-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.28s ease;
  cursor: pointer;
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
}

.card-inner::after {
  content: "";
  position: absolute;
  left: -40%;
  top: -50%;
  width: 60%;
  height: 200%;
  background: linear-gradient(120deg, rgba(255,255,255,0.02), rgba(255,255,255,0.12), rgba(255,255,255,0.02));
  transform: rotate(25deg) translateX(-120%);
  transition: transform 0.9s cubic-bezier(.2,.9,.2,1), opacity 0.5s;
  opacity: 0;
  pointer-events: none;
}
.card-inner:hover::after {
  transform: rotate(25deg) translateX(120%);
  opacity: 1;
}

.logo { width: 65px; height: 65px; object-fit: contain; }
.info h3 { margin: 0; font-size: 1.15rem; }
.info p { margin: 4px 0 0; color: rgba(255,255,255,0.7); }

.card:hover .card-inner {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 0 30px rgba(124,92,255,0.35);
  border-color: var(--accent1);
}

/* Footer */
.footer {
  margin: 60px 0 40px;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}

/* Redesigned GUI */
#gui {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 260px;
  background: rgba(14, 16, 30, 0.95);
  padding: 16px 20px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.9rem;
  z-index: 999;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#gui h3 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  text-align: center;
  color: var(--accent2);
}

#gui .gui-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
}

#gui .gui-control label {
  flex: 1;
  font-size: 0.9rem;
}

#gui .gui-control input[type="range"] {
  flex: 1.2;
  margin-left: 12px;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: rgba(124,92,255,0.3);
  accent-color: var(--accent1);
  cursor: pointer;
  transition: background 0.2s ease;
}

#gui .gui-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  cursor: pointer;
}

#gui .gui-control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  cursor: pointer;
}

#gui.closed {
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  #gui { display: none; }
}

/* Welcome intro */
#welcome-intro {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #0ff;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 2px;
  font-size: 3rem;
  opacity: 1;
  animation: fadeOut 1.6s ease forwards 2.2s;
}

#welcome-intro span {
  opacity: 0;
  animation: textReveal 1.2s ease-out forwards 1s;
}

@keyframes pulseFlash {
  0% { background: #000; }
  20% { background: #00eaff; }
  25% { background: #000; }
  100% { background: #000; }
}

@keyframes textReveal {
  0% { opacity: 0; filter: blur(20px); transform: scale(0.8); }
  40% { opacity: 1; filter: blur(6px); }
  100% { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes fadeOut {
  to { opacity: 0; visibility: hidden; }
}

.scanline {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 120%;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(0,255,255,0.2) 50%,
    transparent 100%);
  animation: scan 1.5s ease-out forwards 1.1s;
}

@keyframes scan {
  0% { top: -100%; }
  100% { top: 100%; }
}

.glitch {
  position: absolute;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(180deg,
    rgba(0,255,255,0.06) 0,
    rgba(0,255,255,0.06) 1px,
    transparent 2px,
    transparent 3px);
  opacity: 0;
  animation: glitchAnim 0.3s steps(2) forwards 1.4s;
}

@keyframes glitchAnim {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(4px); }
  60% { opacity: 1; transform: translateY(-4px); }
  100% { opacity: 0; transform: translateY(0); }
}
