/* === CSS Variables === */
:root {
  --color-primary: #b82024;
  --color-secondary: #1b3254;
  --color-background: #ffffff; /* Seitenhintergrund, Karten */
  --color-white: #ffffff; /* Text auf dunklen Hintergründen (Nav, Footer, Hero) */
  --color-text: #1b3254;
  --color-secondary-light: #243f6b;
  --color-gray-light: #f5f5f5;
  --color-text-light: #555555;
  --color-dark-start: #0a1628;
  --color-dark-end: #234778;
  --font-stack:
    "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

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

/* === Utility === */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Base === */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-stack);
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: 1.6;
}

/* === Header & Navigation === */
header {
  position: sticky;
  top: 0;
  background: var(--color-background);
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-bottom: 2px solid var(--color-primary);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

nav a {
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  transition: transform 0.2s ease;
}

nav a:hover {
  transform: scale(1.1);
}

nav .nav-logo {
  display: flex;
  align-items: center;
  padding: 0.25rem 0;
}

.nav-worker {
  height: 48px;
  width: auto;
  animation: jackhammer 0.15s ease-in-out infinite;
  transform-origin: bottom center;
}

nav .nav-logo:hover .nav-worker {
  animation-duration: 0.08s;
}

@keyframes jackhammer {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-1px) rotate(-0.5deg);
  }
  75% {
    transform: translateY(0.5px) rotate(0.5deg);
  }
}

.nav-cta {
  background: var(--color-secondary);
  color: var(--color-white) !important;
  border-radius: 6px;
  padding: 0.5rem 1.25rem !important;
  font-size: 0.85rem !important;
  white-space: nowrap;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.nav-cta:hover {
  background: var(--color-secondary-light);
}

/* Mobile default: nav-links hidden, toggle visible */
.nav-links {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-background);
  flex-direction: column;
  padding: 1.5rem;
  gap: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.nav-links a {
  font-size: 1.1rem;
  padding: 0.5rem 0;
}

.nav-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-secondary);
  margin: 5px 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

/* Hamburger -> X animation */
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Desktop: nav-links visible, toggle hidden */
@media (min-width: 640px) {
  .nav-links {
    display: flex;
    flex-direction: row;
    position: static;
    align-items: center;
    gap: 1.5rem;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }

  .nav-links a {
    font-size: 0.9rem;
    padding: 0;
  }

  .nav-toggle {
    display: none;
  }
}

/* === Hero === */
#hero {
  background: linear-gradient(
    135deg,
    var(--color-dark-start) 0%,
    var(--color-secondary) 35%,
    var(--color-dark-end) 100%
  );
  padding: 4rem 1rem;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: "";
  position: absolute;
  top: 55%;
  left: -5%;
  right: -5%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-primary),
    transparent
  );
  transform: rotate(-3deg);
  box-shadow:
    0 0 15px rgba(184, 32, 36, 0.4),
    0 0 30px rgba(184, 32, 36, 0.2);
}

.hero-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  animation: fadeInUp 0.8s ease-out both;
  position: relative;
  z-index: 1;
}

.hero-text {
  text-align: center;
}

.hero-text h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-text p {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 0 20px rgba(184, 32, 36, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
  border-color: var(--color-white);
}

.hero-logo {
  max-width: 300px;
  width: 100%;
}

.hero-logo img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Hero load animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .hero-content {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }

  .hero-text {
    flex: 1;
    text-align: left;
  }

  .hero-text h1 {
    font-size: 2.2rem;
  }

  .hero-buttons {
    justify-content: flex-start;
  }

  .hero-logo {
    max-width: 350px;
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-content {
    animation: none;
  }
}

/* === Shared Icon Style === */
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--color-gray-light);
  border-radius: 50%;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

/* === Section Headings (global) === */
main section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-secondary);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
}

main section h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-primary);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

/* === Why Us === */
#why-us {
  padding: 4rem 1rem;
  background-color: var(--color-background);
}

.why-us-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .why-us-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.why-us-card {
  background: var(--color-gray-light);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.why-us-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.why-us-icon {
  width: 4rem;
  height: 4rem;
  background: var(--color-background);
  margin-bottom: 1rem;
}

.why-us-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-secondary);
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.why-us-card p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* === Services === */
#services {
  background-color: var(--color-gray-light);
  padding: 4rem 1rem;
}

