/* =========================================================
   Lift Your Brand — custom styles
   Tailwind utilities live in index.html (CDN).
   This file holds everything Tailwind cannot express:
   keyframes, modal, hover/animation effects, :has() rules.
   ========================================================= */

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ============ Smooth in-page scrolling ============ */
/* Native smooth scroll for anchor clicks. scroll-margin-top offsets the
   target section so the heading isn't hidden under the fixed top nav. */
html {
  scroll-behavior: smooth;
}
section[id] {
  scroll-margin-top: 96px;   /* nav height (80px) + breathing room */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ============ Logo slider (section 3) ============ */
@keyframes scroll-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes scroll-right {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}
.animate-scroll-left  { animation: scroll-left  40s linear infinite; }
.animate-scroll-right { animation: scroll-right 40s linear infinite; }

/* Pause the strip when the cursor is anywhere over it so the logo under
   the pointer doesn't slide away mid-hover. Each strip pauses
   independently — the other one keeps moving. */
.animate-scroll-left:hover,
.animate-scroll-right:hover {
  animation-play-state: paused;
}

/* ============ Logo strip marks ============ */
.logo-mark {
  height: 5rem;             /* 80px on mobile */
  width: auto;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.55;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  -webkit-user-drag: none;
  user-select: none;
}
@media (min-width: 768px) {
  .logo-mark { height: 6.5rem; }    /* 104px on desktop */
}
.logo-mark:hover {
  filter: none;
  opacity: 1;
  transform: scale(1.05);
}

/* ============ Form steps (anfrage.html) ============ */
.form-step[hidden] { display: none; }

/* ============ Mobile menu drawer ============
   Safari sometimes fails to invalidate the [hidden] UA rule when the
   attribute is dynamically removed. Forcing display via .is-open guarantees
   the drawer becomes visible on toggle. */
#mobile-menu.is-open {
  display: block;
}
@media (min-width: 768px) {
  #mobile-menu.is-open { display: none; }
}

/* Hamburger button: kill iOS tap delay + ensure no ghost touches */
#mobile-menu-toggle {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
}

/* Sticky progress bar — pins below the fixed top nav (80px tall) as the user
   scrolls the form. The progress sits at the top of .form-card and uses
   the panel's bg color so it visually merges with the card. */
.form-card #lead-progress {
  position: sticky;
  top: 80px;            /* nav height */
  z-index: 5;
  background: #16161A;  /* surface-card */
  /* Soft fade under the bar when content scrolls beneath */
  box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.4);
}

/* ============ Discipline cards (section 4) + reused for section 9 ============ */
.discipline-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.4s ease,
              box-shadow 0.5s ease,
              background-color 0.4s ease;
  will-change: transform;
}
/* Mouse-tracked spotlight — driven by --mx / --my (set in JS); falls back gracefully to a static top-right glow */
.discipline-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--mx, 80%) var(--my, 0%),
              rgba(93, 93, 255, 0.22),
              transparent 45%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
}
.discipline-card > * { position: relative; z-index: 1; }
.discipline-card:hover {
  transform: translateY(-6px);
  border-color: rgba(93, 93, 255, 0.5);
  box-shadow: 0 20px 60px -20px rgba(93, 93, 255, 0.45),
              0 0 0 1px rgba(93, 93, 255, 0.15);
  background-color: #1a1a24;
}
.discipline-card:hover::before { opacity: 1; }

