﻿/* "How a forward-flow partnership works" animation (PLAN WEB-01).
   Same approach as the ServiceOne sizzle reel: a 1920x1080 stage scaled to fit, one scene at a time,
   each piece waiting for its scene and then playing after its own delay (--t). Prestige Design System colours. */
:root {
	--bg: #070b16;
	--glow: #0f2a45;
	--ink: #f3f4f8;
	--dim: #b3b5bd;
	--accent: #00adef;
	--cta: #00adef; /* the Credit Unions page blue; white is too faint on it, so it takes dark text */
	--cta-hover: #33bdf2;
	--on-cta: #05080f;
	--sans: Inter, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; overflow: hidden; }
body { font-family: var(--sans); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* A 1920x1080 stage, scaled to fit any screen */
#stage {
	position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px;
	transform-origin: 0 0; overflow: hidden;
	background: radial-gradient(ellipse 70% 60% at 50% 55%, var(--glow), var(--bg) 70%);
}
#stage::after { /* fine lines so the dark does not band on a projector */
	content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .06;
	background-image: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px);
}
.grid {
	position: absolute; inset: -20%; opacity: .16;
	background-image: linear-gradient(var(--accent) 1px, transparent 1px), linear-gradient(90deg, var(--accent) 1px, transparent 1px);
	background-size: 120px 120px; transform: perspective(900px) rotateX(58deg) translateY(10%);
	animation: drift 40s linear infinite;
}
@keyframes drift { to { background-position: 0 1200px; } }

#stage.paused, #stage.paused * { animation-play-state: paused !important; }

/* Scenes */
.scene { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-start; padding: 230px 180px 0; visibility: hidden; }
.scene.on { visibility: visible; }
.scene.center { align-items: center; text-align: center; justify-content: center; padding-top: 0; }
.scene > :not(.vis) { position: relative; z-index: 1; }
.scene p, .scene h1, .scene h2 { text-shadow: 0 2px 34px rgba(5, 8, 15, .95); }

