/*
 * PixelScale Stylesheet
 *
 * Dieses Stylesheet definiert das Farbschema, Layouts und Komponenten für die
 * PixelScale‑Website. Das Design orientiert sich an den kräftigen
 * Magenta‑ und Violetttönen des Logos und kombiniert diese mit einem dunklen
 * Hintergrund, um starke Kontraste und ein futuristisches Ambiente zu
 * erzeugen. Alle Textstile basieren auf der Poppins‑Schriftfamilie, die
 * modern wirkt und gute Lesbarkeit bietet.
 */

/* CSS‑Variablen für Farbschema und Wiederverwendbarkeit */
:root {
  /* Neue Farbwerte für Buttons, Icons und Akzente */
  --primary-color: #7f00ff;      /* dunkles Violett */
  --secondary-color: #9a00e6;    /* heller Violettton */
  --gradient-start: rgb(106, 0, 204);
  --gradient-end: rgb(196, 0, 230);
  --dark-bg: #121212;            /* modernes Schwarz für den Hintergrund */
  --card-bg: rgba(255, 255, 255, 0.05); /* halbtransparente Kartenoberfläche */
}

/* Globale Einstellungen */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--dark-bg);
  color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll */
  width: 100%;
  max-width: 100vw;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Grundlayout */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Kopfbereich */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 999;
  transition: background 0.3s ease;
}

/* Hintergrund, wenn der Nutzer scrollt */
.header.sticky {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
}

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

.logo img {
  height: 40px;
}

/* Navigation */
.nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

.nav li {
  position: relative;
}

.nav a {
  font-weight: 500;
  font-size: 16px;
  transition: color 0.3s ease;
}

.nav a:hover {
  color: var(--secondary-color);
}

/* Dropdown */
.nav .submenu {
  position: absolute;
  left: 0;
  /* Das Submenü schließt direkt an den übergeordneten Menüpunkt an,
   * damit beim Übergang mit der Maus kein Zwischenraum entsteht. */
  top: 100%;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.8);
  padding: 15px 20px;
  list-style: none;
  display: none;
  border-radius: 8px;
  min-width: 180px;
}

.nav li:hover > .submenu {
  display: block;
}

/*
 * Halte das Submenü offen, wenn der Cursor sich über das Submenü bewegt.
 * Ohne diese Regel verschwindet das Dropdown, wenn die Maus den
 * Bereich zwischen dem Hauptmenüpunkt und dem Submenü verlässt.
 */
.nav li .submenu:hover {
  display: block;
}

.nav .submenu li a {
  white-space: nowrap;
  font-size: 14px;
  display: block;
  padding: 5px 0;
}

/* Hamburger für Mobilnavigation */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 1000;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Mobile Menü */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    right: -100%;
    top: 0;
    width: 70%;
    height: 100vh;
    background: var(--dark-bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.4s ease;
  }

  .nav.active {
    right: 0;
  }

  .nav ul {
    flex-direction: column;
    gap: 20px;
  }

  .nav .submenu {
    position: static;
    background: none;
    padding: 0;
  }
  .nav li:hover > .submenu {
    display: none;
  }

  .hamburger {
    display: flex;
  }
}

/* Hero‑Bereich */
.hero {
  position: relative;
  /*
   * Verwende ein Grid für den Hero‑Bereich, damit Text und 3D‑Szene
   * nebeneinander dargestellt werden können. Standardmäßig gibt es eine
   * Spalte für schmale Bildschirme. Ab 900px Breite werden zwei Spalten
   * verwendet: links der Text, rechts die Three.js‑Szene. Die Höhe bleibt
   * 100vh, sodass alle Elemente sichtbar sind.
   */
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  text-align: center;
  height: 95vh;
  background-image: url('../images/hero-bg.png');
  background-size: cover;
  background-position: center;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Zwei‑Spalten‑Layout für größere Bildschirme */
@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    text-align: left;
    padding: 0 5%; /* Reduced padding to prevent overflow */
  }
}

/* dunkle Überlagerung für bessere Lesbarkeit */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.hero #hero-three {
  /* Der Container für die Three.js‑Szene füllt seine Zelle vollständig aus. */
  position: relative;
  width: 100%;
  height: 85%;
  z-index: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero #hero-three canvas {
  max-height: 100%;
  width: auto;
  height: auto;
}

@media (max-width: 900px) {
  .hero #hero-three {
    /* Begrenzte Höhe für mobile Ansichten, damit der Canvas nicht den
     * gesamten Viewport einnimmt und sich unter der Überschrift einordnet. */
    height: 350px;
    margin-top: 20px;
    order: 2; /* Move 3D scene below content on mobile */
  }
  
  .hero-content {
    order: 1; /* Move content above 3D scene on mobile */
    padding-top: 20px; /* Add some top padding */
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
}

