/* DSI-HUBER – dezente Bewegung (Runde 1). Alles abschaltbar über "Bewegung reduzieren". */

/* 1) Navigation: Teal-Unterstreichung (Desktop) */
header nav > ul > li > a,
header nav > ul > li > button { position: relative; }
header nav > ul > li > a::after,
header nav > ul > li > button::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px;
  border-radius: 2px; background: #157585; transform: scaleX(0); transform-origin: left center;
  transition: transform .3s ease;
}
header nav > ul > li:hover > a::after,
header nav > ul > li:hover > button::after,
header nav > ul > li > a:focus-visible::after,
header nav > ul > li > button:focus-visible::after,
header nav > ul > li > .is-current::after { transform: scaleX(1); }

/* 2) Lese-Fortschritt am unteren Rand der Kopfleiste */
.scroll-progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: linear-gradient(90deg, #157585, #38aabe); transform: scaleX(0); transform-origin: left center;
  pointer-events: none; will-change: transform;
}

/* 3) Shop-Button: leiser Lichtring */
.sticky-shop a { position: relative; }
.sticky-shop a::before {
  content: ""; position: absolute; inset: -3px; border-radius: 9999px; pointer-events: none;
  border: 2px solid rgba(21,117,133,.55); opacity: 0;
}

/* 4) Karten: sanftes Anheben (nur mit Maus) */
@media (hover: hover) {
  [class*="hover:shadow"].rounded-2xl {
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  }
  [class*="hover:shadow"].rounded-2xl:hover {
    transform: translateY(-4px); border-color: #7cc8d6;
    box-shadow: 0 14px 30px -12px rgba(21,117,133,.35);
  }
}
/* Antippen auf Touch-Geräten */
@media (hover: none) {
  [class*="hover:shadow"].rounded-2xl, .sticky-shop a, a.rounded-full { transition: transform .15s ease; }
  [class*="hover:shadow"].rounded-2xl:active, .sticky-shop a:active, a.rounded-full:active { transform: scale(.975); }
}

/* 5) Startseiten-/Seitenkopf: weiche Teal-Flächen im Hintergrund */
section.from-teal-50 { position: relative; overflow: hidden; }
section.from-teal-50 > * { position: relative; z-index: 1; }
section.from-teal-50::before, section.from-teal-50::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
}
section.from-teal-50::before {
  width: 520px; height: 520px; top: -180px; right: -120px;
  background: radial-gradient(circle, rgba(21,117,133,.16) 0%, rgba(21,117,133,0) 68%);
}
section.from-teal-50::after {
  width: 440px; height: 440px; bottom: -200px; left: -140px;
  background: radial-gradient(circle, rgba(56,170,190,.18) 0%, rgba(56,170,190,0) 68%);
}
@media (max-width: 767px) {
  section.from-teal-50::before { width: 320px; height: 320px; top: -120px; right: -120px; }
  section.from-teal-50::after { width: 280px; height: 280px; bottom: -130px; left: -120px; }
}

/* Mobiles Menü: weiches Einblenden */
header div[class*="md:hidden"].bg-white { transform-origin: top center; }

