/* Finzium Motion · 2026-10-25
   Deliberately restrained: entrance, reveal, interaction feedback.
   Uses transforms + opacity where possible and respects reduced motion.
   This stylesheet comes AFTER style.css so the original layout stays intact. */

:root {
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --motion-soft: cubic-bezier(.25, .8, .25, 1);
}

/* The page remains readable when JavaScript or IntersectionObserver is unavailable. */
html:not(.motion-ready) .reveal {
  opacity: 1;
  transform: none;
}

/* Subtle reading progress under the navigation, updated with one rAF per frame. */
.site-header { isolation: isolate; }
.site-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 2;
  background: linear-gradient(90deg, #178cbb, #4cc8ee);
  transform: scaleX(var(--read-progress, 0));
  transform-origin: left center;
  pointer-events: none;
}

/* Navigation gets a concise indication of the currently viewed section. */
.main-nav > a:not(.mobile-nav-cta) { position: relative; }
.main-nav > a:not(.mobile-nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  border-radius: 99px;
  background: #1699cb;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .28s var(--motion-ease);
}
.main-nav > a.active:not(.mobile-nav-cta)::after,
.main-nav > a:not(.mobile-nav-cta):hover::after,
.main-nav > a:not(.mobile-nav-cta):focus-visible::after {
  transform: scaleX(1);
}

/* For no-JS / JS-disabled browsing, the hero remains immediately visible
   once the one-time CSS entrance has finished. No permanent animation loops. */
