/*
 * Clients & Experts Consulting GmbH — Shared Stylesheet
 * Design System: "Precision Editorial" (analog talentservice-website)
 *
 * Tailwind CDN Config-Block (in jede HTML-Datei inline einfügen):
 * ---------------------------------------------------------------
 * <script src="https://cdn.tailwindcss.com?plugins=forms"></script>
 * <script>
 * tailwind.config = {
 *   theme: {
 *     extend: {
 *       colors: {
 *         "primary":                   "#001c40",
 *         "primary-container":         "#14315b",
 *         "on-primary-container":      "#809aca",
 *         "secondary-container":       "#fdb879",
 *         "on-secondary-container":    "#784712",
 *         "secondary":                 "#86521d",
 *         "tertiary-fixed":            "#ffdcc4",
 *         "on-tertiary-fixed-variant": "#6f3800",
 *         "surface":                   "#fcf9f5",
 *         "surface-container-low":     "#f6f3ef",
 *         "surface-container-lowest":  "#ffffff",
 *         "surface-container-high":    "#ebe8e4",
 *         "on-surface":                "#1c1c1a",
 *         "on-surface-variant":        "#44474f",
 *         "on-background":             "#1c1c1a",
 *         "outline-variant":           "#c4c6d0",
 *       },
 *       fontFamily: {
 *         "headline": ["Manrope", "sans-serif"],
 *         "body":     ["Inter", "sans-serif"],
 *       },
 *     },
 *   },
 * }
 * </script>
 * ---------------------------------------------------------------
 */

/* ============================================================
   GLOBAL BASE
   ============================================================ */

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Inter", sans-serif;
  background-color: #fcf9f5;
  color: #1c1c1a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: max(884px, 100dvh);
  overflow-x: hidden;
}

::selection {
  background-color: #fdb879;
  color: #784712;
}

/* ============================================================
   FLUID TYPOGRAPHY — Einheitliche Überschriften-Skala
   Fluid von Mobile → Desktop, kein harter Breakpoint-Sprung.
   ============================================================ */

/* Hauptüberschrift Startseite (Hero) */
.h-display { font-size: clamp(2.5rem,  5.5vw, 4.5rem);  }  /* 40px → 72px */

/* Haupt-H1 jeder Unterseite */
.h-hero    { font-size: clamp(2.25rem, 4vw,   3.5rem);  }  /* 36px → 56px */

/* Primäre Section-H2 (Haupt-Abschnitte, CTA-Blöcke) */
.h-section { font-size: clamp(2rem,    3.5vw, 2.75rem); }  /* 32px → 44px */

/* Sekundäre H2 (Karten-Titel, kleine Abschnitte) */
.h-card    { font-size: clamp(1.75rem, 2.5vw, 2rem);    }  /* 28px → 32px */

/* ============================================================
   MATERIAL SYMBOLS
   ============================================================ */

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
}

/* ============================================================
   HERO GRADIENT
   ============================================================ */

.bg-hero-gradient {
  background: linear-gradient(135deg, #001c40 0%, #14315b 100%);
}

/* ============================================================
   SHARED HEADER
   ============================================================ */

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: rgba(252, 249, 245, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(196, 198, 208, 0.15);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Kompakter Button im Header */
#site-header .btn-primary {
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
}

/* Nav-Links */
.nav-link {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: #44474f;
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background-color: #f6f3ef;
  color: #44474f;
}

.nav-link.active {
  color: #fdb879;
  font-weight: 700;
}

/* ============================================================
   MOBILE NAV
   ============================================================ */

#mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background-color: #001c40;
  padding: 1.5rem 1.5rem 2rem;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

#mobile-menu.open {
  display: flex;
}

/* Close button inside menu */
#mobile-close-btn {
  align-self: flex-end;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

#mobile-close-btn:hover {
  opacity: 1;
}

.mobile-nav-link {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  color: #ffffff;
  text-decoration: none;
  opacity: 0.85;
  padding: 0.5rem 0;
  display: block;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  opacity: 1;
  color: #fdb879;
}

/* Mobile accordion (Leistungen / Branchen) */
.mobile-accordion {
  border: none;
}

.mobile-accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  color: #ffffff;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  text-align: left;
  padding: 0.5rem 0;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.mobile-accordion-btn:hover,
.mobile-accordion-btn.active {
  opacity: 1;
  color: #fdb879;
}

