/* Shared player for presentation, explainer and tutorial samples.
   Each sample sets its brand with --bg, --ink, --muted, --acc, --acc2, --soft, --line, --font, --display, --dw. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: #081426; color: #fff; font-family: "Plus Jakarta Sans", system-ui, sans-serif; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; height: 100vh; height: 100dvh; overflow: hidden; -webkit-font-smoothing: antialiased; }

/* Page chrome */
.bar { display: flex; align-items: center; gap: 20px; padding: 14px 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.back { font-size: 14px; color: rgba(255,255,255,.65); text-decoration: none; white-space: nowrap; }
.back:hover { color: #fff; }
.ttl { flex: 1; min-width: 0; }
.ttl b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttl span { font-size: 12px; color: #67e0d6; font-weight: 600; letter-spacing: .04em; }
.cta { background: #2563eb; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 9px; white-space: nowrap; }
.cta:hover { background: #1d4fc4; }
@media (max-width: 640px) { .back { display: none; } .cta { font-size: 13px; padding: 8px 12px; } .bar { padding: 12px 16px; } }
.view { display: grid; place-items: center; padding: 20px 24px; min-height: 0; min-width: 0; overflow: hidden; }
@media (max-width: 640px) { .view { padding: 16px; } }
.frame { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(0,0,0,.7); }
.controls { display: flex; align-items: center; gap: 10px; padding: 0 24px 10px; width: 100%; max-width: 1180px; margin: 0 auto; }
.ctl { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ctl:hover { background: rgba(255,255,255,.16); }
.ctl svg { width: 18px; height: 18px; }
.segs { flex: 1; display: flex; gap: 5px; }
.seg { flex: 1; height: 22px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; }
.seg span { position: relative; display: block; width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.seg i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #2563eb, #14a3a0); }
.count { font-size: 13px; color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.note { text-align: center; font-size: 12px; color: rgba(255,255,255,.45); padding: 0 16px 14px; }

/* Embedded thumbnail mode (?embed) */
body.embed { grid-template-rows: 1fr; background: var(--bg); }
.embed .bar, .embed .controls, .embed .note { display: none; }
.embed .view { padding: 0; }
.embed .frame { border-radius: 0; box-shadow: none; }

/* Stage: everything inside is laid out on a fixed 1280 × 720 canvas and scaled to fit */
.stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font), system-ui, sans-serif; }
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
.scene.on { opacity: 1; visibility: visible; }
.chrome { position: absolute; z-index: 5; transition: opacity .4s; }
.stage:has(> .scene:first-of-type.on) .chrome { opacity: 0; }

/* Type & layout helpers */
.pad { position: absolute; inset: 0; padding: 80px 96px; display: flex; flex-direction: column; justify-content: center; }
.pad.center { align-items: center; text-align: center; }
.k { font-size: 17px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--acc); }
.h1 { font-family: var(--display), serif; font-weight: var(--dw, 800); font-size: 92px; line-height: 1.02; letter-spacing: -.03em; }
.h2 { font-family: var(--display), serif; font-weight: var(--dw, 800); font-size: 56px; line-height: 1.08; letter-spacing: -.025em; max-width: 1000px; }
.lead { font-size: 26px; line-height: 1.5; color: var(--muted); max-width: 760px; }
.k + .h1, .k + .h2 { margin-top: 18px; }
.h1 + .lead, .h2 + .lead { margin-top: 22px; }
.small { font-size: 15px; color: var(--muted); }
.foot { position: absolute; left: 96px; bottom: 40px; font-size: 14px; color: var(--muted); }

/* Animations (play each time a scene becomes active). Delay with style="--d:.4s" */
.scene.on .a   { animation: up .8s cubic-bezier(.2,.7,.2,1) var(--d,0s) both; }
.scene.on .a-l { animation: left .8s cubic-bezier(.2,.7,.2,1) var(--d,0s) both; }
.scene.on .a-s { animation: zoom .8s cubic-bezier(.2,.7,.2,1) var(--d,0s) both; }
.scene.on .a-f { animation: fade .9s ease var(--d,0s) both; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.scene.on .draw { animation: draw var(--t,1.4s) ease var(--d,0s) both; }
.grow { transform-box: fill-box; transform-origin: 50% 100%; }
.scene.on .grow { animation: growY .9s cubic-bezier(.2,.7,.2,1) var(--d,0s) both; }
.grow-x { transform-box: fill-box; transform-origin: 0 50%; }
.scene.on .grow-x { animation: growX 1s cubic-bezier(.2,.7,.2,1) var(--d,0s) both; }
.pop { transform-box: fill-box; transform-origin: 50% 50%; }
.scene.on .pop { animation: pop .6s cubic-bezier(.3,1.5,.5,1) var(--d,0s) both; }
.scene.on .pulse { animation: pop .6s cubic-bezier(.3,1.5,.5,1) var(--d,0s) both, pulse 1.8s ease-in-out calc(var(--d,0s) + .8s) infinite; }
.scene.on .float { animation: float 4s ease-in-out infinite; }
@keyframes up { from { opacity: 0; transform: translateY(26px); } }
@keyframes left { from { opacity: 0; transform: translateX(-46px); } }
@keyframes zoom { from { opacity: 0; transform: scale(.86); } }
@keyframes fade { from { opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes growY { from { transform: scaleY(0); } }
@keyframes growX { from { transform: scaleX(0); } }
@keyframes pop { from { opacity: 0; transform: scale(0); } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes float { 50% { transform: translateY(-12px); } }

/* Tutorial cursor, click ripple, typing caret */
.cursor { position: absolute; left: 0; top: 0; width: 34px; height: 34px; margin: -3px 0 0 -6px; z-index: 30; opacity: 0; pointer-events: none; transition: left .8s cubic-bezier(.5,0,.2,1), top .8s cubic-bezier(.5,0,.2,1), opacity .3s, transform .12s; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 2.5v17.2l4.6-4.3 3 6.6 3-1.4-3-6.4h6.2z' fill='%23111' stroke='%23fff' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E"); filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.cursor.show { opacity: 1; }
.cursor.jump { transition: opacity .3s; }
.cursor.press { transform: scale(.82); }
.ripple { position: absolute; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; border: 3px solid var(--acc); z-index: 29; pointer-events: none; animation: ripple .6s ease-out forwards; }
@keyframes ripple { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.typing::after { content: ""; display: inline-block; width: 2px; height: 1.1em; vertical-align: -.15em; margin-left: 2px; background: currentColor; animation: blink .8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Captions (explainers & tutorials) */
.cap { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); width: max-content; max-width: 1000px; z-index: 25; background: rgba(8,12,20,.84); color: #fff; font: 500 23px/1.4 var(--font), system-ui, sans-serif; padding: 12px 26px; border-radius: 12px; text-align: center; opacity: 0; transition: opacity .4s; }
.cap.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .scene.on *, .scene.on *::after { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .cursor { transition: opacity .2s; }
}
