/*
  Global stylesheet for the creepy, VHS‑inspired server hub. The design
  employs dark backgrounds, neon accents and subtle glitch/noise overlays.
  Colours and fonts are defined as CSS variables at the top for easy tuning.
*/

@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

/* Root variables for colours and fonts */
:root {
  --color-bg: #0a0a10;
  --color-panel: rgba(0, 0, 0, 0.7);
  --color-primary: #7d3ed1;
  --color-secondary: #00f0ff;
  --color-light: #e7e7e7;
  --color-muted: #8686a0;
  --font-heading: 'VT323', monospace;
  --font-body: 'Share Tech Mono', monospace;
}

/* Global reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-light);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Noise overlay: two repeating linear gradients animated to create a subtle static effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
  background-image:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0px, rgba(255, 255, 255, 0.015) 1px, transparent 1px, transparent 4px);
  animation: noiseMove 1s infinite steps(10);
  opacity: 0.25;
}

@keyframes noiseMove {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-5%, -10%);
  }
  40% {
    transform: translate(-15%, 5%);
  }
  60% {
    transform: translate(7%, -25%);
  }
  80% {
    transform: translate(-5%, 15%);
  }
  100% {
    transform: translate(0, 0);
  }
}

/* Horizontal scanlines overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 2px,
      transparent 2px,
      transparent 6px
    );
  opacity: 0.15;
  z-index: 9999;
}

/* Navigation styles */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 5000;
}

.nav .logo {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 3px;
  position: relative;
  line-height: 1;
  user-select: none;
}

/* Duplicate of the logo behind to create a layered colour shift */
.nav .logo::after {
  content: attr(data-glitch);
  position: absolute;
  top: 0;
  left: 0;
  color: var(--color-primary);
  opacity: 0.6;
  transform: translate(2px, 2px);
  mix-blend-mode: difference;
  z-index: -1;
  animation: glitchLogo 2s infinite steps(20);
}

@keyframes glitchLogo {
  0% {
    transform: translate(0px, 0px);
  }
  20% {
    transform: translate(2px, -2px);
  }
  40% {
    transform: translate(-2px, 2px);
  }
  60% {
    transform: translate(2px, 1px);
  }
  80% {
    transform: translate(-1px, -2px);
  }
  100% {
    transform: translate(0px, 0px);
  }
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav a {
  color: var(--color-light);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 2px;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s ease-in-out;
  user-select: none;
}

/* Add glitch layers on hover using pseudo elements */
.nav a::before,
.nav a::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  color: var(--color-primary);
  mix-blend-mode: screen;
}

.nav a:hover::before {
  opacity: 0.7;
  animation: glitchLink1 0.8s infinite linear;
}

.nav a:hover::after {
  opacity: 0.7;
  animation: glitchLink2 0.8s infinite linear;
  color: var(--color-secondary);
}

@keyframes glitchLink1 {
  0% {
    clip-path: inset(0% 0% 90% 0%);
    transform: translate(0, 0);
  }
  25% {
    clip-path: inset(10% 0% 70% 0%);
    transform: translate(-2px, 1px);
  }
  50% {
    clip-path: inset(30% 0% 50% 0%);
    transform: translate(2px, -2px);
  }
  75% {
    clip-path: inset(50% 0% 30% 0%);
    transform: translate(-1px, 2px);
  }
  100% {
    clip-path: inset(70% 0% 10% 0%);
    transform: translate(1px, -1px);
  }
}

@keyframes glitchLink2 {
  0% {
    clip-path: inset(0% 0% 80% 0%);
    transform: translate(0, 0);
  }
  20% {
    clip-path: inset(20% 0% 60% 0%);
    transform: translate(2px, -1px);
  }
  40% {
    clip-path: inset(40% 0% 40% 0%);
    transform: translate(-2px, 1px);
  }
  60% {
    clip-path: inset(60% 0% 20% 0%);
    transform: translate(1px, 2px);
  }
  80% {
    clip-path: inset(80% 0% 0% 0%);
    transform: translate(-1px, -2px);
  }
  100% {
    clip-path: inset(0% 0% 80% 0%);
    transform: translate(0, 0);
  }
}

