/* ---------------------------------------------------------------------
   EVIC motion layer.

   Everything that moves lives here, in one file, served straight off
   disk like the other two EVIC stylesheets. No digest, no pipeline:
   change it and the next request has it. That matters because motion
   is the part most likely to need a dozen small corrections.

   It is loaded on the homepage (its own document) and on the shared
   evic_new layout, which covers every other page on the EVIC hosts.
   Nothing here can reach analist.nl: the file is linked nowhere else,
   and every rule is additionally scoped to .homepage-shell or to
   body.evic-new.

   House rules for the timings below. This is a site about money, so
   movement has to read as precision rather than decoration: short,
   150-250ms, eased out at the end, never bouncing and never spinning.
   The one exception is a number counting up, which needs about a
   second or the reader misses it happening.
   --------------------------------------------------------------------- */

:root {
  --m-accent: #86ffcf;
  --m-accent-strong: #a8ffdd;
  --m-glow: rgba(134, 255, 207, 0.22);
  --m-glow-soft: rgba(134, 255, 207, 0.08);
  --m-fast: 140ms;
  --m-base: 200ms;
  --m-slow: 320ms;
  --m-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- Links -----------------------------------------------------------
   The underline grows from the left rather than appearing whole. Drawn
   as a background gradient, not text-decoration, because only a
   background can be animated along its width.
   Buttons dressed as links are excluded, an underline under a filled
   button looks like a mistake. */
body.evic-new .evic-main a:not([class*="btn"]):not(.evic-brand),
.homepage-shell main a:not([class*="btn"]):not([class*="cta"]) {
  background-image: linear-gradient(var(--m-accent), var(--m-accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size var(--m-base) var(--m-ease),
              color var(--m-base) var(--m-ease);
}
body.evic-new .evic-main a:not([class*="btn"]):not(.evic-brand):hover,
.homepage-shell main a:not([class*="btn"]):not([class*="cta"]):hover {
  background-size: 100% 1px;
  text-decoration: none;
}

/* --- Buttons ---------------------------------------------------------
   Lift on hover, settle on press. The press is faster than the lift on
   purpose: a control that yields slowly feels broken. */
body.evic-new .evic-btn,
body.evic-new .btn,
body.evic-new input[type="submit"],
body.evic-new button[type="submit"],
.homepage-shell .site-header__cta,
.homepage-shell .newsletter-band__button {
  transition: transform var(--m-fast) var(--m-ease),
              box-shadow var(--m-base) var(--m-ease),
              background-color var(--m-base) var(--m-ease),
              border-color var(--m-base) var(--m-ease);
}
body.evic-new .evic-btn:hover,
body.evic-new .btn:hover,
body.evic-new input[type="submit"]:hover,
body.evic-new button[type="submit"]:hover,
.homepage-shell .site-header__cta:hover,
.homepage-shell .newsletter-band__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38), 0 0 0 1px var(--m-glow);
}
body.evic-new .evic-btn:active,
body.evic-new .btn:active,
body.evic-new input[type="submit"]:active,
body.evic-new button[type="submit"]:active,
.homepage-shell .site-header__cta:active,
.homepage-shell .newsletter-band__button:active {
  transform: translateY(0) scale(0.985);
  transition-duration: 90ms;
}

/* --- Keyboard focus --------------------------------------------------
   :focus-visible only, so the ring appears for keyboard users and never
   around something just clicked with a mouse. */
body.evic-new :focus-visible,
.homepage-shell :focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --- Navigation pills -------------------------------------------------
   The container is made a positioning context so the sliding marker
   below can live inside it. */
body.evic-new .evic-pro-nav__subjects,
body.evic-new .evic-nav,
.homepage-shell .site-nav { position: relative; }

body.evic-new .evic-pro-nav__subjects a,
body.evic-new .evic-pro-nav__sections a,
.homepage-shell .site-nav a,
.homepage-shell .site-header__newsletter {
  position: relative;
  z-index: 1;
  transition: color var(--m-base) var(--m-ease),
              border-color var(--m-base) var(--m-ease),
              box-shadow var(--m-base) var(--m-ease);
}
body.evic-new .evic-pro-nav__subjects a:hover,
.homepage-shell .site-nav a:hover,
.homepage-shell .site-header__newsletter:hover {
  color: var(--m-accent);
  border-color: var(--m-accent);
  box-shadow: 0 0 0 3px var(--m-glow-soft);
}

/* The marker that slides between pills. Built by motion.js; if the
   script never runs the element never exists and the pills simply keep
   their own styling. */
.m-marker {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  height: 0;
  width: 0;
  border-radius: 999px;
  background: var(--m-glow-soft);
  border: 1px solid var(--m-glow);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--m-base) var(--m-ease),
              width var(--m-base) var(--m-ease),
              height var(--m-base) var(--m-ease),
              opacity var(--m-fast) var(--m-ease);
}

