/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  font-family: 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background-color: #0a0f1c;
  color: #ffffff;
  transition: background 0.3s, color 0.3s;
}
body.light { background-color: #f4f4f4; color: #222; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }

/* ===== Entrance Screen ===== */
#entrance-screen { display: none; }
body.js #entrance-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0f1e2e, #101324);
  color: #66ccff;
  display: grid; place-items: center;
  z-index: 9999;
  cursor: pointer;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
#entrance-screen.fade-out { opacity: 0; transform: scale(1.05); pointer-events: none; }

.entrance-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  isolation: isolate;
  padding: 16px 20px;
}

/* ===== Glitch effect ===== */
.glitch {
  position: relative;
  display: inline-block;
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  line-height: 1;
  color: #66ccff;
  z-index: 3;
  pointer-events: none;
  transform: translateZ(0);
  animation: glitch-skew 1.2s infinite steps(2, end) alternate, flicker 0.3s infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: inherit;
  overflow: hidden;
}

.glitch::before {
  color: #ff3f3f;
  z-index: -1;
  animation: glitch-anim 1.5s infinite steps(2, end) alternate;
}

.glitch::after {
  color: #00ffea;
  z-index: -2;
  animation: glitch-anim2 1.2s infinite steps(2, end) alternate;
}

@keyframes glitch-anim {
  0% { clip-path: inset(10% 0 85% 0); transform: translate(-2px, -2px); }
  20% { clip-path: inset(40% 0 40% 0); transform: translate(2px, 1px); }
  40% { clip-path: inset(70% 0 20% 0); transform: translate(-1px, 2px); }
  60% { clip-path: inset(30% 0 60% 0); transform: translate(1px, -1px); }
  80% { clip-path: inset(50% 0 30% 0); transform: translate(-3px, 0); }
  100% { clip-path: inset(20% 0 70% 0); transform: translate(0, 2px); }
}

@keyframes glitch-anim2 {
  0% { clip-path: inset(15% 0 80% 0); transform: translate(2px, -1px); }
  25% { clip-path: inset(35% 0 45% 0); transform: translate(-1px, 2px); }
  50% { clip-path: inset(60% 0 25% 0); transform: translate(1px, -2px); }
  75% { clip-path: inset(20% 0 65% 0); transform: translate(-2px, 1px); }
  100% { clip-path: inset(40% 0 40% 0); transform: translate(0, 0); }
}

@keyframes glitch-skew {
  0% { transform: skew(0deg); }
  100% { transform: skew(2deg); }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}


/* ===== Typewriter animation ===== */
.typewriter {
  z-index: 1;
  display: inline-block;
  overflow: hidden;
  border-right: .15em solid #66ccff;
  white-space: nowrap;
  animation: typing 2s steps(20, end), blink-caret 0.8s step-end infinite;
}
@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink-caret {
  0%, 100% { border-color: transparent }
  50% { border-color: #66ccff }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .glitch, .glitch::before, .glitch::after, .typewriter { animation: none !important; }
  #entrance-screen, .theme-toggle, .menu-links a { transition: none !important; }
}

/* ===== Main Menu ===== */
.vizon-menu {
  max-width: 960px;
  margin: clamp(56px, 8vh, 96px) auto;
  text-align: center;
  padding: 24px;
}
.title,
.theme-toggle,
.subtitle {
  color: #66ccff;
  text-shadow: 0 0 8px rgba(102, 204, 255, 0.6);
}

.title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.subtitle {
  font-size: 1.1rem;
  margin-bottom: 28px;
  color: #cccccc;
}
body.light .subtitle { color: #555; }

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ===== Link cards ===== */
.menu-links a {
  display: block;
  width: 100%;
  padding: 24px 22px;
  min-height: 60px;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #ffffff;
  text-align: center;
  background: linear-gradient(135deg, rgba(30, 50, 80, 0.95), rgba(10, 20, 40, 0.9));
  border-radius: 14px;

  /* subtle light box to make cards pop */
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.05);

  transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, text-shadow 0.18s ease;
  position: relative;
  transform-origin: center;
}

.menu-links a:hover {
  color: #3399ff;
  text-shadow: 0 0 8px #3399ff;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 14px rgba(51, 153, 255, 0.35);
}

/* ===== Light theme variants ===== */
body.light .menu-links a {
  background: linear-gradient(135deg, #eaeaea, #dcdcdc);
  color: #222;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.03);
}
body.light .menu-links a:hover {
  color: #0056b3;
  text-shadow: 0 0 6px rgba(0, 86, 179, 0.6);
}

/* ===== Home Link ===== */
.vizon-home-link {
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #66ccff;
  text-shadow: 0 0 8px rgba(102, 204, 255, 0.6);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  position: fixed;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: currentColor;
  cursor: pointer;
  transition: transform 0.2s ease, text-shadow 0.2s ease;
}
.theme-toggle:hover {
  transform: rotate(20deg) scale(1.15);
  text-shadow: 0 0 8px currentColor;
}

/* ===== Clean focus styles (no harsh white outline) ===== */
.menu-links a:focus,
.vizon-home-link:focus,
.theme-toggle:focus {
  outline: none;
}

/* Mouse click stays clean; keyboard focus shows glow */
.menu-links a:focus:not(:focus-visible),
.vizon-home-link:focus:not(:focus-visible),
.theme-toggle:focus:not(:focus-visible) {
  box-shadow: none;
  background-color: inherit;
}

/* Keyboard focus glow on cards */
.menu-links a:focus-visible {
  outline: none;
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28), 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Keyboard focus glow on top links */
.vizon-home-link:focus-visible,
.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(102, 204, 255, 0.5);
  border-radius: 10px;
}

/* Light theme focus adjustments */
body.light .menu-links a:focus-visible {
  background-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25), 0 6px 18px rgba(0, 0, 0, 0.15);
}
body.light .vizon-home-link:focus-visible,
body.light .theme-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .menu-links { gap: 24px; }
  .menu-links a { font-size: 1.05rem; padding: 20px; }
}
@media (max-width: 480px) {
  .vizon-menu { padding: 16px; margin: 56px auto; }
  .menu-links { gap: 22px; }
  .menu-links a { font-size: 1rem; padding: 18px; min-height: 56px; }
}

/* Optional: tame subpixel jitter on some GPUs */
.menu-links a, .glitch, .theme-toggle { transform: translateZ(0); }
/* ===== Extra Glow Enhancements ===== */

/* Neon pulse effect on title */
.title {
  animation: neonPulse 3s ease-in-out infinite;
}

@keyframes neonPulse {
  0%, 100% {
    text-shadow: 0 0 8px rgba(102, 204, 255, 0.6);
  }
  50% {
    text-shadow: 0 0 16px rgba(102, 204, 255, 0.9);
  }
}

/* Unified glow for title, subtitle, toggle, and home link */
.title,
.subtitle,
.theme-toggle,
.vizon-home-link {
  color: #66ccff;
  text-shadow: 0 0 8px rgba(102, 204, 255, 0.6);
  border: none;
}

/* Enhanced hover for menu cards */
.menu-links a:hover {
  box-shadow: 0 0 14px rgba(102, 204, 255, 0.35);
  transform: translateY(-2px) scale(1.02);
}

/* Remove outlines globally for safety */
*:focus,
*:focus-visible {
  outline: none;
  box-shadow: none;
}

