/* --- Your Original Base --- */
body {
  background-color: #000;
  color: #00ffcc;
  font-family: 'Share Tech Mono', monospace;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* --- Your Intro Overlay --- */
.intro {
  position: fixed;
  inset: 0;
  background: #000;
  display: grid;
  place-items: center;
  z-index: 1000;
  transition: opacity 600ms ease, visibility 600ms ease;
}
.intro.hidden {
  opacity: 0;
  visibility: hidden;
}
.intro-inner {
  position: relative;
  width: min(900px, 92vw);
  height: min(520px, 70vh);
  border: 1px solid #00ff54;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 0 30px rgba(0,255,84,0.25), inset 0 0 30px rgba(0,255,84,0.08);
  overflow: hidden;
  background: radial-gradient(1200px 500px at 50% 0%, rgba(0,255,84,0.08), transparent 70%);
}
#code-rain {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 24px;
  line-height: 1.05;
  font-size: clamp(10px, 2vw, 14px);
  color: #00ff54;
  opacity: 0.35;
  white-space: pre;
  pointer-events: none;
  user-select: none;
}
#intro-content {
  position: relative;
  display: grid;
  gap: 12px;
  justify-items: center;
  align-content: center;
  height: 100%;
  z-index: 2;
}
.scramble-text {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(24px, 5vw, 48px);
  text-align: center;
  text-shadow: 0 0 8px #00ffcc, 0 0 16px #00ffcc;
}
.typewriter {
  max-width: 90%;
  font-size: clamp(14px, 2.2vw, 18px);
  text-align: center;
  min-height: 2.2em;
  border-right: 2px solid #00ffcc;
  animation: caret 900ms steps(1) infinite;
  padding-right: 6px;
}
@keyframes caret {
  50% {
    border-color: transparent;
  }
}
.skip {
  margin-top: 10px;
  background: transparent;
  border: 1px dashed #00ffcc;
  color: #00ffcc;
  font-family: 'Orbitron', sans-serif;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, 0.2s ease, color 0.2s ease;
}
.skip:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 16px rgba(0, 255, 84, 0.35);
  background: #00ffcc;
  color: #000;
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0px, rgba(0, 0, 0, 0) 2px, rgba(0, 255, 84, 0.05) 3px);
  mix-blend-mode: overlay;
  animation: flicker 2s infinite;
  pointer-events: none;
}
@keyframes flicker {
  0%, 100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.55;
  }
}

.intro-active {
  overflow: hidden;
}

pre {
  display: none;
}

/* Nav */
nav.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  background-color: rgba(0, 255, 100, 0.1);
  backdrop-filter: blur(5px);
}
nav.nav a {
  color: #00ffcc;
  text-decoration: none;
  font-weight: bold;
  position: relative;
  font-family: 'Orbitron', sans-serif;
  transition: 0.3s;
}
nav.nav a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: #00ffcc;
  transition: 0.4s ease-in-out;
}
nav.nav a:hover::after {
  width: 100%;
}

/* Hero */
.hero {
  text-align: center;
  padding: 40px 20px;
  text-shadow: 0 0 5px #00ffcc, 0 0 10px #00ffcc;
}
.hero h1 {
  font-size: 3rem;
  color: #00ffcc;
  animation: neon-pulse 2s infinite alternate;
}
.hero h2 {
  font-size: 1.5rem;
  color: #aaffdd;
  margin-top: 10px;
}

/* Links */
.links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin: 30px;
}
.links a {
  padding: 10px 20px;
  border: 2px solid #00ff54;
  border-radius: 8px;
  text-decoration: none;
  color: #00ffcc;
  transition: 0.3s;
  font-family: 'Orbitron', sans-serif;
}
.links a:hover {
  background-color: #00ff54;
  color: #000;
  box-shadow: 0 0 20px #00ff54;
  transform: scale(1.1);
}

.links .link-text {
  opacity: 100;
  display: inline-block;
}

/* ASCII block */
.ascii {
  padding: 20px;
  color: #00ff54;
  white-space: pre;
  overflow-x: auto;
  background: #000;
  border-top: 1px solid #00ff54;
}

/* Canvas background */
#circuitCanvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  background: black;
  pointer-events: none;
}

/* Neon pulse */
@keyframes neon-pulse {
  from {
    text-shadow: 0 0 5px #00ff54, 0 0 10px #00ff54, 0 0 15px #00ff54;
  }
  to {
    text-shadow: 0 0 20px #00ff54, 0 0 30px #00ff54, 0 0 40px #00ff54;
  }
}

