/* Phesti · flowing light and glass (brand guide v1.2, section 05). Use with flow.js and ../tokens.css.

   <section data-flow-open="both" style="position:relative; isolation:isolate">
     <div data-flow data-tilt="0" data-shift="0,0" aria-hidden="true"></div>     the light
     <div class="glass frost"> headline, a drawing or a short list </div>          on glass
   </section>

   Rules: the light sits only behind a headline or glass, never behind app drawings or body text.
   Glass is used only over the light. It moves by itself and never follows the pointer. */

/* ---------- the light: what shows with no JavaScript or no WebGL (a still close to the moving picture) ---------- */
[data-flow] { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 70% at 72% 18%, rgba(31, 74, 140, .95), rgba(31, 74, 140, 0) 70%),
    radial-gradient(45% 60% at 46% 62%, rgba(26, 122, 142, .7), rgba(26, 122, 142, 0) 70%),
    radial-gradient(40% 50% at 92% 96%, rgba(176, 138, 62, .4), rgba(176, 138, 62, 0) 70%),
    var(--flow-0, #0A142A); }

/* ---------- frosted glass ---------- */
.glass { color: var(--ivory, #EFECE7); background: var(--glass-tint, rgba(10, 20, 42, .46)); border: 1px solid var(--glass-line, rgba(239, 236, 231, .2)); border-radius: var(--glass-radius, 22px);
  -webkit-backdrop-filter: blur(var(--glass-blur, 30px)) saturate(1.35); backdrop-filter: blur(var(--glass-blur, 30px)) saturate(1.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 40px 90px -40px rgba(0, 0, 0, .7); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: rgba(10, 20, 42, .84); } }

/* ---------- scrolling: a section of light arrives as a rounded panel, opens out, and draws back in as it leaves.
   flow.js sets --fin and --fout (1 = drawn in, 0 = open). data-flow-open="both" | "in" | "out" ---------- */
[data-flow-open] { clip-path: inset(0 calc(var(--flow-inset, clamp(12px, 5.5vw, 88px)) * max(var(--fin, 0), var(--fout, 0)))
    round calc(var(--flow-round, clamp(24px, 4vw, 56px)) * var(--fin, 0)) calc(var(--flow-round, clamp(24px, 4vw, 56px)) * var(--fin, 0))
          calc(var(--flow-round, clamp(24px, 4vw, 56px)) * var(--fout, 0)) calc(var(--flow-round, clamp(24px, 4vw, 56px)) * var(--fout, 0))); }

/* ---------- glass frosts over the first time it comes into view ---------- */
@media (prefers-reduced-motion: no-preference) {
  .frost { transition: background-color 900ms var(--ease, cubic-bezier(.2, .8, .2, 1)), border-color 900ms var(--ease, cubic-bezier(.2, .8, .2, 1)), box-shadow 900ms, transform 1000ms var(--ease, cubic-bezier(.2, .8, .2, 1)),
      -webkit-backdrop-filter 1100ms, backdrop-filter 1100ms; }
  .frost.is-clear { background-color: rgba(10, 20, 42, 0); border-color: rgba(239, 236, 231, 0); box-shadow: none; transform: translateY(28px) scale(.975);
    -webkit-backdrop-filter: blur(0px) saturate(1); backdrop-filter: blur(0px) saturate(1); }
}