/* --- Table rows -------------------------------------------------------
   A tinted row plus an accent edge on the left. The edge is an inset
   shadow rather than a border so the row does not change width and the
   columns stay put. */
body.evic-new .evic-main table tbody tr {
  transition: background-color var(--m-base) var(--m-ease),
              box-shadow var(--m-base) var(--m-ease);
}
body.evic-new .evic-main table tbody tr:hover {
  background-color: var(--m-glow-soft);
  box-shadow: inset 3px 0 0 var(--m-accent);
}

/* --- Cards ------------------------------------------------------------ */
.homepage-shell .video-card,
.homepage-shell .promo-card,
.homepage-shell .article-list li,
body.evic-new .evic-main .panel,
body.evic-new .evic-main .well {
  transition: transform var(--m-base) var(--m-ease),
              box-shadow var(--m-base) var(--m-ease),
              border-color var(--m-base) var(--m-ease);
}
.homepage-shell .video-card:hover,
.homepage-shell .promo-card:hover,
body.evic-new .evic-main .panel:hover,
body.evic-new .evic-main .well:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

/* --- The page arriving -------------------------------------------------
   The homepage reveals section by section on scroll and already has its
   own script. Inner pages had nothing, so the content simply appeared.
   One short rise, once. */
@keyframes m-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
body.evic-new .evic-main {
  animation: m-rise var(--m-slow) var(--m-ease) both;
}

/* --- The grid behind everything ---------------------------------------
   Inner pages only. The homepage draws its own and two grids at two
   angles would read as a moire rather than a background.
   Fixed, behind the content, and untouchable by the mouse. */
@keyframes m-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-60px, -60px, 0); }
}
body.evic-new .evic-shell { position: relative; z-index: 1; }
body.evic-new::before {
  content: "";
  position: fixed;
  inset: -80px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(134, 255, 207, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(134, 255, 207, 0.045) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: m-drift 24s linear infinite;
}

/* --- The mark ---------------------------------------------------------
   A very slow breath, so the page is never completely still, and a ring
   when the reader points at it. */
@keyframes m-breathe {
  0%, 100% { opacity: 0.9; }
  50%      { opacity: 1; }
}
body.evic-new .evic-brand__mark,
.homepage-shell .brand-lockup__mark {
  animation: m-breathe 6s ease-in-out infinite;
  transition: box-shadow var(--m-base) var(--m-ease),
              transform var(--m-base) var(--m-ease);
}
body.evic-new .evic-brand:hover .evic-brand__mark,
.homepage-shell .brand-lockup:hover .brand-lockup__mark {
  box-shadow: 0 0 0 4px var(--m-glow);
  transform: rotate(-3deg);
}

/* --- Progress bar ------------------------------------------------------
   Shown while the next page is being fetched. Built by motion.js. */
.m-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  z-index: 9999;
  background: linear-gradient(90deg, var(--m-accent), var(--m-accent-strong));
  box-shadow: 0 0 12px var(--m-glow);
  opacity: 0;
  transition: width 240ms var(--m-ease), opacity 180ms var(--m-ease);
}
.m-progress.is-on { opacity: 1; }

/* --- Skeleton ---------------------------------------------------------- */
@keyframes m-shimmer {
  from { background-position: -420px 0; }
  to   { background-position: 420px 0; }
}
.m-skeleton {
  color: transparent !important;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.04);
  background-image: linear-gradient(90deg,
    transparent, rgba(134, 255, 207, 0.10), transparent);
  background-size: 420px 100%;
  background-repeat: no-repeat;
  animation: m-shimmer 1.1s linear infinite;
}

/* --- The off switch ----------------------------------------------------
   Someone who has asked their system for less movement gets the page
   finished and still, not a slower version of the same thing. */
@media (prefers-reduced-motion: reduce) {
  body.evic-new *,
  body.evic-new ::before,
  body.evic-new ::after,
  .homepage-shell *,
  .homepage-shell ::before,
  .homepage-shell ::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* --- The glow that follows the cursor ----------------------------------
   Homepage hero only. A separate element rather than ::before or
   ::after, because the hero already uses one of those for its own
   backdrop and taking the other would be a trap for whoever edits that
   file next. */
/* Naming the real children rather than excluding the decorations one
   by one. Written as .hero > * it caught whatever was added to the
   hero later and overrode its positioning: first the glow, which
   collapsed to nothing, then the constellation, which became an
   ordinary block two thousand pixels tall and pushed the headline off
   the screen. The hero's actual content is these two. */
.homepage-shell .hero > .page-width { position: relative; z-index: 1; }
.m-hero-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--m-slow) var(--m-ease);
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%),
              var(--m-glow), transparent 70%);
}
.m-hero-glow.is-on { opacity: 1; }

