:root {
  --bg: #05030a;
  --panel: rgba(255,255,255,0.045);
  --border: rgba(178,108,255,0.18);
  --accent: #b48cff;
  --accent-glow: rgba(180, 140, 255, 0.6);
  --text: #f2effa;
  --muted: #b9b2cc;
  --terminal-green: #00ff9d;
  --terminal-glow: rgba(0, 255, 157, 0.3);
  --terminal-red: #ff375f;
  --terminal-yellow: #ffbd44;
  --terminal-blue: #2aabee;
}

.light {
  --bg: #f5f2ff;
  --panel: rgba(0,0,0,0.03);
  --border: rgba(178,108,255,0.3);
  --accent: #8a2be2;
  --text: #1a052e;
  --muted: #5a4a6e;
}

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

body {
  background: radial-gradient(circle at top, #12081f, var(--bg));
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  cursor: none;
}

/* Scanlines effect */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0, 255, 157, 0.03) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 998;
  opacity: 0.4;
}

.terminal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(
      circle at 20% 80%,
      transparent 0%,
      rgba(0, 255, 157, 0.02) 20%,
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 20%,
      transparent 0%,
      rgba(178, 108, 255, 0.02) 20%,
      transparent 40%
    );
  pointer-events: none;
  z-index: 997;
}

canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
}

/* Soft vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 60%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
  z-index: -1;
}

main {
  max-width: 1200px;
  margin: auto;
  padding: 120px 30px 80px;
  position: relative;
  z-index: 1;
}

main.hidden {
  opacity: 0;
  pointer-events: none;
}

/* TERMINAL LOADER - REALISTIC */
.terminal-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 720px;
  max-width: 92%;
  height: 420px;
  background: #0a0a0a;
  border: 1px solid #00ff9d;
  border-radius: 0;
  box-shadow: 
    0 0 30px rgba(0, 255, 157, 0.3),
    inset 0 0 30px rgba(0, 255, 157, 0.05);
  z-index: 10000;
  overflow: hidden;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 15px;
  line-height: 1.4;
}

.terminal-header {
  background: #111;
  padding: 8px 16px;
  border-bottom: 1px solid #00ff9d;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-title {
  color: #00ff9d;
  font-size: 13px;
  font-weight: normal;
  letter-spacing: 0.5px;
}

.terminal-controls {
  display: flex;
  gap: 6px;
}

.control {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.8;
}

.control.minimize { background: #ffbd44; }
.control.maximize { background: #00ca4e; }
.control.close { background: #ff605c; }

.terminal-body {
  padding: 16px;
  height: calc(100% - 40px);
  overflow-y: auto;
  background: #0a0a0a;
  color: #00ff9d;
}

.terminal-line {
  margin-bottom: 6px;
  opacity: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.terminal-line.response {
  color: #e0e0e0;
  margin-left: 4px;
  font-weight: normal;
}

.terminal-line:last-child {
  color: #00ff9d;
}

.blink {
  animation: blink 1s infinite;
  color: #00ff9d;
  font-weight: bold;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Terminal scrollbar */
.terminal-body::-webkit-scrollbar {
  width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
  background: #111;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: #00ff9d;
  border-radius: 0;
}

/* HERO */
.hero {
  text-align: center;
  margin-bottom: 100px;
  position: relative;
}

.hero h1 {
  font-family: 'Satoshi', sans-serif;
  font-size: 5rem;
  letter-spacing: 4px;
  font-weight: 700;
  margin-bottom: 20px;
  position: relative;
}

.glitch {
  position: relative;
  color: var(--accent);
  text-shadow:
    0 0 20px var(--accent-glow),
    0 0 60px rgba(180,140,255,0.3);
  animation: glitch 5s infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  animation: glitch-top 1s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  opacity: 0.8;
}

.glitch::after {
  animation: glitch-bottom 1.5s infinite;
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
  opacity: 0.8;
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

@keyframes glitch-top {
  0%, 100% { transform: translate(0); opacity: 0.8; }
  50% { transform: translate(-2px, -2px); opacity: 0.6; }
}

@keyframes glitch-bottom {
  0%, 100% { transform: translate(0); opacity: 0.8; }
  50% { transform: translate(2px, 2px); opacity: 0.6; }
}

.subtitle {
  font-size: 1.2rem;
  color: var(--muted);
  letter-spacing: 2px;
  font-weight: 300;
  position: relative;
  display: inline-block;
  padding: 10px 30px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* PANELS */
.card {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.02)
  );
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 35px;
  backdrop-filter: blur(22px);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.4),
    inset 0 0 40px rgba(180,140,255,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 40px 80px rgba(0,0,0,0.6),
    inset 0 0 60px rgba(180,140,255,0.08);
  border-color: var(--accent);
}

.card h2 {
  font-family: 'Satoshi', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 1px;
  margin-bottom: 30px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 15px;
}

.card h2 i {
  font-size: 1.3rem;
}

/* SKILLS */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(180,140,255,0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(180,140,255,0.1), transparent);
  transition: left 0.6s ease;
}

.skill-item:hover::before {
  left: 100%;
}

.skill-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 15px 30px rgba(180,140,255,0.15);
  background: rgba(180,140,255,0.1);
}

.skill-item i {
  font-size: 3rem;
  margin-bottom: 15px;
}

.skill-item span {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.skill-level {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 5px;
}

.level-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--terminal-green), var(--accent));
  border-radius: 2px;
  transition: width 1s ease;
}

/* LINKS */
.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 25px;
  border-radius: 12px;
  text-decoration: none;
  color: white;
  font-family: 'Satoshi', sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.link-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}