/* Buttons used in hero and contact form */
.btn {
  position: relative;
  display: inline-block;
  padding: 0.8rem 2rem;
  margin: 0.5rem;
  border: 2px solid var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-light);
  background: transparent;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}

.btn:hover {
  background: var(--color-primary);
  color: var(--color-bg);
  box-shadow: 0 0 10px var(--color-primary), 0 0 20px var(--color-secondary);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -5px;
  right: -5px;
  bottom: 0;
  border: 1px solid var(--color-secondary);
  transform: skew(-2deg);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.btn:hover::before {
  opacity: 1;
}

/* Hero section of the index page */
.hero {
  min-height: 100vh;
  padding-top: 140px; /* offset for fixed nav */
  padding-bottom: 6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background-image: url('bc10dd69-d092-45ac-bf30-101a22fdaab7.png');
  background-size: cover;
  background-position: center;
  color: var(--color-light);
  overflow: hidden;
}

.hero::after {
  /* dark overlay to ensure legibility on top of the hero image */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 4rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  line-height: 1.1;
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--color-secondary);
  min-height: 1.4rem;
  margin-bottom: 2.5rem;
  z-index: 1;
}

.hero-buttons {
  z-index: 1;
}

/* Shared glitch text effect used on headings */
.glitch {
  position: relative;
  display: inline-block;
  user-select: none;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.glitch::before {
  z-index: -1;
  color: var(--color-primary);
  animation: glitchBefore 2s infinite linear;
}

.glitch::after {
  z-index: -2;
  color: var(--color-secondary);
  animation: glitchAfter 2s infinite linear;
}

@keyframes glitchBefore {
  0% {
    clip-path: inset(0% 0% 90% 0%);
    transform: translate(2px, -2px);
  }
  20% {
    clip-path: inset(15% 0% 60% 0%);
    transform: translate(-2px, 2px);
  }
  40% {
    clip-path: inset(35% 0% 45% 0%);
    transform: translate(1px, -1px);
  }
  60% {
    clip-path: inset(55% 0% 25% 0%);
    transform: translate(-3px, 1px);
  }
  80% {
    clip-path: inset(75% 0% 5% 0%);
    transform: translate(2px, -2px);
  }
  100% {
    clip-path: inset(0% 0% 90% 0%);
    transform: translate(0px, 0px);
  }
}

@keyframes glitchAfter {
  0% {
    clip-path: inset(0% 0% 80% 0%);
    transform: translate(-2px, 2px);
  }
  20% {
    clip-path: inset(10% 0% 65% 0%);
    transform: translate(1px, -1px);
  }
  40% {
    clip-path: inset(30% 0% 50% 0%);
    transform: translate(-3px, 1px);
  }
  60% {
    clip-path: inset(50% 0% 30% 0%);
    transform: translate(2px, -2px);
  }
  80% {
    clip-path: inset(70% 0% 10% 0%);
    transform: translate(-1px, 2px);
  }
  100% {
    clip-path: inset(0% 0% 80% 0%);
    transform: translate(0px, 0px);
  }
}

/* Section for listing servers on the index page */
.servers-section {
  position: relative;
  padding: 4rem 2rem;
  text-align: center;
  background: var(--color-bg);
  overflow: hidden;
}

.servers-section h2 {
  font-family: var(--font-heading);
  font-size: 3rem;
  margin-bottom: 2.5rem;
}

.server-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.server-card {
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  width: 280px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.server-card:hover {
  transform: translateY(-6px) rotateX(3deg) rotateY(-3deg);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6), 0 0 30px var(--color-primary);
}

/* Title for server cards: keep crisp with subtle coloured shadows instead of duplicated layers */
.server-card .card-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  position: relative;
  text-shadow: 1px 0 var(--color-primary), -1px 0 var(--color-secondary);
}