@media (prefers-reduced-motion: no-preference) {
  .sticky-shop.show a::before { animation: dsiRing 5.5s ease-out 2s infinite; }
  @keyframes dsiRing {
    0% { transform: scale(1); opacity: .75; }
    28% { transform: scale(1.16, 1.55); opacity: 0; }
    100% { transform: scale(1.16, 1.55); opacity: 0; }
  }
  section.from-teal-50::before { animation: dsiDriftA 26s ease-in-out infinite alternate; }
  section.from-teal-50::after { animation: dsiDriftB 32s ease-in-out infinite alternate; }
  @keyframes dsiDriftA { from { transform: translate(0,0) scale(1); } to { transform: translate(-60px, 50px) scale(1.12); } }
  @keyframes dsiDriftB { from { transform: translate(0,0) scale(1); } to { transform: translate(70px, -40px) scale(1.1); } }
  header div[class*="md:hidden"].bg-white { animation: dsiMenu .28s ease both; }
  header div[class*="md:hidden"].bg-white > a { animation: dsiMenuItem .38s ease both; }
  header div[class*="md:hidden"].bg-white > a:nth-child(1) { animation-delay: .03s; }
  header div[class*="md:hidden"].bg-white > a:nth-child(2) { animation-delay: .06s; }
  header div[class*="md:hidden"].bg-white > a:nth-child(3) { animation-delay: .09s; }
  header div[class*="md:hidden"].bg-white > a:nth-child(4) { animation-delay: .12s; }
  header div[class*="md:hidden"].bg-white > a:nth-child(5) { animation-delay: .15s; }
  header div[class*="md:hidden"].bg-white > a:nth-child(6) { animation-delay: .18s; }
  header div[class*="md:hidden"].bg-white > a:nth-child(7) { animation-delay: .21s; }
  header div[class*="md:hidden"].bg-white > a:nth-child(n+8) { animation-delay: .24s; }
  @keyframes dsiMenu { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
  @keyframes dsiMenuItem { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
}

/* Navigation: edlere Schrift (Outfit, etwas Laufweite) */
header nav > ul > li > a,
header nav > ul > li > button,
header div[class*="md:hidden"].bg-white > a {
  font-family: Outfit, Inter, sans-serif; font-weight: 450; letter-spacing: .015em;
}
header nav > ul > li > a, header nav > ul > li > button { font-size: .9375rem; }

/* Untermenüs: dieselbe Teal-Linie unter dem Text (nur so breit wie der Text) */
header nav > ul > li > div a[href] {
  width: fit-content; max-width: 100%;
  background-image: linear-gradient(#157585, #157585);
  background-repeat: no-repeat; background-size: 0 2px; background-position: 0 calc(100% - 3px);
  transition: background-size .3s ease, color .2s ease;
}
header nav > ul > li > div a[href].is-current { color: #157585; }
header nav > ul > li > div a[href]:hover,
header nav > ul > li > div a[href]:focus-visible,
header nav > ul > li > div a[href].is-current { background-size: 100% 2px; }

/* "Schnell bestellen": Linie unter dem Logo, jeweils in der Logo-Farbe */
header div[x-data*="quick"] a[href] { --u: #157585; }
header div[x-data*="quick"] a[href*="shop.dsi-huber.de"] { --u: #0e8296; }
header div[x-data*="quick"] a[href*="wawibox"] { --u: #4a76c9; }
header div[x-data*="quick"] a[href*="aera-online"] { --u: #c8202f; }
header div[x-data*="quick"] a[href*="blaudental"] { --u: #1b95d3; }
header div[x-data*="quick"] a[href] > img {
  box-sizing: content-box; padding-bottom: 4px; margin-top: 4px;
  background-image: linear-gradient(var(--u), var(--u));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0 2px;
  transition: background-size .3s ease;
}
header div[x-data*="quick"] a[href]:hover > img,
header div[x-data*="quick"] a[href]:focus-visible > img { background-size: 100% 2px; }

/* ===================== Runde 2 ===================== */

/* Fokus-Ring (Tastatur) und Formularfelder in Teal */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #157585; outline-offset: 3px;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: #157585; box-shadow: 0 0 0 3px rgba(21,117,133,.18);
}
input, textarea, select { transition: border-color .2s ease, box-shadow .2s ease; }
form div:focus-within > label { color: #157585; }
form label { transition: color .2s ease; }

/* Nach-oben-Button */
.to-top {
  position: fixed; right: 20px; bottom: 24px; z-index: 40; width: 44px; height: 44px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center; border: 0; cursor: pointer;
  background: #157585; color: #fff; box-shadow: 0 8px 20px -6px rgba(21,117,133,.55);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, background-color .2s ease;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: #0e6070; }
.to-top svg { width: 18px; height: 18px; }
@media (max-width: 767px) { .to-top { right: 14px; bottom: 16px; width: 42px; height: 42px; } }

/* Textmarker in Überschriften */
h1 > span.font-normal, h2 > span.font-normal {
  background-image: linear-gradient(rgba(56,170,190,.22), rgba(56,170,190,.22));
  background-repeat: no-repeat; background-position: 0 88%; background-size: 100% .36em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Pfeile in Buttons und Links rücken beim Überfahren nach rechts */
svg:has(> path[d="M17 8l4 4m0 0l-4 4m4-4H3"]), svg:has(> path[d="M13 7l5 5m0 0l-5 5m5-5H6"]) { transition: transform .25s ease; }
a:hover svg:has(> path[d="M17 8l4 4m0 0l-4 4m4-4H3"]), a:hover svg:has(> path[d="M13 7l5 5m0 0l-5 5m5-5H6"]),
button:hover svg:has(> path[d="M17 8l4 4m0 0l-4 4m4-4H3"]) { transform: translateX(4px); }

/* Glanzstreifen auf Haupt-Buttons (nicht beim Shop-Button unten) */
a.bg-teal-600.rounded-full, a.bg-slate-900.rounded-full {
  background-image: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.26) 50%, transparent 62%);
  background-repeat: no-repeat; background-size: 260% 100%; background-position: 160% 0;
  transition: background-position .8s ease, background-color .2s ease;
}
@media (hover: hover) {
  a.bg-teal-600.rounded-full:hover, a.bg-slate-900.rounded-full:hover { background-position: -60% 0; }
}

/* Download-Einträge: Symbol wippt, Rand wird teal */
a.group.flex > span:first-child { transition: transform .25s ease; }
@media (hover: hover) { a.group.flex:hover > span:first-child { transform: translateY(-2px) rotate(-6deg) scale(1.06); } }

/* Hinweisboxen: Teal-Streifen links (wächst beim Einblenden) */
.border-l-4.border-teal-500 { border-left-width: 0; padding-left: calc(1rem + 4px); position: relative; }
.border-l-4.border-teal-500::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #1a8a9c;
  border-radius: 2px; transform-origin: top center; transition: transform .8s ease;
}

/* Textbild-Weichzeichner beim Laden verzögerter Bilder */
img.img-wait { opacity: 0; }
img { transition: opacity .5s ease; }

/* Sprungmarken: Ziel wird kurz hervorgehoben */
div[id].scroll-mt-24:target, article[id]:target { animation: dsiTargetRing 2.4s ease; }
h1:target, h2:target, h3:target { animation: dsiMark 2.4s ease; border-radius: .5rem; }
@keyframes dsiTargetRing { 0%, 40% { box-shadow: 0 0 0 4px rgba(56,170,190,.45); } 100% { box-shadow: 0 0 0 4px rgba(56,170,190,0); } }
@keyframes dsiMark { 0%, 40% { background-color: rgba(56,170,190,.28); } 100% { background-color: rgba(56,170,190,0); } }

@media (prefers-reduced-motion: no-preference) {
  /* gestaffeltes Einblenden */
  .dsi-js .st-wait { opacity: 0; }
  .st-go { animation: dsiRise .6s ease backwards; animation-delay: var(--d, 0ms); }
  @keyframes dsiRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

  /* Textmarker zieht auf */
  .dsi-js h1 > span.font-normal, .dsi-js h2 > span.font-normal { background-size: 0 .36em; transition: background-size 1s ease .35s; }
  .dsi-js h1 > span.font-normal.hl-on, .dsi-js h2 > span.font-normal.hl-on { background-size: 100% .36em; }

  /* Hinweisboxen: Streifen wächst */
  .dsi-js .border-l-4.border-teal-500:not(.cl-on)::before { transform: scaleY(0); }

  /* Parallax der Hintergrundflächen (Desktop) */
  section.from-teal-50::before { translate: 0 var(--py, 0px); }
  section.from-teal-50::after { translate: 0 calc(var(--py, 0px) * -.6); }

  /* Erfolgs-Häkchen zeichnet sich */
  path[d="M5 13l4 4L19 7"] { stroke-dasharray: 24; stroke-dashoffset: 24; animation: dsiDraw .6s ease .25s forwards; }
  @keyframes dsiDraw { to { stroke-dashoffset: 0; } }
  .w-16.h-16.bg-teal-50.rounded-full { animation: dsiPop .5s cubic-bezier(.2,1.4,.4,1) backwards; }
  @keyframes dsiPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

  /* weiche Seitenübergänge (moderne Browser) */
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
}

/* "Schnell bestellen" in der Kopfleiste: ebenfalls Lichtstreifen */
header button.bg-teal-600.rounded-full {
  background-image: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.26) 50%, transparent 62%);
  background-repeat: no-repeat; background-size: 260% 100%; background-position: 160% 0;
  transition: background-position .8s ease, background-color .2s ease;
}
@media (hover: hover) {
  header button.bg-teal-600.rounded-full:hover,
  header div[x-data*="quick"]:hover > button.bg-teal-600.rounded-full { background-position: -60% 0; }
}

/* Es gibt nur einen Nach-oben-Button: der ältere weiße wird durch den Teal-Button (.to-top) ersetzt */
.back-top { display: none !important; }
