/* Section styles — why-us */

/* ── Section Shell ── */

.why-us {
  position: relative;
  overflow: hidden;
  background: var(--color-background, #fcf9f8);
  padding-top: clamp(4.5rem, 7vw, 8rem);
  padding-bottom: clamp(5rem, 8vw, 10rem);
}

.why-us__bg {
  position: absolute;
  inset: 0;
  background-image: url('https://www.elms.istwow.de/wp-content/uploads/elms-wireframe/elms_background_hell.webp');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Side feather — soft fade into section background (no mask-image) */
.why-us__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    90deg,
    var(--color-background, #fcf9f8) 0%,
    rgba(252, 249, 248, 0.92) 4%,
    rgba(252, 249, 248, 0.55) 10%,
    rgba(252, 249, 248, 0.18) 16%,
    transparent 24%,
    transparent 76%,
    rgba(252, 249, 248, 0.18) 84%,
    rgba(252, 249, 248, 0.55) 90%,
    rgba(252, 249, 248, 0.92) 96%,
    var(--color-background, #fcf9f8) 100%
  );
}

/* Vertical veil + subtle cyan horizon glow at sides */
.why-us__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(
      ellipse 34% 68% at 0% 72%,
      rgba(0, 180, 216, 0.13) 0%,
      rgba(0, 180, 216, 0.04) 38%,
      transparent 72%
    ),
    radial-gradient(
      ellipse 34% 68% at 100% 72%,
      rgba(0, 180, 216, 0.13) 0%,
      rgba(0, 180, 216, 0.04) 38%,
      transparent 72%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.68) 0%,
      rgba(255, 255, 255, 0.20) 52%,
      rgba(255, 255, 255, 0.06) 100%
    );
}

.why-us__wrap {
  position: relative;
  z-index: 1;
}

/* ── Header — centered ── */

.why-us__header {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto clamp(3rem, 5vw, 5.5rem);
}

.why-us__eyebrow {
  display: inline-block;
  font-size: var(--fs-label, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary, #1d96bd);
  margin: 0 0 1.25rem;
}

.why-us__title {
  font-family: var(--font-heading, "Plus Jakarta Sans", sans-serif);
  color: #0b1d35;
  margin: 0 0 1.375rem;
}

.why-us__lead {
  font-size: clamp(0.95rem, 0.9rem + 0.28vw, 1.1rem);
  line-height: 1.75;
  color: #3d4f63;
  font-weight: 400;
  margin: 0;
}

/* ── Grid ── */

.why-us__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  perspective: 1400px;
}

@media (max-width: 1024px) {
  .why-us__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ── Card — frosted glass + 3D tilt ── */

.why-us-card {
  --why-icon-inner: 4rem;
  --why-icon-offset: 4px;
  --why-icon-ring: 2px;
  --why-icon-outer: calc(var(--why-icon-inner) + 2 * var(--why-icon-offset) + 2 * var(--why-icon-ring));
  --why-icon-reveal-y: calc(2.125rem + var(--why-icon-outer) / 2);
  --why-icon-reveal-r: calc(var(--why-icon-outer) / 2);
  --why-accent-gradient: linear-gradient(
    155deg,
    var(--color-primary, #1d96bd) 0%,
    var(--color-primary-dark, #157fa0) 52%,
    #0e6a87 100%
  );
  --mouse-x: 50%;
  --mouse-y: 50%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  will-change: transform;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -1px 0 rgba(255, 255, 255, 0.35) inset,
    0 8px 32px rgba(29, 150, 189, 0.08),
    0 24px 48px rgba(15, 31, 53, 0.05);
  padding: 2.125rem 1.75rem 1.875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.875rem;
  cursor: pointer;
  transition:
    transform 0.18s ease-out,
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.why-us-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Static glass highlight — top-left sheen */
.why-us-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.72) 0%,
    rgba(255, 255, 255, 0.18) 28%,
    transparent 52%
  );
}

/* Dynamic mouse glare — sehr dezent */
.why-us-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    circle 120px at var(--mouse-x) var(--mouse-y),
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.06) 38%,
    transparent 62%
  );
}

.why-us-card.is-active::after {
  opacity: 0.35;
}

.why-us-card.is-active {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -1px 0 rgba(255, 255, 255, 0.35) inset,
    0 12px 40px rgba(29, 150, 189, 0.14),
    0 32px 64px rgba(15, 31, 53, 0.07);
}

.why-us-card > *:not(.why-us-card__accent-fill) {
  position: relative;
  z-index: 2;
}

