/* Smile4U · „Näher" · the first-view sheet, round 2.
   David 2026-11-17: "make the preloader longer and ux aware but also add some info there that can already keep the
   person engaged"; then, on the first version (a ledger hung from a line): "preloader is okay but add the logo as
   well, and the info there should look more like popups and it needs to smoothly transition into the hero".

   One idea: the sheet is the hero's own ground (mist) with the logo in its middle, and the practice's four facts
   arrive around it as the same small paper cards the hero carries (address, languages, a tappable phone number,
   today's hours). When the page is loaded (pre.js) nothing is pulled away: the cards close, the ground dissolves
   into the hero behind it, and the logo travels to its place in the header.
   The hairline under the logo is the page's real loading (--nxp, 0…1). */
html.js.pld-on .pld.nxp { display: block; background: var(--mist); }
.nxp .pld-in { position: absolute; inset: 0; display: block; }
.nxp-mark { position: absolute; left: 50%; top: 50%; width: 200px; margin: -52px 0 0 -100px; display: grid; justify-items: center; gap: 24px; }
.nxp .pld-logo { display: block; width: 200px; height: auto; transform-origin: 0 0; }
.nxp .pld-rule { width: 200px; background: rgba(26, 26, 24, .1); }
html.js.pld-on .pld.nxp .pld-fill { background: var(--ink); transform: scaleX(var(--nxp, 0)); transition: transform .3s linear; }

/* the four cards: the hero's card (components.css .card), smaller; each a little off the level, as on the hero */
.nxp-card {
  position: absolute; margin: 0; padding: 14px 22px 16px; border-radius: var(--r-sm); background: var(--paper); color: var(--ink);
  box-shadow: 0 14px 34px -18px rgba(26, 26, 24, .22);
  width: max-content; max-width: calc(100% - 2 * var(--side));
}
.nxp-l { display: block; font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--ink-64); }
.nxp-v { display: block; margin-top: 2px; font-size: clamp(20px, 1.6vw, 26px); line-height: 1.3; letter-spacing: -0.02em; }
.nxp-v a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: rgba(26, 26, 24, .3); }
.nxp-v a:hover { text-decoration-color: currentColor; }
.nxp-v a:focus-visible, .nxp-skip:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 2px; }
.nxp-nb { white-space: nowrap; }
.nxp-card--1 { left: max(var(--side), calc(50% - 600px)); top: 22%; rotate: -2deg; }
.nxp-card--2 { right: max(var(--side), calc(50% - 560px)); top: 17%; rotate: 1.5deg; }
.nxp-card--3 { right: max(var(--side), calc(50% - 620px)); bottom: 19%; rotate: -1.5deg; }
.nxp-card--4 { left: max(var(--side), calc(50% - 540px)); bottom: 15%; rotate: 2deg; }
/* today's hours come from the page itself (js/core/cards.js fills them, pre.js copies the sentence): no card until then */
.nxp .nxp-card--4 { visibility: hidden; animation: none; }
html.js .nxp .nxp-card--4.is-in { visibility: visible; }

/* purpose: the cards pop in one after the other, so the sheet is read in order while the page loads */
html.js:not(.rm) .nxp-card { animation: nxp-pop .5s var(--ease-ui) both; }
html.js:not(.rm) .nxp-card--1 { animation-delay: .25s; }
html.js:not(.rm) .nxp-card--2 { animation-delay: .55s; }
html.js:not(.rm) .nxp-card--3 { animation-delay: .85s; }
html.js:not(.rm) .nxp .nxp-card--4.is-in { animation: nxp-pop .5s var(--ease-ui) both; }
@keyframes nxp-pop { from { opacity: 0; translate: 0 14px; scale: .96; } }

/* a slow line: after 4 s the visitor may open the page as it is (pre.js sets html.nxp-late) */
.nxp-skip {
  position: absolute; left: 50%; bottom: 28px; translate: -50% 0; padding: 8px 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: var(--fs-ui); color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease-ui), visibility 0s .3s;
}
html.nxp-late:not(.pld-out) .nxp-skip { opacity: 1; visibility: visible; transition: opacity .3s var(--ease-ui); }
.nxp-gate { display: none; }

/* ---------- the hand-over into the hero (html.pld-out; replaces v8's "the sheet lifts off") ----------
   purpose: the first screen is not uncovered, it is arrived at. Cards close (0.3 s), the ground dissolves into the
   hero's same ground behind it, and the logo travels to the header's logo (pre.js measures where that will stand:
   --nxp-x/y/s). The header's own logo is held back until the sheet is gone, so there is one logo the whole way.
   The ground's fade is the last movement to end: v8's preloader.js takes the sheet out on that transition's end. */
html.js.pld-on .nav-logo img { visibility: hidden; }
html.js.pld-on.pld-out:not(.rm) .pld.nxp {
  transform: none; pointer-events: none; background-color: rgba(237, 243, 247, 0);
  transition: background-color .6s var(--ease-ui) .35s;
}
html.js.pld-on.pld-out:not(.rm) .nxp .pld-logo {
  transform: translate3d(var(--nxp-x, 0px), var(--nxp-y, 0px), 0) scale(var(--nxp-s, 1));
  transition: transform .8s cubic-bezier(.22, .8, .24, 1);      /* fast away from the middle: it is at the header before the headline under it has faded in */
}
html.js.pld-on.pld-out:not(.rm) .nxp .pld-rule { opacity: 0; transition: opacity .2s linear; }
html.js.pld-on.pld-out:not(.rm) .nxp-card { opacity: 0; translate: 0 -10px; scale: .97; transition: opacity .3s var(--ease-ui), translate .3s var(--ease-ui), scale .3s var(--ease-ui); animation: none; }
html.js.pld-on.pld-out:not(.rm) .nxp-card--2 { transition-delay: .05s; }
html.js.pld-on.pld-out:not(.rm) .nxp-card--3 { transition-delay: .1s; }
html.js.pld-on.pld-out:not(.rm) .nxp-card--4 { transition-delay: .15s; }
html.js.pld-on.pld-out .nxp-skip { opacity: 0; visibility: hidden; }

@media (max-width: 809.98px) {
  .nxp-mark { top: 21%; width: 148px; margin: -36px 0 0 -74px; gap: 18px; }
  .nxp .pld-logo, .nxp .pld-rule { width: 148px; }
  .nxp-card { padding: 11px 16px 12px; max-width: calc(100% - 44px); }
  .nxp-v { font-size: 17px; }
  .nxp-card--1 { left: 16px; right: auto; top: 37%; bottom: auto; }
  .nxp-card--2 { right: 16px; left: auto; top: calc(37% + 78px); bottom: auto; }
  .nxp-card--3 { left: 28px; right: auto; top: calc(37% + 156px); bottom: auto; }
  .nxp-card--4 { right: 22px; left: auto; top: calc(37% + 234px); bottom: auto; }
  .nxp-skip { bottom: 18px; }
}
@media (max-width: 809.98px) and (max-height: 600px) {
  .nxp-mark { top: 17%; }
  .nxp-card--1 { top: 31%; } .nxp-card--2 { top: calc(31% + 72px); } .nxp-card--3 { top: calc(31% + 144px); } .nxp-card--4 { top: calc(31% + 216px); }
}
