/* === VARIABLES === */
:root {
  --header-height: 140px;
  --color-primary: #99ddff;    /* Ghostly pale cyan */
  --color-accent: #66ff99;     /* Ghostly green for hover */
  --color-bg-dark: #000000;    /* Pure black for main background */
  --color-bg-gradient-start: rgba(0, 0, 0, 0.95);
  --color-bg-gradient-end: rgba(0, 0, 0, 0.9);
  --color-ghostly-glow: rgba(153, 221, 255, 0.25); /* Haunting, cold glow */
  --font-main: 'Orbitron', sans-serif;
}

/* === RESET & BASE === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
}

body {
  background: var(--color-bg-dark);
  color: #d5d5d5;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* === STARFIELD BACKGROUND === */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: var(--color-bg-dark);
  pointer-events: none;
  overflow: hidden;
}

/* Subtle fog-like overlay for haunting effect */
#starfield::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: linear-gradient(135deg, rgba(153, 221, 255, 0.08), rgba(170, 119, 204, 0.08));
  opacity: 0.2;
  animation: fogDrift 40s linear infinite;
}

@keyframes fogDrift {
  0% { transform: translateX(-50%); opacity: 0.2; }
  50% { opacity: 0.3; }
  100% { transform: translateX(0); opacity: 0.2; }
}

/* === HEADER === */
header {
  position: sticky;
  top: 0;
  width: 100%;
  min-height: var(--header-height);
  padding: 1.5rem 1rem;
  background: rgba(0, 0, 15, 0.65);
  backdrop-filter: saturate(200%) blur(25px);
  -webkit-backdrop-filter: saturate(200%) blur(25px);
  border-bottom: 1px solid var(--color-ghostly-glow);
  box-shadow:
    0 0 12px var(--color-primary),
    0 0 30px var(--color-accent);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  overflow: hidden;
}

header > .container {
  max-width: 960px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* === LOGO === */
.logo-img {
  width: 150px;
  max-width: 100%;
  height: auto;
  filter:
    drop-shadow(0 0 10px var(--color-primary))
    drop-shadow(0 0 15px var(--color-accent));
  margin-bottom: 0.7rem;
  animation: pulseGlow 3s ease-in-out infinite;
  cursor: default;
}

@keyframes pulseGlow {
  0%, 100% {
    filter:
      drop-shadow(0 0 10px var(--color-primary))
      drop-shadow(0 0 15px var(--color-accent));
    opacity: 1;
  }
  50% {
    filter:
      drop-shadow(0 0 20px var(--color-primary))
      drop-shadow(0 0 25px var(--color-accent));
    opacity: 0.9;
  }
}

/* === NAVIGATION === */
nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1rem;
  width: 100%;
}

nav a {
  font-size: 1.2rem;
  text-decoration: none;
  color: #d5d5d5;
  border-bottom: 2px solid transparent;
  padding-bottom: 5px;
  transition: color 0.3s ease, border-color 0.3s ease, text-shadow 0.3s ease;
  position: relative;
  text-shadow: 0 0 6px var(--color-ghostly-glow);
}

nav a:hover,
nav a:focus {
  color: var(--color-primary);
  border-color: var(--color-ghostly-glow);
  text-shadow:
    0 0 10px var(--color-primary),
    0 0 18px var(--color-accent);
}

