@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
  --retro-bg: #e0e0e0;
  --retro-text: #000000;
  --retro-accent: #000000;
  /* Monochrome black accent */
  --retro-accent-hover: #333333;
  --retro-border: #000000;
  --retro-shadow: #000000;
  --retro-card-bg: #ffffff;
  --grid-color: rgba(0, 0, 0, 0.15);
  /* Darker dots for light bg */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--retro-bg);
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center top;
  font-family: 'VT323', monospace;
  color: var(--retro-text);
  line-height: 1.6;
  font-size: 18px;
  overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Press Start 2P', cursive;
  text-transform: uppercase;
  line-height: 1.4;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.2rem;
}

a {
  text-decoration: none;
  color: var(--retro-text);
}

a:hover {
  text-decoration: underline;
}

/* Global Paragraphs */
p {
  font-size: 18px;
  margin-bottom: 1rem;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 3px solid var(--retro-border);
  padding: 0.8rem 0;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background: transparent;
  color: #000;
  padding: 5px 0;
  border: none;
}

.logo-link:hover {
  text-decoration: none;
}

.logo-img {
  width: 32px;
  height: 32px;

  background: transparent;
  display: inline-block;
  /* Show image if available */
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
}

.logo-text {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  color: #000;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 15px;
}

/* Navigation Links (Styled as Retro Buttons) */
.nav-link {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: #000;
  padding: 10px 15px;
  border: 3px solid #000;
  background: #fff;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 4px 4px 0 #000;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
}

.nav-link:hover {
  background: #ffbe00;
  /* Yellow on hover */
  color: #000;
  text-decoration: none;
  box-shadow: 8px 8px 0 #000;
  /* Larger shadow = Pop Up */
  transform: translate(-4px, -4px);
  /* Move Up */
}

/* Active Page State */
.nav-link.active {
  background: #ffbe00;
  box-shadow: 4px 4px 0 #000;
  transform: none;
}


/* Components */
.pixel-btn {
  display: inline-block;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  padding: 12px 24px;
  background: #fff;
  /* White Default */
  color: #000;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, background-color 0.2s;
  text-decoration: none;
}

.pixel-btn:hover {
  transform: translate(-3px, -3px);
  /* Pop Up */
  box-shadow: 8px 8px 0 #000;
  /* Grow Shadow */
  background: #ffbe00;
  /* Yellow ONLY on hover */
  text-decoration: none;
  color: #000;
}

.pixel-btn:active {
  transform: translate(2px, 2px);
  /* Press */
  box-shadow: 2px 2px 0 #000;
}

/* Secondary Button - Same behavior */
.pixel-btn.secondary {
  background: #fff;
  color: #000;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
}

.pixel-btn.secondary:hover {
  background: #ffbe00;
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 #000;
}

.pixel-btn.secondary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.retro-window {
  background: var(--retro-card-bg);
  border: 4px solid var(--retro-border);
  box-shadow: 10px 10px 0 var(--retro-shadow);
  padding: 0;
  position: relative;
  margin-bottom: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.window-bar {
  background: #000;
  color: #fff;
  padding: 8px 12px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid #000;
}

.retro-window-content {
  padding: 2rem;
  text-align: center;
}

/* Specific component for the "About This Tool" look */
.stats-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
  text-align: left;
}

.stat-box {
  border: 3px solid #000;
  padding: 15px;
  background: #fff;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
  /* Subtle default */
}

.stat-box:hover {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 #000;
  /* Pop Up */
  border-color: #000;
}

.stat-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  margin-bottom: 10px;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
  display: inline-block;
  color: #000;
}

/* Hero Section */
.hero-section {
  padding: 60px 0;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 3px 3px 0 #ccc;
  color: #000;
}

.hero-subtext {
  font-size: 1.2rem;
  margin-bottom: 3rem;
  color: #444;
}

.hero-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 40px 0;
}

.tool-card {
  background: var(--retro-card-bg);
  border: 3px solid var(--retro-border);
  padding: 2rem;
  text-align: center;
  transition: transform 0.2s;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.1);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 #000;
}

.tool-icon {
  width: 50px;
  height: 50px;
  margin-bottom: 1.5rem;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #000;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #ccc;
}

.tool-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #000;
}

.tool-desc {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: #555;
  height: 3rem;
}

/* Contact Form */
.pixel-input {
  background: #fff;
  border: 2px solid #000;
  padding: 10px;
  color: #000;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  width: 100%;
  box-shadow: 3px 3px 0 #ddd;
}

.pixel-input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 3px 3px 0 #000;
}

