/* Look of the product tour. Dark, calm, with the CS WorkHub teal as the accent. */
:root {
  --bg: #0b1626;
  --panel: #12233b;
  --panel-2: #172c49;
  --line: #254064;
  --text: #e8eef6;
  --muted: #9db0c8;
  --teal: #3aa89c;
  --teal-2: #52c7b8;
  --amber: #f0b429;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 700px at 70% -10%, #17335a 0%, var(--bg) 60%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, select:focus-visible, .progress:focus-visible, .chapters a:focus-visible { outline: 3px solid var(--teal-2); outline-offset: 2px; }

.app { min-height: 100%; display: flex; flex-direction: column; max-width: 1600px; margin: 0 auto; padding: 0 16px 24px; }
.top { display: flex; align-items: center; gap: 16px; padding: 14px 4px; }
.top-title { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); padding-left: 16px; }
.top-time { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.site-back { color: var(--muted); font-size: 14px; text-decoration: none; margin-left: 8px; }
.site-back:hover { color: var(--teal-2); }
.in-frame .top { display: none; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }

/* The stage keeps the shape of the captures (16:9) */
.stage {
  position: relative; aspect-ratio: 16 / 9; width: 100%; max-width: 100%; border-radius: 14px; overflow: hidden;
  background: #0a1220; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.chrome {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0; height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 12px;
  background: #1b2b43; border-bottom: 1px solid var(--line);
}
.chrome .dot { width: 10px; height: 10px; border-radius: 50%; background: #3b5273; }
.chrome .url { margin-left: 12px; flex: 0 1 460px; background: #0f1c30; color: var(--muted); border-radius: 12px; padding: 3px 14px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen { position: absolute; left: 0; right: 0; top: 30px; bottom: 0; overflow: hidden; background: #e8f1f0; }

/* A scene: its frames (captures) cross-fade, and the whole scene moves like a camera */
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; transform-origin: 50% 50%; will-change: transform; }
.slide.active { opacity: 1; z-index: 2; }
.slide.cam { transition: opacity .6s ease, transform 1.4s cubic-bezier(.45, .05, .25, 1), transform-origin 1.4s cubic-bezier(.45, .05, .25, 1); }
.slide.drift { transition: opacity .6s ease, transform 14s linear; }
.frame { position: absolute; inset: 0; opacity: 0; transition: opacity .55s ease; }
.frame.show { opacity: 1; }
.frame img { display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; }

/* Callouts: a ring around part of a capture, with its label */
.spot { position: absolute; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.spot.seen { opacity: 1; pointer-events: auto; cursor: pointer; }
.spot .ring {
  position: absolute; inset: -5px; border-radius: 12px; border: 3px solid var(--amber);
  box-shadow: 0 0 0 9999px rgba(8, 16, 28, 0); transition: box-shadow .5s ease, border-color .3s ease, opacity .3s ease; opacity: 0;
}
.spot.seen .ring { opacity: .45; border-width: 2px; }
.spot.on .ring { opacity: 1; border-width: 3px; box-shadow: 0 0 0 9999px rgba(8, 16, 28, .42), 0 0 26px 2px rgba(240, 180, 41, .75); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { border-color: #ffd36b; } }
.spot .tip {
  position: absolute; left: 0; top: calc(100% + 14px); z-index: 4; background: #0e1c31; color: #fff; border: 1px solid var(--amber); border-radius: 10px;
  padding: 8px 14px; font-size: 21px; font-weight: 600; width: max-content; max-width: 560px; line-height: 1.25;
  opacity: 0; transform: translateY(-8px) scale(.97); transition: opacity .35s ease, transform .35s ease; box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.spot.flip .tip { top: auto; bottom: calc(100% + 14px); }
.spot.right .tip { left: auto; right: 0; }
.spot.inside .tip { top: 14px; left: 14px; }
.spot.on .tip, .spot.pinned .tip { opacity: 1; transform: none; }

/* The cursor that moves to each callout, and its click */
.cursor { position: absolute; z-index: 5; width: 30px; height: 30px; margin: -3px 0 0 -4px; pointer-events: none; opacity: 0;
  transition: left 1s cubic-bezier(.5, .05, .2, 1), top 1s cubic-bezier(.5, .05, .2, 1), opacity .4s ease; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.cursor.on { opacity: 1; }
.cursor svg { display: block; width: 100%; height: 100%; }
.cursor .ripple { position: absolute; left: 4px; top: 3px; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid var(--amber); opacity: 0; transform: scale(.2); }
.cursor.click .ripple { animation: ripple .7s ease-out; }
.cursor.click svg { animation: press .3s ease; }
@keyframes ripple { 0% { opacity: .95; transform: scale(.2); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes press { 50% { transform: scale(.82); } }

/* Section title that opens each scene */
.title-card { position: absolute; z-index: 7; inset: 30px 0 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(800px 400px at 50% 40%, rgba(58, 168, 156, .28), transparent 70%), rgba(9, 18, 32, .9); opacity: 0; pointer-events: none; }
.title-card.show { animation: title-in 2s ease forwards; }
.title-card .title-logo { width: clamp(140px, 22%, 300px); height: auto; display: none; }
.title-card.first .title-logo { display: block; }
.title-num { font-size: clamp(12px, 1.4vw, 18px); letter-spacing: .3em; text-transform: uppercase; color: var(--teal-2); }
.title-name { font-size: clamp(26px, 5vw, 64px); font-weight: 700; letter-spacing: -.01em; }
.title-card.show .title-name { animation: title-name 2s ease forwards; }
@keyframes title-in { 0% { opacity: 0; } 15% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; } }
@keyframes title-name { 0% { transform: translateY(18px); opacity: 0; } 25% { transform: none; opacity: 1; } 100% { transform: translateY(-6px); } }

.captions {
  position: absolute; z-index: 6; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(86%, 1000px); text-align: center;
  background: rgba(7, 14, 25, .84); backdrop-filter: blur(6px); border-radius: 12px; padding: 10px 18px; font-size: clamp(14px, 1.9vw, 24px); line-height: 1.35;
  transition: opacity .25s ease; pointer-events: none;
}
.captions:empty, .captions.off { opacity: 0; }

/* Start and end screens */
.poster, .end-card {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px;
  background: radial-gradient(900px 500px at 50% 20%, rgba(58, 168, 156, .22), transparent 70%), linear-gradient(180deg, #11233c, #0a1424);
}
.poster-logo { width: clamp(150px, 24%, 300px); height: auto; animation: logo-in 1.2s ease both; }
@keyframes logo-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.poster h1 { margin: 14px 0 0; font-size: clamp(24px, 3.6vw, 44px); letter-spacing: -.01em; }
.poster p { margin: 0; color: var(--muted); font-size: clamp(14px, 1.6vw, 19px); }
.poster .hint { margin-top: 22px; font-size: 13px; opacity: .8; }
.big-play {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 12px; padding: 14px 30px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #06241f; font-weight: 800; font-size: 19px; box-shadow: 0 14px 40px rgba(58, 168, 156, .45); transition: transform .15s ease;
}
.big-play:hover { transform: scale(1.04); }
.end-card h2 { margin: 0; font-size: clamp(22px, 3vw, 36px); }
.end-card p { margin: 0; color: var(--muted); }
.end-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 820px; margin: 10px 0 8px; }
.end-grid button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 14px; }
.end-grid button:hover { border-color: var(--teal); }
.replay { background: var(--teal); color: #06241f; border: 0; border-radius: 999px; padding: 10px 24px; font-weight: 800; }

/* Controls */
.controls { margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.progress { display: flex; gap: 3px; height: 14px; align-items: center; cursor: pointer; margin-bottom: 8px; }
.progress .seg { position: relative; height: 6px; background: #223a5c; border-radius: 3px; overflow: hidden; transition: height .15s ease; }
.progress:hover .seg { height: 9px; }
.progress .seg i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--teal), var(--teal-2)); }
.progress .seg.done i { width: 100%; }
.buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctl { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 38px; display: grid; place-items: center; }
.ctl.play { width: 52px; background: var(--teal); color: #06241f; border-color: var(--teal); }
.ctl:hover { border-color: var(--teal-2); }
.ctl.txt { width: auto; padding: 0 12px; font-size: 14px; font-weight: 600; }
.ctl.on { background: #1d4a56; border-color: var(--teal); }
.now { margin-left: 8px; font-weight: 600; }
.spacer { flex: 1; }
.speed { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.speed select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font: inherit; max-width: 220px; }

/* Section list */
.chapters { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px; position: sticky; top: 12px; }
.chapters h2 { margin: 0 8px 8px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.chapters ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.chapters a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; cursor: pointer; }
.chapters a:hover { background: var(--panel-2); }
.chapters a .n { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--muted); flex: none; }
.chapters a .t { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chapters a.current { background: #1d3a57; box-shadow: inset 3px 0 0 var(--teal); }
.chapters a.current .n { background: var(--teal); border-color: var(--teal); color: #06241f; font-weight: 800; }
.chapters a.watched .n { background: #1d4a56; border-color: var(--teal); color: var(--teal-2); }

/* Full screen and small screens */
.app:fullscreen { background: var(--bg); padding: 12px 20px; overflow: auto; }
@media (max-width: 700px) {
  .poster-logo { width: 130px; }
  .poster .hint, .chrome .url { display: none; }
  .poster { gap: 4px; padding: 12px; }
  .big-play { margin-top: 8px; padding: 9px 20px; font-size: 15px; }
  .captions { bottom: 8px; padding: 6px 10px; }
  .top-title { display: none; }
  .end-grid button { padding: 4px 9px; font-size: 12px; }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .chapters { position: static; }
  .chapters ol { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .spot .tip { font-size: 13px; max-width: 220px; padding: 5px 9px; }
  .cursor { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .slide, .slide.cam, .slide.drift, .frame, .spot, .spot .ring, .cursor { transition: none; }
  .spot.on .ring, .title-card.show .title-name, .poster-logo { animation: none; }
}
