/* ============================================================
   /projects — DARK  ·  11) GLASS – MLHA + STRUKTURA
   ------------------------------------------------------------
   Přidá všem skleněným panelům:
     · o něco hustší frost (větší blur + saturate)
     · jemnou monochromatickou zrnitost (SVG fractalNoise),
       míchanou přes soft-light → sklo vypadá „mléčné", ne ploché
   Zrno je čistě dekorativní vrstva (::before / ::after), 0 clicků.
   Síla se ladí proměnnými --psx-blur a --psx-grain-opacity.
   ============================================================ */

body.psx-dark {
  --psx-blur: 24px;                 /* bylo 18 – hustší mlha */
  --psx-grain-opacity: 0.26;        /* síla zrna 0–1 */
}

/* silnější frost na všech sklech */
body.psx-dark .psx-intro,
body.psx-dark .psx-hero,
body.psx-dark .psx-card,
body.psx-dark .psx-tile,
body.psx-dark .psx-legal,
body.psx-dark .psm-minimal-footer-inner {
  -webkit-backdrop-filter: blur(var(--psx-blur)) saturate(140%);
  backdrop-filter: blur(var(--psx-blur)) saturate(140%);
}

/* --- zrno (monochromatický šum) ---------------------------- */
body.psx-dark .psx-intro::before,
body.psx-dark .psx-hero::after,
body.psx-dark .psx-card::after,
body.psx-dark .psx-tile::after,
body.psx-dark .psx-legal::after,
body.psx-dark .psx-footer .psm-minimal-footer-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;                       /* nad obsahem, ale je to jen jemná mlha */
  pointer-events: none;
  border-radius: inherit;
  opacity: var(--psx-grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* --- jemná horní „mlžná" špička (kam padá světlo na sklo) --- */
body.psx-dark .psx-hero::before,
body.psx-dark .psx-legal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(120% 60% at 50% -10%,
              rgba(255,255,255,0.06), rgba(255,255,255,0) 70%);
}

/* --- stejná mlha i na skleněných tlačítkách / chipech / přepínači --- */
body.psx-dark .psx-btn,
body.psx-dark .psx-chip,
body.psx-dark .psx-facemode__btn,
body.psx-dark .psx-legal__back,
body.psx-dark .psm-menu-panel-grid a {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
body.psx-dark .psx-btn::after,
body.psx-dark .psx-chip::after,
body.psx-dark .psx-facemode__btn::after,
body.psx-dark .psx-legal__back::after,
body.psx-dark .psm-menu-panel-grid a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  opacity: calc(var(--psx-grain-opacity) * 1.15);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23b)'/%3E%3C/svg%3E");
  background-size: 120px 120px;
}
/* text/ikona tlačítka musí zůstat nad zrnem */
body.psx-dark .psx-btn > *,
body.psx-dark .psx-chip > *,
body.psx-dark .psx-facemode__btn > * { position: relative; z-index: 3; }