.disc-num {
  display: inline-block;
  background: linear-gradient(135deg, #5D5DFF 0%, #A855F7 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              letter-spacing 0.4s ease,
              opacity 0.3s ease;
  opacity: 0.85;
}
.discipline-card:hover .disc-num {
  transform: translateY(-2px) scale(1.05);
  letter-spacing: -0.04em;
  opacity: 1;
}
.disc-title {
  transition: color 0.3s ease, transform 0.4s ease;
}
.disc-arrow {
  position: absolute;
  top: 1.75rem;
  right: 1.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: rgba(93, 93, 255, 0.12);
  color: #c1c1ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translate(-8px, 8px) rotate(-25deg);
  transition: opacity 0.4s ease,
              transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.3s ease;
  z-index: 2;
}
.discipline-card:hover .disc-arrow {
  opacity: 1;
  transform: translate(0, 0) rotate(0deg);
  background: rgba(93, 93, 255, 0.25);
}

/* ============ Pillars (section 5) — also used for icon blocks in section 9 ============ */
.pillar-card {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.pillar-card:hover { transform: translateY(-4px); }

.pillar-icon {
  position: relative;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s ease,
              background-color 0.4s ease;
}
.pillar-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #5D5DFF 0%, #A855F7 100%);
  opacity: 0;
  transition: opacity 0.45s ease;
  border-radius: inherit;
}
.pillar-icon .material-symbols-outlined {
  position: relative;
  z-index: 1;
  transition: color 0.35s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.pillar-card:hover .pillar-icon,
.discipline-card:hover .pillar-icon {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 12px 40px -8px rgba(93, 93, 255, 0.55);
}
.pillar-card:hover .pillar-icon::before,
.discipline-card:hover .pillar-icon::before { opacity: 1; }
.pillar-card:hover .pillar-icon .material-symbols-outlined,
.discipline-card:hover .pillar-icon .material-symbols-outlined {
  color: #fff;
  transform: scale(1.1);
}
.pillar-title {
  transition: color 0.3s ease, transform 0.4s ease;
}
.pillar-card:hover .pillar-title {
  background: linear-gradient(135deg, #c1c1ff 0%, #ddb7ff 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

/* ============ Case study cards (section 7) ============ */
.case-card {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.4s ease,
              box-shadow 0.5s ease;
  will-change: transform;
}
.case-card:hover {
  transform: translateY(-4px);
  border-color: rgba(93, 93, 255, 0.45);
  box-shadow: 0 28px 80px -28px rgba(93, 93, 255, 0.5),
              0 0 0 1px rgba(93, 93, 255, 0.12);
}
.case-image {
  position: relative;
  overflow: hidden;
}
.case-img {
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.5s ease,
              filter 0.5s ease;
}
.case-card:hover .case-img {
  transform: scale(1.06);
  opacity: 1 !important;
  mix-blend-mode: normal !important;
}
.case-eyebrow {
  transition: letter-spacing 0.4s ease, color 0.3s ease;
}
.case-card:hover .case-eyebrow {
  letter-spacing: 0.18em;
  color: #ddb7ff;
}

/* ============ Animated counter (Zahlen-Leiste) ============ */
.stat-card {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.stat-card:hover { transform: translateY(-4px); }
.stat-number {
  display: inline-block;
  background: linear-gradient(135deg, #5D5DFF 0%, #A855F7 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
  transition: filter 0.4s ease;
}
.stat-card:hover .stat-number {
  filter: drop-shadow(0 0 24px rgba(93, 93, 255, 0.5));
}

/* ============ Reveal-on-scroll ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Reduced motion override ============ */
@media (prefers-reduced-motion: reduce) {
  .discipline-card, .discipline-card *,
  .pillar-card, .pillar-icon, .pillar-icon *,
  .case-card, .case-img, .stat-card,
  .reveal {
    transition: none !important;
    transform: none !important;
  }
  .reveal { opacity: 1; }
}

/* ============ Option card selected state (multistep form) ============
   peer-checked: in Tailwind only reaches direct siblings of the <input>,
   not nested indicators — so we use :has() here. JS adds an .is-checked
   fallback class for browsers that don't support :has() (iOS Safari < 15.4). */
label:has(> input[type="checkbox"]:checked) > div,
label:has(> input[type="radio"]:checked)    > div,
label.is-checked > div {
  border-color: #c1c1ff;
  background-color: rgba(93, 93, 255, 0.1);
}
label:has(> input[type="checkbox"]:checked) .opt-check,
label.is-checked .opt-check {
  background-color: #5d5dff;
  border-color: #5d5dff;
}
label:has(> input[type="checkbox"]:checked) .opt-check-icon,
label.is-checked .opt-check-icon {
  color: #fefaff;
}
label:has(> input[type="radio"]:checked) .opt-radio-outer,
label.is-checked .opt-radio-outer {
  border-color: #5d5dff;
}
label:has(> input[type="radio"]:checked) .opt-radio-dot,
label.is-checked .opt-radio-dot {
  background-color: #5d5dff;
}

/* =========================================================
   Floating CTA button (FAB)
   ========================================================= */
.lyb-fab {
  position: fixed;
  right: 1rem;
  /* iOS safe-area inset for notched devices */
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #5D5DFF 0%, #A855F7 100%);
  color: #fff;
  font-family: Manrope, system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  /* Remove iOS 300ms tap delay; tell the browser this element only scrolls/pans
     in standard ways so taps fire instantly. */
  touch-action: manipulation;
  box-shadow: 0 12px 30px -8px rgba(93, 93, 255, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.05);
  /* Hidden initially; revealed by JS once user scrolls past hero. Pointer-events:
     none while hidden so an off-screen FAB never catches stray taps. */
  opacity: 0;
  transform: translateY(150%);
  pointer-events: none;
  transition: opacity 0.4s ease,
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s ease;
}
.lyb-fab.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.lyb-fab.is-hidden {
  opacity: 0;
  transform: translateY(150%);
  pointer-events: none;
}
.lyb-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -8px rgba(93, 93, 255, 0.75),
              0 0 0 1px rgba(255, 255, 255, 0.1);
}
.lyb-fab:active { transform: translateY(0) scale(0.97); }
.lyb-fab:focus-visible {
  box-shadow: 0 0 0 3px rgba(93, 93, 255, 0.4),
              0 12px 30px -8px rgba(93, 93, 255, 0.6);
}
.lyb-fab .material-symbols-outlined { font-size: 1.25rem; }

/* On phones: collapse to icon-only circle, same size as the scrolltop button. */
@media (max-width: 480px) {
  .lyb-fab {
    width: 3rem;
    height: 3rem;
    padding: 0;
    justify-content: center;
    right: 1rem;
  }
  .lyb-fab-label { display: none; }
  .lyb-fab .material-symbols-outlined { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lyb-fab { transition: opacity 0.2s ease; transform: none !important; }
}

/* =========================================================
   Mobile / Safari-specific fixes
   ========================================================= */

/* Prevent iOS Safari from zooming in when focusing form inputs.
   iOS auto-zooms if the rendered font-size is below 16px. */
#lead-form input,
#lead-form textarea,
#lead-form select {
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
  /* Force dark surface + light text so the input text stays readable
     regardless of theme or browser-native overrides. */
  background-color: #1b1b24 !important;
  color: #e4e1ee !important;
  caret-color: #c1c1ff;
}
#lead-form input::placeholder,
#lead-form textarea::placeholder {
  color: #908fa1 !important;
  opacity: 1;
}
/* Chrome / Safari autofill recolors the input bg yellow/white and overrides
   `background-color`. The box-shadow trick paints over it; -webkit-text-fill-color
   beats the autofilled black text. */
#lead-form input:-webkit-autofill,
#lead-form input:-webkit-autofill:hover,
#lead-form input:-webkit-autofill:focus,
#lead-form input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #1b1b24 inset !important;
  -webkit-text-fill-color: #e4e1ee !important;
  caret-color: #c1c1ff !important;
  transition: background-color 9999s ease-in-out 0s;
}

/* ============ Final step nav (full-width submit, back below) ============ */
#lead-nav.is-final {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
#lead-nav.is-final #btn-submit {
  width: 100%;
  justify-content: center;
  order: 1;
}
#lead-nav.is-final #btn-back {
  align-self: center;
  order: 2;
}

/* Disable mouse-spotlight cost on touch devices — pointermove fires
   continuously during scroll and burns battery on iOS. */
@media (hover: none) {
  .discipline-card::before { display: none; }
  .discipline-card:hover {
    transform: none;
    background-color: inherit;
  }
}

/* Phones: tighten card padding so content breathes */
@media (max-width: 640px) {
  .discipline-card,
  .case-card {
    padding: 1.5rem;
  }
  .case-card.lg\:p-12 { padding: 1.5rem; }
  .disc-arrow { top: 1.25rem; right: 1.25rem; width: 2rem; height: 2rem; }
}

/* Top nav: keep the logo + CTA from colliding on narrow screens */
@media (max-width: 380px) {
  nav .text-2xl { font-size: 1.125rem; }
}

/* =========================================================
   Badge preview lightbox
   - Native <dialog> styled to match the brand
   - Opens when a .badge-preview button is clicked
   ========================================================= */
.badge-preview {
  background: transparent;
  border: 0;
  padding: 0;
  display: inline-flex;
  -webkit-tap-highlight-color: transparent;
}
.badge-preview:focus-visible {
  outline: 2px solid #5D5DFF;
  outline-offset: 4px;
  border-radius: 6px;
}
/* Badges now scale by width (each occupies 50% of the row via flex-1), so no
   per-breakpoint height overrides are needed. Aspect ratio is preserved by
   the img's `h-auto`. */

.badge-lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  color: inherit;
}
.badge-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.badge-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  inset: 0;
  margin: auto;
}
.badge-lightbox img {
  display: block;
  max-width: min(90vw, 720px);
  max-height: 80vh;
  width: auto;
  height: auto;
  padding: 1rem;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.08);
}
/* Photo mode: drop the white frame for full-bleed case-study photos */
.badge-lightbox img.is-photo {
  max-width: min(95vw, 1280px);
  max-height: 85vh;
  padding: 0;
  background: transparent;
}
/* Case study photos: indicate they're clickable */
.case-image { cursor: zoom-in; }

