/* ==========================================================================
   JobNest Rider — "See JobNest Rider in Action" animated onboarding demo
   Everything inside the phone is sized in container units (cqw), so the whole
   screen scales with the phone. Entrance animations run when a slide becomes
   .is-active; .is-paused on the root pauses every animation.
   ========================================================================== */

/* ---------- Layout ---------- */
.ob-section::before {
    content: ""; position: absolute; inset: auto -20% -30% auto; width: 620px; height: 620px; border-radius: 50%;
    background: radial-gradient(circle, var(--color-primary-a20), transparent 65%); pointer-events: none;
}
.ob-section .container { position: relative; }
.ob-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(2rem, 1rem + 4vw, 5rem);
    grid-template-areas: "head stage" "side stage"; align-items: center;
}
.ob-head { grid-area: head; align-self: end; }
.ob-side { grid-area: side; align-self: start; }
.ob-stage { grid-area: stage; position: relative; display: flex; flex-direction: column; align-items: center; }
.ob-stage__glow { position: absolute; top: 8%; left: 50%; width: 420px; max-width: 110%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 204, 0, 0.28), transparent 66%); pointer-events: none; }

/* ---------- Step list ---------- */
.ob-steps { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.6rem; }
.ob-step {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 0.9rem; width: 100%; text-align: left;
    padding: 0.85rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--color-white-a10);
    background: var(--color-white-a06); color: var(--color-text-on-dark);
    transition: background-color var(--dur), border-color var(--dur), transform var(--dur) var(--ease);
}
.ob-step:hover { border-color: var(--color-primary-a35); }
.ob-step.is-active { background: var(--color-white-a10); border-color: var(--color-primary); }
.ob-step__icon { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; background: var(--color-primary-a20); color: var(--color-primary); transition: background-color var(--dur), color var(--dur); }
.ob-step.is-active .ob-step__icon { background: var(--color-primary); color: var(--color-dark); }
.ob-step__text strong { display: block; color: var(--color-white); font-size: 0.95rem; }
.ob-step__text small { display: block; color: var(--color-text-muted-on-dark); font-size: 0.82rem; line-height: 1.45; }
.ob-step__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.ob-step__bar i { display: block; height: 100%; width: 0; background: var(--color-primary); }
.ob-highlights { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ob-highlights li { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.8rem; border-radius: var(--radius-pill); background: var(--color-white-a06); border: 1px solid var(--color-white-a10); color: var(--color-text-on-dark); font-size: 0.82rem; font-weight: var(--fw-medium); }
.ob-highlights i { color: var(--color-primary); }
.ob-note { margin-top: 1.25rem; }
.ob-note a { color: var(--color-primary); }

/* ---------- Phone ---------- */
.ob-phone.phone { width: 280px; }
.ob-screen {
    container-type: inline-size; position: relative; overflow: hidden; aspect-ratio: 9 / 19.5;
    background: #0b0d12; color: #fff; font-family: var(--font-sans);
}
.ob-slide {
    position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
    opacity: 0; visibility: hidden; transform: translateX(6%);
    transition: opacity 500ms var(--ease), transform 600ms var(--ease), visibility 0s linear 600ms;
}
.ob-slide.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity 500ms var(--ease), transform 600ms var(--ease), visibility 0s; z-index: 2; }
.ob-slide.is-leaving { transform: translateX(-6%) scale(0.98); }
.ob-slide--welcome { background: radial-gradient(120% 70% at 50% 42%, #1d2a47 0%, #0e1424 52%, #06070b 100%); }
.ob-slide--earn { background: radial-gradient(90% 55% at 15% 22%, rgba(255, 204, 0, 0.18), transparent 60%), #0c0c0d; }
.ob-slide--free { background: radial-gradient(80% 50% at 100% 25%, rgba(255, 204, 0, 0.14), transparent 60%), #0b0b0c; }
.ob-slide--login { background: linear-gradient(180deg, #f1f3f5 0%, #e7eaee 100%); color: var(--color-dark); }

/* Status + top bar */
.ob-status { display: flex; justify-content: space-between; padding: 3.2cqw 6cqw 0; font-size: 3.4cqw; font-weight: 600; opacity: 0.9; }
.ob-status span:last-child { display: flex; gap: 1.4cqw; }
.ob-topbar { display: flex; align-items: center; justify-content: space-between; padding: 3.5cqw 5cqw 0; }
.ob-brand { display: inline-flex; align-items: center; gap: 2cqw; font-size: 4.4cqw; letter-spacing: 0.04em; }
.ob-brand__logo { display: inline-flex; border-radius: 50%; }
.ob-screen .logo-halo img { animation: none; }
.ob-login__logo.logo-halo { --halo-size: 152%; }
.ob-brand img { width: 9.5cqw; height: 9.5cqw; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 0.5cqw rgba(255, 204, 0, 0.5); }
.ob-brand b { font-weight: 800; }
.ob-brand i, .ob-login__brand i { font-style: normal; font-size: 2.5cqw; font-weight: 800; letter-spacing: 0.08em; padding: 0.6cqw 1.6cqw; border-radius: 1.2cqw; background: var(--color-primary); color: var(--color-dark); }
.ob-topbar__actions { display: inline-flex; gap: 2cqw; }
.ob-round, .ob-skip { display: grid; place-items: center; height: 8.5cqw; border-radius: 99px; border: 1px solid rgba(255, 255, 255, 0.18); font-size: 3.2cqw; font-weight: 700; }
.ob-round { width: 8.5cqw; }
.ob-skip { padding: 0 3.6cqw; }

/* Copy block (bottom of dark slides) */
.ob-copy { margin-top: auto; padding: 0 6cqw 7cqw; position: relative; z-index: 2; }
.ob-label { display: block; font-size: 3.1cqw; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-primary); margin-bottom: 2.4cqw; }
.ob-title { font-size: 8.4cqw; font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 2.6cqw; color: #fff; }
.ob-title em { display: block; font-style: normal; color: var(--color-primary); }
.ob-text { font-size: 4cqw; line-height: 1.5; color: rgba(255, 255, 255, 0.72); margin: 0 0 5.5cqw; }
.ob-footer { display: flex; align-items: center; justify-content: space-between; gap: 4cqw; }
.ob-dots { display: inline-flex; gap: 1.6cqw; }
.ob-dots i { width: 2.2cqw; height: 2.2cqw; border-radius: 99px; background: rgba(255, 255, 255, 0.3); }
.ob-dots i.is-on { width: 7cqw; background: var(--color-primary); }
.ob-btn { display: inline-flex; align-items: center; justify-content: center; gap: 2cqw; height: 12cqw; padding: 0 7cqw; border-radius: 4cqw; background: var(--color-primary); color: var(--color-dark); font-size: 3.5cqw; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; box-shadow: 0 2cqw 6cqw -2cqw rgba(255, 204, 0, 0.65); }
.ob-btn--wide { flex: 1; }
.ob-btn--block { width: 100%; }
.ob-footer--wide .ob-dots { flex-shrink: 0; }
.ob-login-hint { margin: 3cqw 0 0; text-align: center; font-size: 3.4cqw; color: rgba(255, 255, 255, 0.65); }
.ob-login-hint b { color: var(--color-primary); }

/* Screen 1 · welcome visual */
.ob-stars span { position: absolute; width: 0.9cqw; height: 0.9cqw; border-radius: 50%; background: #fff; opacity: 0.15; }
.ob-hero-icon { position: absolute; left: 50%; top: 40%; width: 0; height: 0; }
.ob-coin, .ob-ring, .ob-orbit { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.ob-coin { display: grid; place-items: center; width: 34cqw; height: 34cqw; background: var(--color-primary); color: var(--color-dark); font-size: 13cqw; box-shadow: 0 0 12cqw rgba(255, 204, 0, 0.45); }
.ob-orbit { width: 50cqw; height: 50cqw; border: 0.5cqw solid rgba(255, 204, 0, 0.45); }
.ob-ring { width: 50cqw; height: 50cqw; border: 0.5cqw solid rgba(255, 204, 0, 0.5); opacity: 0; }

/* Screen 2 · earnings card */
.ob-earn-card { margin: 13cqw 7cqw 0; padding: 5cqw; border-radius: 5.5cqw; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 6cqw 14cqw -6cqw rgba(0, 0, 0, 0.8); }
.ob-earn-card__head { display: flex; align-items: center; gap: 3cqw; }
.ob-wallet { display: grid; place-items: center; flex-shrink: 0; width: 11cqw; height: 11cqw; border-radius: 3cqw; background: var(--color-primary); color: var(--color-dark); font-size: 5cqw; }
.ob-earn-card__text { flex: 1; min-width: 0; }
.ob-earn-card__text small { display: block; font-size: 3.1cqw; color: rgba(255, 255, 255, 0.6); }
.ob-earn-card__text b { display: block; font-size: 5.6cqw; font-weight: 800; }
.ob-growth { align-self: flex-start; padding: 1cqw 2.4cqw; border-radius: 99px; background: rgba(46, 204, 113, 0.15); color: #34d27b; font-size: 3cqw; font-weight: 700; white-space: nowrap; }
.ob-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 2cqw; height: 34cqw; margin-top: 6cqw; }
.ob-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 1.6cqw; }
.ob-bar i { display: block; width: 100%; height: var(--h); border-radius: 1.6cqw; background: linear-gradient(180deg, #5a5a5d, #3d3d40); transform-origin: bottom; }
.ob-bar.is-peak i { background: linear-gradient(180deg, #ffe066, var(--color-primary)); }
.ob-bar small { font-size: 2.9cqw; color: rgba(255, 255, 255, 0.5); }

/* Screen 3 · route card + perks */
.ob-route-card { position: relative; margin: 12cqw 6cqw 0; height: 42cqw; border-radius: 5cqw; border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.04);
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 7cqw 7cqw; overflow: hidden; }
.ob-online { position: absolute; top: 3.5cqw; left: 3.5cqw; z-index: 1; display: inline-flex; align-items: center; gap: 1.6cqw; padding: 1.4cqw 2.6cqw 1.4cqw 1.6cqw; border-radius: 99px; background: rgba(0, 0, 0, 0.55); font-size: 3.1cqw; font-weight: 600; }
.ob-online b { color: #34d27b; }
.ob-toggle { position: relative; width: 6.4cqw; height: 3.6cqw; border-radius: 99px; background: #2ecc71; }
.ob-toggle::after { content: ""; position: absolute; top: 0.5cqw; right: 0.5cqw; width: 2.6cqw; height: 2.6cqw; border-radius: 50%; background: #fff; }
.ob-route { position: absolute; inset: 9cqw 2cqw 2cqw; width: calc(100% - 4cqw); height: calc(100% - 11cqw); overflow: visible; }
.ob-route path { fill: none; stroke-linecap: round; }
.ob-route__track { stroke: rgba(255, 255, 255, 0.08); stroke-width: 7; }
.ob-route__line { stroke: var(--color-primary); stroke-width: 4.5; filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.55)); }
.ob-route__dot { fill: var(--color-primary); stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(255, 204, 0, 0.9)); }
.ob-perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.4cqw; margin: 4cqw 6cqw 0; }
.ob-perk { display: flex; flex-direction: column; align-items: center; gap: 2cqw; padding: 3.6cqw 1cqw; border-radius: 3.6cqw; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); font-size: 3.1cqw; font-weight: 700; text-align: center; line-height: 1.2; }
.ob-perk i { color: var(--color-primary); font-size: 5cqw; }

/* Screen 4 · phone sign-in */
.ob-login { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 7cqw 8cqw; text-align: center; }
.ob-login__logo { position: relative; display: block; width: 36cqw; height: 36cqw; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1.4cqw rgba(255, 204, 0, 0.35), 0 0 0 9cqw rgba(255, 255, 255, 0.45), 0 4cqw 10cqw -3cqw rgba(0, 0, 0, 0.35); margin-bottom: 8cqw; }
.ob-login__logo img { width: 100%; height: 100%; object-fit: cover; }
.ob-login__brand { margin: 0 0 1.4cqw; font-size: 6cqw; letter-spacing: 0.04em; }
.ob-login__brand b { font-weight: 800; }
.ob-login__brand i { background: var(--color-dark); color: var(--color-primary); vertical-align: middle; }
.ob-login__sub { margin: 0 0 7cqw; font-size: 3.6cqw; color: #6b7280; }
.ob-login__card { width: 100%; padding: 5cqw; border-radius: 5cqw; background: rgba(255, 255, 255, 0.75); box-shadow: 0 3cqw 10cqw -5cqw rgba(15, 23, 42, 0.3); text-align: left; }
.ob-login__label { display: block; font-size: 2.9cqw; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2.4cqw; }
.ob-login__field { display: flex; align-items: center; gap: 4cqw; height: 12cqw; padding: 0 4cqw; border-radius: 3cqw; background: #dfe3e8; font-size: 3.6cqw; color: #6b7280; margin-bottom: 5cqw; }
.ob-typed { position: relative; display: inline-block; overflow: hidden; white-space: nowrap; }
.ob-typed::after { content: ""; position: absolute; right: 0; top: 10%; bottom: 10%; width: 0.4cqw; background: var(--color-dark); }
.ob-login__terms { margin: 5cqw 0 0; font-size: 2.9cqw; color: #6b7280; }
.ob-slide--login .ob-status { color: var(--color-dark); }

/* ---------- Entrance animations (run when a slide becomes active) ---------- */
.ob-slide.is-active .ob-up { animation: ob-up 650ms var(--ease) both; animation-delay: var(--d, 0s); }
.ob-slide.is-active .ob-fade { animation: ob-fade 600ms var(--ease) both; animation-delay: var(--d, 0s); }
.ob-slide.is-active .ob-pop { animation: ob-pop 700ms var(--ease) both; animation-delay: var(--d, 0s); }
.ob-slide.is-active .ob-coin { animation: ob-coin 900ms var(--ease) both 0.1s, ob-coin-float 4s ease-in-out 1s infinite; }
.ob-slide.is-active .ob-orbit { animation: ob-fade 900ms var(--ease) both 0.3s; }
.ob-slide.is-active .ob-ring { animation: ob-ring 2.6s ease-out 0.5s infinite; }
.ob-slide.is-active .ob-ring--2 { animation-delay: 1.8s; }
.ob-slide.is-active .ob-stars span { animation: ob-twinkle 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ob-slide.is-active .ob-bar i { animation: ob-bar 650ms var(--ease) both; animation-delay: calc(0.45s + var(--i) * 0.08s); }
.ob-slide.is-active .ob-bar.is-peak i { animation: ob-bar 650ms var(--ease) both calc(0.45s + var(--i) * 0.08s), ob-peak 2.2s ease-in-out 1.3s infinite; }
.ob-slide.is-active .ob-login__logo { animation: ob-pop 700ms var(--ease) both 0.2s, ob-coin-float 4s ease-in-out 1.2s infinite; }
.ob-slide.is-active .ob-typed { animation: ob-type 1.1s steps(12, end) both 1.4s; }
.ob-slide.is-active .ob-typed::after { animation: ob-caret 0.9s steps(1) infinite; }

@keyframes ob-up { from { opacity: 0; transform: translateY(6cqw); } to { opacity: 1; transform: none; } }
@keyframes ob-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ob-pop { from { opacity: 0; transform: translateY(4cqw) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes ob-coin { from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); } 70% { transform: translate(-50%, -50%) scale(1.05); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes ob-coin-float { 0%, 100% { margin-top: 0; } 50% { margin-top: -1.6cqw; } }
@keyframes ob-ring { 0% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.75); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); } }
@keyframes ob-twinkle { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.6; } }
@keyframes ob-bar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes ob-peak { 0%, 100% { box-shadow: 0 0 0 rgba(255, 204, 0, 0); } 50% { box-shadow: 0 0 5cqw rgba(255, 204, 0, 0.6); } }
@keyframes ob-type { from { max-width: 0; } to { max-width: 30cqw; } }
@keyframes ob-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Paused: freeze every animation inside the demo */
.ob-layout.is-paused .ob-screen *, .ob-layout.is-paused .ob-screen *::before, .ob-layout.is-paused .ob-screen *::after { animation-play-state: paused !important; }

/* ---------- Controls ---------- */
.ob-controls { position: relative; z-index: 2; width: 280px; max-width: 100%; margin-top: 1.25rem; }
.ob-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 0.9rem; }
.ob-progress span { height: 4px; border-radius: 4px; background: var(--color-white-a16); overflow: hidden; }
.ob-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--color-primary); }
.ob-buttons { display: flex; justify-content: center; gap: 0.6rem; }
.ob-ctrl { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--color-white-a16); background: var(--color-white-a06); color: var(--color-white); transition: background-color var(--dur), color var(--dur), border-color var(--dur), transform var(--dur) var(--ease); }
.ob-ctrl:hover { background: var(--color-white); color: var(--color-dark); }
.ob-ctrl--main { width: 52px; height: 52px; background: var(--color-primary); border-color: var(--color-primary); color: var(--color-dark); box-shadow: var(--shadow-brand); }
.ob-ctrl--main:hover { background: var(--color-primary-hover); color: var(--color-dark); }
.no-js .ob-controls { display: none; }
@media (hover: hover) { .ob-ctrl:hover { transform: translateY(-2px); } .ob-step:hover { transform: translateX(3px); } }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .ob-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "side"; row-gap: 1.75rem; }
    .ob-head { text-align: center; }
    .ob-head .section-lead--start { margin-left: auto; margin-right: auto; }
    .ob-side { max-width: 560px; width: 100%; justify-self: center; }
    .ob-highlights { justify-content: center; }
}
@media (max-width: 575.98px) {
    .ob-phone.phone { width: min(262px, 78vw); }
    .ob-controls { width: min(262px, 78vw); }
    .ob-stage__glow { width: 320px; }
    .ob-section::before { width: 380px; height: 380px; }
}

/* ---------- Reduced motion: show final states, no looping effects ---------- */
@media (prefers-reduced-motion: reduce) {
    .ob-slide, .ob-slide.is-active { transition: none; transform: none; }
    .ob-slide.is-active *, .ob-slide.is-active *::after { animation: none !important; }
    .ob-ring { display: none; }
}
