/* ============================================================
   „Уебсайтове“: Лабораторията, осем малки опита ([plabo_web_lab]).
   Образец: .wx-lab и .lab-grid в site/src/styles/web.css.

   Мрежата: на компютър 4 колони (Тежест и Ритъм са широки, Светлина е висока),
   до 1100 px 2 колони, до 640 px една колона (плочките са почти квадратни).
   Заглавието (.wx-h2, .wx-dot) и помощниците (.wx-mag, .wx-spark) са от web.css.

   Променливи (CSS на страницата може да ги смени):
     --wl-bg      фонът на секцията
     --wl-tile    фонът на плочките
     --wl-gap     разстоянието между плочките
   ============================================================ */

.pfx.wl { background: var(--wl-bg, #07080A); color: #EDEFF1; }
.pfx.wl .wl-head { align-items: flex-end; }
.pfx.wl .wl-intro { max-width: 360px; }

/* текст за мишка или за пръст */
.pfx.wl .wl-touch { display: none; }
@media (hover: none) {
  .pfx.wl .wl-fine { display: none; }
  .pfx.wl .wl-touch { display: inline; }
}

.pfx.wl .wl-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(270px, 31vh, 340px); gap: var(--wl-gap, 14px); margin-top: 56px;
  grid-template-areas: 'weight weight light morph' 'rhythm rhythm light magnet' 'depth frame pause pause';
}
.pfx.wl .wl-tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-width: 0; padding: 22px; overflow: clip; border-radius: 16px; background: var(--wl-tile, #0E1013); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); transition: box-shadow .5s; }
.pfx.wl .wl-tile:hover { box-shadow: inset 0 0 0 1px rgba(42, 196, 234, .4); }
.pfx.wl .wl-k { position: relative; z-index: 2; font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--room, #2AC4EA); }
.pfx.wl .wl-d { position: relative; z-index: 2; max-width: 36ch; font-size: 14px; line-height: 1.5; color: rgba(237, 239, 241, .68); }
/* надписите върху снимка: горе вляво и долу */
.pfx.wl .wl-light .wl-k, .pfx.wl .wl-morph .wl-k, .pfx.wl .wl-frame .wl-k, .pfx.wl .wl-pause .wl-k { position: absolute; left: 22px; top: 22px; }
.pfx.wl .wl-light .wl-d, .pfx.wl .wl-morph .wl-d, .pfx.wl .wl-frame .wl-d, .pfx.wl .wl-pause .wl-d { position: absolute; left: 22px; right: 22px; bottom: 22px; }

/* 01 Тежест */
.pfx.wl .wl-weight { grid-area: weight; }
.pfx.wl .wl-word { font-size: clamp(40px, 5.2vw, 88px); line-height: 1; letter-spacing: -.045em; }

/* 02 Светлина: снимката в мрак, светлината около мишката (--mx, --my от web-lab.js) */
.pfx.wl .wl-light { grid-area: light; padding: 0; }
.pfx.wl .wl-fl { position: absolute; inset: 0; overflow: clip; }
.pfx.wl .wl-fl-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 30%; filter: grayscale(1); }
.pfx.wl .wl-fl-dark { position: absolute; inset: 0; background: radial-gradient(circle at var(--mx, 50%) var(--my, 42%), rgb(0 0 0 / var(--fl-core, .08)) var(--fl-in, 50px), rgb(0 0 0 / .97) var(--fl-out, 300px)); }
.pfx.wl .wl-light .wl-d { color: #fff; font-style: italic; font-size: 16px; }

/* 03 Морф: общото хиро с Morph Slider, смалено в плочката (без заглавие, без „Надолу“, без тъмнината) */
.pfx.wl .wl-morph { grid-area: morph; padding: 0; }
.pfx.wl .wl-morph-stage { position: absolute; inset: 0; }
.pfx.wl .wl-morph-stage .pfx.mh { position: absolute; inset: 0; height: 100%; min-height: 0; --mh-bg: var(--wl-tile, #0E1013); }
.pfx.wl .wl-morph-stage .pfx.mh .mh-center, .pfx.wl .wl-morph-stage .pfx.mh .mh-foot, .pfx.wl .wl-morph-stage .pfx.mh .mh-veil { display: none; }
/* първата снимка се вижда, докато дойде слайдерът (той се зарежда чак когато Лабораторията наближи) */
[data-js] .pfx.wl .wl-morph-stage .pfx.mh .mh-fallback { opacity: 1; }
.pfx.wl .wl-morph-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.pfx.wl .wl-morph .wl-k { pointer-events: none; text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
.pfx.wl .wl-morph .wl-d { color: #fff; pointer-events: none; text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }

/* 04 Ритъм: двете ленти (общата „Бягаща лента“, ускорява се при бърз скрол) */
.pfx.wl .wl-rhythm { grid-area: rhythm; }
.pfx.wl .wl-mq { margin-inline: -22px; }
.pfx.wl .wl-rt { display: inline-block; padding-right: .3em; font-size: clamp(40px, 4.8vw, 80px); line-height: 1.05; font-weight: 200; letter-spacing: -.045em; white-space: nowrap; }
.pfx.wl .wl-rt b { font-weight: 800; }
.pfx.wl .wl-mq.is-2 .wl-rt { color: var(--room, #2AC4EA); }

/* 05 Магнит */
.pfx.wl .wl-magnet { grid-area: magnet; }
.pfx.wl .wl-mag-area { position: relative; flex: 1; min-height: 150px; }
.pfx.wl .wl-spark { position: absolute; inset: 0; display: grid; place-items: center; }
/* Salient дава на всеки <button> border-radius: 4px !important и свои отстъпи */
.pfx.wl .wl-mag-btn { display: grid; place-items: center; width: 128px; height: 128px; margin: 0; padding: 0 !important; border: 0; border-radius: 50% !important; background: var(--room, #2AC4EA); color: #0B2530; font-family: inherit; font-size: 15px; font-weight: 800; line-height: 1; letter-spacing: 0; text-transform: none; cursor: pointer; transition: transform .6s var(--ease-out, ease-out), box-shadow .6s; }
.pfx.wl .wl-mag-btn:hover { transform: scale(1.07); box-shadow: 0 20px 60px -10px rgba(42, 196, 234, .55); }
.pfx.wl .wl-mag-btn:active { transform: scale(.94); }
.pfx.wl .wl-mag-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* 06 Дълбочина: картата се накланя, двата надписа са на различна дълбочина */
.pfx.wl .wl-depth { grid-area: depth; }
.pfx.wl .wl-card { position: relative; flex: 1; min-height: 0; border-radius: 12px; transform-style: preserve-3d; }
.pfx.wl .wl-card-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 12px; }
.pfx.wl .wl-l1, .pfx.wl .wl-l2 { position: absolute; color: #fff; text-shadow: 0 4px 30px rgba(0, 0, 0, .5); pointer-events: none; }
.pfx.wl .wl-l1 { left: 16px; top: 14px; transform: translateZ(60px); font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.pfx.wl .wl-l2 { right: 16px; bottom: 14px; transform: translateZ(100px); font-size: 24px; font-weight: 200; font-style: italic; }

/* 07 Кадър: визьорът и данните на снимката */
.pfx.wl .wl-frame { grid-area: frame; padding: 0; }
.pfx.wl .wl-frame-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; filter: grayscale(1) brightness(.78); transition: filter .8s; }
.pfx.wl .wl-frame:hover .wl-frame-img { filter: grayscale(.2) brightness(.9); }
.pfx.wl .wl-box { position: absolute; left: calc(50% - 60px); top: calc(50% - 45px); z-index: 2; width: 120px; height: 90px; pointer-events: none; }
.pfx.wl .wl-box::before, .pfx.wl .wl-box::after, .pfx.wl .wl-box i::before, .pfx.wl .wl-box i::after { content: ''; position: absolute; width: 18px; height: 18px; border: 0 solid #fff; }
.pfx.wl .wl-box::before { left: 0; top: 0; border-width: 2px 0 0 2px; }
.pfx.wl .wl-box::after { right: 0; top: 0; border-width: 2px 2px 0 0; }
.pfx.wl .wl-box i::before { left: 0; bottom: 0; border-width: 0 0 2px 2px; }
.pfx.wl .wl-box i::after { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.pfx.wl .wl-read { position: absolute; right: 22px; top: 22px; z-index: 2; font-size: 11px; letter-spacing: .08em; color: #fff; font-variant-numeric: tabular-nums; }
.pfx.wl .wl-frame .wl-d { color: #fff; }

/* 08 Пауза: кръгът диша 10 s (4 s вдишване, 6 s издишване); движи се само докато се вижда */
.pfx.wl .wl-pause { grid-area: pause; align-items: center; justify-content: center; text-align: center; }
.pfx.wl .wl-circle { position: absolute; left: 50%; top: 50%; width: min(64%, 280px); aspect-ratio: 1; transform: translate(-50%, -50%); }
.pfx.wl .wl-circle i { position: absolute; inset: 0; border-radius: 50%; background: rgba(42, 196, 234, .07); box-shadow: inset 0 0 0 1px rgba(42, 196, 234, .55); transform: scale(.55); animation: wl-breath 10s ease-in-out infinite; animation-play-state: paused; }
.pfx.wl[data-vis] .wl-circle i, html:not([data-js]) .pfx.wl .wl-circle i { animation-play-state: running; }
@keyframes wl-breath { 0% { transform: scale(.55); } 40% { transform: scale(1); } 100% { transform: scale(.55); } }
.pfx.wl .wl-breath { position: relative; z-index: 2; font-size: clamp(34px, 3.6vw, 58px); font-weight: 200; font-style: italic; letter-spacing: -.03em; transition: opacity .25s; }
.pfx.wl .wl-breath.is-swap { opacity: 0; }
.pfx.wl .wl-pause .wl-d { text-align: left; }

/* ---------- таблет и телефон ---------- */
@media (max-width: 1100px) {
  .pfx.wl .wl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: 'weight weight' 'light morph' 'light magnet' 'rhythm rhythm' 'depth frame' 'pause pause'; }
}
@media (max-width: 640px) {
  .pfx.wl .wl-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(330px, 92vw); gap: 18px; margin-top: 40px; grid-template-areas: 'weight' 'light' 'morph' 'magnet' 'rhythm' 'depth' 'frame' 'pause'; }
  .pfx.wl .wl-word { font-size: clamp(40px, 13vw, 64px); }
  .pfx.wl .wl-rt { font-size: clamp(36px, 12vw, 60px); }
}

/* ---------- намалено движение: всичко стои ---------- */
@media (prefers-reduced-motion: reduce) {
  .pfx.wl .wl-circle i { animation: none; transform: scale(.8); }
  .pfx.wl .wl-tile, .pfx.wl .wl-frame-img, .pfx.wl .wl-mag-btn, .pfx.wl .wl-breath { transition: none; }
  .pfx.wl .wl-mag-btn:hover, .pfx.wl .wl-mag-btn:active { transform: none; }
}
