/* Homepage hero slider (2026-11-25). Swiss style: paper, ink, one amber accent, square corners.
   Loaded on the homepage only, after site.css. Works without JS (first slide only). */

.n-hero--slides { position: relative; overflow: hidden; isolation: isolate; }

/* faint Swiss column lines */
.hx-lines { position: absolute; inset: 0; z-index: -1; pointer-events: none; display: grid; grid-template-columns: repeat(4, 1fr); max-width: var(--wrap, 1280px); margin-inline: auto; padding-inline: clamp(20px, 4vw, 48px); }
.hx-lines i { border-left: 1px solid rgba(17,17,16,.07); transform: translate3d(calc(var(--mx, 0) * -6px), 0, 0); transition: transform .9s var(--ease); }
.hx-lines i:last-child { border-right: 1px solid rgba(17,17,16,.07); }

.n-hero--slides .n-hero-grid { align-items: center; }

/* ---- copy ---- */
.hx-texts { display: grid; }
.hx-text { grid-area: 1 / 1; align-self: start; }
.hx-text:not(.is-active) { visibility: hidden; }
.hx-num { font-family: var(--lbi-mono); }

.n-hero--slides .hx-h { font-size: clamp(2.6rem, 1.2rem + 3.7vw, 4.6rem); line-height: .98; letter-spacing: -.035em; font-weight: 700; color: var(--lbi-black); max-width: 13ch; margin: var(--s-4) 0; }
.hx-l1, .hx-l2 { display: block; }
.hx-l2 mark { color: inherit; background: linear-gradient(var(--lbi-accent), var(--lbi-accent)) 0 88% / 100% .26em no-repeat; padding: 0 .04em; }
.n-hero--slides .lead { max-width: 32rem; }

/* controls */
.hx-ctrl { display: none; align-items: center; gap: 18px; margin-top: var(--s-7); font-family: var(--lbi-mono); font-size: var(--fs-label); letter-spacing: .12em; color: var(--lbi-black); }
.js-hx .hx-ctrl { display: flex; }
.hx-btn { appearance: none; background: none; border: 0; padding: 10px 4px; cursor: pointer; color: var(--lbi-black); line-height: 0; }
.hx-btn svg { width: 46px; height: 12px; transition: transform .35s var(--ease); }
.hx-prev:hover svg { transform: translateX(-6px); }
.hx-next:hover svg { transform: translateX(6px); }
.hx-btn:focus-visible { outline: 2px solid var(--lbi-black); outline-offset: 2px; }
.hx-count b { font-weight: 600; }
.hx-bar { position: relative; width: 96px; height: 2px; background: var(--lbi-border); overflow: hidden; }
.hx-bar i { position: absolute; inset: 0; background: var(--lbi-accent); transform-origin: 0 50%; transform: scaleX(0); }
.hx-pause { margin-left: 4px; font: inherit; letter-spacing: inherit; text-transform: uppercase; color: var(--lbi-grey); padding: 10px 0; }
.hx-pause:hover { color: var(--lbi-black); }

