/* The public Investments page (/investments, iv-*). It sits on .mw for the site's tokens and type. Each section is an
   iv-story: the words on one side (heading, paragraph, the view tabs and a line on what the view shows) and a stage on
   the other (PublicStageIv*.razor, wwwroot/css/investments-stages.css), alternating sides like the rest of the site.
   The screenshot styles below (iv-shot, iv-fx, iv-duo, iv-zoom) are kept for PublicShot.razor, which the page no
   longer uses: earlier it showed one real screenshot of the app under a centered heading. The screenshots are the app's own
   cards with transparent corners (PublicShot.razor), so they need no frame, only a soft shadow; light and dark
   captures swap with the theme.
   Motion: wwwroot/js/public-scenes.js sets --p (0 to 1) on every [data-iv-scene] as it scrolls into view. The
   screenshot rises in over the first part of --p and the effects in .iv-fx play over the rest, each in its own window
   (--at, --len). Effects are placed in percent of the screenshot (--x --y --w --h), so they hold at every size.
   Without the script --p stays 1 and everything shows finished. */
.iv { --iv-wide: 1368px; --iv-card: #fff; --iv-sheet: #fcfdfd; --iv-accent: var(--ci-investments-accent); --iv-shadow: drop-shadow(0 16px 30px rgba(27, 31, 58, .11)); }
[data-bs-theme="dark"] .iv { --iv-card: #161b28; --iv-sheet: #0c0f19; --iv-shadow: drop-shadow(0 16px 30px rgba(0, 0, 0, .5)); }
.iv .iv-wrap { max-width: var(--iv-wide); margin-inline: auto; padding-inline: 24px; }

/* Type. Sizes are set here on purpose: .mw's own h1/h2 are the large marketing sizes. */
.mw.iv h1 { max-width: 22em; margin: 0 auto 16px; font-size: clamp(28px, 3vw, 40px); font-weight: 800; line-height: 1.15; letter-spacing: -.025em; text-wrap: balance; }
.mw.iv h2 { margin: 0 0 12px; font-size: clamp(22px, 2.1vw, 28px); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.iv .iv-kicker { margin: 0 0 12px; font-size: 13px; font-weight: 700; }
.mw.iv .iv-kicker, .mw.iv .iv-kicker a { color: var(--ci-investments-accent); }
.iv .iv-kicker a:hover { text-decoration: underline; }

.iv .iv-hero { padding: 132px 0 64px; text-align: center; }
.iv .iv-lead { max-width: 640px; margin: 0 auto; font-size: 17px; line-height: 1.65; }
.iv .iv-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 22px; margin-top: 24px; }
.mw.iv .iv-actions .btn { padding: 11px 22px; font-size: 14px; }
.iv .iv-actions a:not(.btn) { color: var(--mw-text); font-size: 14px; font-weight: 700; }
.iv .iv-actions a:not(.btn):hover { color: var(--bs-primary); }
.iv .iv-hero .iv-shot { margin-top: 44px; }

.iv .iv-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 28px; padding-block: 10px; border-block: 1px solid var(--mw-border); }
.iv .iv-jump a { display: inline-flex; align-items: center; min-height: 40px; color: var(--mw-muted); font-size: 13px; font-weight: 700; }
.iv .iv-jump a:hover { color: var(--mw-text); }

.iv .iv-section { padding-block: 72px; }
/* The rule between sections lines up with the content, not with the padded edge of the container. */
.iv .iv-section + .iv-section { background: linear-gradient(var(--mw-border), var(--mw-border)) top center / calc(100% - 48px) 1px no-repeat; }
.iv .iv-section:last-child { padding-bottom: 56px; }
.iv .iv-copy { max-width: 660px; margin-inline: auto; text-align: center; }
.iv .iv-copy > p { margin: 0; font-size: 16px; line-height: 1.7; }
.iv .iv-section > .iv-shot, .iv .iv-section > .iv-duo, .iv .iv-panel { margin-top: 36px; }
.mw.iv .iv-note { max-width: 660px; margin: 22px auto 0; font-size: 12.5px; line-height: 1.6; text-align: center; }

/* A screenshot. The frame is as wide as the file it was resampled to and no wider. */
.iv .iv-shot { margin: 0; }
.iv .iv-frame { position: relative; margin-inline: auto; container-type: inline-size; --e: clamp(0, calc(var(--p, 1) / .28), 1); opacity: var(--e); transform: translate3d(0, calc((1 - var(--e)) * 32px), 0) scale(calc(.965 + .035 * var(--e))); transform-origin: 50% 100%; }
.iv .iv-shot-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.iv .iv-shot-open img, .iv .iv-pop img { display: block; width: 100%; height: auto; filter: var(--iv-shadow); }
/* Theme swap. Typed on img so it outranks the display: block above (.iv .iv-shot-open img ties .iv .iv-dark and wins). */
.iv img.iv-dark, [data-bs-theme="dark"] .iv img.iv-light { display: none; }
[data-bs-theme="dark"] .iv img.iv-dark { display: block; }
.mw.iv .iv-shot figcaption, .mw.iv .iv-caption { max-width: 660px; margin: 18px auto 0; color: var(--mw-muted); font-size: 14px; line-height: 1.65; text-align: center; }
.iv [data-iv-scene] { --p: 1; }

/* Effects over a screenshot. --t is each effect's own 0..1 inside the scene's --p. */
.iv .iv-fx { position: absolute; inset: 0; pointer-events: none; }
.iv .iv-fx > * { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); --t: clamp(0, calc((var(--p, 1) - var(--at, 0)) / var(--len, .2)), 1); }
.iv .iv-wipe, .iv .iv-cover, .iv .iv-spot { width: calc(var(--w) * 1%); height: calc(var(--h) * 1%); }
/* A patch of the card's own colour over part of the capture. Taking it away is what makes a chart draw itself, bars
   grow or a row arrive. .is-sheet is the dialog background instead of the card. */
