/* r5 detail pass (27 Nov 2026, Europe/Zurich). Preview only, motion-r5.
   Loader handover, iPhone boat composition, mid-page lake quality, small UI details.
   Does not change copy. */

/* ---------- 1. Loader handover: no curtain jump, no scroll reset ---------- */
html.intro-scroll-lock,
html.intro-scroll-lock body{overflow:hidden}
@media (prefers-reduced-motion:no-preference){
  /* Veil eases out with opacity + a slight lift. The hero photograph is already
     settled underneath (it is never translated). Matching easing with the lockup FLIP. */
  html[data-intro-style="aman"] .site-intro.is-handoff::before,
  html[data-intro-style="aman"] .site-intro.is-out,
  html[data-intro-style="swell"] .site-intro.is-handoff::before,
  html[data-intro-style="swell"] .site-intro.is-out{
    animation:r5-veil-out 1.05s cubic-bezier(.33,0,.2,1) both!important
  }
  html[data-intro-style="aman"] .site-intro.is-handoff.is-out,
  html[data-intro-style="swell"] .site-intro.is-handoff.is-out{
    /* Keep the element visible while the veil animation plays; JS hides it after the veil eases out (~1.05s). */
    opacity:1!important;visibility:visible!important;pointer-events:none;
    background:transparent!important
  }
  html[data-intro-style="aman"] .site-intro.is-out .site-intro-inner,
  html[data-intro-style="swell"] .site-intro.is-out .site-intro-inner{
    animation:none!important;opacity:0
  }
}
@keyframes r5-veil-out{
  from{opacity:1;transform:translate3d(0,0,0)}
  to{opacity:0;transform:translate3d(0,-10px,0);visibility:hidden}
}
@media (prefers-reduced-motion:reduce){
  html.intro-scroll-lock,html.intro-scroll-lock body{overflow:auto}
}

/* ---------- 1b. Loader choreography (t162u): AVS + CONSULTING emerge together
   from the shadow, then the existing motto fades up, then the r5 dissolve. */
@media (prefers-reduced-motion:no-preference){
  /* Beat lockup-hero-lc.css opacity:1 / animation:none !important, and the
     aman group fade, so the two lockup lines can appear on their own. */
  html.intro-pending[data-intro-style="aman"] .site-intro:not(.is-run) .site-intro-avs,
  html.intro-pending[data-intro-style="aman"] .site-intro:not(.is-run) .site-intro-sub{
    opacity:0!important;
    transform:translate3d(0,8px,0)!important;
    filter:blur(6px);
    animation:none!important
  }
  html.intro-pending[data-intro-style="aman"] .site-intro:not(.is-run) .site-intro-motto{
    opacity:0!important;
    transform:translate3d(0,8px,0)!important;
    filter:none;
    animation:none!important
  }
  html.intro-pending[data-intro-style="aman"] .site-intro.is-run .site-intro-avs,
  html.intro-pending[data-intro-style="aman"] .site-intro.is-run .site-intro-sub{
    animation:r5-from-shadow 1.65s cubic-bezier(.33,0,.2,1) both!important
  }
  html.intro-pending[data-intro-style="aman"] .site-intro.is-run .site-intro-motto{
    animation:r5-motto-up 1.05s cubic-bezier(.33,0,.2,1) 1.25s both!important
  }
  html[data-intro-style="aman"] .site-intro-inner,
  html[data-intro-style="aman"] .site-intro.is-run .site-intro-inner{
    animation:none!important;
    opacity:1!important
  }
}
@keyframes r5-from-shadow{
  0%{opacity:0;filter:blur(6px);transform:translate3d(0,10px,0)}
  55%{opacity:1;filter:blur(1.5px);transform:translate3d(0,3px,0)}
  100%{opacity:1;filter:blur(0);transform:translate3d(0,0,0)}
}
@keyframes r5-motto-up{
  0%{opacity:0;transform:translate3d(0,10px,0)}
  100%{opacity:1;transform:translate3d(0,0,0)}
}
@media (prefers-reduced-motion:reduce){
  html[data-intro-style="aman"] .site-intro .site-intro-avs,
  html[data-intro-style="aman"] .site-intro .site-intro-sub,
  html[data-intro-style="aman"] .site-intro .site-intro-motto{
    opacity:1!important;transform:none!important;filter:none!important;animation:none!important
  }
}

