/* Falmera intro (2026-11-11): a short title sequence before the first page of a visit. The approved particle
   logo film (the motion team's hero film, cut to its first six seconds in assets/video/falmera-intro-*.mp4)
   gathers into the Falmera logo; a fine line draws out under it and the line of services rises in; then the
   card lifts off the light page on a curved edge while the film trails behind it.
   The film is shown as it was made and never recoloured. Each cut is widened (wide cut) or heightened (tall
   cut) inside the video itself, from the film's own edge, so the logo sits in the exact middle of the frame
   and the film can cover the whole screen. No page colour ever meets the film: browsers colour-manage video
   and CSS differently, so a CSS fill that matches the film in one browser shows as a seam in another.
   Hidden unless js/falmera-intro.js turns it on, so without JavaScript, with reduced motion, with Data Saver
   or on a return visit the page shows straight away. */
.fm-intro { display: none; }

html.fm-intro-on { overflow: hidden; }
html.fm-intro-on .fm-intro {
  position: fixed; inset: 0; z-index: 2147483000;
  display: block; overflow: hidden; cursor: pointer;
  background: #121A33; /* the film's edge, shown only for the moment before the poster paints */
}

/* Wide cut 2316 x 900, tall cut 720 x 1734, both with the logo dead centre; cover keeps it there. */
.fm-intro__film { position: absolute; inset: 0; }
.fm-intro__video {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: 50% 50%;
}

/* Under the logo: a fine line draws out from the centre, then the services rise in word by word. Both wait
   for the film (the script adds .is-told once the particles have settled into the logo). The line sits 113 film
   pixels under the logo's centre (117 in the tall cut), scaled the way cover scales the film. */
.fm-intro__words {
  position: absolute; left: 50%; top: calc(50% + max(12.6vh, 4.9vw)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; width: max-content; max-width: 88vw;
}
.fm-intro.is-portrait .fm-intro__words { top: calc(50% + max(16.18vw, 6.72vh)); }
.fm-intro__rule {
  display: block; width: min(240px, 46vw); height: 1px;
  background: linear-gradient(90deg, transparent, #F6B7AD 22%, #C07D9E 78%, transparent);
  transform: scaleX(0);
}
.fm-intro__tag {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .15em .55em;
  max-width: 88vw; margin: clamp(10px, 1.4vw, 16px) 0 0;
  font: 500 clamp(14px, 1.35vw, 19px)/1.4 var(--fm-font-display, 'Instrument Sans', system-ui, sans-serif);
  color: #F7EFEA; letter-spacing: .01em;
}
.fm-intro__tag > span { display: inline-block; overflow: hidden; padding-bottom: .08em; }
.fm-intro__tag > span > span { display: inline-block; transform: translateY(110%); }
.fm-intro__tag .fm-intro__dot { color: #F69477; }
.fm-intro.is-told .fm-intro__rule { animation: fm-intro-draw .8s cubic-bezier(.65,0,.35,1) forwards; }
.fm-intro.is-told .fm-intro__tag > span > span { animation: fm-intro-word .7s cubic-bezier(.2,.9,.25,1) calc(.2s + var(--d) * .08s) forwards; }
.fm-intro__tag > span:nth-child(1) > span { --d: 0; } .fm-intro__tag > span:nth-child(2) > span { --d: 1; }
.fm-intro__tag > span:nth-child(3) > span { --d: 2; } .fm-intro__tag > span:nth-child(4) > span { --d: 3; }
.fm-intro__tag > span:nth-child(5) > span { --d: 4; } .fm-intro__tag > span:nth-child(6) > span { --d: 5; }
.fm-intro__tag > span:nth-child(7) > span { --d: 6; }
@keyframes fm-intro-draw { to { transform: scaleX(1); } }
@keyframes fm-intro-word { to { transform: translateY(0); } }

/* Leaving: the card lifts off the page on a curved edge, and the film travels a little slower than the
   card, so it reads as depth rather than a slide. */
html.fm-intro-on .fm-intro.is-leaving { animation: fm-intro-lift 1.05s cubic-bezier(.76,0,.24,1) forwards; }
.fm-intro.is-leaving .fm-intro__film { animation: fm-intro-trail 1.05s cubic-bezier(.76,0,.24,1) forwards; }
@keyframes fm-intro-lift {
  to { transform: translateY(-100%); border-bottom-left-radius: 50% 18vh; border-bottom-right-radius: 50% 18vh; }
}
@keyframes fm-intro-trail { to { transform: translateY(42vh) scale(.96); opacity: .25; } }

/* Narrow screens: two even lines instead of a dot hanging at the end of the first. */
@media (max-width: 560px) {
  .fm-intro__tag > span:nth-child(4) { flex-basis: 100%; height: 0; padding: 0; visibility: hidden; }
}