.iv .iv-wipe, .iv .iv-cover { --fill: var(--iv-card); }
.iv .iv-wipe.is-sheet, .iv .iv-cover.is-sheet { --fill: var(--iv-sheet); }
.iv .iv-wipe::before { content: ""; position: absolute; inset: 0; background: var(--fill); clip-path: inset(0 0 0 calc(var(--t) * 100%)); }
.iv .iv-wipe::after { content: ""; position: absolute; top: 4%; bottom: 4%; left: calc(var(--t) * 100%); width: 2px; margin-left: -1px; border-radius: 2px; background: linear-gradient(transparent, var(--iv-accent), transparent); opacity: calc(min(var(--t), 1 - var(--t)) * 14); }
.iv .iv-wipe.is-row::after { display: none; }
.iv .iv-cover { background: var(--fill); }
.iv .iv-cover.is-fade { opacity: calc(1 - var(--t)); }
.iv .iv-cover.is-rise { transform-origin: 50% 0; transform: scaleY(calc(1 - var(--t))); }
/* A focus ring around one part of the capture. --out, when set, is where it lets go again. */
.iv .iv-spot { --o: clamp(0, calc((var(--p, 1) - var(--out, 9)) / .1), 1); border-radius: clamp(5px, 1cqw, 12px); box-shadow: 0 0 0 max(1.5px, .16cqw) var(--iv-accent), 0 0 0 max(4px, .6cqw) color-mix(in srgb, var(--iv-accent) 20%, transparent); opacity: calc(var(--t) * (1 - var(--o))); transform: scale(calc(1.05 - .05 * var(--t))); }
.iv .iv-spot.is-round { border-radius: 50%; }
/* A soft pulse on one point. */
.iv .iv-ping { width: 0; height: 0; opacity: var(--t); }
.iv .iv-ping::before, .iv .iv-ping::after { content: ""; position: absolute; left: 50%; top: 50%; width: clamp(14px, 2cqw, 26px); aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--iv-accent); transform: translate(-50%, -50%) scale(.4); opacity: 0; animation: iv-ping 2.4s cubic-bezier(.2, .6, .3, 1) infinite; }
.iv .iv-ping::after { animation-delay: 1.2s; }
@keyframes iv-ping { 0% { transform: translate(-50%, -50%) scale(.4); opacity: .9; } 100% { transform: translate(-50%, -50%) scale(2.1); opacity: 0; } }
/* A numbered step beside a focus ring. */
.iv .iv-tag { --o: clamp(0, calc((var(--p, 1) - var(--out, 9)) / .1), 1); display: inline-flex; align-items: center; gap: .5em; padding: .42em .8em .42em .46em; border-radius: 99px; background: var(--mw-text); color: var(--ci-base-page); font-size: clamp(9px, 1.25cqw, 12.5px); font-weight: 700; line-height: 1; white-space: nowrap; opacity: calc(var(--t) * (1 - var(--o))); transform: translate3d(0, calc((1 - var(--t)) * .7em), 0); }
.iv .iv-tag b { display: grid; place-items: center; width: 1.55em; aspect-ratio: 1; border-radius: 50%; background: var(--iv-accent); color: #fff; font-weight: 800; }
[data-bs-theme="dark"] .iv .iv-tag b { color: #06231a; }

/* Two captures in one scene: the rule editor, and the alert it produces arriving beside it. */
.iv .iv-duo { position: relative; max-width: 1320px; margin-inline: auto; }
.iv .iv-duo .iv-shot { width: 69.7%; }
.iv .iv-pop { position: absolute; right: 0; top: 15%; width: 34.85%; --t: clamp(0, calc((var(--p, 1) - .64) / .28), 1); opacity: var(--t); transform: translate3d(calc((1 - var(--t)) * 56px), calc((1 - var(--t)) * 28px), 0) scale(calc(.94 + .06 * var(--t))); transform-origin: 0 100%; container-type: inline-size; }
.iv .iv-pop .iv-tag { position: absolute; right: 4%; bottom: calc(100% + .9em); font-size: clamp(9px, 2.7cqw, 12.5px); }

/* Views of one area: plain text tabs over a single screenshot. */
.iv .iv-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 26px; width: fit-content; max-width: 100%; margin: 28px auto 0; border-bottom: 1px solid var(--mw-border); }
.iv .iv-tabs button { margin-bottom: -1px; padding: 10px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--mw-muted); font: inherit; font-size: 14px; font-weight: 700; }
.iv .iv-tabs button:hover { color: var(--mw-text); }
.iv .iv-tabs button.is-active { border-bottom-color: var(--ci-investments-accent); color: var(--mw-text); }
.iv .iv-panel { margin-top: 30px; }