/* ---------- 2. iPhone lake: living scene. Video (portrait clip) plays when
   it can; the 2:3 still is the poster/fallback. On the still, the boat keeps
   its bob and slowly drifts out across the water. Reduce Motion stays gentle. */
@media (max-width:799px){
  /* Extra overflow on the right so a slow exit never shows a raw edge. */
  html[data-mobile-intro="lake"] body[data-page="home"] .hero-bleed .hero-drift{
    inset:-12% -32% -12% -12%;
    will-change:transform
  }
  html[data-mobile-intro="lake"] body[data-page="home"] .hero-bleed .hero-video,
  html[data-mobile-intro="lake"] body[data-page="home"] .hero-bleed .hero-frame-still img,
  html[data-mobile-intro="lake"] body[data-page="home"] .hero-drift img,
  html[data-mobile-intro="lake"] body[data-page="home"] .hero-drift video{
    object-fit:cover;
    object-position:50% 50%!important
  }
}
@media (max-width:799px) and (prefers-reduced-motion:no-preference){
  /* Still fallback only: parent drifts out, the image keeps the bob. */
  html[data-mobile-intro="lake"] body[data-page="home"] .hero-bleed.hd-static:not(.has-hero-video) .hero-drift{
    animation:r5-hero-exit 24s cubic-bezier(.33,0,.2,1) forwards;
    transform-origin:50% 55%
  }
  html[data-mobile-intro="lake"] body[data-page="home"] .hero-bleed.hd-static:not(.has-hero-video) .hero-drift img{
    animation:r5-hero-bob 6s ease-in-out infinite alternate;
    transform-origin:50% 55%
  }
}
/* Visible, calm bob: 4–6px + slight sway. Alternate so the first 3s reach the peak. */
@keyframes r5-hero-bob{
  from{transform:translate3d(-2px,0,0) rotate(.3deg)}
  to{transform:translate3d(3px,-6px,0) rotate(-.5deg)}
}
/* Slow exit to the right — boat floats away across the water. */
@keyframes r5-hero-exit{
  from{transform:translate3d(0,0,0)}
  to{transform:translate3d(26%,5%,0)}
}
@keyframes r5-hero-bob-soft{
  0%,100%{transform:translate3d(0,0,0)}
  50%{transform:translate3d(0,-2px,0)}
}
/* Reduce Motion: living 2px bob only, no exit, no video travel. */
@media (max-width:799px) and (prefers-reduced-motion:reduce){
  html[data-mobile-intro="lake"] body[data-page="home"] .hero-bleed .hero-drift{
    inset:-8%;
    animation:none!important
  }
  html[data-mobile-intro="lake"] body[data-page="home"] .hero-bleed.hd-static:not(.has-hero-video) .hero-drift img{
    animation:r5-hero-bob-soft 8s ease-in-out infinite alternate!important;
    transform-origin:50% 55%
  }
}

/* ---------- 3. Mid-page lake: boat-free 4K crop, gentle swell, no 150/520vw upscale ---------- */
.water-words .ww-swell{
  position:absolute;inset:-8%;
  will-change:transform;transform-origin:50% 45%
}
.water-words .ww-media img{
  position:absolute;inset:0;left:0;right:0;top:0;bottom:0;
  width:100%;height:100%;max-width:none;min-width:0;
  object-fit:cover;object-position:50% 42%;
  transform:none
}
/* Run without waiting for .is-live so the water is already moving on first look.
   14s / ~2% travel is calm but readable in a few seconds. */
@media (prefers-reduced-motion:no-preference){
  body[data-page="home"] .water-words .ww-swell{
    inset:-14%;
    animation:r5-ww-swell 14s ease-in-out infinite alternate
  }
}
@keyframes r5-ww-swell{
  from{transform:translate3d(0,0,0) scale(1)}
  to{transform:translate3d(-2.2%,-1.5%,0) scale(1.04)}
}
@media (max-width:599px){
  .water-words .ww-media img{height:100%;object-position:50% 42%;transform:none}
}
@media (prefers-reduced-motion:reduce){
  /* No large swell under Reduce Motion; a soft opacity breathe only (below). */
  body[data-page="home"] .water-words .ww-swell{animation:none!important;transform:none!important}
}


/* ---------- 3b. Desktop mid-page: sit the figcaption below the quote's water
   reflection (Thea QA, 1440). Light scrim only — no dark colours.
   Mobile/phone typography spacing is in 3c below; this block stays at min-width:800px. */
