/* ============================================
   TERMinator Website - Retro BBS Theme
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0A1929;
  --bg-secondary: #081320;
  --bg-card: #0d2137;
  --bg-card-hover: #122a45;
  --text-primary: #AAAAAA;
  --text-bright: #e0e0e0;
  --cyan: #00AAFF;
  --cyan-dark: #0088DD;
  --green: #00FFAA;
  --green-dim: #00cc88;
  --red: #FF5555;
  --yellow: #FFFF55;
  --magenta: #FF55FF;
  --blue-stripe: #335094;
  --border-color: #1a3a5c;
  --glow-cyan: 0 0 10px rgba(0, 170, 255, 0.3);
  --glow-green: 0 0 10px rgba(0, 255, 170, 0.3);
  --font-mono: 'IBM Plex Mono', 'Courier New', Courier, monospace;
  --font-display: 'Press Start 2P', 'IBM Plex Mono', monospace;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: 'Press Start 2P', cursive;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.7rem;
  line-height: 2;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  position: relative;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--green);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Global TERMinator brand colors --- */
.term {
  color: #AA55FF;
}
.inator {
  color: var(--cyan);
}

/* --- Scanline Overlay (CRT effect) --- */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* --- Matrix Rain Background --- */
.matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  opacity: 0.12;
}

.matrix-column {
  position: absolute;
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
  color: var(--green);
  writing-mode: vertical-rl;
  white-space: nowrap;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(8, 19, 32, 0.95);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
}

#pixel-logo {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  height: 21px;
  width: auto;
}

.pixel-logo {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  vertical-align: middle;
  display: inline-block;
}

.pixel-logo--heading {
  height: 28px;
  width: auto;
  vertical-align: baseline;
  position: relative;
  top: 2px;
}

.pixel-logo--inline {
  height: 14px;
  width: auto;
  vertical-align: baseline;
  position: relative;
  top: 1px;
}

.pixel-logo--footer {
  height: 18px;
  width: auto;
}

.pixel-nav {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  height: 13px;
  width: auto;
  display: block;
}

.pixel-title {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  height: 28px;
  width: auto;
  display: block;
  margin: 0 auto;
}


.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  color: var(--text-primary);
  font-family: 'Press Start 2P', cursive;
  font-size: 0.55rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--cyan);
  transition: width 0.3s;
}
.nav-links a:hover {
  color: var(--cyan);
}
.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--cyan);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px 60px;
  position: relative;
}

.hero-logo {
  margin-bottom: 12px;
}

.hero-header-img {
  max-width: 480px;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 20px rgba(0, 170, 255, 0.3));
}

.hero-splash {
  margin: 20px 0;
  position: relative;
  display: inline-block;
}

.hero-splash-img {
  max-width: 480px;
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 255, 170, 0.1), 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* --- Scanline Wipe --- */
.hero-splash .scanline {
  position: absolute;
  left: 0;
  width: 100%;
  height: 8px;
  pointer-events: none;
  z-index: 4;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 255, 170, 0.2) 0px,
      rgba(0, 255, 170, 0.05) 3px,
      rgba(0, 255, 170, 0.25) 5px,
      transparent 7px,
      rgba(0, 255, 170, 0.18) 10px,
      rgba(0, 255, 170, 0.03) 12px,
      rgba(0, 255, 170, 0.22) 15px,
      transparent 17px,
      rgba(0, 255, 170, 0.15) 20px
    ),
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(0, 255, 170, 0.08) 20%,
      rgba(0, 255, 170, 0.2) 50%,
      rgba(0, 255, 170, 0.08) 80%,
      transparent 100%
    );
  box-shadow: 0 0 14px 4px rgba(0, 255, 170, 0.1);
  animation: scanline-roll 8s linear infinite;
  clip-path: polygon(
    0% 20%, 3% 0%, 7% 40%, 10% 10%, 14% 50%, 18% 5%, 22% 45%,
    26% 0%, 30% 35%, 34% 10%, 38% 50%, 42% 5%, 46% 40%,
    50% 15%, 54% 50%, 58% 0%, 62% 45%, 66% 10%, 70% 50%,
    74% 5%, 78% 40%, 82% 0%, 86% 35%, 90% 15%, 94% 50%,
    97% 5%, 100% 30%, 100% 80%, 97% 100%, 94% 60%, 90% 95%,
    86% 55%, 82% 100%, 78% 65%, 74% 95%, 70% 55%, 66% 100%,
    62% 60%, 58% 100%, 54% 55%, 50% 90%, 46% 60%, 42% 100%,
    38% 55%, 34% 95%, 30% 65%, 26% 100%, 22% 60%, 18% 95%,
    14% 55%, 10% 100%, 7% 65%, 3% 95%, 0% 70%
  );
}

