/* =========================================================
   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: 3.5rem;           /* 56px 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: 4.5rem; }    /* 72px on desktop */
}
.logo-mark:hover {
  filter: none;
  opacity: 1;
  transform: scale(1.05);
}

/* ============ Modal animation ============ */
.modal-hidden { display: none; }
.modal-overlay { animation: fadeIn 0.25s ease-out; }
.modal-panel   { animation: panelIn 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.body-locked  { overflow: hidden; }
.form-step[hidden] { display: none; }

/* ============ 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;
}
/* While the modal is open, hide the FAB so it doesn't sit on top of the form. */
body.body-locked .lyb-fab {
  opacity: 0;
  pointer-events: none;
  transform: translateY(150%);
}
.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 to stay out of the way */
@media (max-width: 480px) {
  .lyb-fab {
    width: 3.5rem;
    height: 3.5rem;
    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;
}

/* Modal: use dynamic viewport height (dvh) so iOS Safari toolbar
   doesn't crop the panel; fall back to vh on older browsers. */
#lead-modal {
  height: 100vh;
  height: 100dvh;
}
#lead-modal > .relative {
  max-height: 100vh;
  max-height: 100dvh;
  -webkit-overflow-scrolling: touch;
}

/* Modal panel = flex column with a non-scrolling progress header on top
   and a scrolling form body below. This guarantees the progress bar
   stays visible when the user scrolls through long form steps on mobile —
   regardless of which container would otherwise pick up the scroll
   (a known iOS Safari quirk with position: sticky). */
.modal-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: hidden;            /* the inner .modal-scroll handles scrolling */
}
@media (min-width: 768px) {
  .modal-panel {
    max-height: calc(100vh - 4rem);
    max-height: calc(100dvh - 4rem);
  }
}

/* Progress header — never scrolls. flex-shrink:0 holds it at its content size. */
#lead-progress {
  flex-shrink: 0;
  /* Subtle separator from the scrollable content below */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Scrollable form body */
.modal-scroll {
  flex: 1 1 auto;
  min-height: 0;               /* required so flex item can shrink below its content */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  /* Add some top padding so first content has breathing room from the progress */
  padding-top: 1.5rem;
}

/* ============ 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;
}

/* iOS-safe scroll lock: when modal is open, body becomes position:fixed
   (set by JS). The CSS class just reinforces it. */
body.body-locked {
  overflow: hidden;
  /* Anti-bounce on iOS — JS sets position:fixed inline so this is belt+braces */
  position: fixed;
  width: 100%;
}

/* Backdrop blur — Safari requires the -webkit- prefix. Tailwind's CDN should
   add it, but we declare it explicitly for the modal backdrop to be safe. */
#lead-modal .absolute.inset-0.bg-surface-deep\/80 {
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}

/* 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; }
}
