/* =====================================================
   KM Project Solutions – style.css
   Design System & Component Styles
   ===================================================== */

/* ─── 1. CUSTOM PROPERTIES ─────────────────────────── */
:root {
  /* Brand colours */
  --color-primary: #A2231D;
  --color-primary-dark: #7A1A15;
  --color-primary-light: #C94040;

  /* Backgrounds */
  --color-bg: #FFFFFF;
  --color-bg-alt: #F5F5F5;
  --color-bg-warm: #FDF2F2;

  /* Text */
  --color-text-dark: #1A1A2E;
  --color-text-mid: #4A4A6A;
  --color-text-light: #7A7A9A;
  --color-white: #FFFFFF;

  /* Border */
  --color-border: #E0E0E0;

  /* Shadows */
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.14);
  --shadow-nav: 0 2px 20px rgba(0, 0, 0, 0.06);

  /* Radius */
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-icon: 50%;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --section-py: 100px;
  --container-max: 1200px;
  --container-px: 24px;

  /* Transitions */
  --transition: all 0.3s ease;
}

/* ─── 2. RESET & BASE ───────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-mid);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

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

ul,
ol {
  list-style: none;
}

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

/* ─── 3. UTILITY / LAYOUT ───────────────────────────── */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

.text-primary {
  color: var(--color-primary);
}

/* ─── 4. TYPOGRAPHY ─────────────────────────────────── */
h1,
h2,
h3,
h4 {
  color: var(--color-text-dark);
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(36px, 5vw, 60px);
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
}

h3 {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 600;
}

/* ─── 5. SCROLL ANIMATIONS ──────────────────────────── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ─── 6. BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-btn);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-align: center;
  line-height: 1;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 16px;
}

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

/* Primary */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(162, 35, 29, 0.3);
}

/* Outline */
.btn-outline {
  background-color: transparent;
  color: var(--color-text-dark);
  border-color: var(--color-border);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* White (for dark backgrounds) */
.btn-white {
  background-color: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}

.btn-white:hover,
.btn-white:focus-visible {
  background-color: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
  transform: translateY(-2px);
}

/* ─── 7. SECTION HEADER ─────────────────────────────── */
.section-header {
  text-align: center;
  max-width: 680px;
  margin-inline: auto;
  margin-bottom: 56px;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(162, 35, 29, 0.07);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.section-label-light {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-white);
}

.section-desc {
  font-size: 17px;
  color: var(--color-text-mid);
  margin-top: 12px;
}

/* ─── 8. HEADER / NAV ───────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(224, 224, 224, 0.5);
  box-shadow: var(--shadow-nav);
  transition: var(--transition);
}

.nav-container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-img {
  height: 55px;
  width: auto;
  object-fit: contain;
}

.logo-fallback {
  display: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

/* Nav menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-dark);
  padding: 8px 14px;
  border-radius: var(--radius-btn);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--color-primary);
  background: rgba(162, 35, 29, 0.06);
}

.nav-cta {
  margin-left: 8px;
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-dark);
  padding: 8px;
  border-radius: var(--radius-btn);
  transition: var(--transition);
}

.hamburger:hover {
  background: var(--color-bg-alt);
}

.hamburger svg {
  width: 24px;
  height: 24px;
}

/* ─── 9. HERO ────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  /* Overlay gradient, then the image shifted right, then a base gradient to fill any gaps smoothly */
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(253, 242, 242, 0.88) 100%),
    url('../assets/images/Gemini_Generated_Image_2lnnwp2lnnwp2lnn.png') no-repeat,
    linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-warm) 100%);
  background-position: center, 100% 30%, center;
  background-size: cover, 70% auto, cover;
  padding: 100px 0 80px;
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(162, 35, 29, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(162, 35, 29, 0.07);
  border: 1px solid rgba(162, 35, 29, 0.15);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.hero-text h1 {
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text-mid);
  margin-bottom: 16px;
}

.hero-description {
  font-size: 17px;
  color: var(--color-text-mid);
  margin-bottom: 40px;
  max-width: 520px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Hero Visual */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-card-stack {
  position: relative;
  width: 320px;
  height: 280px;
}

.hero-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 18px 24px;
  box-shadow: var(--shadow-card);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-dark);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}

.hero-card svg {
  width: 22px;
  height: 22px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.hero-card-1 {
  top: 0;
  left: 0;
  right: 0;
  animation: floatCard1 4s ease-in-out infinite;
}

.hero-card-2 {
  top: 96px;
  left: 20px;
  right: 20px;
  animation: floatCard2 4s ease-in-out infinite 0.5s;
}

.hero-card-3 {
  top: 192px;
  left: 0;
  right: 0;
  animation: floatCard1 4s ease-in-out infinite 1s;
}

@keyframes floatCard1 {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes floatCard2 {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* ─── 10. COMPETENCIES (Feature Cards) ──────────────── */
.competencies {
  background: var(--color-bg-alt);
  padding: var(--section-py) 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 36px 28px;
  box-shadow: var(--shadow-card);
  border: 1px solid transparent;
  transition: var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
  border-color: rgba(162, 35, 29, 0.1);
}

.feature-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-icon);
  background: rgba(162, 35, 29, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: var(--transition);
}

.feature-card:hover .feature-icon-wrap {
  background: rgba(162, 35, 29, 0.12);
}

.feature-icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
  stroke-width: 2;
}

.feature-card h3 {
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--color-text-mid);
  font-size: 15px;
  line-height: 1.65;
}

/* ─── 11. SERVICES ───────────────────────────────────── */
.services {
  background: var(--color-bg);
  padding: var(--section-py) 0;
}

.services-banner {
  text-align: center;
  margin-bottom: 56px;
}

.services-banner-img {
  max-width: 60%;
  height: auto;
  display: block;
  margin-inline: auto;
}

