/* Home hero (v6): full-bleed photo slideshow.
   Markup: _src/pages/index.html (section.hlab). Behaviour: assets/js/hero-lab.js. */

/* ------------------------------------------------------------------ shared */
.hero.hlab {
  --c1: var(--teal); --c2: var(--blue); --c3: #3a3fbf; --c4: var(--violet);
  --hl-h: calc(100svh - var(--header-h) - 37px);
  display: block; padding: 0; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #F3F7FB, var(--bg) 92%);
}
[data-theme="dark"] .hero.hlab { --c3: #8a8cff; background: var(--bg); }
.hlab ~ .products { padding-top: var(--sec); padding-bottom: clamp(48px, 5vw, 96px); }

.hl-panel {
  position: relative;
  min-height: var(--hl-h);
  padding: clamp(28px, 4vw, 56px) var(--gutter) clamp(84px, 10vh, 112px);
  display: grid; align-content: center; grid-template-columns: minmax(0, 1fr);
}
.hl-panel[hidden] { display: none; }
.hl-copy { position: relative; z-index: 2; container-type: inline-size; }
.hlab .hero-title {
  margin: clamp(20px, 2.6vw, 36px) 0 clamp(22px, 2.4vw, 34px);
  --hl-fs: clamp(40px, 6.4vw, 124px);
  font-size: min(var(--hl-fs), 7.4cqi); /* hero-lab.js refines this to the exact fit */
  line-height: .98; letter-spacing: -0.04em;
}
.hlab .hero-title .l1 { color: var(--fg-3); }
.hlab .hero-title .l2 { text-align: left; }
.hlab .hero-title .line > span { white-space: nowrap; }
.hlab .lead { margin-bottom: 30px; text-wrap: pretty; }
@media (min-width: 768px) { .hl-copy > :is(.label, .lead, .actions) { zoom: 1.12; } }

/* ------------------------------------------------------------- full bleed */
.hl-bleed {
  --shade: var(--bg);
  align-content: start; padding-top: clamp(40px, 8vh, 96px); padding-bottom: clamp(84px, 11vh, 120px);
  overflow: hidden; isolation: isolate; background: #e9eef2;
}
.bl-world { position: absolute; inset: -2.5%; z-index: -2; transition: transform 1.4s var(--ease-out); }
.bl-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1.3s ease, visibility 0s 1.3s; }
.bl-slide.is-on { opacity: 1; visibility: visible; transition: opacity 1.3s ease, visibility 0s; z-index: 1; }
.bl-world picture, .bl-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.bl-img { object-fit: cover; object-position: var(--pos, 50% 50%); }
/* a slow settle as each photo arrives; it ends at full size so the photo is sharp while it is read */
.bl-slide.is-on .bl-img { animation: blsettle 2.4s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes blsettle { from { transform: scale(1.045); } to { transform: none; } }
.bl-tags { position: absolute; inset: 0; }
.bl-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  /* fade only behind the text (top left), so the rest of the photo stays at full clarity */
  background: linear-gradient(90deg, color-mix(in srgb, var(--shade) 90%, transparent) 0%, color-mix(in srgb, var(--shade) 84%, transparent) 36%, color-mix(in srgb, var(--shade) 45%, transparent) 50%, transparent 63%); }