.mobile-accordion-icon {
  font-size: 1.25rem;
  transition: transform 0.25s ease;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.mobile-accordion-btn[aria-expanded="true"] .mobile-accordion-icon {
  transform: rotate(180deg);
}

.mobile-accordion-panel {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0.25rem 0 0.5rem 1rem;
  border-left: 2px solid rgba(253, 184, 121, 0.3);
  margin-left: 0.25rem;
  margin-bottom: 0.5rem;
}

.mobile-accordion-panel.open {
  display: flex;
}

.mobile-sub-link {
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 0.4rem 0;
  transition: color 0.2s ease;
}

.mobile-sub-link:hover {
  color: #fdb879;
}

/* Hamburger → X animation */
#hamburger-btn .bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

#hamburger-btn.open .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

#hamburger-btn.open .bar:nth-child(2) {
  opacity: 0;
}

#hamburger-btn.open .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ============================================================
   NAV DROPDOWN
   ============================================================ */

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown > .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-arrow {
  font-size: 0.75rem;
  opacity: 0.6;
  transition: transform 0.2s ease;
  line-height: 1;
}

.nav-dropdown.open .nav-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-panel {
  display: none !important;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  border: 1px solid rgba(196, 198, 208, 0.4);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  min-width: 220px;
  padding: 0.5rem 0;
  z-index: 100;
  white-space: nowrap;
}

.nav-dropdown.open .nav-dropdown-panel {
  display: block !important;
}

.nav-dropdown-link {
  display: block;
  padding: 0.6rem 1.25rem;
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #44474f;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-dropdown-link:hover {
  background-color: #f6f3ef;
  color: #001c40;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease !important;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Verzögerungsstufen */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================================
   CTA BUTTON
   ============================================================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #fdb879;
  color: #784712;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  padding: 0.875rem 2rem;
  border-radius: 0.375rem;
  text-decoration: none;
  transform: scale(0.95);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #86521d;
  color: #ffffff;
  transform: scale(1.00);
  box-shadow: 0 8px 24px rgba(0, 28, 64, 0.15);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.875rem 2rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   KARTEN / CARDS
   ============================================================ */

.card {
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 20px 40px rgba(0, 28, 64, 0.04);
  padding: 2rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 48px rgba(0, 28, 64, 0.08);
}

/* ============================================================
   CHIP / BADGE
   ============================================================ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: #ffdcc4;
  color: #6f3800;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
}

.tag {
  display: inline-block;
  background-color: #f6f3ef;
  color: #1c1c1a;
  font-family: "Inter", sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
}

/* ============================================================
   AMBIENT SHADOW HELPER
   ============================================================ */

.shadow-ambient {
  box-shadow: 0 20px 40px rgba(0, 28, 64, 0.04);
}

/* ============================================================
   STATS STRIP
   ============================================================ */

.stats-strip {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 4rem;
  padding-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (min-width: 640px) {
  .stats-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   STEP NUMBERING
   ============================================================ */

.step-number {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  color: #784712;
  background-color: #fdb879;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */

#site-footer {
  background-color: #001c40;
  color: rgba(255, 255, 255, 0.6);
}

.footer-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 3rem;
  align-items: flex-start;
}

.footer-grid > div:first-child {
  flex: 2 0 0;
  min-width: 0;
}

.footer-grid > div:not(:first-child) {
  flex: 1 0 0;
  min-width: 0;
}

@media (max-width: 767px) {
  .footer-grid {
    flex-direction: column !important;
  }
  .footer-grid > div:first-child,
  .footer-grid > div:not(:first-child) {
    flex: none;
  }
}

#site-footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s ease;
}

#site-footer a:hover {
  color: #fdb879;
}

/* ============================================================
   FORMSPREE KONTAKTFORMULAR
   ============================================================ */

.form-input {
  width: 100%;
  font-family: "Inter", sans-serif;
  font-size: 0.9375rem;
  color: #1c1c1a;
  background-color: #ebe8e4;
  border: none;
  border-radius: 0.375rem;
  padding: 0.875rem 1rem;
  outline: none;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
  appearance: none;
}

.form-input:focus {
  background-color: #ffffff;
  box-shadow: 0 0 0 2px #001c40;
}

.form-input::placeholder {
  color: #c4c6d0;
}