@keyframes scanline-roll {
  0%   { top: -8px; }
  100% { top: 100%; }
}

/* --- Glitch Effect --- */
.glitch {
  overflow: hidden;
}

.glitch-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  border: none !important;
  box-shadow: none !important;
}

.glitch-r {
  animation: glitch-red 5s infinite;
}

.glitch-b {
  animation: glitch-cyan 5s infinite;
  animation-delay: 0.3s;
}

@keyframes glitch-red {
  0%, 55% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  56%     { opacity: 0.8; clip-path: inset(20% 0 60% 0); transform: translate(4px, 0); filter: hue-rotate(-50deg) saturate(3) brightness(1.5); }
  58%     { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  60%     { opacity: 0.9; clip-path: inset(55% 0 15% 0); transform: translate(-6px, 0); filter: hue-rotate(-50deg) saturate(3) brightness(1.5); }
  62%     { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  64%     { opacity: 0.7; clip-path: inset(5% 0 85% 0); transform: translate(3px, 0); filter: hue-rotate(-50deg) saturate(3) brightness(1.5); }
  66%     { opacity: 0.8; clip-path: inset(70% 0 10% 0); transform: translate(-5px, 0); filter: hue-rotate(-50deg) saturate(3) brightness(1.5); }
  68%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
}

@keyframes glitch-cyan {
  0%, 62% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  63%     { opacity: 0.8; clip-path: inset(45% 0 30% 0); transform: translate(-5px, 0); filter: hue-rotate(100deg) saturate(3) brightness(1.5); }
  65%     { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
  67%     { opacity: 0.9; clip-path: inset(10% 0 70% 0); transform: translate(6px, 0); filter: hue-rotate(100deg) saturate(3) brightness(1.5); }
  69%     { opacity: 0.7; clip-path: inset(75% 0 5% 0); transform: translate(-3px, 0); filter: hue-rotate(100deg) saturate(3) brightness(1.5); }
  71%     { opacity: 0.8; clip-path: inset(35% 0 45% 0); transform: translate(4px, 0); filter: hue-rotate(100deg) saturate(3) brightness(1.5); }
  73%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0); }
}

/* --- Glitch Slices (JS-driven) --- */
.glitch-slice {
  overflow: hidden;
  mix-blend-mode: screen;
}

.hero-subtitle {
  font-size: clamp(0.675rem, 1.5vw, 0.86rem);
  color: var(--green);
  letter-spacing: 3px;
  margin-bottom: 24px;
  text-shadow: var(--glow-green);
}

.hero-tagline {
  font-size: clamp(0.675rem, 1.5vw, 0.86rem);
  color: var(--text-primary);
  max-width: 600px;
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-tagline .highlight {
  color: var(--yellow);
}


.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 4px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.btn-primary {
  background: var(--cyan);
  color: var(--bg-primary);
  border-color: var(--cyan);
}
.btn-primary:hover {
  background: transparent;
  color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}
.btn-outline:hover {
  background: var(--green);
  color: var(--bg-primary);
  box-shadow: var(--glow-green);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* --- Section Layout --- */
.section {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  font-size: 0.75rem;
  color: var(--green);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.section-title {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 400;
  color: var(--cyan);
  letter-spacing: 2px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  text-shadow: var(--glow-cyan);
}

.section-divider {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  margin: 16px auto 0;
  border: none;
}

/* --- About Section --- */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-text p {
  margin-bottom: 16px;
  line-height: 1.8;
}

.about-text .highlight {
  color: var(--cyan);
  font-weight: 600;
}

.about-art {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.about-art img {
  display: block;
  width: 100%;
}

/* --- Features Section --- */
.features-bg {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.term-card {
  background: #0c0c0c;
  border: 1px solid #333;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.term-card:hover {
  border-color: var(--cyan-dark);
  box-shadow: 0 0 15px rgba(0, 170, 255, 0.1);
}

.term-titlebar {
  background: #1a1a1a;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #333;
}

.term-path {
  color: var(--green);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-buttons {
  display: flex;
  gap: 10px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.btn-min { color: var(--yellow); }
.btn-max { color: var(--green); }
.btn-close { color: var(--red); }

.term-body {
  padding: 14px 16px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.9;
}

.term-line {
  color: var(--text-bright);
}

.term-prompt {
  color: var(--green);
  margin-right: 6px;
}

.term-output {
  color: var(--cyan);
}

.term-text {
  color: var(--green-dim);
  margin-top: 6px;
  font-size: 0.7rem;
  line-height: 1.8;
}

.term-cursor {
  color: var(--green);
  animation: blink-cursor 1s step-end infinite;
  margin-top: 4px;
}

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

/* --- Screenshots Section --- */
.screenshots-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.tab-btn {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: 'Press Start 2P', cursive;
  font-size: 0.85rem;
  letter-spacing: 1px;
  cursor: pointer;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  border-radius: 4px;
  transition: all 0.25s;
}

.tab-btn.active,
.tab-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 170, 255, 0.08);
}

.tab-btn[data-platform="android"]:hover,
.tab-btn[data-platform="android"].active {
  color: var(--green);
  border-color: var(--green);
  background: rgba(0, 255, 170, 0.08);
}

.screenshots-grid {
  display: grid;
  gap: 20px;
}

.screenshots-grid[data-platform="android"] {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  max-width: 900px;
  margin: 0 auto;
}

.screenshots-grid[data-platform="windows"] {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  max-width: 1100px;
  margin: 0 auto;
}

.screenshot-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--bg-card);
}

.screenshot-card:hover {
  border-color: var(--cyan);
  transform: scale(1.02);
  box-shadow: var(--glow-cyan);
}

.screenshot-card img {
  display: block;
  width: 100%;
}

.screenshot-card .caption {
  padding: 10px 14px;
  font-size: 0.75rem;
  color: var(--text-primary);
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.platform-group {
  display: none;
}
.platform-group.active {
  display: block;
}

/* --- Downloads Section --- */
.downloads-bg {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s;
}

.download-card:hover {
  border-color: var(--cyan);
  background: var(--bg-card-hover);
}

.download-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
}

.download-card h3 {
  color: var(--text-bright);
  font-size: 1.1rem;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.download-card .version {
  font-size: 0.8rem;
  color: var(--green);
  margin-bottom: 6px;
}

.download-card .status {
  font-size: 0.75rem;
  margin-bottom: 20px;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  letter-spacing: 1px;
}

.status-available {
  color: var(--green);
  border: 1px solid var(--green);
}

.status-beta {
  color: var(--yellow);
  border: 1px solid var(--yellow);
}

.status-sideload {
  color: var(--magenta);
  border: 1px solid var(--magenta);
}

.download-card .btn {
  width: 100%;
  justify-content: center;
}

.download-note {
  font-size: 0.7rem;
  color: #667;
  margin-top: 10px;
  line-height: 1.5;
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 40px;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 0 60px rgba(0, 170, 255, 0.15);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: var(--text-primary);
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-mono);
}
.lightbox-close:hover {
  color: var(--cyan);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
}

.footer-brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 8px;
}


.footer-text {
  font-size: 0.605rem;
  color: #556;
  margin-bottom: 4px;
  line-height: 1.7;
}

.footer-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-primary);
}
.footer-links a:hover {
  color: var(--cyan);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(8, 19, 32, 0.98);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-art {
    order: -1;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .screenshots-grid[data-platform="android"] {
    grid-template-columns: repeat(2, 1fr);
  }

  .screenshots-grid[data-platform="windows"] {
    grid-template-columns: 1fr;
  }

  .downloads-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 80px;
  }
}

@media (max-width: 480px) {
  .screenshots-grid[data-platform="android"] {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }
}