/* Accent reveal — circular expand from icon (IdentityCard / RevealCard) */
.why-us-card__accent-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
  pointer-events: none;
  background: var(--why-accent-gradient);
  clip-path: circle(var(--why-icon-reveal-r) at 50% var(--why-icon-reveal-y));
  transition: clip-path 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.why-us-card.is-revealed .why-us-card__accent-fill {
  clip-path: circle(160% at 50% var(--why-icon-reveal-y));
  transition-duration: 0.8s;
  transition-timing-function: cubic-bezier(0.83, 0, 0.17, 1);
}

@media (hover: hover) and (pointer: fine) {
  .why-us-card:not(.is-active):hover {
    transform: translateY(-4px);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.95) inset,
      0 10px 36px rgba(29, 150, 189, 0.12),
      0 28px 56px rgba(15, 31, 53, 0.06);
  }
}

/* Icon — concentric ring (inner fill + offset + border) */
.why-us-card__icon-wrap {
  --icon-inner: var(--why-icon-inner);
  --icon-offset: var(--why-icon-offset);
  --icon-ring: var(--why-icon-ring);
  --icon-outer: var(--why-icon-outer);
  position: relative;
  width: var(--icon-outer);
  height: var(--icon-outer);
  flex-shrink: 0;
  margin-bottom: 0.25rem;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
}

/* Inner fill — exakt zentriert */
.why-us-card__icon-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--icon-inner);
  height: var(--icon-inner);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--why-accent-gradient);
  box-shadow: 0 4px 16px rgba(14, 106, 135, 0.28);
  transition: background 0.45s ease, box-shadow 0.45s ease;
}

/* Outer ring — exakt zentriert, ring-offset via wrap background */
.why-us-card__icon-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: var(--icon-ring) solid var(--color-primary-dark, #157fa0);
  box-sizing: border-box;
  pointer-events: none;
  transition: border-color 0.45s ease;
}

.why-us-card.is-revealed .why-us-card__icon-wrap {
  background: rgba(255, 255, 255, 0.22);
}

.why-us-card.is-revealed .why-us-card__icon-wrap::before {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

.why-us-card.is-revealed .why-us-card__icon-wrap::after {
  border-color: rgba(255, 255, 255, 0.88);
}

.why-us-card__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  font-size: 1.875rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.94);
  font-variation-settings: 'wght' 300, 'FILL' 0;
  transition: color 0.45s ease;
  -webkit-font-smoothing: antialiased;
}

.why-us-card.is-revealed .why-us-card__icon {
  color: #fff;
}

/* Title + text invert on accent reveal */
.why-us-card__title,
.why-us-card__text,
.why-us-card__rule {
  transition:
    color 0.45s ease,
    width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.why-us-card.is-revealed .why-us-card__title {
  color: #fff;
}

.why-us-card.is-revealed .why-us-card__text {
  color: rgba(255, 255, 255, 0.88);
}

.why-us-card.is-revealed .why-us-card__rule {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 18%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0.2) 82%,
    transparent 100%
  );
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.22),
    0 0 16px rgba(255, 255, 255, 0.1);
}

/* Title */
.why-us-card__title {
  font-family: var(--font-heading, "Plus Jakarta Sans", sans-serif);
  font-size: clamp(0.95rem, 0.91rem + 0.2vw, 1.05rem);
  font-weight: 700;
  color: #0b1d35;
  line-height: 1.3;
  margin: 0;
  letter-spacing: -0.01em;
}

/* Body text */
.why-us-card__text {
  font-size: clamp(0.835rem, 0.81rem + 0.12vw, 0.9rem);
  line-height: 1.68;
  color: #4a5a6e;
  font-weight: 400;
  margin: 0;
  flex: 1;
}

/* Decorative bottom rule — space horizon with unified side fades */
.why-us-card__rule {
  display: block;
  width: 4.5rem;
  height: 2px;
  margin-top: 0.5rem;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 180, 216, 0.12) 18%,
    rgba(0, 180, 216, 0.62) 50%,
    rgba(0, 180, 216, 0.12) 82%,
    transparent 100%
  );
  box-shadow:
    0 0 8px rgba(0, 180, 216, 0.22),
    0 0 16px rgba(0, 180, 216, 0.12);
  transition:
    width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.why-us-card:hover .why-us-card__rule {
  width: 5.5rem;
  box-shadow:
    0 0 10px rgba(0, 180, 216, 0.32),
    0 0 22px rgba(0, 180, 216, 0.16);
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .why-us-card {
    transition: none;
  }
  .why-us-card::after {
    display: none;
  }
  .why-us-card:not(.is-active):hover {
    transform: none;
  }
  .why-us-card__accent-fill {
    display: none;
  }
  .why-us-card.is-revealed .why-us-card__title,
  .why-us-card.is-revealed .why-us-card__text,
  .why-us-card.is-revealed .why-us-card__icon {
    color: inherit;
  }
  .why-us-card__rule {
    transition: none;
  }
}
