/* =======================================================================
   SAFARI DESKTOP LAYER  (css half — js/safari.js is the other half)
   -----------------------------------------------------------------------
   EVERY selector in this file starts with html.cm-safari-desktop, a class
   that only js/safari.js ever sets and only in WebKit-that-is-not-Chrome on
   a screen 810px or wider. Chrome, Edge, Firefox and mobile Safari cannot
   match anything here, so this file is physically incapable of changing how
   the site looks in them. Load it LAST, after custom.css, so it wins ties.

   Everything below is a WebKit compositor workaround, not a design change:
   what Chrome gets for free (GPU-accelerated blur transitions, cheap
   backdrop filters, cached SVG filters) WebKit re-rasterises in software on
   every scroll frame.
   ======================================================================= */

/* -----------------------------------------------------------------------
   1. SCROLL-DRIVEN BLUR — the single most expensive thing on the page in
   WebKit. The therapy "depth" hand-over animates filter: blur() from a
   scroll position, i.e. a new blur radius every frame. Blink runs that on
   the GPU; WebKit re-rasterises the whole layer in software each time.
   The movement and the cross-fade are kept exactly as they are — only the
   blur is dropped, and the photos keep their duotone.
   ----------------------------------------------------------------------- */
html.cm-safari-desktop #main .cm-therapy-framer-services-bridge .cm-therapy-depth {
  filter: none !important;
  transition: transform 0.14s linear, opacity 0.14s linear !important;
  will-change: transform, opacity !important;
}

/* The PHOTO PANELS get the blur dropped too — but ONLY the blur. Their
   `transition: none` is load-bearing: the panel is viewport-fixed and every
   value it takes is already a direct function of scroll position, so easing
   it just makes the painted position lag the computed one. Giving them a
   transition here is what pushed the picture roughly 40px out of its frame
   in Safari. Filter only. Nothing else on this rule. */
html.cm-safari-desktop body.cm-page-terapi #main .cm-therapy-framer-services-bridge .framer-14o5rni::after,
html.cm-safari-desktop body.cm-page-terapi #main .cm-therapy-framer-services-bridge .framer-5me07v::after,
html.cm-safari-desktop body.cm-page-terapi #main .cm-therapy-framer-services-bridge .framer-neciwr::after {
  filter: none !important;   /* farvefotos siden 2026-11-26 — ingen duotone */
}

/* -----------------------------------------------------------------------
   2. HOVER BLUR ON THE SERVICE CARDS. Transitioning filter: blur() from 0
   to 3.5px over a large photo pins a WebKit core for the length of the
   hover. The blur still happens — it just snaps instead of ramping, which
   on a 380ms hover is hard to notice — while the zoom keeps easing.
   ----------------------------------------------------------------------- */
html.cm-safari-desktop body.cm-home [data-framer-name="Our Services"] a.framer-v3ZRv.framer-mi53us > .framer-pt47h1-container > div {
  transition: transform 0.38s ease !important;
}

/* -----------------------------------------------------------------------
   3. TRANSITIONED backdrop-filter. Same problem, worse: WebKit re-snapshots
   and re-blurs everything behind the element on every frame of the ramp.
   The glass effect is kept, it just arrives at once.
   ----------------------------------------------------------------------- */
html.cm-safari-desktop .cm-icon-circle,
html.cm-safari-desktop .timeline-icon-wrap {
  transition-property: transform, background-color, box-shadow, border-color, color !important;
}

/* -----------------------------------------------------------------------
   4. THE IDLE HERO DRIFT. Two infinite 34s/52s keyframe animations on
   mix-blend-mode pseudo elements. js/safari.js adds the class below
   whenever the hero is off screen, so the compositor stops being asked to
   move them once you have scrolled past. Nothing changes while you are
   looking at the hero.
   ----------------------------------------------------------------------- */
html.cm-safari-desktop .framer-61oaly.cm-safari-drift-off::before,
html.cm-safari-desktop .framer-61oaly.cm-safari-drift-off::after {
  animation-play-state: paused !important;
}

/* -----------------------------------------------------------------------
   5. (WITHDRAWN) FEATHERING THE BLUR BAND WITH A MASK ON ITS CONTAINER.
   The idea was to fade the finished band out over its bottom half so its
   edge could not show. It does not work and must not be tried again: a mask
   makes the element a "backdrop root", and once the container is a backdrop
   root its children's backdrop-filter has nothing behind it to sample — the
   blur disappears completely. Verified: masking the container removed the
   blur across the whole top of the page.

   Two earlier attempts on this same hairline also failed, and both made it
   MORE visible (see the withdrawn note in js/safari.js): deleting the band's
   weakest layers, and promoting the container with contain/translateZ.

   The band is therefore left EXACTLY as Chrome renders it. What has not been
   ruled out yet is that the hairline is not the band at all but the kink in
   the footer's own gradient stack — safari-test.html separates the two.
   ----------------------------------------------------------------------- */