.a { opacity: 0; }
.scene.on .a { animation: var(--fx, rise) var(--dur, 1.1s) cubic-bezier(.16, 1, .3, 1) var(--t, 0s) both; }
@keyframes rise { from { opacity: 0; transform: translateY(60px); filter: blur(12px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(1.5); filter: blur(18px); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes wipe { from { opacity: 1; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes slam { 0% { opacity: 0; transform: scale(2.6); } 60% { opacity: 1; transform: scale(.95); } 100% { opacity: 1; transform: none; } }

.kicker { font-size: 32px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin-bottom: 28px; }
.huge { font-size: 146px; font-weight: 900; line-height: .98; letter-spacing: -.035em; }
.big { font-size: 104px; font-weight: 900; line-height: 1.02; letter-spacing: -.03em; }
.sub { font-size: 46px; font-weight: 400; line-height: 1.25; color: var(--dim); margin-top: 36px; max-width: 1200px; }
.scene[data-step] .huge { font-size: 124px; }
.scene[data-step] .sub { max-width: 880px; }

.scene > .reel-logo { position: absolute; top: 96px; left: 180px; width: 240px; }
.scene > .reel-logo--end { position: relative; top: auto; left: auto; width: 380px; margin-top: 70px; }
.reel-cta { display: inline-block; margin-top: 56px; padding: 26px 64px; font-size: 38px; font-weight: 600; color: var(--on-cta); text-decoration: none; background: var(--cta); border-radius: 12px; }
.reel-cta:hover { background: var(--cta-hover); }
.reel-cta:focus-visible { outline: 4px solid var(--accent); outline-offset: 6px; }

/* Step rail: shows which of the five steps the scene is about */
#rail { position: absolute; top: 70px; left: 50%; z-index: 5; display: flex; gap: 18px; transform: translateX(-50%); opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
#rail[data-step] { opacity: 1; visibility: visible; }
#rail button { font-family: inherit; cursor: pointer; background: transparent; padding: 12px 28px; font-size: 26px; font-weight: 600; color: var(--dim); border: 2px solid rgba(255, 255, 255, .18); border-radius: 999px; transition: background .4s, color .4s, border-color .4s; }
#rail[data-step="1"] button:nth-child(-n+1), #rail[data-step="2"] button:nth-child(-n+2), #rail[data-step="3"] button:nth-child(-n+3),
#rail[data-step="4"] button:nth-child(-n+4), #rail[data-step="5"] button:nth-child(-n+5) { border-color: var(--accent); color: var(--ink); }
#rail[data-step="1"] button:nth-child(1), #rail[data-step="2"] button:nth-child(2), #rail[data-step="3"] button:nth-child(3),
#rail[data-step="4"] button:nth-child(4), #rail[data-step="5"] button:nth-child(5) { background: var(--accent); color: #05080f; }
#rail button:hover { border-color: var(--accent); color: var(--ink); }
#rail button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

/* Graphics */
.vis { position: absolute; z-index: 0; }
.node { padding: 34px 56px; font-size: 44px; font-weight: 800; text-align: center; background: rgba(7, 11, 22, .85); border: 3px solid var(--accent); border-radius: 18px; box-shadow: 0 0 60px rgba(0, 173, 239, .25); }
.node--accent { background: var(--accent); color: #05080f; }

.flow { left: 180px; bottom: 210px; width: 1560px; height: 200px; display: flex; align-items: center; justify-content: space-between; }
.flow--low { bottom: 190px; }
.flow .line { flex: 1; height: 6px; margin: 0 28px; background: linear-gradient(90deg, rgba(0, 173, 239, .1), var(--accent)); border-radius: 3px; }
.token, .doc { position: absolute; left: 480px; top: 50%; opacity: 0; }
.token { width: 56px; height: 36px; margin-top: -18px; background: var(--accent); border-radius: 8px; box-shadow: 0 0 30px rgba(0, 173, 239, .6); }
.doc { margin-top: -30px; padding: 14px 26px; font-size: 28px; font-weight: 600; background: #fff; color: #05080f; border-radius: 10px; }
.scene.on .token { animation: travel 2.6s linear infinite var(--d) both; }
.scene.on .doc { animation: travelOnce 2.8s cubic-bezier(.45, 0, .2, 1) var(--d) both; }
@keyframes travel { 0% { opacity: 0; transform: translateX(0); } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateX(560px); } }
@keyframes travelOnce { 0% { opacity: 0; transform: translateX(-40px); } 15% { opacity: 1; } 100% { opacity: 1; transform: translateX(560px); } }

.pricing { right: 140px; top: 220px; width: 640px; height: 640px; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; width: 640px; }
.chip { height: 84px; background: rgba(0, 173, 239, .12); border: 3px solid var(--accent); border-radius: 14px; }

.bars { right: 160px; top: 260px; width: 620px; height: 560px; display: flex; align-items: flex-end; gap: 26px; border-bottom: 4px solid rgba(255, 255, 255, .25); }
.bar { flex: 1; height: 0; background: linear-gradient(var(--accent), rgba(0, 173, 239, .45)); border-radius: 12px 12px 0 0; }
.scene.on .bar { animation: grow 1.2s cubic-bezier(.16, 1, .3, 1) var(--d) both; }
@keyframes grow { from { height: 0; } to { height: var(--h); } }

.member { right: 140px; top: 220px; width: 640px; height: 640px; display: grid; place-items: center; }
.ring { position: absolute; left: 50%; top: 50%; width: 560px; height: 560px; border: 3px solid rgba(0, 173, 239, .55); border-radius: 50%; opacity: 0; transform: translate(-50%, -50%) scale(.35); }
.scene.on .ring { animation: pulse 3.4s ease-out infinite; }
.r2 { animation-delay: 1.1s !important; }
.r3 { animation-delay: 2.2s !important; }
@keyframes pulse { 0% { opacity: .9; transform: translate(-50%, -50%) scale(.35); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
.person { width: 250px; fill: var(--accent); filter: drop-shadow(0 0 40px rgba(0, 173, 239, .5)); }
.tag { position: absolute; padding: 14px 30px; font-size: 34px; font-weight: 600; color: var(--ink); background: rgba(7, 11, 22, .9); border: 2px solid var(--accent); border-radius: 999px; }
.tag1 { left: 0; top: 70px; } .tag2 { right: 0; top: 250px; } .tag3 { left: 40px; bottom: 60px; }

.cycle { right: 120px; top: 190px; width: 680px; height: 680px; }
.cycle svg { width: 100%; height: 100%; }
.orbit { fill: none; stroke: rgba(0, 173, 239, .4); stroke-width: 4; stroke-dasharray: 10 16; }
.dot { fill: var(--bg); stroke: var(--accent); stroke-width: 7; }
.dot:first-child { fill: var(--accent); }
.hub { fill: rgba(0, 173, 239, .12); stroke: var(--accent); stroke-width: 4; }
.hubtext { font-size: 34px; font-weight: 800; fill: var(--ink); }

.results { list-style: none; margin-top: 10px; }
.results li { margin-bottom: 26px; font-size: 84px; font-weight: 900; line-height: 1.05; letter-spacing: -.03em; text-shadow: 0 2px 34px rgba(5, 8, 15, .95); }
.results li::before { content: '\2713'; margin-right: 36px; color: var(--accent); }

.pillar { font-size: 82px; font-weight: 900; line-height: 1.1; letter-spacing: -.03em; margin: 8px 0; }
.scene.center { padding-bottom: 130px; }

/* Controls and chrome */
.reel-back { position: fixed; top: 20px; left: 24px; z-index: 12; font-size: 18px; color: var(--dim); text-decoration: none; }
.reel-back:hover, .reel-back:focus-visible { color: var(--ink); text-decoration: underline; }
.reel-skip { position: fixed; left: 8px; top: -60px; z-index: 30; padding: 10px 16px; color: #05080f; background: #fff; }
.reel-skip:focus { top: 8px; }
#bar { position: fixed; left: 0; bottom: 0; z-index: 12; width: 0; height: 6px; background: var(--accent); }
#controls { position: fixed; left: 50%; bottom: 24px; z-index: 12; display: flex; gap: 6px; padding: 8px; transform: translateX(-50%); background: rgba(5, 8, 15, .82); border: 1px solid rgba(0, 173, 239, .35); border-radius: 14px; }
#controls button { min-width: 44px; min-height: 44px; padding: 0 18px; white-space: nowrap; font: 600 16px/1 var(--sans); color: var(--ink); background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
#controls button:hover { background: rgba(0, 173, 239, .18); }
#controls button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#btnPlay { color: var(--on-cta) !important; background: var(--cta) !important; }
#btnPlay:hover { background: var(--cta-hover) !important; }
#controls .music { display: flex; align-items: center; gap: 6px; margin-left: 8px; padding-left: 14px; font: 600 16px/1 var(--sans); color: var(--dim); border-left: 1px solid rgba(255, 255, 255, .2); }
#music { min-height: 44px; padding: 0 12px; font: 600 16px/1 var(--sans); color: var(--ink); background: transparent; border: 1px solid rgba(0, 173, 239, .35); border-radius: 10px; cursor: pointer; }
#music option { color: #05080f; background: #fff; }
#music:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.transcript { position: fixed; inset: 0; z-index: 20; overflow: auto; padding: 90px 12vw; background: #05080f; line-height: 1.6; }
.transcript[hidden] { display: none; }
.transcript h2 { margin-bottom: 24px; font-size: 34px; }
.transcript li { margin: 0 0 14px 1.2em; font-size: 22px; color: var(--dim); }
.transcript a { color: var(--accent); }
.transcript h2:focus { outline: none; }
.transcript__close { position: fixed; top: 18px; right: 24px; min-width: 44px; min-height: 44px; padding: 0 20px; font: 600 16px/1 var(--sans); color: var(--ink); background: rgba(0, 173, 239, .15); border: 1px solid var(--accent); border-radius: 10px; cursor: pointer; }
.transcript__close:hover { background: rgba(0, 173, 239, .3); }
.transcript__close:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (max-width: 900px) {
	#controls { flex-wrap: wrap; justify-content: center; width: calc(100% - 20px); }
}

@media (max-width: 600px) {
	#controls { flex-wrap: wrap; justify-content: center; width: calc(100% - 20px); bottom: 10px; }
	#controls button, #music, #controls .music { padding: 0 12px; font-size: 14px; }
	#controls .music { margin-left: 0; border-left: 0; }
	.reel-back { font-size: 16px; }
}

/* Without scripts, show the text version instead of the stage */
html:not(.js) #stage, html:not(.js) #controls, html:not(.js) #bar { display: none; }
html:not(.js) .transcript[hidden] { display: block; }

@media (prefers-reduced-motion: reduce) {
	.grid { animation: none; }
	.scene.on .a { animation: none; opacity: 1; }
	.scene.on .bar { animation: none; height: var(--h); }
	.scene.on .ring { animation: none; opacity: .5; transform: translate(-50%, -50%) scale(.9); }
	.scene.on .token, .scene.on .doc { animation: none; opacity: 1; transform: translateX(280px); }
	.scene .vis * { transition: none; }
}