.services-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 400px) {
  .services-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .services-grid {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

/* Flip Cards */
.flip-card {
  perspective: 800px;
  height: 180px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}

.flip-card-front {
  background: var(--color-background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.flip-card-front h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-top: 0.5rem;
}

.flip-card-back {
  background: var(--color-secondary);
  color: var(--color-white);
  transform: rotateY(180deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.flip-card-back p {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* CTA Card */
.service-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 180px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.service-cta:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(184, 32, 36, 0.3);
}

.service-cta-icon {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-white);
  flex-shrink: 0;
}

.service-cta strong {
  font-size: 0.95rem;
}

.service-cta span {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* === Process === */
#process {
  padding: 4rem 1rem;
  background-color: var(--color-background);
}

.process-steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.process-step {
  text-align: center;
  max-width: 220px;
}

.process-step h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 0.4rem;
}

.process-step p {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.process-arrow {
  font-size: 2rem;
  color: var(--color-primary);
  font-weight: 700;
  transform: rotate(90deg);
  line-height: 1;
}

@media (min-width: 640px) {
  .process-steps {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .process-arrow {
    transform: none;
    margin-top: 1.5rem;
  }
}

/* === Contact === */
#contact {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 1rem;
}

.contact-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 640px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .contact-map {
    grid-column: 1 / -1;
  }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.25rem;
  flex: 1;
  background: var(--color-background);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: var(--color-text);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

a.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.contact-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray-light);
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--color-secondary);
}

.contact-card strong {
  display: block;
  font-size: 0.85rem;
  color: var(--color-secondary);
  margin-bottom: 0.15rem;
}

.contact-card span:not(.contact-icon) {
  color: var(--color-primary);
}

.contact-portrait {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.contact-portrait img {
  width: auto;
  max-width: 100%;
  max-height: 350px;
  display: block;
  border-radius: 12px;
  margin: 0 auto;
}

.contact-map {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.contact-map iframe {
  border: 0;
  width: 100%;
  min-height: 250px;
  display: block;
}

/* === Legal Pages === */
.legal-page {
  background-color: var(--color-gray-light);
  padding: 3rem 1rem;
  display: flex;
  justify-content: center;
}

.legal-card {
  background: var(--color-background);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 700px;
  width: 100%;
}

.legal-card h1 {
  font-size: 1.8rem;
  color: var(--color-secondary);
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5rem;
}

.legal-card h2 {
  font-size: 1.2rem;
  color: var(--color-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-card h3 {
  font-size: 1.05rem;
  color: var(--color-secondary);
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.legal-page p {
  margin-bottom: 0.75rem;
}

.legal-page a {
  color: var(--color-primary);
}

/* === Footer === */
footer {
  background: linear-gradient(
    135deg,
    var(--color-dark-start) 0%,
    var(--color-secondary) 35%,
    var(--color-dark-end) 100%
  );
  color: var(--color-white);
  border-top: 2px solid var(--color-primary);
}

.footer-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
  display: grid;
  gap: 2rem;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-content {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    text-align: left;
  }
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-heading {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  color: var(--color-primary);
}

.footer-section span:not(.footer-heading) {
  font-size: 0.85rem;
  opacity: 0.8;
}

footer a {
  color: var(--color-white);
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

footer a:hover {
  opacity: 1;
}

/* === Cookie Banner === */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-secondary);
  color: var(--color-white);
  padding: 1.25rem 1.5rem;
  z-index: 200;
  display: none;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
}

.cookie-banner.visible {
  display: block;
}

.cookie-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.cookie-banner p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.cookie-banner a {
  color: var(--color-white);
  text-decoration: underline;
  opacity: 0.9;
}

.cookie-buttons {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-btn-outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.cookie-btn-outline:hover {
  border-color: var(--color-white);
}

@media (min-width: 640px) {
  .cookie-inner {
    flex-direction: row;
    text-align: left;
  }
}

/* === Scroll Animations === */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation for cards in a grid */
.services-grid .animate-on-scroll:nth-child(even) {
  transition-delay: 0.1s;
}

.contact-info .animate-on-scroll:nth-child(2) {
  transition-delay: 0.1s;
}

.contact-info .animate-on-scroll:nth-child(3) {
  transition-delay: 0.2s;
}

/* Global transitions */
a {
  transition: color 0.2s ease;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .flip-card:hover .flip-card-inner,
  .flip-card.flipped .flip-card-inner {
    transform: none;
  }

  .btn:hover,
  .service-cta:hover,
  .why-us-card:hover,
  a.contact-card:hover {
    transform: none;
    box-shadow: none;
  }

  .nav-worker {
    animation: none;
  }
}