/* Footer */
.site-footer {
  background: #000;
  border-top: 3px solid #000;
  padding: 2rem 0;
  text-align: center;
  color: #fff;
  font-family: 'Press Start 2P', cursive;
  font-size: 1rem;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  transition: 0.2s;
}

.site-footer a:hover {
  /* opacity: 0.7; */
  text-decoration: underline;
  color: #ffbe00;
  /* Fixed undefined variable */
}

.footer-links {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.ad-space {
  width: 100%;
  min-height: 100px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid-container {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  /* Mobile Header Layout */
  .site-header {
    padding: 1rem 0;
  }

  .header-inner {
    flex-direction: column;
    gap: 15px;
  }

  /* Center Logo */
  .logo-link {
    justify-content: center;
    width: 100%;
  }

  /* Nav Links Grid */
  .main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
  }

  /* Make nav links look good on mobile */
  .nav-link {
    font-size: 0.7rem;
    padding: 10px 10px;
    min-width: 80px;
    text-align: center;
  }

  /* Force Contact button to bottom row if needed, or rely on wrap */
  /* If you want purely 2 rows like the image:
     HOME TOOLS GAMES BLOG
           CONTACT
  */
  .nav-link.btn-contact {
    width: 140px;
    /* Make contact button slightly wider/prominent */
    margin-top: 5px;
  }
}

/* Animations */
@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.blink {
  animation: blink 1s step-end infinite;
}

/* Glitch Effect */
/* Glitch Effect - RGB Split */
.glitch {
  position: relative;
}

.glitch:hover {
  color: #000;
}

.glitch:hover::before,
.glitch:hover::after {
  content: attr(data-text);
  /* Dynamic Text */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  /* No Box */
  opacity: 0.8;
  pointer-events: none;
  /* Ensure text remains selectable/hoverable */
}

.glitch:hover::before {
  color: #ff00c1;
  z-index: 2;
  /* Put ON TOP of text */
  mix-blend-mode: multiply;
  /* Blend for effect */
  animation: glitch-anim-1 4s infinite linear alternate-reverse;
}

.glitch:hover::after {
  color: #00fff9;
  z-index: 2;
  /* Put ON TOP of text */
  mix-blend-mode: multiply;
  /* Blend for effect */
  animation: glitch-anim-2 4s infinite linear alternate-reverse;
}

@keyframes glitch-poke {
  0% {
    transform: translate(0);
  }

  20% {
    transform: translate(-2px, 2px);
  }

  40% {
    transform: translate(-2px, -2px);
  }

  60% {
    transform: translate(2px, 2px);
  }

  80% {
    transform: translate(2px, -2px);
  }

  100% {
    transform: translate(0);
  }
}

@keyframes glitch-anim-1 {
  0% {
    clip-path: inset(20% 0 80% 0);
    transform: translate(-2px, 1px);
  }

  20% {
    clip-path: inset(60% 0 1% 0);
    transform: translate(1px, -1px);
  }

  40% {
    clip-path: inset(40% 0 20% 0);
    transform: translate(-1px, 2px);
  }

  60% {
    clip-path: inset(80% 0 5% 0);
    transform: translate(2px, -2px);
  }

  80% {
    clip-path: inset(10% 0 60% 0);
    transform: translate(-2px, 1px);
  }

  100% {
    clip-path: inset(30% 0 20% 0);
    transform: translate(1px, -1px);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(10% 0 60% 0);
    transform: translate(2px, -1px);
  }

  20% {
    clip-path: inset(30% 0 20% 0);
    transform: translate(-1px, 2px);
  }

  40% {
    clip-path: inset(10% 0 80% 0);
    transform: translate(1px, -2px);
  }

  60% {
    clip-path: inset(40% 0 10% 0);
    transform: translate(-2px, 1px);
  }

  80% {
    clip-path: inset(80% 0 5% 0);
    transform: translate(2px, -2px);
  }

  100% {
    clip-path: inset(20% 0 40% 0);
    transform: translate(-1px, 1px);
  }
}

/* Retro Cursor Trail */
.cursor-trail {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: var(--retro-accent);
  /* Black dots */
  pointer-events: none;
  z-index: 9998;
  opacity: 0.8;
  animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
  to {
    transform: scale(0);
    opacity: 0;
  }
}

/* Retro Form Elements */
.retro-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.retro-input {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  padding: 10px;
  border: 3px solid #000;
  background: #fff;
  color: #000;
  outline: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
  flex: 1;
  min-width: 200px;
}

.retro-input:focus {
  box-shadow: 4px 4px 0 #000;
  background: #ffffcc;
  /* Light yellow focus */
}

/* --- GAME STYLES --- */

/* Canvas Borders */
#snakeCanvas,
#invadersCanvas {
  border: 4px solid #333;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
  display: block;
  margin: 0 auto;
  background: #000;
  max-width: 100%;
  height: auto;
}