.link-btn:hover::before {
  left: 100%;
}

.link-btn i {
  font-size: 1.8rem;
  transition: transform 0.3s ease;
}

.link-btn:hover i {
  transform: scale(1.2);
}

.link-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.2);
}

.telegram {
  background: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
}

.discord {
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
}

.github {
  background: linear-gradient(135deg, #333 0%, #000 100%);
}

.email {
  background: linear-gradient(135deg, #ea4335 0%, #d62516 100%);
}

/* AUDIO SECTION */
.audio-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.audio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.audio-title {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: var(--muted);
}

.audio-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--terminal-green);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.status-text {
  color: var(--terminal-green);
  text-shadow: 0 0 10px var(--terminal-glow);
}

.audio-visualizer {
  height: 80px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.audio-stats {
  display: flex;
  gap: 30px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
}

.stat i {
  color: var(--terminal-green);
  width: 16px;
}

/* Hide audio element */
audio {
  display: none;
}

/* FOOTER */
.footer-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.system-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.status-label {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
}

.status-value {
  font-size: 1.1rem;
  color: var(--terminal-green);
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.status-value.active {
  color: var(--terminal-green);
  text-shadow: 0 0 10px var(--terminal-glow);
}

.status-value.safe {
  color: var(--terminal-green);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.footer-links a:hover {
  color: var(--accent);
  border-color: var(--border);
  background: rgba(180,140,255,0.05);
}

.footer-links a i {
  font-size: 0.8rem;
}

.copyright {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-align: center;
  font-family: 'Courier New', monospace;
  line-height: 1.6;
}

.copyright i {
  color: var(--terminal-green);
}

/* CURSOR */
.cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, var(--accent), transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: width 0.3s, height 0.3s, background 0.3s;
}

.cursor.hover {
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, var(--terminal-green), transparent 70%);
}

/* THEME TOGGLE */
#themeToggle {
  position: fixed;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(180,140,255,0.1);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#themeToggle:hover {
  background: var(--accent);
  color: white;
  transform: rotate(180deg);
  box-shadow: 0 0 30px var(--accent-glow);
}

/* MOBILE */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 3.5rem;
  }
  
  .terminal-loader {
    width: 95%;
    height: 320px;
    font-size: 13px;
  }
  
  .terminal-body {
    padding: 12px;
  }
  
  .terminal-line {
    font-size: 13px;
    line-height: 1.3;
  }
  
  .skills {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .links {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 25px;
  }
  
  .system-status {
    grid-template-columns: 1fr;
  }
  
  .footer-links {
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.8rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .skills {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .audio-stats {
    flex-direction: column;
    gap: 15px;
  }
}
