/* ============================================================
   Inner pages: the colour wave and motion (owner, 2026-11-09: "work on the
   inner pages, blog, docs etc., to look better as well"). Hand-written,
   loaded last on every static page (FgsDocument) and on the pricing layout,
   after the light skin. Movement and the wave only: colours, type and layout
   stay the light skin's.

   - The homepage's colour wave, quieter (`data-fg-wave="soft"`), behind the
     top of each page: the header and the title sit on it, then it fades into
     the cream before the page's small text. It shows only once it has drawn,
     so without WebGL and with reduced motion the page is its plain cream.
   - Everything that moves sits inside prefers-reduced-motion: no-preference.
   ============================================================ */

/* ---- The colour wave behind the title ----------------------------------
   The page body is transparent where the wave runs (the root keeps the very
   same cream), so a layer one step under the page shows through it; the old
   white background layer goes with it. */
html.nf-page body:is(.fgs, .sub-page):has(.fgs-wave) {
  background: transparent !important;
  background-color: transparent !important;
}
html.nf-page body:has(.fgs-wave) .fgs-bg { display: none !important; }
html.nf-page .fgs-wave {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: clamp(420px, 62vh, 600px);
  overflow: clip;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 30%, rgba(0, 0, 0, 0.45) 62%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 0%, #000 30%, rgba(0, 0, 0, 0.45) 62%, transparent 92%);
}
html.nf-page .fgs-wave > .fg-wave {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
}
html.nf-page .fgs-wave > .fg-wave[data-ready="true"] { opacity: 1; }

/* ---- Small grey text that sits on the wave reads darker ------------------
   These labels were 4.2:1 on the plain cream (#737A89); the wave behind them
   would take them lower, so they take the skin's muted ink instead. */
html.nf-page :is(.fgx-figures li span, .fgx-count, .fgd-search > span, .fgs-uc-note, .fgs-uc-note span) { color: #4A505E !important; }

/* ---- The reading line along the top: the brand colours ----------------- */
html.nf-page .nf-progress { height: 3px; }
html.nf-page .nf-progress i {
  background: linear-gradient(90deg, #2F6BFF, #7C4DFF 52%, #FF4FA0) !important;
  box-shadow: 0 0 12px rgba(124, 77, 255, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
  html.nf-page .fgs-wave > .fg-wave { transition: opacity 1200ms var(--ease-out); }

  /* Page titles sharpen in from a blur, like the homepage headline. Only
     the blur moves: the pages' own rise and reveal keep position and fade
     (pages with their own hero motion are left alone). */
  html.nf-page body:not(.fgs-hero-motion) :is(.fgs-h1, .fgd-hero-title, .fgd-ahero-title, .fgx-title, .fb-title, .fb-article-title) {
    animation: fgi-title-in 1000ms var(--ease-out) 60ms backwards;
  }

  /* (Blog cards move in _fluttergo-blog-light.css, with their design.) */

  /* Docs start cards: the picture leans in under their own lift. */
  html.nf-page .fgd-start-card img { transition: scale 700ms var(--ease-out); }
  html.nf-page .fgd-start-card:is(:hover, :focus-visible) img { scale: 1.04; }

  /* Use-case cards lift like the explore cards. */
  html.nf-page .fgs-uc-card {
    transition: translate var(--dur-glide) var(--ease-out), box-shadow var(--dur-glide) var(--ease-out);
  }
  html.nf-page .fgs-uc-card:hover {
    translate: 0 -3px;
    box-shadow: 0 1px 2px rgba(17, 19, 24, 0.04), 0 22px 44px -28px rgba(17, 19, 24, 0.4) !important;
  }

  /* Cards and article figures rise in as they scroll into view. Only where
     the browser can tie it to scrolling; elsewhere they simply show. (Not
     the explore cards: they carry glass, which must never fade. Not the
     blog feed: a full-page capture of 68 posts came out blank below the
     fold.) */
  @supports (animation-timeline: view()) {
    html.nf-page :is(.fgd-start-card, .fgs-uc-card, .fb-prose > figure) {
      animation: fgi-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

@keyframes fgi-title-in {
  from { filter: blur(12px); }
}
@keyframes fgi-rise {
  from { opacity: 0; translate: 0 28px; }
}
