/* ============== Global ============== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Courier New", monospace;
}

body.dark {
  background: #000;
  color: #00ff99;
}
body.light {
  background: #fff;
  color: #000;
}

/* ============== Header ============== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  z-index: 15;
}

header h1 {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s;
}
.nav-links a:hover {
  opacity: 0.7;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#theme-toggle {
  padding: 5px 10px;
  border: 1px solid #00ff99;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 5px;
}

/* ============== Mobile menu ============== */
#menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
#menu-btn span {
  width: 25px;
  height: 3px;
  background: currentColor;
}

#mobile-menu {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 60px;
  right: 0;
  background: #000;
  padding: 15px;
  gap: 15px;
  z-index: 20;
}

/* ============== Hero ============== */
.hero-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
  padding: 100px 20px 60px;
  min-height: 90vh;
  flex-wrap: wrap;
  position: relative;
  z-index: 5;
}

.hero-text {
  flex: 1;
  min-width: 280px;
  text-align: left;
  position: relative;
  z-index: 15;
}

#typing-name {
  font-size: 3rem;
  font-weight: bold;
  color: #00ff99;
  border-right: 3px solid #00ff99;
  white-space: nowrap;
  overflow: hidden;
  width: 0;
  animation: typing 3s steps(20, end) forwards, blink 0.7s infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blink {
  50% { border-color: transparent; }
}

.subtitle {
  margin-top: 15px;
  opacity: 0.8;
  font-size: 1.1rem;
}

.cta-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #00ff99;
  color: #000;
  font-weight: bold;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.3s;
}
.cta-btn:hover {
  background-color: #00cc77;
}

.hero-image {
  flex: 1;
  min-width: 250px;
  text-align: center;
}
.hero-image img {
  max-width: 300px;
  width: 100%;
  height: auto;
  border-radius: 50%;
  border: 3px solid #00ff99;
  box-shadow: 0 0 20px #00ff99;
  transition: transform 0.3s;
}
.hero-image img:hover {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .hero-container {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }
  .hero-text {
    text-align: center;
  }
  #typing-name {
    font-size: 2rem;
  }
  #menu-btn { display: flex; }
}

/* ============== Projects ============== */
#projects .projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.project {
  padding: 15px;
  border: 1px solid #00ff99;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.6);
  transition: transform 0.3s, box-shadow 0.3s;
}
.project:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px #00ff99;
}

/* ============== Binary Rain (canvas) ============== */
#binary-rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}
#binary-rain.active {
  opacity: 1;
}

#projectPopup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.95);
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 20px;
  border-radius: 12px;
  width: 350px;
  text-align: center;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
}

#projectPopup a {
  color: #ff00ff;
  text-decoration: none;
  font-weight: bold;
}

#projectPopup a:hover {
  text-decoration: underline;
}

#projectPopup:not(.hidden) {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#projectPopup.hidden {
  display: none;
}

header, .hero-container, .hero-text, #typing-name {
  position: relative;
  z-index: 20 !important;
}

/* ============== Terminal Modal ============== */
#terminal-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
#terminal-modal.show {
  display: flex;
}
.hidden { display: none; }

.terminal-box {
  width: 80%;
  max-width: 800px;
  height: 70%;
  background: #000;
  border: 1px solid #0f0;
  border-radius: 10px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  position: relative;
}
#terminal-output {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 10px;
  white-space: pre-wrap;
}
.terminal-input {
  display: flex;
  align-items: center;
  gap: 5px;
}
.terminal-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #0f0;
  font-family: monospace;
  caret-color: #0f0;
}
#close-terminal {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: red;
  font-size: 18px;
  cursor: pointer;
}
.cmd { color: cyan; }

/* ============== Name highlight ============== */
.name {
  color: #f01520;
  cursor: pointer;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  font-weight: bold;
}
.name:hover {
  color: #00e5ff;
  text-shadow: 0 0 10px #00e5ff, 0 0 30px #00e5ff;
}

#terminal-btn {
  display: inline-block;
  margin: 20px auto;
  padding: 5px 20px;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(135deg, #611010, #585150);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-left: 90%;
  position: fixed;
  bottom: 20px;
  right: 20px;
}
#terminal-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
#terminal-btn:active {
  transform: scale(0.95);
}

#playBtn {
  display: inline-block;
  margin: 20px auto;
  padding: 5px 20px;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(135deg, #611010, #585150);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#playBtn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
#playBtn:active {
  transform: scale(0.95);
}

/* HUD */
#hud {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  color: #0ff;
  font-family: monospace;
  font-size: 18px;
  text-shadow: 0 0 10px #0ff;
  z-index: 2000;
}

/* Controls */
#controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2000;
}

#controls button {
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid #0ff;
  color: #0ff;
  font-size: 20px;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  text-shadow: 0 0 5px #0ff;
}

#controls .middle-row {
  display: flex;
  gap: 10px;
}

#controls button:hover {
  background: rgba(0, 255, 255, 0.3);
}

#exitBtn {
  margin-top: 15px;
  background: rgba(255, 0, 0, 0.2) !important;
  border: 1px solid red !important;
  color: red !important;
}

/* ============== Footer ============== */
footer {
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid #00ff99;
}
footer p {
  margin-bottom: 10px;
}
.footer-links a {
  color: #00ff99;
  margin: 0 8px;
  text-decoration: none;
  transition: color 0.3s, text-shadow 0.3s;
}
.footer-links a:hover {
  color: #00e5ff;
  text-shadow: 0 0 10px #00e5ff;
}
/* ============== Contact Links Enhancement ============== */
#contact a {
  font-weight: bold;
  color: #ff00ff;
  text-decoration: none;
  font-size: 1.1rem;
  display: inline-block;
  margin: 8px 12px;
  padding: 6px 12px;
  border: 1px solid #ff00ff;
  border-radius: 6px;
  background: rgba(255, 0, 255, 0.05);
  transition: all 0.3s ease;
  animation: glowPulse 2.5s infinite;
}

#contact a:hover {
  color: #00e5ff;
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.1);
  text-shadow: 0 0 8px #00e5ff, 0 0 20px #00e5ff;
  transform: scale(1.08);
}

#contact a:active {
  transform: scale(0.95);
  background: rgba(0, 229, 255, 0.2);
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 5px #ff00ff; }
  50% { box-shadow: 0 0 15px #ff00ff, 0 0 25px #00e5ff; }
  100% { box-shadow: 0 0 5px #ff00ff; }
}
/* Camera toggle + HUD tweaks (game) */
#camToggle {
  font-family: monospace;
}
#hudSpeed, #hudMode {
  backdrop-filter: blur(6px);
}
#camToggle, #hudSpeed, #hudMode {
  user-select: none;
}