.server-card p {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.server-card .player-count {
  font-size: 0.85rem;
  color: var(--color-secondary);
  margin-top: 1rem;
}

/* Sub-hero used on secondary pages */
.sub-hero {
  position: relative;
  padding-top: 140px;
  padding-bottom: 3rem;
  text-align: center;
  background-image: url('43f21c79-ef00-4bc5-a059-d61e3680b7ee.png');
  background-size: cover;
  background-position: center;
  color: var(--color-light);
}

.sub-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
}

.sub-hero h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  margin-bottom: 1rem;
  z-index: 1;
  position: relative;
}

.sub-hero .sub-tagline {
  font-size: 1rem;
  color: var(--color-secondary);
  z-index: 1;
  position: relative;
}

/* Detail section styles for servers page */
.servers-detail-section {
  padding: 4rem 2rem;
}

.servers-detail-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.server-card-detail {
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.server-card-detail:hover {
  transform: translateY(-6px) rotateX(3deg) rotateY(-3deg);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6), 0 0 30px var(--color-primary);
}

/* Title for detailed server cards: coloured shadow effect for subtle glitch */
.server-card-detail h3 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  position: relative;
  text-shadow: 1px 0 var(--color-primary), -1px 0 var(--color-secondary);
}

.server-card-detail p {
  font-size: 1rem;
  color: var(--color-muted);
  margin-bottom: 0.7rem;
}

.server-card-detail .ip {
  font-size: 0.9rem;
  color: var(--color-secondary);
  margin-bottom: 1rem;
}

.server-card-detail ul {
  list-style: none;
  margin: 0;
  padding-left: 1rem;
}

.server-card-detail li {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  position: relative;
  color: var(--color-light);
}

.server-card-detail li::before {
  content: '▹';
  color: var(--color-primary);
  margin-right: 0.4rem;
}

.server-card-detail .player-count {
  font-size: 0.9rem;
  color: var(--color-secondary);
  margin-top: 1rem;
}

/* Community section layout */
.community-section {
  padding: 4rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  max-width: 1000px;
  margin: 0 auto;
}

.rules,
.contact-form {
  flex: 1;
  min-width: 300px;
  background: var(--color-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.rules h2,
.contact-form h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.rules h2::before,
.rules h2::after,
.contact-form h2::before,
.contact-form h2::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  opacity: 0.5;
}

.rules h2::before,
.contact-form h2::before {
  color: var(--color-primary);
}

.rules h2::after,
.contact-form h2::after {
  color: var(--color-secondary);
  transform: translate(2px, 2px);
}

.rules-list {
  list-style: none;
  padding-left: 0;
}

.rules-list li {
  margin-bottom: 1rem;
  font-size: 1rem;
  position: relative;
}

.rules-list li::before {
  content: '▹';
  color: var(--color-primary);
  margin-right: 0.5rem;
}

.contact-form form {
  display: flex;
  flex-direction: column;
}

/* Ensure the form’s submit button is sized appropriately and separated from inputs */
.contact-form .btn {
  width: max-content;
  margin-top: 1.5rem;
}

.contact-form label {
  margin-top: 1rem;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.contact-form input,
.contact-form textarea {
  padding: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--color-light);
  font-family: var(--font-body);
  border-radius: 4px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 5px var(--color-primary);
}

.form-response {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--color-secondary);
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 5000;
}

.footer ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.footer a {
  color: var(--color-light);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 2px;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s ease-in-out;
  user-select: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav ul {
    margin-top: 0.5rem;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .servers-section h2 {
    font-size: 2.5rem;
  }
  .server-card {
    width: 90%;
  }
  .servers-detail-list {
    width: 100%;
  }
  .server-card-detail h3 {
    font-size: 1.8rem;
  }
  .sub-hero h1 {
    font-size: 2.3rem;
  }
}