/* ---- visuals ---- */
.hx-visuals { position: relative; }
.hx-depth { display: grid; }
.hx-vis { grid-area: 1 / 1; align-self: center; margin: 0; position: relative; }
.hx-vis:not(.is-active):not(.is-prev) { visibility: hidden; }
.hx-vis.is-active { z-index: 2; }
.hx-vis.is-prev { z-index: 1; }
.hx-vis .wa-phone, .hx-vis .hx-cap { transition: opacity .3s var(--ease); }
.hx-vis.is-prev .wa-phone, .hx-vis.is-prev .hx-cap { opacity: 0; }
.hx-vis .shot { border: 1px solid var(--lbi-black); background: #fff; overflow: hidden; }
.hx-vis .shot img { display: block; width: 100%; height: auto; }
.hx-cap { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-family: var(--lbi-mono); font-size: var(--fs-label); letter-spacing: .12em; text-transform: uppercase; color: var(--lbi-grey); }
.hx-cap::before { content: ""; width: 8px; height: 8px; background: var(--lbi-accent); flex: none; }
.hx-vis.n-visual--combo { padding-bottom: 150px; }
.hx-vis.n-visual--combo .hx-cap { position: absolute; right: 0; bottom: 118px; margin: 0; }

/* amber block that drifts behind the visual (the slider's moving shape) */
.hx-block { position: absolute; z-index: 0; width: 34%; aspect-ratio: 1; background: var(--lbi-accent); right: -5%; top: -7%; transition: transform 1.1s var(--ease), width 1.1s var(--ease); transform: translate3d(calc(var(--mx, 0) * 14px), calc(var(--my, 0) * 14px), 0); }
.hx-depth { position: relative; z-index: 1; transform: translate3d(calc(var(--mx, 0) * -8px), calc(var(--my, 0) * -8px), 0); transition: transform .9s var(--ease); }
.n-hero--slides[data-slide="1"] .hx-block { width: 26%; transform: translate3d(calc(-260% + var(--mx, 0) * 14px), calc(250% + var(--my, 0) * 14px), 0); }
.n-hero--slides[data-slide="2"] .hx-block { width: 22%; transform: translate3d(calc(20% + var(--mx, 0) * 14px), calc(330% + var(--my, 0) * 14px), 0); }

/* ---- motion (only once JS is running and motion is allowed) ---- */
@media (prefers-reduced-motion: no-preference) {
  .js-hx .hx-text .n-eyebrow,
  .js-hx .hx-text .hx-l1,
  .js-hx .hx-text .hx-l2,
  .js-hx .hx-text .lead { opacity: 0; filter: blur(8px); transform: translate3d(0, .35em, 0); transition: opacity .7s var(--ease), filter .7s var(--ease), transform .8s var(--ease); }
  .js-hx .hx-text.is-active .n-eyebrow { transition-delay: .05s; }
  .js-hx .hx-text.is-active .hx-l1 { transition-delay: .12s; }
  .js-hx .hx-text.is-active .hx-l2 { transition-delay: .26s; }
  .js-hx .hx-text.is-active .lead { transition-delay: .4s; }
  .js-hx .hx-text.is-active .n-eyebrow,
  .js-hx .hx-text.is-active .hx-l1,
  .js-hx .hx-text.is-active .hx-l2,
  .js-hx .hx-text.is-active .lead { opacity: 1; filter: none; transform: none; }
  /* before hero.js starts: hold the first slide hidden (no flash), with a failsafe if the script never runs */
  .js-hx:not(.hx-on) .hx-text .n-eyebrow,
  .js-hx:not(.hx-on) .hx-text .hx-l1,
  .js-hx:not(.hx-on) .hx-text .hx-l2,
  .js-hx:not(.hx-on) .hx-text .lead { opacity: 0; animation: hx-show .01s 2.5s forwards; }
  .js-hx .hx-text.is-leaving { visibility: visible; }
  .js-hx .hx-text.is-leaving > * { opacity: 0 !important; filter: blur(6px) !important; transform: translate3d(0, -.25em, 0) !important; transition-duration: .4s !important; transition-delay: 0s !important; }
  .js-hx .hx-l2 mark { background-size: 0% .26em; transition: background-size .7s var(--ease) .55s; }
  .js-hx.hx-on .hx-text.is-active .hx-l2 mark { background-size: 100% .26em; }

  .js-hx .hx-vis.is-active { animation: hx-wipe-r 1.05s var(--ease) backwards; } /* backwards only: no clip left behind (the phone overhangs the frame) */
  .js-hx.is-back .hx-vis.is-active { animation-name: hx-wipe-l; }
  .js-hx .hx-vis.is-active .shot img { animation: hx-zoom 1.6s var(--ease) both; }
  .js-hx.is-first .hx-vis.is-active,
  .js-hx.is-first .hx-vis.is-active .shot img { animation: none; }
  .js-hx .hx-bar i.run { animation: hx-bar var(--hx-ms, 6500ms) linear forwards; }
  .js-hx.is-paused .hx-bar i.run { animation-play-state: paused; }
}
@keyframes hx-wipe-r { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes hx-wipe-l { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes hx-zoom { from { transform: scale(1.07); } to { transform: none; } }
@keyframes hx-show { to { opacity: 1; filter: none; transform: none; } }
@keyframes hx-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  .hx-block, .hx-depth, .hx-lines i { transition: none; transform: none !important; }
  .hx-pause { display: none; }
}

/* ---- smaller screens ---- */
@media (max-width: 1024px) {
  .hx-lines { grid-template-columns: repeat(3, 1fr); }
  .hx-lines i:nth-child(4) { display: none; }
}
@media (max-width: 900px) {
  .hx-visuals { margin-top: var(--s-5); max-width: 560px; }
  .hx-block { width: 28%; right: -3%; }
  .hx-ctrl { margin-top: var(--s-6); }
}
@media (max-width: 600px) {
  .n-hero--slides .hx-h { font-size: clamp(2.3rem, 1rem + 7vw, 3rem); }
  .hx-lines { grid-template-columns: repeat(2, 1fr); }
  .hx-lines i:nth-child(n+3) { display: none; }
  .hx-vis.n-visual--combo { padding-bottom: 120px; }
  .hx-vis.n-visual--combo .hx-cap { display: none; }
  .hx-bar { width: 56px; }
}