nav a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* === MAIN CONTENT === */
main {
  scroll-margin-top: var(--header-height);
  padding: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

/* === SECTIONS === */
section {
  max-width: 900px;
  margin: 3rem auto;
  padding: 2.5rem 3rem;
  background: linear-gradient(145deg, var(--color-bg-gradient-end), var(--color-bg-gradient-start));
  border-radius: 18px;
  border: 1px solid var(--color-ghostly-glow);
  backdrop-filter: blur(25px);
  box-shadow:
    0 0 60px rgba(153, 221, 255, 0.25),
    inset 0 0 40px rgba(170, 119, 204, 0.15);
  animation: etherealFade 1.5s ease-in forwards;
  will-change: transform, opacity;
  color: #c5c5c5;
}

@keyframes etherealFade {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === HEADINGS === */
h2 {
  color: var(--color-primary);
  font-size: 2.2rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid rgba(170, 119, 204, 0.45);
  padding-bottom: 0.5rem;
  text-shadow:
    0 0 12px var(--color-primary),
    0 0 25px var(--color-accent);
  position: relative;
  animation: glitch 2s linear infinite;
}

h3 {
  font-size: 1.6rem;
  margin: 1.8rem 0 1.2rem;
  color: #c5c5c5;
  text-shadow:
    0 0 8px var(--color-ghostly-glow),
    0 0 15px var(--color-accent);
  animation: glitch 3s linear infinite;
}

@keyframes glitch {
  0% { transform: translate(0); }
  10% { transform: translate(-2px, 2px); }
  20% { transform: translate(2px, -2px); }
  30% { transform: translate(-1px, 1px); }
  40% { transform: translate(0); }
  100% { transform: translate(0); }
}

/* === LISTS === */
ul {
  padding-left: 1.8rem;
  list-style-type: disc;
  color: #a5a5a5;
}

li {
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

/* === LINKS === */
a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover,
a:focus {
  color: var(--color-accent);
  text-shadow: 0 0 15px var(--color-accent);
  outline: none;
}

/* === BUTTONS === */
.cta-button {
  padding: 1rem 2rem;
  background: var(--color-primary);
  border: 2px solid transparent;
  border-radius: 12px;
  color: #050514;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow:
    0 0 30px var(--color-primary),
    inset 0 0 10px rgba(153, 221, 255, 0.3);
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  user-select: none;
  will-change: transform, box-shadow;
}

.cta-button:hover,
.cta-button:focus {
  background: var(--color-accent);
  border-color: var(--color-primary);
  box-shadow:
    0 0 50px var(--color-accent),
    inset 0 0 15px rgba(102, 255, 153, 0.5);
  transform: scale(1.04);
  color: #050514;
}

/* === PARAVOX CARD === */
.paravox-card {
  display: flex;
  flex-direction: row;
  background: radial-gradient(circle at top left, rgba(170, 119, 204, 0.25), rgba(153, 221, 255, 0.25));
  padding: 1.8rem;
  border-radius: 14px;
  border: 1px solid var(--color-ghostly-glow);
  margin-top: 2.5rem;
  box-shadow:
    0 0 30px rgba(153, 221, 255, 0.2);
  transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.4s ease;
  will-change: transform, box-shadow, opacity;
  width: 100%;
  min-height: 220px;
}

.paravox-card:hover,
.paravox-card:focus {
  transform: scale(1.04);
  box-shadow:
    0 0 60px rgba(170, 119, 204, 0.5),
    0 0 50px rgba(153, 221, 255, 0.5);
  opacity: 0.95;
  animation: spectralPulse 2s ease-in-out infinite;
}

@keyframes spectralPulse {
  0%, 100% {
    transform: scale(1.04);
    box-shadow:
      0 0 60px rgba(170, 119, 204, 0.5),
      0 0 50px rgba(153, 221, 255, 0.5);
    opacity: 0.95;
  }
  50% {
    transform: scale(1.06);
    box-shadow:
      0 0 80px rgba(170, 119, 204, 0.7),
      0 0 70px rgba(153, 221, 255, 0.7);
    opacity: 0.9;
  }
}

/* === PARAVOX IMAGE === */
.app-image {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-right: 1.5rem;
  box-shadow: 0 0 20px var(--color-ghostly-glow);
  animation: glowPulse 2.5s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px var(--color-accent);
  }
  50% {
    box-shadow: 0 0 40px var(--color-accent), 0 0 60px rgba(102, 255, 153, 0.5);
  }
}

/* === PARAVOX CONTENT === */
.paravox-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  padding: 0.5rem 0;
}

.paravox-content h3 {
  margin-top: 0;
}

.paravox-content p {
  margin: 0.5rem 0 1rem;
}

/* === FORM === */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 520px;
  margin: 2rem auto;
}

.contact-form input,
.contact-form textarea {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid var(--color-ghostly-glow);
  border-radius: 10px;
  color: #d5d5d5;
  font-family: var(--font-main);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  resize: vertical;
}

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