.bl-copy { max-width: 100%; }
/* wide screens: the text owns the left column, top to bottom: label, big headline, then lead and buttons at the foot */
@media (min-width: 1024px) {
  .hl-bleed { align-content: stretch; grid-template-rows: minmax(0, 1fr); padding-top: clamp(36px, 6vh, 72px); padding-bottom: clamp(76px, 10vh, 112px); }
  .bl-copy { display: flex; flex-direction: column; max-width: min(54vw, 920px); container-type: normal; }
  .hlab .hl-bleed .hero-title { --hl-fs: min(7.2vw, 11.6vh, 136px); margin: clamp(18px, 3vh, 36px) 0 0; line-height: .96; letter-spacing: -0.045em; }
  .hlab .hl-bleed .hero-title .line > span { white-space: normal; text-wrap: balance; }
  .bl-copy .lead { margin: auto 0 0; padding-top: clamp(24px, 4vh, 48px); max-width: 30rem; zoom: 1; font-size: clamp(17px, 1.3vw, 21px); line-height: 1.5; }
  .bl-copy .actions { margin-top: clamp(20px, 3vh, 32px); zoom: 1; }
  .bl-copy .label { zoom: 1; }
  .bl-shade { background: linear-gradient(90deg, color-mix(in srgb, var(--shade) 80%, transparent) 0%, color-mix(in srgb, var(--shade) 72%, transparent) 36%, color-mix(in srgb, var(--shade) 38%, transparent) 50%, transparent 62%); }
}
.hlab .hl-bleed .hero-title .l1 { color: var(--slate); }
[data-theme="dark"] .hlab .hl-bleed .hero-title .l1 { color: var(--mist); }
.hl-bleed .lead { color: var(--fg); max-width: 34rem; }
.bl-foot2 { position: absolute; right: var(--gutter); bottom: 22px; z-index: 2; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 2 * var(--gutter)); }
.bl-dots { display: flex; gap: 4px; padding: 6px 8px; border-radius: 999px; background: rgba(255, 255, 255, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.bl-dot { position: relative; width: 22px; height: 14px; padding: 0; border: 0; background: none; cursor: pointer; }
.bl-dot::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 2px; background: rgba(41, 53, 60, .22); }
.bl-dot s { position: absolute; left: 0; top: 6px; height: 2px; width: 0; border-radius: 2px; background: var(--pc, #29353C); }
.bl-dot[aria-current="true"] s { animation: bldot var(--bl-dur, 5s) linear forwards; }
.bl-dots.is-paused .bl-dot s { animation-play-state: paused; }
@keyframes bldot { to { width: 100%; } }
.bl-credit { position: static; display: flex; align-items: center; gap: 9px; min-width: 0; white-space: nowrap; overflow: hidden; transition: opacity .4s; padding: 5px 10px 5px 8px; border-radius: 999px; background: rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font: 400 10.5px/1.2 var(--mono); letter-spacing: .06em; color: #44576D; }
.bl-src { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* the product this photo shows, in that product's colour; links to its page */
.bl-prod { flex: none; display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px/1.2 var(--sans); letter-spacing: 0; color: var(--pc, #29353C); text-decoration: none; }
.bl-prod > i { width: 7px; height: 7px; border-radius: 50%; background: var(--pc, #29353C); }
.bl-prod:hover span { text-decoration: underline; text-underline-offset: 2px; }
.bl-prod + .bl-src { padding-left: 9px; border-left: 1px solid rgba(41, 53, 60, .2); }
.bl-tag { position: absolute; left: 0; top: 0; display: flex; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity .6s var(--ease-out); }
.bl-tag.is-on { opacity: 1; }
.bl-tag[hidden] { display: none; }
.bl-tag > i { position: relative; flex: none; width: 12px; height: 12px; margin: 0 0 -6px -6px; border-radius: 50%; background: var(--pc, var(--c1)); box-shadow: 0 0 0 3px rgba(255, 255, 255, .8); }
.bl-tag > i::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 1.5px solid var(--pc, var(--c1)); animation: blping 2.4s var(--ease-out) infinite; }
@keyframes blping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.bl-tag > span { position: relative; display: grid; gap: 3px; margin: 0 0 22px 18px; padding: 9px 13px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 14px 30px -14px rgba(20, 30, 40, .45); white-space: nowrap;
  clip-path: inset(0 100% 0 0 round 12px); transition: clip-path .7s cubic-bezier(.7, 0, .2, 1) .15s; }
.bl-tag.is-on > span { clip-path: inset(0 0 0 0 round 12px); }
.bl-tag > span::before { content: ""; position: absolute; left: -18px; bottom: -16px; width: 18px; height: 16px; border-left: 1.5px solid rgba(255, 255, 255, .9); border-top: 1.5px solid rgba(255, 255, 255, .9); transform: skewX(-42deg); transform-origin: left top; }
.bl-tag b { font: 500 13.5px/1.2 var(--sans); color: #1b2227; }
.bl-tag em { font: normal 400 11px/1.2 var(--mono); letter-spacing: .05em; color: var(--pc, #0b6f7c); }
.bl-tag.is-left { flex-direction: row-reverse; }
.bl-tag.is-left > i { margin: 0 -6px -6px 0; }
.bl-tag.is-left > span { margin: 0 18px 22px 0; }
.bl-tag.is-left > span::before { left: auto; right: -18px; border-left: 0; border-right: 1.5px solid rgba(255, 255, 255, .9); transform: skewX(42deg); transform-origin: right top; }
[data-theme="dark"] .hl-bleed { background: #12181c; }
[data-theme="dark"] .bl-img { filter: brightness(.82); }
@media (max-width: 760px) {
  .hlab .hl-bleed .hero-title { --hl-fs: clamp(40px, 12.4vw, 64px); line-height: 1; }
  .hlab .hl-bleed .hero-title .line > span { white-space: normal; }
  .bl-img { object-position: 70% 50%; }
  .bl-shade { background: linear-gradient(180deg, color-mix(in srgb, var(--shade) 94%, transparent) 0%, color-mix(in srgb, var(--shade) 82%, transparent) 46%, transparent 72%); }
  .bl-tag b { font-size: 12px; } .bl-tag em { font-size: 10px; }
  .bl-foot2 { left: var(--gutter); right: auto; } .bl-src { display: none; }
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hlab *, .hlab *::before, .hlab *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
