/* PluginDate – 2-minute animated tour (web/tour.html). */
/* Layout: one 16:9 stage that plays the walkthrough (the product's own look), control bar under it, then the script.
   Page chrome follows the viewer's theme; the stage has its own light/dark switch for recording. */
:root {
  --bg: #f4f6f9; --panel: #ffffff; --fg: #1b1f24; --muted: #5b6470; --line: #d9dde3; --accent: #2463eb; --accent-fg: #ffffff;
  --soft: #e8eefc; --logo: #2463eb;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #1f2227; --panel: #2a2e35; --fg: #e6e9ed; --muted: #9aa4b1; --line: #3b414b; --accent: #5b8def; --accent-fg: #0b0e12; --soft: #1c2638; --logo: #e6e9ed; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #1f2227; --panel: #2a2e35; --fg: #e6e9ed; --muted: #9aa4b1; --line: #3b414b; --accent: #5b8def; --accent-fg: #0b0e12; --soft: #1c2638; --logo: #e6e9ed; color-scheme: dark; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--ui); }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; padding-block: 24px 64px; }
h1 { font-size: 26px; margin: 0 0 4px; text-wrap: balance; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 18px; max-width: 75ch; }
h2 { font-size: 19px; margin: 36px 0 10px; text-wrap: balance; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- player ---------- */
.player { background: #000; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.viewport { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #0b0e12; max-width: 100%; }
.player:fullscreen { border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
.player:fullscreen .viewport { aspect-ratio: auto; flex: 1; }
.bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--panel); border-top: 1px solid var(--line); }
.bar button { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent;
  color: var(--fg); font-size: 16px; line-height: 1; padding: 0; }
.bar button:hover { background: var(--soft); }
.bar .play { background: var(--accent); color: var(--accent-fg); border-radius: 50%; font-size: 14px; }
.bar .play:hover { background: var(--accent); filter: brightness(1.08); }
.bar #subsBtn { font: 700 12px var(--ui); letter-spacing: .03em; color: var(--muted); }
.bar #subsBtn[aria-pressed="true"] { color: var(--accent); }
.bar #voiceBtn[aria-pressed="false"] { color: var(--muted); }
.seek { flex: 1 1 auto; min-width: 60px; height: 6px; margin: 0 6px; appearance: none; -webkit-appearance: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(to right, var(--accent) var(--pct, 0%), var(--line) var(--pct, 0%)); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--accent); }
.seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--panel); }
.seek::-moz-range-track { background: transparent; }
.time { margin-right: 4px; }
.vol { flex: none; width: 70px; height: 4px; appearance: none; -webkit-appearance: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(to right, var(--fg) var(--vol, 100%), var(--line) var(--vol, 100%)); }
.vol::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--fg); }
.vol::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--fg); }
@media (max-width: 520px) { .vol { display: none; } }
.viewport { cursor: pointer; }
/* embedded on the home page (player.html in an iframe): the player fills the frame */
html.embed, html.embed body { height: 100%; margin: 0; overflow: hidden; background: var(--panel); }
html.embed .player { height: 100%; display: flex; flex-direction: column; border-radius: 0; box-shadow: none; }
html.embed .viewport { flex: 1; aspect-ratio: auto; min-height: 0; }

/* ---------- stage: the product's look, 1280 × 720 logical px, scaled to fit ---------- */
.stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden;
  --s-bg: #eef1f5; --s-panel: #ffffff; --s-fg: #1b1f24; --s-muted: #5b6470; --s-line: #d9dde3; --s-acc: #2463eb; --s-acc-fg: #ffffff;
  --s-ok: #1d7a46; --s-ok-bg: #e3f4ea; --s-bad: #b42318; --s-bad-bg: #fde7e5; --s-new: #6b3fb8; --s-new-bg: #efe7fb;
  --s-warn-bg: #fdf0da; --s-warn: #9a5b00; --s-code: #0f1720; --s-code-fg: #d6e2f0; --s-shadow: 0 2px 4px rgba(16,24,40,.06), 0 14px 34px rgba(16,24,40,.12);
  --s-band: #f3f6fb;
  background: var(--s-bg); color: var(--s-fg); font: 16px/1.45 var(--ui); }