/* Responsive Text Sizes */
@media (min-width: 400px) {
  #scramble {
    font-size: 1.6rem;
  }
  #tw {
    font-size: 1.1rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero h2 {
    font-size: 1.1rem;
  }
}
@media (min-width: 428px) {
  #scramble {
    font-size: 1.8rem;
  }
  #tw {
    font-size: 1.2rem;
  }
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero h2 {
    font-size: 1.2rem;
  }
}
@media (min-width: 768px) {
  .intro-inner {
    max-width: 640px;
  }
  #scramble {
    font-size: 2.2rem;
  }
  #tw {
    font-size: 1.4rem;
  }
  .hero h1 {
    font-size: 2.6rem;
  }
  .hero h2 {
    font-size: 1.4rem;
  }
  .links a {
    font-size: 1rem;
    padding: 10px 18px;
  }
}

/* === MODE TOGGLE BUTTON === */
#mode-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  background: #00ffcc26;
  border: 2px solid #00ffcc;
  color: #00ffcc;
  font-size: 1.4rem;
  padding: 10px 14px;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.3);
}
#mode-toggle:hover {
  background: #00ffcc;
  color: #000;
  box-shadow: 0 0 20px #00ffcc;
}

/* Toggle styles in light mode */
body.light-mode #mode-toggle {
  background: rgba(0, 0, 0, 0.08);
  border-color: #0077ff;
  color: #0077ff;
  box-shadow: 0 0 10px rgba(0, 119, 255, 0.3);
}
body.light-mode #mode-toggle:hover {
  background: #0077ff;
  color: white;
  box-shadow: 0 0 20px #0077ff;
}

/* Mobile adjustments to make intro, code rain, and typewriter fit */
@media (max-width: 480px) {
  .intro-inner {
    width: 90vw;
    height: 60vh;
    padding: 12px;
  }
  #code-rain {
    padding: 12px;
    font-size: clamp(8px, 3vw, 12px);
  }
  .typewriter {
    font-size: clamp(12px, 4vw, 16px);
  }
  .scramble-text {
    font-size: clamp(18px, 5vw, 32px);
  }
  #loading-container {
    width: 95% !important;  /* fix width */
    max-width: none;        /* remove desktop max-width */
  }
  #loading-bar {
    width: 100% !important; /* ensure full width */
    height: 16px;
  }
  #loading-text {
    font-size: 0.9rem;
  }
}

/* === LIGHT MODE STYLES === */
body.light-mode {
  background-color: #f8f9fa;
  color: #1b1b1b;
}
body.light-mode .intro,
body.light-mode #circuitCanvas {
  background-color: #e8fff5; /* Soft mint/light teal */
}
body.light-mode .intro-inner {
  border-color: #333;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
  background: radial-gradient(1200px 500px at 50% 0%, rgba(0, 0, 0, 0.05), transparent 70%);
}
body.light-mode #code-rain {
  color: #007f5f; /* Dark teal for rain code */
  opacity: 0.35;
}
body.light-mode .scramble-text,
body.light-mode .typewriter,
body.light-mode nav.nav a,
body.light-mode .hero h1,
body.light-mode .hero h2,
body.light-mode .links a {
  color: #000000;
  text-shadow: none;
  border-color: #444;
}
body.light-mode .links a {
  border-color: #00bbaa;
}
body.light-mode .links a:hover {
  background-color: #00bbaa;
  color: #fff;
  box-shadow: 0 0 20px #00bbaa;
}
body.light-mode nav.nav {
  background-color: rgba(0, 255, 42, 0.766);
}
body.light-mode nav.nav a::after {
  background-color: #1b1b1b;
}

/* Wave lines and circuit lines colors */
body.light-mode .wave-lines,
body.light-mode .circuit-lines {
  stroke: #66cc99; /* light teal */
  opacity: 0.7;
}

/* Loading container */
#loading-container {
  width: 90%;
  max-width: 400px;
  min-width: 200px;
  text-align: center;
  margin: 10px auto;
  padding: 4px;
  box-sizing: border-box;
}

/* Loading bar */
#loading-bar {
  width: 100%;
  height: 14px;
  background: rgba(0, 255, 84, 0.15);
  border: 1px solid #00ffcc;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.3);
}

/* Loading fill */
#loading-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00ffcc, #00ff54);
  box-shadow: 0 0 12px #00ffcc;
  transition: width 0.05s linear;
  border-radius: 12px;
}

/* Loading text */
#loading-text {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  margin-top: 6px;
  color: #00ffcc;
  text-shadow: 0 0 10px #00ffcc;
  letter-spacing: 1px;
}

/* Light mode bar */
body.light-mode #loading-bar {
  background: rgba(0, 119, 255, 0.1);
  border-color: #0077ff;
}
body.light-mode #loading-fill {
  background: linear-gradient(90deg, #0077ff, #00bbaa);
  box-shadow: 0 0 12px #0077ff;
}
body.light-mode #loading-text {
  color: #0077ff;
  text-shadow: none;
}


/* --- My Intro and Loading CSS merged with minimal conflicts --- */
/* Using #intro-wrapper prefix to avoid conflicts with your .intro class */

#intro-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #001a33; /* Dark blue background */
}
