/* ============================================================
   Steuer-Hebel – Dashboard-Karten mit großer Kennzahl-Hero
   (Sektion "Konkrete Steuer-Hebel" auf steuerbetreuung.html)
   ============================================================ */

/* --- Section background decor --- */
.hebel-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.hebel-section__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 12% 0%, rgba(212, 179, 106, 0.10), transparent 70%),
    radial-gradient(ellipse 50% 45% at 92% 100%, rgba(20, 33, 61, 0.06), transparent 70%);
}
/* faint dot grid */
.hebel-section__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(20, 33, 61, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 75%, transparent 100%);
}

.hebel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
@media (max-width: 1000px) {
  .hebel-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hebel-grid { grid-template-columns: 1fr; }
}

/* --- Single Hebel card --- */
.hebel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 2.5vw, 1.75rem);
  border-radius: 18px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbf9f3 100%);
  border: 1px solid rgba(20, 33, 61, 0.08);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.4s ease;
  box-shadow: 0 6px 18px -12px rgba(20, 33, 61, 0.12);
}

.hebel-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #D4B36A 0%, #B08856 50%, #14213D 100%);
  transform-origin: left center;
  transform: scaleX(0.25);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hebel-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -25%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(212, 179, 106, 0.16) 0%, transparent 65%);
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hebel-card:hover,
.hebel-card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(212, 179, 106, 0.45);
  box-shadow: 0 26px 54px -22px rgba(20, 33, 61, 0.32);
}
.hebel-card:hover::before,
.hebel-card:focus-within::before {
  transform: scaleX(1);
}
.hebel-card:hover::after,
.hebel-card:focus-within::after {
  opacity: 1;
}

/* Staggered reveal — uses the existing .reveal/.is-visible system */
.hebel-card.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) var(--hb-delay, 0s),
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) var(--hb-delay, 0s),
              box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.4s ease;
}
.hebel-card.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.hebel-card.reveal.is-visible:hover,
.hebel-card.reveal.is-visible:focus-within {
  transform: translateY(-6px);
}

/* Large faded watermark index number */
.hebel-card__index {
  position: absolute;
  top: -0.35rem;
  right: 0.4rem;
  font-family: var(--font-display, "Instrument Serif", serif);
  font-style: italic;
  font-size: 5.5rem;
  line-height: 1;
  font-weight: 400;
  color: rgba(20, 33, 61, 0.05);
  z-index: 0;
  pointer-events: none;
  transition: color 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hebel-card:hover .hebel-card__index,
.hebel-card:focus-within .hebel-card__index {
  color: rgba(212, 179, 106, 0.16);
  transform: translateY(2px) scale(1.05);
}
/* keep content above the watermark */
.hebel-card__top,
.hebel-card__hero,
.hebel-card__hero-sub,
.hebel-card__title,
.hebel-card__body,
.hebel-card__ref {
  position: relative;
  z-index: 1;
}

/* --- Top row: icon + meta --- */
.hebel-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.hebel-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg,
              rgba(20, 33, 61, 0.06)   0%,
              rgba(212, 179, 106, 0.16) 100%);
  border: 1px solid rgba(212, 179, 106, 0.30);
  color: #14213D;
  flex-shrink: 0;
  transition: background 0.5s ease, color 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hebel-card__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hebel-card:hover .hebel-card__icon,
.hebel-card:focus-within .hebel-card__icon {
  background: linear-gradient(135deg, #14213D 0%, #1f3258 100%);
  color: #D4B36A;
  transform: rotate(-4deg);
}
.hebel-card:hover .hebel-card__icon svg,
.hebel-card:focus-within .hebel-card__icon svg {
  transform: scale(1.08) rotate(8deg);
}

.hebel-card__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #B08856;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(212, 179, 106, 0.10);
}
.hebel-card__label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #D4B36A;
}

/* --- Hero number --- */
.hebel-card__hero {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.25rem 0 0.9rem;
  line-height: 1;
}
.hebel-card__num {
  font-family: var(--font-display, "Instrument Serif", serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
  line-height: 0.95;
  background: linear-gradient(135deg, #14213D 0%, #B08856 70%, #D4B36A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* Italic glyphs überhängen rechts – etwas Platz + inline-block,
     damit das letzte Zeichen beim background-clip nicht abgeschnitten wird. */
  display: inline-block;
  padding-right: 0.14em;
}
.hebel-card__unit {
  font-family: var(--font-display, "Instrument Serif", serif);
  font-style: italic;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  color: #B08856;
  font-weight: 400;
}

.hebel-card__hero-sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: #B08856;
  letter-spacing: 0.04em;
  margin: -0.5rem 0 0.9rem;
}

/* --- Title + body --- */
.hebel-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #14213D;
  margin: 0 0 0.55rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.hebel-card__body {
  font-size: 0.93rem;
  line-height: 1.55;
  color: #4b5366;
  margin: 0;
}
.hebel-card__body strong { color: #14213D; font-weight: 600; }

/* --- Footer paragraph reference (small, optional) --- */
.hebel-card__ref {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid rgba(20, 33, 61, 0.06);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(20, 33, 61, 0.45);
  transition: border-color 0.4s ease, color 0.4s ease;
}
.hebel-card:hover .hebel-card__ref,
.hebel-card:focus-within .hebel-card__ref {
  border-top-color: rgba(212, 179, 106, 0.40);
  color: #B08856;
}
.hebel-card__ref-arrow {
  display: inline-flex;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(212, 179, 106, 0.12);
  align-items: center;
  justify-content: center;
  color: #B08856;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.4s ease;
}
.hebel-card__ref-arrow svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
}
.hebel-card:hover .hebel-card__ref-arrow,
.hebel-card:focus-within .hebel-card__ref-arrow {
  background: #14213D;
  color: #D4B36A;
  transform: translateX(4px);
}

/* --- Per-icon micro animations --- */
.hebel-card__icon[data-variant="chart-up"] svg {
  transform-box: fill-box; transform-origin: center;
  animation: hb-rise 4s ease-in-out infinite;
}
@keyframes hb-rise {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
.hebel-card__icon[data-variant="cycle"] svg {
  transform-box: fill-box; transform-origin: center;
  animation: hb-spin 16s linear infinite;
}
@keyframes hb-spin {
  to { transform: rotate(360deg); }
}
.hebel-card__icon[data-variant="shield"] svg {
  transform-box: fill-box; transform-origin: center;
  animation: hb-pulse 3.4s ease-in-out infinite;
}
@keyframes hb-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.hebel-card__icon[data-variant="family"] svg {
  transform-box: fill-box; transform-origin: center;
  animation: hb-bob 4.5s ease-in-out infinite;
}
@keyframes hb-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
.hebel-card__icon[data-variant="car"] svg {
  transform-box: fill-box; transform-origin: center;
  animation: hb-drive 5s ease-in-out infinite;
}
@keyframes hb-drive {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(2px); }
}
.hebel-card__icon[data-variant="scale"] svg {
  transform-box: fill-box; transform-origin: center;
  animation: hb-tilt 5.5s ease-in-out infinite;
}
@keyframes hb-tilt {
  0%, 100% { transform: rotate(0deg);   }
  25%      { transform: rotate(-3deg);  }
  75%      { transform: rotate(3deg);   }
}

/* --- Section heading polish --- */
.hebel-intro {
  position: relative;
  text-align: center;
  margin: 0 auto;
  max-width: 720px;
}
.hebel-intro::after {
  content: "";
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #D4B36A 50%, transparent 100%);
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .hebel-card, .hebel-card *, .hebel-card__icon svg {
    transition: none !important;
    animation: none !important;
  }
}