@media (min-width: 900px) {
  .hero-content {
    text-align: left;
    align-self: center;
  }
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
    margin-top: 60px; /* Add top margin for mobile */
  }
  
  .hero p {
    font-size: 1.2rem;
    padding: 0 20px; /* Add horizontal padding */
    word-wrap: break-word; /* Ensure text wraps */
    max-width: 100%; /* Prevent overflow */
  }
  
  .hero-content {
    padding: 0 15px; /* Add padding to content container */
  }
}

.hero p {
  font-size: 1.4rem;
  margin-bottom: 30px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: 1rem;
  background: linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  color: #fff;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.3s ease;
}

/* Standardfarbe für alle Ionicons */
ion-icon {
  color: var(--primary-color);
}

.btn:hover {
  background: linear-gradient(90deg, var(--gradient-end) 0%, var(--gradient-start) 100%);
}

.btn-secondary {
  background: linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
}

.btn-secondary:hover {
  background: linear-gradient(90deg, var(--gradient-end) 0%, var(--gradient-start) 100%);
}

/* Leistungssektion */
.services {
  padding: 100px 0 60px;
}

.services h2 {
  text-align: center;
  font-size: 2.4rem;
  margin-bottom: 60px;
  font-weight: 600;
}

/*
 * Leistungsübersicht
 *
 * Wir nutzen CSS‑Grid, um eine flexible Spaltenanzahl zu erreichen. Auf
 * größeren Bildschirmen werden zwei Spalten dargestellt, auf kleineren
 * Geräten bricht das Grid automatisch auf eine Spalte um. */
/*
 * Services cards:
 * Standardmäßig in einer Spalte für schmale Ansichten. Ab einer Breite
 * von 768px werden zwei Spalten angezeigt. Dies sorgt für eine bessere
 * Lesbarkeit auf Mobilgeräten und erfüllt den Wunsch nach genau zwei
 * Spalten auf Desktop‑Geräten.
 */
.services-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  justify-items: stretch;
  justify-content: center;
}
@media (min-width: 768px) {
  .services-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.service-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  text-align: center;
  transition: transform 0.3s ease, background 0.3s ease;
}

.service-card:hover {
  transform: translateY(-10px);
  background: rgba(255, 255, 255, 0.1);
}

.service-card .icon {
  font-size: 40px;
  /* Icons bekommen die neue Akzentfarbe */
  color: var(--primary-color);
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.service-card p {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #ddd;
}

/* Über uns */
.about {
  padding: 100px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 50px;
}

.about h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.about p,
.about ul {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

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

.about ul li {
  margin-bottom: 8px;
}

.about ul strong {
  color: var(--secondary-color);
}

.about-img img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-img {
    order: -1;
  }
}

/* Referenzen */
.references {
  padding: 100px 0;
}

.references h2 {
  text-align: center;
  font-size: 2.4rem;
  margin-bottom: 60px;
  font-weight: 600;
}

.references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

/*
 * Für ausreichend breite Ansichten (ab 900px) werden genau drei Spalten
 * definiert. Dadurch wirken die Referenzen luftiger und gleichmäßig
 * verteilt, unabhängig von der Gesamtbreite des Containers.
 */
@media (min-width: 900px) {
  .references-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.reference-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.reference-card:hover {
  transform: translateY(-8px);
}

.reference-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.reference-content {
  padding: 20px;
}

.reference-content h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.reference-content p {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #ccc;
}

/* Call‑To‑Action Bereich */
.cta {
  padding: 80px 0;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  border-radius: 30px;
  margin: 80px 20px;
}

.cta h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.cta p {
  font-size: 1rem;
  margin-bottom: 30px;
  color: #f5f5f5;
}

/* Fußbereich */
.footer {
  background: #0c0123;
  padding: 60px 0 20px;
  color: #bbb;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.footer-logo {
  height: 40px;
  margin-bottom: 15px;
  display: block;
}

.footer h4 {
  color: #fff;
  margin-bottom: 15px;
  font-weight: 600;
}

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

.footer ul li {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.footer ul li a {
  color: #bbb;
  transition: color 0.3s ease;
}

.footer ul li a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  color: #666;
}

/* Service‑Hero Bereich für Unterseiten */
.service-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  height: 50vh;
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
}

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

.service-hero .container {
  position: relative;
  z-index: 1;
}

.service-hero h1 {
  font-size: 2.8rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.service-hero p {
  font-size: 1.2rem;
}

/* Service Content */
.service-content {
  padding: 80px 0;
}

.service-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.service-content p {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #ddd;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin: 40px 0;
}

.feature {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  transition: background 0.3s ease;
}

.feature:hover {
  background: rgba(255, 255, 255, 0.1);
}

.feature ion-icon {
  font-size: 36px;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

.feature h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.feature p {
  font-size: 0.9rem;
  color: #ccc;
}

/* Kontaktseite */
.contact-hero {
  background-image: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
}

.contact-hero h1 {
  font-size: 2.6rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.contact-hero p {
  font-size: 1.1rem;
}

.contact-form-section {
  padding: 80px 0;
}

.contact-form-section form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 40px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #ccc;
}

.form-group input,
.form-group textarea {
  padding: 12px 15px;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
}

.form-group textarea {
  min-height: 120px;
}

#form-message {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
}