@media (min-width:800px){
  body[data-page="home"] .water-words .ww-reflect{
    margin-bottom:1.35em
  }
  body[data-page="home"] .water-words .example-feature-quote figcaption{
    position:relative;
    z-index:2;
    padding-top:.45rem;
    padding-left:1rem;
    padding-right:1rem
  }
  body[data-page="home"] .water-words .example-feature-quote figcaption::before{
    content:"";
    display:block;
    position:absolute;
    z-index:-1;
    pointer-events:none;
    inset:-.55rem -1.35rem;
    background:radial-gradient(ellipse 82% 78% at 50% 50%,
      rgba(240,242,244,.86) 0%,
      rgba(228,231,235,.42) 50%,
      rgba(228,231,235,0) 76%)
  }
}


/* ---------- 3c. Mobile mid-page: sit the figcaption below the quote's water
   reflection (VSA, real iPhone Safari). Same light pearl scrim as 3b — no dark
   colours. Generous gap: Safari font, transform and mask metrics differ from
   Chromium. Checked at 360 / 375 / 393 / 414 / 430, EN and DE.
   Desktop 3b (min-width:800px) is unchanged. */
@media (max-width:799px){
  body[data-page="home"] .water-words .ww-reflect{
    margin-bottom:2.1em;
    -webkit-mask-image:linear-gradient(0deg,#000 0%,rgba(0,0,0,.28) 38%,transparent 62%);
            mask-image:linear-gradient(0deg,#000 0%,rgba(0,0,0,.28) 38%,transparent 62%)
  }
  body[data-page="home"] .water-words .example-feature-quote figcaption{
    position:relative;
    z-index:2;
    padding-top:.7rem;
    padding-left:.85rem;
    padding-right:.85rem
  }
  body[data-page="home"] .water-words .example-feature-quote figcaption::before{
    content:"";
    display:block;
    position:absolute;
    z-index:-1;
    pointer-events:none;
    inset:-.55rem -1.1rem;
    background:radial-gradient(ellipse 82% 78% at 50% 50%,
      rgba(240,242,244,.86) 0%,
      rgba(228,231,235,.42) 50%,
      rgba(228,231,235,0) 76%)
  }
}


/* ---------- 3d. Continuous CSS fog + a Reduce Motion breathe.
   Fog must not wait on .is-live, and must not have an inline JS transform
   (that cancelled ww-drift). Slightly quicker durations so the drift reads
   in a few seconds, still calm. */
body[data-page="home"] .water-words .ww-fog,
body[data-page="home"] .hero-bleed .hero-fog span,
body[data-page="home"] .hero-bleed .hero-fog > span .hf-drift{
  animation-play-state:running!important
}
body[data-page="home"] .hero-bleed .hero-fog > span .hf-drift{
  animation:ww-drift 55s linear infinite;
  animation-play-state:running!important
}
body[data-page="home"] .water-words .ww-fog-a{animation-duration:50s}
body[data-page="home"] .water-words .ww-fog-b{animation-duration:70s}
body[data-page="home"] .water-words .ww-fog-c{animation-duration:58s}
@keyframes r5-fog-breathe{
  0%,100%{opacity:.7}
  50%{opacity:.95}
}
@keyframes r5-water-breathe{
  0%,100%{opacity:.55}
  50%{opacity:.8}
}
@media (prefers-reduced-motion:reduce){
  body[data-page="home"] .water-words .ww-fog,
  body[data-page="home"] .hero-bleed .hero-fog span,
  body[data-page="home"] .hero-bleed .hero-fog > span .hf-drift{
    animation:r5-fog-breathe 10s ease-in-out infinite!important;
    transform:none!important
  }
  body[data-page="home"] .water-words .ww-media::after{
    animation:r5-water-breathe 12s ease-in-out infinite!important
  }
  body[data-page="home"] .water-words .ww-par,
  body[data-page="home"] .water-words .ww-fog-par{transform:none!important}
}


/* ---------- 3e. Reflection bugfix (VSA iPhone, 27 Nov 2026).
   .ww-reflect is meant to be a faded, scaleY(-.5) water reflection of the quote
   (water-words.css). The entrance animation ww-beat-in fills forwards with
   transform:none and opacity:1, which wiped the flip and left a readable,
   right-side-up duplicate of the last quote line. Restore the reflection
   after entrance; under Reduce Motion, keep the flip without shimmer. */
@media (prefers-reduced-motion:no-preference){
  body[data-page="home"] .water-words .ww-plane.ww-enter.is-in .ww-reflect.ww-beat,
  body[data-page="home"] .water-words .ww-reflect{
    animation:ww-shimmer 7.5s ease-in-out infinite alternate both;
    animation-play-state:running
  }
}
@media (prefers-reduced-motion:reduce){
  body[data-page="home"] .water-words .ww-plane.ww-enter .ww-reflect.ww-beat,
  body[data-page="home"] .water-words .ww-reflect{
    transform:translateY(50%) scaleY(-.5)!important;
    opacity:.2!important;
    animation:none!important;
    filter:none!important
  }
}

/* ---------- 4. Small details: type, tap targets, focus ---------- */
html body h1,html body h2,html body .svc-title,
html body .water-words blockquote{
  text-wrap:balance
}
html body p,html body figcaption,html body li{
  text-wrap:pretty
}
/* Visible focus on header chrome and hero controls (keyboard + switch access). */
html body .lang a:focus-visible,
html body .nav-toggle:focus-visible,
html body .header-enquire:focus-visible,
html body .site-header .nav a:focus-visible,
html body .hero-sound:focus-visible,
html body .hero-track-switch button:focus-visible,
html body .hero-track-switch-btn:focus-visible,
html body .site-intro-skip:focus-visible,
html body .about-close:focus-visible,
html body .btn:focus-visible{
  outline:2px solid #1c1c1e;
  outline-offset:3px
}

/* ≥44px tap targets on small screens without changing the visual rhythm. */
@media (max-width:799px){
  html body .lang a,
  html body .nav-toggle,
  html body .header-enquire,
  html body .hero-sound,
  html body .site-intro-skip,
  html body .about-close{
    min-height:44px!important;min-width:44px!important;
    display:inline-flex;align-items:center;justify-content:center;
    box-sizing:border-box
  }
  html body .hero-track-switch button,
  html body .hero-track-switch-btn,
  html body .hero-bleed .hero-actions .btn{
    min-height:44px;
    box-sizing:border-box
  }
}

/* Music dock labels wrap cleanly at 360px instead of overflowing. */
@media (max-width:379px){
  html body .hero-track-switch{flex-wrap:wrap;justify-content:flex-start;row-gap:.35rem}
  /* Long DE CTA labels were nowrap-min-content and pushed the copy past 360px. */
  html[data-mobile-intro="lake"] body[data-page="home"] .hero.hero-bleed .hero-copy,
  html[data-mobile-intro="lake"] body[data-page="home"] .hero-bleed .hero-actions{
    max-width:100%;min-width:0;box-sizing:border-box
  }
  html[lang^="de"][data-mobile-intro="lake"] body[data-page="home"] .hero-bleed .hero-actions .btn{
    font-size:.56rem!important;padding:.7em .32em!important
  }
}


/* ---------- 5. Mobile menu sizing (preview; iPhone 375–430 + short landscape).
   Same design, type, colour and animation. Fit the visible viewport with
   100svh/dvh (not 100vh) and safe-area insets. Closed header must not overflow
   or clip the toggle; the open menu must scroll internally so every item and
   the close control stay reachable. */
@media (max-width:799px){
  html body .site-header{
    max-width:100%;
    width:100%;
    box-sizing:border-box;
    padding-top:max(.75rem, env(safe-area-inset-top, 0px));
    padding-left:max(var(--pad), env(safe-area-inset-left, 0px));
    padding-right:max(var(--pad), env(safe-area-inset-right, 0px))
  }
  html body .site-header .brand,
  html body .site-header .brand-logo,
  html body .site-header .brand-lockup{
    min-width:0;
    max-width:100%
  }
  html body .header-tools{
    flex:0 0 auto;
    max-width:100%;
    box-sizing:border-box
  }
  /* Enquire in the bar plus the word “Menu” overflows 400–430 EN.
     Icon-only toggle, same as the existing ≤399px pattern, through 479. */
  html body .header-enquire{display:none!important}
  html body .nav-toggle-label{
    position:absolute;width:1px;height:1px;padding:0;margin:-1px;
    overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0
  }
  html body .nav-toggle-burger{display:block}
  html body.nav-open .nav-toggle-burger,
  html.nav-open body .nav-toggle-burger{display:none}
  html body .nav-toggle{
    position:relative;
    z-index:61;
    flex:0 0 auto;
    max-width:44px;
    box-sizing:border-box
  }
  html body.nav-open .site-header,
  html.nav-open body .site-header{
    position:fixed;
    top:0;left:0;right:0;
    z-index:60;
    width:100%;
    max-width:100%;
    box-sizing:border-box
  }
  html body .nav,
  html body .nav.is-open,
  html body.nav-open .nav,
  html.nav-open body .nav{
    position:fixed;
    top:0;left:0;right:0;
    width:100%;
    max-width:100%;
    box-sizing:border-box;
    height:100vh;
    height:100dvh;
    height:100svh;
    max-height:100vh;
    max-height:100dvh;
    max-height:100svh;
    overflow-x:hidden;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    /* Clear the real sticky header (~6.6rem) plus the notch, not just --header (4.5rem). */
    padding-top:calc(7.25rem + env(safe-area-inset-top, 0px));
    padding-left:max(var(--pad), env(safe-area-inset-left, 0px));
    padding-right:max(var(--pad), env(safe-area-inset-right, 0px));
    padding-bottom:max(1.5rem, env(safe-area-inset-bottom, 0px))
  }
}

/* iPhone landscape (~844×390): the desktop bar wraps and clips Enquire / DE lang.
   Use the same hamburger panel as portrait, without changing type or colour. */
@media (min-width:800px) and (max-height:500px) and (orientation:landscape){
  html body .nav-toggle{
    display:inline-flex!important;
    align-items:center;
    justify-content:center;
    position:relative;
    z-index:61;
    flex:0 0 auto;
    min-width:44px;
    min-height:44px;
    max-width:44px;
    box-sizing:border-box
  }
  html body .nav-toggle-label{
    position:absolute;width:1px;height:1px;padding:0;margin:-1px;
    overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0
  }
  html body .nav-toggle-burger{display:block}
  html body.nav-open .nav-toggle-burger,
  html.nav-open body .nav-toggle-burger{display:none}
  html body .header-enquire{display:none!important}
  html body .site-header{
    max-width:100%;
    width:100%;
    box-sizing:border-box;
    padding-top:max(.75rem, env(safe-area-inset-top, 0px));
    padding-left:max(var(--pad), env(safe-area-inset-left, 0px));
    padding-right:max(var(--pad), env(safe-area-inset-right, 0px))
  }
  html body.nav-open .site-header,
  html.nav-open body .site-header{
    position:fixed;
    top:0;left:0;right:0;
    z-index:60
  }
  html body .nav,
  html body .nav.is-open,
  html body.nav-open .nav,
  html.nav-open body .nav{
    position:fixed;
    top:0;left:0;right:0;
    z-index:48;
    display:none;
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    gap:0;
    width:100%;
    max-width:100%;
    box-sizing:border-box;
    height:100vh;
    height:100dvh;
    height:100svh;
    max-height:100vh;
    max-height:100dvh;
    max-height:100svh;
    overflow-x:hidden;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    padding:calc(7.25rem + env(safe-area-inset-top, 0px)) max(var(--pad), env(safe-area-inset-right, 0px)) max(1.5rem, env(safe-area-inset-bottom, 0px)) max(var(--pad), env(safe-area-inset-left, 0px));
    background:#faf9f7
  }
  html body .nav.is-open,
  html body.nav-open .nav,
  html.nav-open body .nav{display:flex}
  html body .nav>a{
    font-family:var(--serif);
    font-size:clamp(1.8rem,8vw,2.35rem);
    font-weight:400;
    line-height:1.15;
    letter-spacing:-.02em;
    text-transform:none;
    color:#1c1c1e;
    padding:1.05rem 0;
    border-bottom:1px solid #989b9f;
    box-shadow:none!important;
    width:100%
  }
  html body .nav-mid,
  html body .nav-actions{display:flex}
}

/* Open-menu focus: hide the ring on touch / programmatic focus.
   Keyboard users still get a clear :focus-visible ring. The panel itself
   is focused on open, so it must not draw a viewport-sized outline. */
html body .nav a:focus:not(:focus-visible),
html body .nav button:focus:not(:focus-visible),
html body .nav:focus,
html body .nav:focus-visible{
  outline:none;
  box-shadow:none
}
html body .nav a:focus-visible,
html body .nav button:focus-visible{
  outline:2px solid var(--espresso,#242426);
  outline-offset:3px
}