@media (max-width: 768px) {
  .services-banner {
    margin-inline: calc(-1 * var(--container-px));
    padding-inline: 12px;
  }

  .services-banner-img {
    max-width: 100%;
  }
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.service-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 24px;
  transition: var(--transition);
}

.service-item:hover {
  box-shadow: var(--shadow-card);
  border-color: rgba(162, 35, 29, 0.15);
  transform: translateY(-2px);
}

.service-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(162, 35, 29, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.service-item:hover .service-icon-wrap {
  background: rgba(162, 35, 29, 0.12);
}

.service-icon-wrap svg {
  width: 22px;
  height: 22px;
  color: var(--color-primary);
  stroke-width: 2;
}

.service-text h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--color-text-dark);
}

.service-text p {
  font-size: 14px;
  color: var(--color-text-mid);
  line-height: 1.55;
}


/* ─── 12. APPLICATIONS ───────────────────────────────── */
.applications {
  background: var(--color-bg-alt);
  padding: var(--section-py) 0;
}

.app-gallery {
  margin-top: 48px;
  max-width: 860px;
  margin-inline: auto;
}

@media (max-width: 768px) {
  .app-gallery {
    margin-inline: calc(-1 * var(--container-px));
    padding-inline: 12px;
  }
}

.gallery-img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.6s ease;
}

/* ─── 13. CONTACT CTA ────────────────────────────────── */
.contact {
  background: var(--color-primary);
  padding: var(--section-py) 0;
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

/* Left info column */
.contact-info .section-label {
  margin-bottom: 16px;
}

.contact-info h2 {
  color: var(--color-white);
  margin-bottom: 24px;
}

.contact-info p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.contact-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* Form card */
.contact-form-wrap {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.contact-form h3 {
  margin-bottom: 28px;
  font-size: 22px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-dark);
  margin-bottom: 8px;
}

.form-group .optional {
  font-weight: 400;
  color: var(--color-text-light);
  font-size: 13px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-family);
  font-size: 15px;
  color: var(--color-text-dark);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-btn);
  outline: none;
  transition: var(--transition);
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-light);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(162, 35, 29, 0.1);
  background: var(--color-white);
}

.form-group input.is-invalid,
.form-group textarea.is-invalid {
  border-color: var(--color-primary);
  background: rgba(162, 35, 29, 0.02);
}

.field-error {
  display: block;
  font-size: 12px;
  color: var(--color-primary);
  margin-top: 6px;
  min-height: 16px;
}

.form-success[hidden] {
  display: none;
}

.form-success {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding: 16px 20px;
  background: rgba(162, 35, 29, 0.06);
  border: 1px solid rgba(162, 35, 29, 0.2);
  border-radius: var(--radius-btn);
  color: var(--color-primary);
  font-size: 15px;
}

.form-success svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ─── 14. FOOTER ─────────────────────────────────────── */
/* ─── LEGAL PAGE (Impressum / Datenschutz) ─── */
.legal-page {
  padding: 80px 0 100px;
  background: var(--color-bg);
}

.legal-content {
  max-width: 680px;
}

.legal-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 48px;
}

.legal-content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-dark);
  margin-top: 40px;
  margin-bottom: 8px;
}

.legal-content p {
  color: var(--color-text-muted);
  line-height: 1.75;
}

.legal-content a {
  color: var(--color-primary);
  text-decoration: none;
}

.legal-content a:hover {
  text-decoration: underline;
}

/* ─── SITE FOOTER ─── */
.site-footer {
  background: var(--color-text-dark);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logo-img-footer {
  height: 50px;
  opacity: 1;
}

.footer-brand .logo-fallback {
  color: var(--color-white);
  font-size: 16px;
}

.footer-tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  max-width: 320px;
}

.footer-links {
  display: flex;
  gap: 8px;
}

.footer-link {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  padding: 6px 12px;
  border-radius: 6px;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.08);
}

.footer-copy {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  width: 100%;
  text-align: center;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ─── 15. RESPONSIVE ─────────────────────────────────── */

/* Tablet: 768–1199px */
@media (max-width: 1199px) {
  :root {
    --section-py: 80px;
  }

  .hero-content {
    gap: 40px;
  }

  .hero-card-stack {
    width: 280px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-inner {
    gap: 40px;
  }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
  :root {
    --section-py: 60px;
    --container-px: 20px;
  }

  /* Nav */
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 8px var(--container-px) 16px;
    gap: 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu li {
    display: block;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    padding: 14px 12px;
    font-size: 16px;
    border-radius: var(--radius-btn);
  }

  .nav-link:hover,
  .nav-link:focus-visible {
    border-radius: var(--radius-btn);
  }

  .nav-cta,
  .nav-cta:hover,
  .nav-cta:focus-visible {
    display: block;
    padding: 14px 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-dark);
    background: none;
    border: none;
    border-radius: var(--radius-btn);
    box-shadow: none;
    transform: none;
    margin: 0;
    width: 100%;
    text-align: left;
    white-space: normal;
  }

  .nav-cta:hover,
  .nav-cta:focus-visible {
    color: var(--color-primary);
    background: rgba(162, 35, 29, 0.06);
  }

  .nav-cta svg {
    display: none;
  }

  /* Hero */
  .hero {
    padding: 60px 0 48px;
    background-position: center, center top, center;
    background-size: cover, 130% auto, cover;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-visual {
    order: -1;
  }

  .hero-card-stack {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .hero-ctas {
    flex-direction: column;
  }

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

  /* Feature cards */
  .cards-grid {
    grid-template-columns: 1fr;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-form-wrap {
    padding: 28px 24px;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-copy {
    text-align: left;
  }
}

/* ─── 16. FOCUS STYLES (Accessibility) ──────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}