@keyframes fin-hero-rise {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fin-hero-art {
  from { opacity: .25; transform: translate3d(10px, 24px, 0) rotate(10deg) scale(.97); }
  to { opacity: 1; transform: translate3d(0, 0, 0) rotate(7deg) scale(1); }
}
@keyframes fin-soft-drop {
  from { opacity: 0; transform: translate3d(0, -7px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fin-faq-open {
  from { opacity: .2; transform: translate3d(0, -7px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fin-status-appear {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy .eyebrow-light,
  .hero-copy h1,
  .hero-copy .hero-lead,
  .hero-copy .hero-actions,
  .hero-copy .hero-proof,
  .hero-picture,
  .hero-art-back,
  .founder-tag,
  .trust-chip {
    animation: fin-hero-rise .8s var(--motion-ease) both;
  }
  .hero-copy .eyebrow-light { animation-delay: .04s; }
  .hero-copy h1 { animation-delay: .14s; }
  .hero-copy .hero-lead { animation-delay: .27s; }
  .hero-copy .hero-actions { animation-delay: .39s; }
  .hero-copy .hero-proof { animation-delay: .52s; }
  .hero-art-back {
    animation-name: fin-hero-art;
    animation-duration: 1.05s;
    animation-delay: .18s;
  }
  .hero-picture { animation-delay: .28s; animation-duration: .95s; }
  .founder-tag { animation-delay: .63s; }
  .trust-chip { animation-delay: .77s; }

  /* Build on the old .reveal classes with gentle, grouped staggering.
     No dependency on the motion code for content visibility. */
  html.motion-ready .reveal {
    opacity: 0;
    transform: translate3d(0, 19px, 0);
    transition:
      opacity .72s var(--motion-soft),
      transform .72s var(--motion-ease),
      box-shadow .28s ease,
      border-color .28s ease;
    transition-delay:
      var(--motion-delay, 0ms),
      var(--motion-delay, 0ms),
      0ms,
      0ms;
  }
  html.motion-ready .reveal.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  html.motion-ready [data-motion-step] {
    opacity: 0;
    transform: translate3d(0, 13px, 0);
    transition:
      opacity .65s var(--motion-soft),
      transform .65s var(--motion-ease);
    transition-delay: var(--motion-delay, 0ms);
  }
  html.motion-ready [data-motion-step].is-inview {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  /* Bars are rendered at their exact final heights by app.js;
     the graph reveals only when it actually enters the screen. */
  html.motion-ready .wealth-panel .bar-fill {
    transform: scaleY(.02);
    transform-origin: bottom center;
    transition:
      transform .88s var(--motion-ease),
      height .48s var(--motion-ease);
  }
  html.motion-ready .wealth-panel.visible .bar-fill {
    transform: scaleY(1);
  }
  html.motion-ready .wealth-column:nth-child(1) .bar-fill { transition-delay: .08s, 0s; }
  html.motion-ready .wealth-column:nth-child(2) .bar-fill { transition-delay: .19s, 0s; }
  html.motion-ready .wealth-column:nth-child(3) .bar-fill { transition-delay: .3s, 0s; }

  .faq-list details[open] > p { animation: fin-faq-open .3s var(--motion-ease) both; }
  .form-status:not(:empty) { animation: fin-status-appear .34s var(--motion-ease) both; }

  .btn {
    position: relative;
    overflow: hidden;
  }
  .btn::after {
    content: "";
    pointer-events: none;
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.18) 47%, transparent 69%);
    transform: translate3d(-150%, 0, 0);
    transition: transform .65s var(--motion-ease);
  }
  .btn:active { transform: scale(.98); }
  .segmented button {
    transition: background .2s ease, color .2s ease,
      box-shadow .23s ease, transform .18s ease;
  }
  .segmented button:active { transform: scale(.975); }
  .contact-card { transition: box-shadow .32s ease, border-color .32s ease; }
  .contact-card:focus-within {
    border-color: #cce9f4;
    box-shadow: 0 27px 65px rgba(16, 101, 141, .1);
  }
  .field { transition: color .22s ease; }
  .field:focus-within { color: #0c83b5; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .btn:hover::after { transform: translate3d(150%, 0, 0); }
  .feature-card {
    position: relative;
    overflow: hidden;
    transition: box-shadow .3s ease, border-color .3s ease, transform .32s var(--motion-ease);
  }
  .feature-card::before {
    content: "";
    pointer-events: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: #25b7e8;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s var(--motion-ease);
  }
  .feature-card:hover {
    transform: translateY(-5px);
    border-color: #d0ebf5;
    box-shadow: 0 18px 37px rgba(15, 60, 89, .08);
  }
  html.motion-ready .feature-card.reveal.visible:hover {
    transform: translateY(-5px);
  }
  .feature-card:hover::before { transform: scaleX(1); }
  .feature-icon svg { transition: transform .36s var(--motion-ease); }
  .feature-card:hover .feature-icon svg { transform: rotate(-6deg) scale(1.09); }
  .myth-card:hover { border-color: #cee8f4; }
  html.motion-ready .myth-card.reveal.visible:hover { transform: translateY(-4px); }
  .about-photo img {
    transition: transform .75s var(--motion-ease);
  }
  .about-visual:hover .about-photo img { transform: scale(1.035); }
  .faq-list summary:hover { color: #087ba9; }
}

/* The mobile dropdown fades and slides without jump cuts, and hidden links
   remain unfocusable while the menu is closed. */
@media (max-width: 950px) {
  .main-nav {
    display: flex;
    visibility: hidden;
    opacity: 0;
    transform: translate3d(0, -10px, 0);
    pointer-events: none;
    transition:
      visibility .24s ease,
      opacity .24s ease,
      transform .24s var(--motion-ease);
  }
  .main-nav.is-open {
    display: flex;
    visibility: visible;
    opacity: 1;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
  }
  .main-nav > a:not(.mobile-nav-cta)::after { display: none; }
}

/* Accessibility: make ALL motion optional, including later system changes.
   Avoid hiding .reveal nodes if reduced motion becomes active midway through a page. */
@media (prefers-reduced-motion: reduce) {
  html .reveal,
  html [data-motion-step] {
    opacity: 1 !important;
    transform: none !important;
  }
  html .wealth-panel .bar-fill { transform: none !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