/* =========================================================
   Scroll-to-top button (bottom-left, mirrors the FAB)
   ========================================================= */
.lyb-scrolltop {
  position: fixed;
  /* Mobile default: bottom-left (chatbot FAB sits bottom-right). */
  left: 1rem;
  right: auto;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  /* Brand violet so it pops against the dark page sections */
  background: linear-gradient(135deg, #5D5DFF 0%, #A855F7 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: 0 12px 30px -8px rgba(93, 93, 255, 0.55),
              0 0 0 1px rgba(255, 255, 255, 0.05);
  /* Visible by default — JS adds .is-hidden only when user is at the top. */
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.4s ease,
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.2s ease;
}
.lyb-scrolltop.is-hidden {
  opacity: 0;
  transform: translateY(150%);
  pointer-events: none;
}
.lyb-scrolltop:hover  { filter: brightness(1.1); }
.lyb-scrolltop:active { transform: scale(0.94); }
.lyb-scrolltop .material-symbols-outlined { font-size: 24px; }

@media (prefers-reduced-motion: reduce) {
  .lyb-scrolltop           { transition: opacity 0.2s ease; transform: none; }
  .lyb-scrolltop.is-hidden { transform: none; }
}

/* Desktop: scroll-up sits 80px above its mobile baseline, with the same 20px
   right-edge distance as the Lila chatbot FAB — they stack neatly with a
   small gap between them. */
@media (min-width: 768px) {
  .lyb-scrolltop {
    left: auto;
    right: 20px;
    bottom: calc(1rem + 80px + env(safe-area-inset-bottom, 0px));
  }
}
.badge-lightbox-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 0;
  background: #ffffff;
  color: #111;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}
.badge-lightbox-close:hover { transform: scale(1.08); }
.badge-lightbox-close:active { transform: scale(0.95); }