.stage[data-look="dark"] { --s-bg: #1f2227; --s-panel: #2a2e35; --s-fg: #e6e9ed; --s-muted: #9aa4b1; --s-line: #3b414b; --s-acc: #5b8def; --s-acc-fg: #0b0e12;
  --s-ok: #5fd08f; --s-ok-bg: #16301f; --s-bad: #ff8a80; --s-bad-bg: #3a1714; --s-new: #c3a6f7; --s-new-bg: #2a1f3d;
  --s-warn-bg: #33270f; --s-warn: #f0b458; --s-code: #07090c; --s-code-fg: #c9d6e6; --s-shadow: 0 2px 4px rgba(0,0,0,.4), 0 14px 34px rgba(0,0,0,.5); --s-band: #30353d; }
.stage.paused *, .stage.paused *::before, .stage.paused *::after { animation-play-state: paused !important; }
.scene { position: absolute; inset: 0; }

/* browser window */
.win { position: absolute; left: 40px; top: 28px; width: 1200px; height: 664px; background: var(--s-bg); border-radius: 14px; overflow: hidden;
  box-shadow: var(--s-shadow); border: 1px solid var(--s-line); transition: transform .85s cubic-bezier(.22,.75,.25,1); }
.win .chrome { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: var(--s-panel); border-bottom: 1px solid var(--s-line); }
.dots i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.url { margin-left: 18px; flex: 0 1 420px; background: var(--s-bg); border-radius: 8px; padding: 4px 14px; font-size: 14px; color: var(--s-muted); }
.url b { color: var(--s-fg); font-weight: 600; }
.page { position: absolute; top: 43px; left: 0; right: 0; bottom: 0; padding: 22px 36px; overflow: hidden; }
.logo { width: 32px; height: 32px; }
/* the web page inside the window is a copy of the real page (shadow root, styled by style.css + tour_site.css) */
.page.site-page { padding: 0; }

/* overlays */
.cursor { position: absolute; left: 1300px; top: 760px; width: 26px; height: 26px; z-index: 50; pointer-events: none;
  transition: left .7s cubic-bezier(.4,.1,.2,1), top .7s cubic-bezier(.4,.1,.2,1); filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.subs { position: absolute; left: 50%; bottom: 3.5%; transform: translateX(-50%); max-width: 82%; z-index: 60; text-align: center; pointer-events: none;
  font: 600 clamp(12px, 1.9vw, 22px)/1.35 var(--ui); color: #fff; background: rgba(0,0,0,.72); padding: .35em .8em; border-radius: 8px; }
.subs:empty { display: none; }
.player:not(.with-subs) .subs { display: none; }

/* generic in-stage pieces */
.fade { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.fade.on { opacity: 1; transform: none; }
.pop { opacity: 0; transform: scale(.94); transition: opacity .4s ease, transform .4s cubic-bezier(.2,.9,.3,1.3); }
.pop.on { opacity: 1; transform: none; }
.center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }

/* scene 1 – cloud */
.cloud span { position: absolute; font: 600 17px var(--mono); color: var(--s-muted); white-space: nowrap; opacity: 0;
  transition: opacity .6s, color .6s; animation: drift 4.8s ease-in-out infinite alternate; }
.cloud span.on { opacity: .9; }
.cloud span.bad { color: var(--s-bad); }
.cloud span:nth-child(3n) { animation-duration: 6.2s; }
.cloud span:nth-child(4n) { font-size: 19px; }
@keyframes drift { from { transform: translate(-11px, 7px); } to { transform: translate(13px, -11px); } }
.hook { font-size: 54px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; max-width: 900px; text-wrap: balance; }
.hook { padding: 28px 42px; border-radius: 20px; background: color-mix(in srgb, var(--s-bg) 91%, transparent); backdrop-filter: blur(7px); }
.hook small { display: block; font-size: 24px; font-weight: 500; color: var(--s-muted); margin-top: 16px; letter-spacing: 0; }

/* scene 4 – terminal */
.term { position: absolute; left: 150px; top: 80px; width: 980px; height: 520px; background: #0b0e12; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.45); border: 1px solid #2a2f37; }
.term .chrome { height: 36px; background: #1d2128; display: flex; align-items: center; padding: 0 14px; color: #9aa4b1; font-size: 13px; }
.term .chrome span { flex: 1; text-align: center; margin-right: 54px; }
.term pre { margin: 0; padding: 18px 22px; font: 16px/1.6 var(--mono); color: #d6e2f0; white-space: pre-wrap; }
.term .g { color: #5fd08f; } .term .y { color: #f0b458; } .term .p { color: #8fb3ff; }
.caret { display: inline-block; width: 9px; height: 18px; background: #d6e2f0; vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.csvfile { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; color: var(--s-fg); }
.csvfile .doc { width: 64px; height: 80px; border-radius: 6px; background: var(--s-panel); border: 2px solid var(--s-line); position: relative; display: grid; place-items: end center; padding-bottom: 10px;
  font: 700 13px var(--ui); color: var(--s-ok); box-shadow: var(--s-shadow); }
.csvfile .doc::before { content: ""; position: absolute; right: -2px; top: -2px; border: 9px solid; border-color: var(--s-bg) var(--s-bg) var(--s-line) var(--s-line); }

/* scene 5 – offline */
.machines { position: absolute; left: 0; right: 0; top: 190px; display: flex; justify-content: center; gap: 330px; }
.mach { text-align: center; width: 260px; }
.mach svg { width: 200px; height: 150px; color: var(--s-fg); }
.mach b { display: block; font-size: 22px; }
.mach span { color: var(--s-muted); font-size: 17px; }
.mach .net { display: inline-block; margin-top: 6px; padding: 2px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.net.off { background: var(--s-bad-bg); color: var(--s-bad); } .net.on { background: var(--s-ok-bg); color: var(--s-ok); }
.usb { position: absolute; left: 400px; top: 260px; width: 90px; transition: left 2.2s cubic-bezier(.45,.05,.3,1), top 2.2s cubic-bezier(.45,.05,.3,1); }

/* drag & drop, toast, file icons */
.drag { position: absolute; z-index: 40; transition: left .9s cubic-bezier(.4,.1,.2,1), top .9s cubic-bezier(.4,.1,.2,1), opacity .3s, transform .3s; }
.toast { position: absolute; right: 60px; bottom: 50px; background: var(--s-ok); color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 17px; z-index: 30; box-shadow: var(--s-shadow); }
.files { display: flex; gap: 26px; justify-content: center; margin-top: 30px; }
.ptdoc .doc { color: var(--s-new); }

/* scene 12 */
.outro h3 { font-size: 64px; margin: 0; letter-spacing: -.02em; }
.outro h3 em { font-style: normal; color: var(--s-acc); }
.pills { display: flex; gap: 12px; justify-content: center; margin: 22px 0 28px; flex-wrap: wrap; }
.pill { border: 2px solid var(--s-acc); color: var(--s-acc); border-radius: 999px; padding: 6px 18px; font-size: 20px; font-weight: 700; }
.outro .url2 { font: 700 34px var(--ui); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.home { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--fg); text-decoration: none; }
.home svg { width: 30px; height: 32px; fill: var(--logo); }
.home span span { color: var(--accent); }
.cta { display: inline-block; background: var(--accent); color: var(--accent-fg); text-decoration: none; font-weight: 700; padding: 10px 18px; border-radius: 10px; }
.after { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.after p { margin: 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
@media (prefers-reduced-motion: reduce) { .cursor, .usb, .drag { transition-duration: .01s; } }
/* full screen without the Fullscreen API (iPhone): the player covers the window */
html.pseudo-fs, html.pseudo-fs body { overflow: hidden; }
html.pseudo-fs .player { position: fixed; inset: 0; z-index: 1000; border-radius: 0; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px); background: #000; }
html.pseudo-fs .viewport { flex: 1; aspect-ratio: auto; min-height: 0; }