.contact-form button {
  padding: 1rem 2rem;
  background: var(--color-primary);
  border: 2px solid transparent;
  border-radius: 12px;
  color: #050514;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow:
    0 0 30px var(--color-primary),
    inset 0 0 10px rgba(153, 221, 255, 0.3);
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.3s ease;
}

.contact-form button:hover,
.contact-form button:focus {
  background: var(--color-accent);
  border-color: var(--color-primary);
  box-shadow:
    0 0 50px var(--color-accent),
    inset 0 0 15px rgba(102, 255, 153, 0.5);
  color: #050514;
}

/* === FOOTER === */
footer {
  text-align: center;
  margin-top: 5rem;
  padding: 2.5rem 1rem;
  font-size: 0.95rem;
  color: #888;
  background: rgba(0, 0, 15, 0.75);
  border-top: 1px solid var(--color-ghostly-glow);
  box-shadow:
    inset 0 2px 6px rgba(153, 221, 255, 0.2),
    0 0 20px rgba(170, 119, 204, 0.3);
}

.social-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social-icon {
  font-size: 1.2rem;
  color: #d5d5d5;
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease;
}

.social-icon:hover,
.social-icon:focus {
  color: var(--color-accent);
  text-shadow: 0 0 15px var(--color-accent);
  transform: scale(1.1);
}

/* === NEWSLETTER === */
.newsletter {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.newsletter input {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid var(--color-ghostly-glow);
  border-radius: 12px;
  color: #d5d5d5;
  font-size: 1rem;
  width: 240px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.newsletter input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 25px var(--color-accent);
  outline: none;
}

.newsletter button {
  padding: 1rem 2rem;
  background: var(--color-primary);
  border: 2px solid transparent;
  border-radius: 12px;
  color: #050514;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow:
    0 0 30px var(--color-primary),
    inset 0 0 10px rgba(153, 221, 255, 0.3);
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.3s ease;
}

.newsletter button:hover,
.newsletter button:focus {
  background: var(--color-accent);
  border-color: var(--color-primary);
  box-shadow:
    0 0 50px var(--color-accent),
    inset 0 0 15px rgba(102, 255, 153, 0.5);
  color: #050514;
}

/* === GRID FOR PORTFOLIO AND TESTIMONIALS === */
.paravox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.testimonial {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--color-ghostly-glow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 20px rgba(153, 221, 255, 0.3);
}

.testimonial .author {
  font-style: italic;
  color: #a5a5a5;
  margin-top: 1rem;
}

/* === BUTTON GROUP === */
.button-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 1.5rem;
  padding-top: 1rem;
}

/* === COMMUNITY SECTION === */
.community-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  max-width: 900px;
  margin: 3rem auto;
  background: linear-gradient(145deg, var(--color-bg-gradient-end), var(--color-bg-gradient-start));
  border-radius: 18px;
  border: 1px solid var(--color-ghostly-glow);
  backdrop-filter: blur(25px);
  box-shadow: 0 0 60px rgba(153, 221, 255, 0.25), inset 0 0 40px rgba(170, 119, 204, 0.15);
}

.community-section p {
  margin-bottom: 5rem; /* Add space between text and button */
}

.community-section .cta-button {
  margin-top: 1rem; /* Ensure button has space from the text above */
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .logo-img {
    width: 120px;
  }

  nav {
    gap: 1.2rem;
  }

  nav a {
    font-size: 1rem;
  }

  section {
    margin: 2rem 1rem;
    padding: 1.8rem 2rem;
  }

  .contact-form {
    max-width: 90vw;
    padding: 0 1rem;
  }

  .newsletter {
    flex-direction: column;
    align-items: center;
  }

  .newsletter input,
  .newsletter button {
    width: 90vw;
    max-width: 320px;
  }

  .button-group {
    flex-direction: column;
    align-items: center;
  }

  .paravox-card {
    flex-direction: column;
    align-items: center;
    min-height: auto;
  }

  .app-image {
    margin-right: 0;
    margin-bottom: 1rem;
    width: 150px;
    height: 150px;
  }

  .paravox-content {
    text-align: center;
  }
}