/* A section with its words beside its stage. The stage's panel hangs toward the words, as on every other page. */
.iv .iv-story { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(36px, 5vw, 84px); }
.iv .iv-story > .iv-copy { max-width: 470px; margin: 0; text-align: left; }
.iv .iv-story.is-reversed { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
.iv .iv-story.is-reversed > .iv-copy { order: 2; }
.iv .iv-story .iv-tabs button.is-active { border-bottom-color: var(--mw-text); }
.mw.iv .iv-story h2 { margin-bottom: 16px; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.15; letter-spacing: -.03em; }
.iv .iv-story .iv-tabs { justify-content: flex-start; gap: 0 20px; margin: 26px 0 0; }
.mw.iv .iv-story .iv-view { min-height: 4.95em; margin: 14px 0 0; color: var(--mw-muted); font-size: 14px; line-height: 1.65; }
.mw.iv .iv-story .iv-note { max-width: none; margin: 18px 0 0; text-align: left; }
.iv .iv-stage { min-width: 0; }
.iv .iv-story .iv-panel { margin-top: 0; }
.iv .iv-story .iv-panel[hidden] { display: none; }
@media (min-width: 992px) {
    .iv .iv-story.is-reversed .ps-card { margin-right: -30px; margin-left: 28px; }
}
@media (max-width: 991.98px) {
    .iv .iv-story, .iv .iv-story.is-reversed { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .iv .iv-story.is-reversed > .iv-copy { order: 0; }
    .iv .iv-story > .iv-copy { max-width: 660px; }
    .mw.iv .iv-story .iv-view { min-height: 0; }
}

.iv .iv-limits { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 20px 56px; align-items: start; max-width: 1040px; margin-inline: auto; }
.iv .iv-limits p { margin: 0; font-size: 15px; line-height: 1.7; }
.iv .iv-limits p + p { margin-top: 12px; }
.iv .iv-limits a { color: var(--bs-primary); font-weight: 700; }
.iv .iv-limits a:hover { text-decoration: underline; }

/* The full-size capture, opened from a screenshot. Wide captures scroll sideways on a small screen instead of shrinking. */
.iv .iv-zoom { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: clamp(12px, 3vw, 40px); background: rgba(11, 15, 25, .8); cursor: zoom-out; }
.iv .iv-zoom-dialog { position: relative; max-width: 100%; max-height: 100%; display: flex; cursor: default; }
.iv .iv-zoom-scroll { overflow: auto; max-width: 100%; max-height: calc(100vh - clamp(24px, 6vw, 80px)); border-radius: 18px; }
.iv .iv-zoom-scroll img { max-width: none; height: auto; }
.iv .iv-zoom-scroll img:not(.iv-dark) { display: block; }
.iv .iv-zoom .iv-dark, [data-bs-theme="dark"] .iv .iv-zoom .iv-light { display: none; }
[data-bs-theme="dark"] .iv .iv-zoom .iv-dark { display: block; }
.iv .iv-zoom-close { position: absolute; top: 10px; right: 10px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(11, 15, 25, .75); color: #fff; font-size: 24px; }
@media (min-width: 992px) {
    .iv .iv-zoom-scroll img { max-width: 100%; }
}
@media (max-width: 767.98px) {
    .iv .iv-wrap { padding-inline: 20px; }
    .iv .iv-section + .iv-section { background-size: calc(100% - 40px) 1px; }
    .iv .iv-hero { padding: 108px 0 44px; }
    .iv .iv-hero .iv-shot { margin-top: 32px; }
    .iv .iv-lead { font-size: 16px; }
    .iv .iv-copy > p { font-size: 15px; }
    .iv .iv-section { padding-block: 52px; }
    .iv .iv-tabs { gap: 0 18px; }
    .iv .iv-tabs button { font-size: 13px; }
    .iv .iv-limits { grid-template-columns: 1fr; }
    .iv .iv-duo .iv-shot { width: 100%; }
    .iv .iv-pop { position: relative; top: auto; width: 74%; margin: -16% 0 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .iv .iv-ping::before, .iv .iv-ping::after { animation: none; opacity: .7; transform: translate(-50%, -50%) scale(1.2); }
}