/* --- Numbers -----------------------------------------------------------
   The yearly returns in the screener overview. Three things happen to
   them: tabular figures so the columns line up under each other, a sign
   colour, and a bar behind the number whose length is the figure's size
   against the largest on the page.

   The bar is a real element rather than ::after. These cells are shared
   with analist.nl's own stylesheet and taking a pseudo-element that
   something else may already use is how a table quietly breaks.

   Scaled with transform, not width: a width transition on a hundred
   cells at once makes the browser lay the table out on every frame. */
body.evic-new td.color-sign,
.homepage-shell td.color-sign {
  position: relative;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
body.evic-new td.color-sign .m-val,
.homepage-shell td.color-sign .m-val { position: relative; z-index: 1; }
/* A rule under the figure rather than a block behind it. Behind it, a
   small value became a short bar hard against the cell's right padding,
   which read as a divider between columns instead of a quantity. */
body.evic-new td.color-sign .m-bar,
.homepage-shell td.color-sign .m-bar {
  position: absolute;
  right: 8px;
  bottom: 5px;
  z-index: 0;
  height: 2px;
  width: var(--w, 0%);
  border-radius: 2px;
  background: var(--m-accent);
  opacity: 0.5;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 900ms var(--m-ease);
}
body.evic-new td.color-sign.is-shown .m-bar,
.homepage-shell td.color-sign.is-shown .m-bar { transform: scaleX(1); }
body.evic-new td.color-sign.is-pos,
.homepage-shell td.color-sign.is-pos { color: var(--m-accent); }
body.evic-new td.color-sign.is-neg,
.homepage-shell td.color-sign.is-neg { color: #ff8e7a; }
body.evic-new td.color-sign.is-neg .m-bar,
.homepage-shell td.color-sign.is-neg .m-bar { background: #ff8e7a; }

/* --- How a page opens --------------------------------------------------
   Every inner page began cold with an h1 and nothing else, while the
   homepage opens each section with a small accent rule above the
   heading. The same rule is drawn here, in CSS alone, so all of them
   line up without editing several dozen templates. */
@keyframes m-rule {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
body.evic-new .evic-main .headline {
  position: relative;
  padding-top: 26px;
  margin-bottom: 24px;
}
body.evic-new .evic-main .headline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 54px;
  height: 2px;
  background: var(--m-accent);
  transform-origin: left center;
  animation: m-rule 520ms var(--m-ease) both;
}
body.evic-new .evic-main .headline h1 {
  letter-spacing: -0.02em;
  line-height: 1.08;
}

/* --- Nothing here ------------------------------------------------------
   An empty tab used to be one grey sentence adrift in the page. It is
   now a panel with a mark, so a reader can see at a glance that the
   page worked and simply has nothing to show. */
body.evic-new .evic-main .alert-info,
body.evic-new .evic-main .alert-danger {
  position: relative;
  padding: 22px 24px 22px 60px;
  border-radius: 14px;
  border: 1px solid rgba(134, 255, 207, 0.16);
  background: rgba(13, 27, 46, 0.6);
  color: #a7b8d4;
}
body.evic-new .evic-main .alert-info::before,
body.evic-new .evic-main .alert-danger::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 23px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--m-accent);
  opacity: 0.75;
}
/* A real error keeps a warm mark: an empty list and a failure should
   not look like the same event. */
body.evic-new .evic-main .alert-danger {
  border-color: rgba(255, 142, 122, 0.22);
}
body.evic-new .evic-main .alert-danger::before {
  border-color: #ff8e7a;
}

/* --- The headline arriving --------------------------------------------- */
@keyframes m-word {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.homepage-shell .hero__copy h1 .m-word {
  display: inline-block;
  animation: m-word 560ms var(--m-ease) both;
}

/* --- The marks ---------------------------------------------------------
   Stroked, never filled, and coloured by whatever text they sit beside,
   so a pill that turns mint on hover takes its mark with it. */
.m-icon {
  width: 14px;
  height: 14px;
  margin-right: 7px;
  vertical-align: -2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
  transition: opacity var(--m-base) var(--m-ease);
}
a:hover > .m-icon,
a.is-active > .m-icon { opacity: 1; }
