/* Licensed to account 52c7da1aea3f, 2026-10-20. Moving parts. */
/* Greeting loader, the mechanics.
   Moving parts. The overlay covers the page from the first paint; the script builds what moves inside it.
   Readable source: components/greeting-loader/greeting-loader.css */

/* File layout: required mechanics, then the optional look.
   The rules before the line "look, left out of the Webflow Embed" are what
   the loader needs to work at all. They read attributes, and the classes
   the script creates itself; never a class of the page. */

/* Overlay: covers the viewport from the first paint.
   The overlay is on the page before any script runs, so the page never
   flashes under it. Read on the attribute alone: Webflow renames a class
   pasted twice on one site, an attribute comes through as it is. */
[data-greeting-loader] {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background-color: var(--greeting-loader-color, #15100c);
}

:where([data-greeting-loader]) {
  z-index: 1000;
}

/* Overlay shown by its attribute, over a class that hides it in the Designer.
   The Webflow class of the overlay hides it, so the Designer canvas, which
   runs no script and applies no Embed, shows the page under it. On the
   published page this rule comes after the class and wins. */
[data-greeting-loader] {
  visibility: visible;
}

/* Once the script has it, the panel is the SVG path, not the box.
   The box only paints the panel until the script is there; from then on its
   lower edge has to be able to curve and to leave. */
[data-greeting-loader][data-greeting-loader-state] {
  background-color: transparent;
}

/* Overlay gone once played, skipped in the same session, or destroyed. */
[data-greeting-loader][data-greeting-loader-state="done"],
[data-greeting-loader][data-greeting-loader-state="skipped"],
[data-greeting-loader][data-greeting-loader-state="off"] {
  display: none;
}

/* No script at all: the overlay lets go after eight seconds.
   Read on the state attribute, which the engine writes at its first move.
   Without a script, nothing writes it and the page comes through anyway. */
@keyframes greeting-loader-bail {
  to {
    visibility: hidden;
    pointer-events: none;
  }
}

[data-greeting-loader]:not([data-greeting-loader-state]) {
  animation: greeting-loader-bail 0s linear 8s forwards;
}

/* A session that has seen the loader, marked from the head of the page.
   Optional: a one line script in the head sets this attribute before the
   first paint, so the panel never shows on the later pages of a visit. */
html[data-greeting-loader-seen] [data-greeting-loader] {
  display: none;
}

/* Scroll held while the greetings run, given back as the panel lifts. */
html[data-greeting-loader-lock] {
  overflow: hidden;
}

/* The headline, kept out of sight while its copy travels to it.
   Transparent rather than hidden, so it keeps its box, its place in the
   reading order and its text for a screen reader. */
[data-greeting-loader-away] {
  opacity: 0 !important;
}

/* The three layers the script builds: copy under, panel, stage over. */
.greeting-loader-under,
.greeting-loader-stage {
  position: absolute;
  inset: 0;
}

.greeting-loader-panel {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.greeting-loader-panel path {
  fill: var(--greeting-loader-color, #15100c);
}

/* Stage: the greetings and the dot, in the ink of the panel.
   The script clips it to the path of the panel, so nothing of it shows
   where the panel has already left. */
.greeting-loader-stage {
  color: var(--greeting-loader-ink, #f4ece0);
  line-height: 1.5;
}

/* Mask: a one line window across the middle of the panel.
   Full width, so it only ever cuts a greeting at its top and its foot. */
.greeting-loader-mask {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1.5em;
  margin-top: -0.75em;
  overflow: hidden;
}

/* The window opens for the last word to fly out of it. */
[data-greeting-loader-state="handover"] .greeting-loader-mask {
  overflow: visible;
}

/* Greeting: centred in the window, and still; its letters do the moving. */
.greeting-loader-word {
  position: absolute;
  top: 50%;
  left: 50%;
  white-space: nowrap;
  line-height: 1.5;
  transform: translate(-50%, -50%);
}

/* Letter: a box of its own, under the window until the script raises it. */
.greeting-loader-letter {
  display: inline-block;
  transform: translateY(130%);
}

/* Dot: before the greeting, its size and place in em of the greetings.
   Set a little under the middle of the line, at the middle of the lower
   case letters. */
.greeting-loader-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.2em;
  height: 0.2em;
  margin-top: -0.02em;
  border-radius: 50%;
  background-color: var(--greeting-loader-dot, #ff4a00);
  transform: scale(0);
}

/* The two copies of the headline: one on the panel, one under it.
   Placed and scaled from their top left corner by the script. No
   will-change here: a layer kept for the flight is drawn once at the small
   size and comes out blurred as it grows. */
.greeting-loader-twin {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.greeting-loader-twin-text {
  position: absolute;
  margin: 0;
}

/* ---------- look, left out of the Webflow Embed ---------- */

/* Clinix Studio: the look of the preview (the greeting-loader-* classes of
   the cream Dunder Mifflin page, set in Instrument Sans and Geist Mono) is
   left out of this copy on purpose. The overlay sits on the homepage
   (src/pages/index.astro) and lands on the hero headline, which keeps its
   own face; the colours come from the tokens through
   window.GreetingLoaderSettings in src/layouts/BaseLayout.astro and the
   first paint from a rule in src/styles/global.css. The mechanics above are
   the file as shipped. */