.form-label {
  display: block;
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #001c40;
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

/* Mobile touch targets */
@media (max-width: 768px) {
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
  }
  .nav-link {
    padding: 0.5rem 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Mobile: prevent heading and chip overflow */
@media (max-width: 767px) {
  h1, h2 {
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .chip {
    display: none;
  }
}

@media (min-width: 640px) {
  .chip {
    display: inline-flex;
  }
}

/* ============================================================
   KAI WIDGET — KI-Mitarbeiter Slideout
   ============================================================ */

@keyframes kai-hint-show {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  78%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes kai-arrow-flow {
  0%   { opacity: 0.15; transform: translateX(-4px); }
  50%  { opacity: 1;    transform: translateX(4px); }
  100% { opacity: 0.15; transform: translateX(-4px); }
}

#kai-hint {
  position: fixed;
  right: calc(2.5rem + 56px + 0.4rem);
  bottom: calc(1.5rem + 28px);
  transform: translateY(50%);
  display: flex;
  align-items: center;
  gap: 0;
  pointer-events: none;
  opacity: 0;
  animation: kai-hint-show 3.2s ease forwards;
  animation-delay: 1.7s;
}

.kai-arrow {
  color: #fdb879;
  font-size: 2.5rem;
  line-height: 1;
  animation: kai-arrow-flow 0.65s ease-in-out infinite;
}
.kai-arrow:nth-child(1) { animation-delay: 0s; }
.kai-arrow:nth-child(2) { animation-delay: 0.22s; }
.kai-arrow:nth-child(3) { animation-delay: 0.44s; }

@keyframes kai-slide-in {
  0%   { transform: translateY(calc(-100vh + 160px)); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  68%  { transform: translateY(14px);  animation-timing-function: ease-out; }
  82%  { transform: translateY(-7px);  animation-timing-function: ease-in; }
  93%  { transform: translateY(4px);   animation-timing-function: ease-out; }
  100% { transform: translateY(0); }
}

@keyframes kai-ping {
  0%   { box-shadow: 0 4px 20px rgba(253,184,121,0.45), 0 0 0 0 rgba(253,184,121,0.7); }
  70%  { box-shadow: 0 4px 20px rgba(253,184,121,0.45), 0 0 0 18px rgba(253,184,121,0); }
  100% { box-shadow: 0 4px 20px rgba(253,184,121,0.45), 0 0 0 0 rgba(253,184,121,0); }
}

#kai-trigger {
  position: fixed;
  right: 2.5rem;
  bottom: 1.5rem;
  z-index: 300;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fdb879;
  color: #001c40;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(253,184,121,0.45), 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, background 0.15s ease;
}
#kai-trigger.kai-ping {
  transition: none;
  animation:
    kai-slide-in 1.2s linear 0.3s both,
    kai-ping 0.8s ease-out 3 1.7s backwards;
}
#kai-trigger:hover {
  background: #f0a040;
  transform: scale(1.08);
}
#kai-trigger .material-symbols-outlined {
  font-size: 26px;
}

#kai-panel {
  position: fixed;
  bottom: 5rem;
  right: 1.25rem;
  width: 320px;
  max-width: calc(100vw - 2.5rem);
  background: #fff;
  z-index: 295;
  border-radius: 1rem;
  box-shadow: 0 8px 40px rgba(0,28,64,0.18);
  display: flex;
  flex-direction: column;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), opacity 0.25s ease;
}
#kai-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#kai-panel-header {
  background: linear-gradient(135deg, #001c40 0%, #14315b 100%);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 1rem 1rem 0 0;
}
#kai-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.2s;
}
#kai-close:hover { color: #fff; }

#kai-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#kai-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ffdcc4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
#kai-avatar .material-symbols-outlined {
  font-size: 32px;
  color: #6f3800;
}

#kai-phone-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #001c40;
  color: #fff;
  text-decoration: none;
  border-radius: 0.75rem;
  padding: 0.875rem 1.25rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  transition: background 0.2s;
}
#kai-phone-link:hover { background: #14315b; }
#kai-phone-link .material-symbols-outlined { font-size: 20px; }

#kai-privacy {
  font-size: 0.75rem;
  color: #44474f;
  text-align: center;
  line-height: 1.5;
}
#kai-privacy a {
  color: #86521d;
  text-decoration: underline;
}

@media (max-width: 400px) {
  #kai-panel { width: 100vw; }
}

/* ============================================================
   COOKIE BANNER
   ============================================================ */

#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: #001c40;
  border-top: 2px solid rgba(253, 184, 121, 0.3);
  padding: 1.25rem 1.5rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#cookie-banner.hiding {
  transform: translateY(100%);
  opacity: 0;
}

#cookie-banner-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

#cookie-banner-text {
  flex: 1;
  min-width: 0;
  color: rgba(255, 255, 255, 0.75);
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  line-height: 1.6;
}

#cookie-banner-text strong {
  color: #ffffff;
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

#cookie-banner-text a {
  color: #fdb879;
  text-decoration: underline;
  transition: color 0.2s;
}

#cookie-banner-text a:hover {
  color: #ffffff;
}

#cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

#cookie-accept-all {
  background: #fdb879;
  color: #784712;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

#cookie-accept-all:hover {
  background: #86521d;
  color: #ffffff;
}

#cookie-more-info {
  color: rgba(255, 255, 255, 0.55);
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.625rem 0.25rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

#cookie-more-info:hover {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 640px) {
  #cookie-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  #cookie-banner-actions {
    width: 100%;
  }
  #cookie-accept-all {
    flex: 1;
    text-align: center;
  }
}
