/* ═══════════════════════════════════════════════════════════════
   85millimeter · LENS LAYER V5 · zentrale Datei für alle Seiten
   Seitenübergänge (Bucket Render · Kamerafahrt) · AF-Cursor ·
   Filmkorn · Magnet-Buttons · Vorladen beim Überfahren.
   Ablage: /wp-content/uploads/js/85mm/  (per FTP, neben three.min.js)
   Nach jeder Änderung in allen Seiten ?v= hochzählen (Zeile ganz
   unten im Seitencode), sonst zeigen Browser die alte Datei.
═══════════════════════════════════════════════════════════════ */
  :root { --lx-af: #9fdcaa; --lx-ease: cubic-bezier(.23,1,.32,1); }

  /* Bucket Render: Kachelraster zwischen Kopf- und Fußleiste */
  #lx-bk { position: fixed; left: 0; right: 0; z-index: 148; pointer-events: none; display: grid; visibility: hidden; --c: #e6e6e6; }
  #lx-bk.on { visibility: visible; }
  #lx-bk.block { pointer-events: auto; }
  #lx-bk i { position: relative; display: block; opacity: 0; background-color: #070707; box-shadow: inset 0 0 0 0.5px rgba(245,245,245,0.07); }
  #lx-bk.wire i { background-image: linear-gradient(to top right, transparent calc(50% - 0.5px), rgba(245,245,245,0.07) 50%, transparent calc(50% + 0.5px)); }
  #lx-bk b {
    position: absolute; inset: 3px; opacity: 0;
    background:
      linear-gradient(var(--c), var(--c)) left top / 10px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) left top / 1.5px 10px no-repeat,
      linear-gradient(var(--c), var(--c)) right top / 10px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) right top / 1.5px 10px no-repeat,
      linear-gradient(var(--c), var(--c)) left bottom / 10px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) left bottom / 1.5px 10px no-repeat,
      linear-gradient(var(--c), var(--c)) right bottom / 10px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) right bottom / 1.5px 10px no-repeat;
  }
  #lx-bk.nocorners b { display: none; }

  /* Anzeige (Zähler / Schärfe) */
  #lx-hud {
    position: fixed; left: 64px; bottom: 16px; z-index: 149; pointer-events: none; opacity: 0;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 10px; letter-spacing: 0.14em; line-height: 1.2; color: rgba(245,245,245,0.8);
    background: rgba(0,0,0,0.65); padding: 6px 10px; border: 1px solid rgba(245,245,245,0.1); white-space: nowrap;
  }
  @media (max-width: 1024px) { #lx-hud { left: 40px; } }
  @media (max-width: 768px)  { #lx-hud { left: 22px; } }

  /* Filmkorn */
  #lx-grain {
    position: fixed; inset: -10%; z-index: 9997; pointer-events: none; opacity: 0.055;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px; animation: lxGrain 0.9s steps(6) infinite;
  }
  @keyframes lxGrain {
    0%   { transform: translate(0, 0); }
    20%  { transform: translate(-4%, 3%); }
    40%  { transform: translate(3%, -4%); }
    60%  { transform: translate(-5%, -2%); }
    80%  { transform: translate(4%, 4%); }
    100% { transform: translate(0, 0); }
  }

  /* AF-Cursor (nur Maus) */
  html.lx-cursor, html.lx-cursor * { cursor: none !important; }
  html.lx-cursor input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]),
  html.lx-cursor textarea, html.lx-cursor select, html.lx-cursor [contenteditable="true"] { cursor: text !important; }
  #lx-cur { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity 0.25s ease; }
  #lx-cur.is-on { opacity: 1; }
  #lx-cur.is-off { opacity: 0 !important; }
  #lx-cur:not(.is-lock) { mix-blend-mode: difference; }
  #lx-cur .lx-c { position: absolute; left: 0; top: 0; width: 9px; height: 9px; border: 0 solid #fff; will-change: transform; transition: border-color 0.25s ease; }
  #lx-cur .lx-c1 { border-left-width: 1.5px; border-top-width: 1.5px; }
  #lx-cur .lx-c2 { border-right-width: 1.5px; border-top-width: 1.5px; }
  #lx-cur .lx-c3 { border-left-width: 1.5px; border-bottom-width: 1.5px; }
  #lx-cur .lx-c4 { border-right-width: 1.5px; border-bottom-width: 1.5px; }
  #lx-cur.is-lock .lx-c { border-color: var(--lx-af); }
  #lx-cur .lx-dot { position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 50%; background: #fff; will-change: transform; }
  #lx-cur.is-lock .lx-dot { background: var(--lx-af); }
  #lx-cur .lx-lbl {
    position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform;
    font: 600 10px/1 'Work Sans', sans-serif; letter-spacing: 0.18em; text-transform: uppercase;
    color: #000; background: var(--lx-af); padding: 6px 9px; opacity: 0; transition: opacity 0.2s ease;
  }
  #lx-cur.has-lbl .lx-lbl { opacity: 1; }

  /* V5 · Sprachumschalter: sichtbarer Fokus nur bei Tastatur */
  .lang-opt:focus { outline: none; }
  .lang-opt:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

  @media (prefers-reduced-motion: reduce) { #lx-grain { animation: none; } }
  @media print { #lx-grain, #lx-cur, #lx-bk, #lx-hud, #lx-boot { display: none !important; } }
