/* ─────────────────────────────────────────────────────────────────────────
   EFFECTS - the support effects of the house (Jarvis 0175).
   The rules, the options and the cost: .claude/skills/site-builder/references/motion.md §3.1

   Independent blocks, one per effect, turned on by data-effect="<name>"; two effects may share an element
   (data-effect="lines underline"). Copy only the blocks the page uses, with the matching block of effects.js.
   The options are CSS variables, in the style of the element: --fx-delay, --fx-far, --fx-speed, --fx-turn, --fx-force, --fx-ink.

   THE RULE OF ALL OF THEM: the still state is the page. Without JavaScript, without support or with reduced motion
   on, everything is visible, readable and reachable. An invisible start exists only inside
   @supports (animation-timeline) or under .mov, the class the script puts after checking reduced motion.
   ───────────────────────────────────────────────────────────────────────── */

/* floor: who asked for less motion gets the still state, whatever block is copied */
@media (prefers-reduced-motion: reduce) {
  [data-effect], [data-effect] *, [data-effect]::before, [data-effect]::after { animation: none !important; transition: none !important; }
}

/* ── lines · the title comes in line by line, from inside a mask (needs effects.js) ── */
.mov [data-effect~="lines"]:not(.fx-ready) { visibility: hidden; }
.fx-w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .12em .08em .16em; margin: -.12em -.08em -.16em; }   /* a folga dos lados: com o espaçamento negativo do título, a última letra (o s de "Três") passava da caixa e era cortada */
.fx-w > span { display: inline-block; }
.mov .fx-lines .fx-w > span { transform: translateY(125%) rotate(3deg); transform-origin: 0 100%; transition: transform 1.1s cubic-bezier(.16, 1, .3, 1); transition-delay: calc(var(--fx-delay, 0s) + var(--l, 0) * .1s); }
.mov .fx-lines.is-in .fx-w > span { transform: none; }
.mov .fx-lines:not(.is-in) .fx-w > span { transition-duration: .4s; transition-delay: 0s; }

/* ── arrive · the block comes in (data-from: bottom, the default, left, right, zoom) and goes out when the page goes back (needs effects.js) ── */
.mov { overflow-x: clip; }   /* what waits on the right does not widen the page */
.mov [data-effect~="arrive"] { transition: opacity .7s ease var(--fx-delay, 0s), translate 1s cubic-bezier(.16, 1, .3, 1) var(--fx-delay, 0s), scale 1s cubic-bezier(.16, 1, .3, 1) var(--fx-delay, 0s), transform .25s ease, box-shadow .25s ease; }
.mov [data-effect~="arrive"]:not(.is-in) { opacity: 0; translate: 0 var(--fx-far, 2.6rem); transition-duration: .35s; transition-delay: 0s; }
.mov [data-effect~="arrive"][data-from="zoom"]:not(.is-in) { translate: 0 0; scale: .3; }
@media (min-width: 48rem) {
  .mov [data-effect~="arrive"][data-from="left"]:not(.is-in) { translate: calc(var(--fx-far, 4rem) * -1) 0; }
  .mov [data-effect~="arrive"][data-from="right"]:not(.is-in) { translate: var(--fx-far, 4rem) 0; }
}

/* ── unfold · the answers slide open and shut, on the list of <details>; where the browser does not do it, effects.js does ── */
[data-effect~="unfold"] { interpolate-size: allow-keywords; }
@media (prefers-reduced-motion: no-preference) {
  [data-effect~="unfold"] details::details-content { block-size: 0; overflow: clip; transition: block-size .38s cubic-bezier(.22, .8, .2, 1), content-visibility .38s allow-discrete; }
  [data-effect~="unfold"] details[open]::details-content { block-size: auto; }
}

/* ── door · the coloured section opens from its corners ─────────────────── */
[data-effect~="door"] { position: relative; isolation: isolate; overflow: clip; }
[data-effect~="door"]::before { content: ""; position: absolute; inset: -56px; border-radius: 52px; background: var(--fx-room, #111); z-index: -1; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    [data-effect~="door"]::before { animation: fx-door linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
  }
}
@keyframes fx-door { from { transform: scale(.82, .7); } to { transform: none; } }
