/**
 * Konform. — globale Styles + Custom Cursor (Desktop)
 * mix-blend-mode: Kontrast auf hell/dunkel; reduced-motion = Systemcursor
 */

:root {
  --cursor-dot: #c47e2c;
  --cursor-ring: rgba(28, 31, 38, 0.85);
  --cursor-smooth: 0.18;
}

/* Nur Desktop: Custom Cursor aktiv wenn JS die Klasse setzt */
html.custom-cursor-active,
html.custom-cursor-active body {
  cursor: none;
}

/* Fallback: Touch / reduced motion / kein JS */
@media (hover: none), (pointer: coarse) {
  html.custom-cursor-active,
  html.custom-cursor-active body {
    cursor: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.custom-cursor-active,
  html.custom-cursor-active body {
    cursor: auto;
  }
}

/* Custom Cursor Container */
.custom-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 99999;
  pointer-events: none;
  mix-blend-mode: exclusion;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cc-layer {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

html.custom-cursor-ready .custom-cursor {
  opacity: 1;
}

.custom-cursor__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 9999px;
  background: #fff;
  transform: translate3d(0, 0, 0);
}

.custom-cursor__ring {
  position: absolute;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  transform: translate3d(0, 0, 0) scale(1);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Kontext via :has() — Cursor reagiert auf Hover-Ziele unter dem Pointer */
body:has(a:hover) .custom-cursor__ring,
body:has(button:hover) .custom-cursor__ring,
body:has([role="button"]:hover) .custom-cursor__ring,
body:has(input:hover) .custom-cursor__ring,
body:has(textarea:hover) .custom-cursor__ring,
body:has(select:hover) .custom-cursor__ring,
body:has(summary:hover) .custom-cursor__ring,
body:has(.cursor-magnetic:hover) .custom-cursor__ring {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  transform: translate3d(0, 0, 0) scale(1.05);
}

body:has(img:hover) .custom-cursor__ring,
body:has(article:hover) .custom-cursor__ring,
body:has(figure:hover) .custom-cursor__ring {
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 18px;
  transform: translate3d(0, 0, 0) scale(1.02);
}

body:has(a:hover) .custom-cursor__dot,
body:has(button:hover) .custom-cursor__dot,
body:has([role="button"]:hover) .custom-cursor__dot {
  transform: translate3d(0, 0, 0) scale(1.35);
}

/* Grain overlay utility */
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* Subnav animation */
.nav-dd {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.nav-group:hover .nav-dd,
.nav-group:focus-within .nav-dd {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body.pp-modal-open {
  overflow: hidden;
}