.game-area {
  text-align: center;
}

/* Whack-a-Glitch Board */
.wag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 250px;
  margin: 0 auto;
  background: #000;
  border: 4px solid #000;
  padding: 10px;
}

.wag-cell {
  background: #33ff33;
  /* Stable Green */
  width: 100%;
  height: 60px;
  cursor: pointer;
  border: 2px solid #000;
  transition: background 0.1s;
}

.wag-cell.glitched {
  background: #ff0000;
  /* Glitch Red */
  animation: glitch-shake 0.2s infinite;
}

@keyframes glitch-shake {
  0% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-2px, 2px);
  }

  50% {
    transform: translate(2px, -2px);
  }

  75% {
    transform: translate(-2px, -2px);
  }

  100% {
    transform: translate(0, 0);
  }
}

/* Footer Social Icons */
.footer-social-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.social-icon {
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.social-icon:hover {
  opacity: 1;
  transform: translateY(-3px);
  color: #ffbe00 !important;
  /* Yellow hover with !important to override .site-footer a:hover */
}

.social-icon::after {
  content: attr(title);
  position: absolute;
  bottom: 125%;
  /* Move it up slightly more */
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-family: sans-serif;
  white-space: nowrap;
  border: 1px solid #444;
  z-index: 9999;
  /* Higher Z-index */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  /* Add transform transition for smooth lift */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  visibility: hidden;
  display: block;
  /* Force display block */
}

.social-icon:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px);
  /* Add subtle lift animation */
}

.social-icon {
  position: relative;
  overflow: visible;
  /* Ensure tooltip isn't clipped by icon container */
}

.social-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Feature Cards */
.pixel-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pixel-card:hover {
  transform: translateY(-5px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

/* Dark Retro Window Theme (Terminal Style) */
.retro-window.terminal-style {
  background-color: #000;
  color: #33ff00;
  /* Retro Terminal Green */
  border-color: #000;
  box-shadow: 10px 10px 0 #555;
}

.retro-window.terminal-style .window-bar {
  background: #33ff00;
  color: #000;
  border-bottom: 4px solid #33ff00;
}

.retro-window.terminal-style .retro-window-content {
  text-align: left;
  font-family: 'VT323', monospace;
  padding: 2rem;
}

/* Feature Schematic Grid */
.schematic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  border: 2px solid #33ff00;
}

.schematic-item {
  padding: 20px;
  border: 1px solid #33ff00;
  /* Grid lines */
  position: relative;
  transition: background 0.2s;
}

.schematic-item:hover {
  background: #003300;
}

.schematic-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.schematic-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  color: #33ff00;
}

.schematic-desc {
  font-size: 1rem;
  line-height: 1.4;
  color: #ccffcc;
}

/* Flowchart Steps (How to Use) */
.flow-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  padding: 20px 0;
}

.flow-step {
  flex: 1;
  background: #fff;
  border: 3px solid #000;
  padding: 20px;
  text-align: center;
  position: relative;
  box-shadow: 5px 5px 0 #000;
  z-index: 2;
}

.flow-number {
  background: #000;
  color: #fff;
  font-family: 'Press Start 2P', cursive;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -35px auto 10px;
  /* Pull up to sit on border */
  border: 3px solid #000;
}

.flow-connector {
  display: none;
  /* Hidden on mobile */
}

@media (min-width: 768px) {
  .flow-connector {
    display: block;
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: #000;
    /* The line connecting steps */
    z-index: 1;
    transform: translateY(-50%);
  }
}

/* Benchmark / Comparison Table */
.benchmark-container {
  background: #fff;
  border: 3px solid #000;
}

.benchmark-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 2px solid #000;
}

.benchmark-row:last-child {
  border-bottom: none;
}

.benchmark-cell {
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.benchmark-cell.bad {
  background: #f0f0f0;
  border-right: 2px solid #000;
  color: #555;
}

.benchmark-cell.good {
  background: #fff;
  font-weight: bold;
}

.check-icon {
  color: #00aa00;
  font-weight: bold;
}

.cross-icon {
  color: #cc0000;
  font-weight: bold;
}

@media (max-width: 600px) {
  .flow-container {
    flex-direction: column;
  }

  .flow-connector {
    display: none;
  }

  .flow-step {
    width: 100%;
    margin-bottom: 20px;
  }
}