/* -----------------------------------------------------------------------
   6. THE FOOTER TRANSITION.
   Three fades overlap where the page hands over to the dune artwork: the
   image's own gradient mask, a sand veil over its top band, and a seam
   feather on the footer. Each of the three is a three-stop gradient, so it
   has a kink in the middle — a point where the rate of fade changes
   abruptly. Blink dithers that away; WebKit renders it flat, and the kink
   reads as a faint horizontal edge.
   Same start and end points, same overall shape, but eased through the
   middle so there is no kink left to show.
   ----------------------------------------------------------------------- */
@media (min-width: 1200px) {
  html.cm-safari-desktop .framer-1d0d1sn {
    -webkit-mask-image: linear-gradient(to bottom,
      rgba(0,0,0,0) 0px,
      rgba(0,0,0,0.06) 130px,
      rgba(0,0,0,0.18) 240px,
      rgba(0,0,0,0.32) 320px,
      rgba(0,0,0,0.45) 380px,
      rgba(0,0,0,0.62) 470px,
      rgba(0,0,0,0.78) 570px,
      rgba(0,0,0,0.91) 670px,
      rgba(0,0,0,1) 760px) !important;
    mask-image: linear-gradient(to bottom,
      rgba(0,0,0,0) 0px,
      rgba(0,0,0,0.06) 130px,
      rgba(0,0,0,0.18) 240px,
      rgba(0,0,0,0.32) 320px,
      rgba(0,0,0,0.45) 380px,
      rgba(0,0,0,0.62) 470px,
      rgba(0,0,0,0.78) 570px,
      rgba(0,0,0,0.91) 670px,
      rgba(0,0,0,1) 760px) !important;
  }
}

@media (min-width: 810px) {
  html.cm-safari-desktop .framer-1d0d1sn::after {
    background: linear-gradient(to bottom,
      var(--cm-bg, #f4f1ea) 0%,
      rgba(244, 241, 234, 0.94) 12%,
      rgba(244, 241, 234, 0.82) 24%,
      rgba(244, 241, 234, 0.68) 35%,
      rgba(244, 241, 234, 0.55) 45%,
      rgba(244, 241, 234, 0.38) 58%,
      rgba(244, 241, 234, 0.22) 72%,
      rgba(244, 241, 234, 0.09) 86%,
      rgba(244, 241, 234, 0)  100%) !important;
  }
}

html.cm-safari-desktop footer.framer-cdmgys::before {
  background: linear-gradient(to bottom,
    var(--cm-bg, #f4f1ea) 0%,
    rgba(244, 241, 234, 0.92) 13%,
    rgba(244, 241, 234, 0.78) 26%,
    rgba(244, 241, 234, 0.60) 40%,
    rgba(244, 241, 234, 0.42) 55%,
    rgba(244, 241, 234, 0.25) 70%,
    rgba(244, 241, 234, 0.11) 85%,
    rgba(244, 241, 234, 0)  100%) !important;
}

/* -----------------------------------------------------------------------
   7. STATIC DECORATIVE FILTERS. WebKit re-rasterises a filtered element
   every time the area repaints unless it has been told the result is worth
   caching. `drop-shadow` on the big numerals is the visible one. Kept
   deliberately narrow — blanket GPU promotion costs more than it saves.
   ----------------------------------------------------------------------- */
html.cm-safari-desktop .text-gold,
html.cm-safari-desktop .cm-about-portrait-parallax-noise {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* -----------------------------------------------------------------------
   8. ROUNDED CORNERS THAT SAFARI DROPS.
   A box with a border-radius and overflow:hidden clips whatever is inside
   it — unless what is inside has been put on its own GPU layer, which every
   one of these has (they all hold a picture that slides on scroll). WebKit
   then clips the layer to a plain RECTANGLE and throws the rounding away, so
   the picture comes out with square corners inside a rounded frame. That is
   the portrait on "Om mig", and the same shape is used in seven other places
   on the site.

   The fix is the long-standing WebKit one: give the frame a mask. The mask
   is fully opaque everywhere — both stops are solid — so it paints nothing
   and changes nothing; its only job is to make WebKit build the clip as a
   real rounded path instead of a rectangle. Safari-only, so Chrome keeps
   doing what it already does correctly.
   ----------------------------------------------------------------------- */
html.cm-safari-desktop .cm-about-portrait-parallax-frame,
html.cm-safari-desktop .cm-about-reverse-parallax-frame,
html.cm-safari-desktop .lm-course-parallax-frame,
html.cm-safari-desktop .cm-therapy-bottom-parallax-frame,
html.cm-safari-desktop .cm-shop-media,
html.cm-safari-desktop a.framer-v3ZRv.framer-yOtxB {
  -webkit-mask-image: -webkit-radial-gradient(#fff, #000);
  mask-image: radial-gradient(#fff, #000);
}
