/* Wanderlust how-to guide. Materio tokens, like the staff panel and portal. */
:root {
  --bg: #f4f5fa; --surface: #ffffff; --surface-2: #f7f7fb; --line: #e7e7ef;
  --head: #2e263d; --body: #544f63; --muted: #8a8698; --faint: #b4b0bf;
  --primary: #8c57ff; --primary-soft: rgba(140, 87, 255, .12); --primary-ink: #fff;
  --customer: #16b1ff; --customer-soft: rgba(22, 177, 255, .13);
  --staff: #8c57ff; --staff-soft: rgba(140, 87, 255, .13);
  --accounts: #3ea521; --accounts-soft: rgba(62, 165, 33, .14);
  --shadow: 0 4px 18px rgba(46, 38, 61, .10);
  --shadow-lg: 0 18px 50px rgba(46, 38, 61, .18);
  --radius: 10px;
  --chrome: #eceaf3; --chrome-ink: #6d6880;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #28243d; --surface: #312d4b; --surface-2: #2c2843; --line: #403b5c;
    --head: #e7e3fc; --body: #c8c4dc; --muted: #9a95b0; --faint: #6f6a87;
    --primary-soft: rgba(140, 87, 255, .22); --customer-soft: rgba(22, 177, 255, .2);
    --staff-soft: rgba(140, 87, 255, .24); --accounts-soft: rgba(86, 202, 0, .2); --accounts: #56ca00;
    --shadow: 0 4px 18px rgba(0, 0, 0, .3); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
    --chrome: #3a3555; --chrome-ink: #b3aecb; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #28243d; --surface: #312d4b; --surface-2: #2c2843; --line: #403b5c;
  --head: #e7e3fc; --body: #c8c4dc; --muted: #9a95b0; --faint: #6f6a87;
  --primary-soft: rgba(140, 87, 255, .22); --customer-soft: rgba(22, 177, 255, .2);
  --staff-soft: rgba(140, 87, 255, .24); --accounts-soft: rgba(86, 202, 0, .2); --accounts: #56ca00;
  --shadow: 0 4px 18px rgba(0, 0, 0, .3); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
  --chrome: #3a3555; --chrome-ink: #b3aecb; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--body);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--primary); }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- home ---------------------------------------------------------------------------- */
.home { max-width: 1180px; margin: 0 auto; padding: 40px 24px 56px; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--head); text-decoration: none; }
.brand img { height: 40px; width: auto; }
.brand span { font-weight: 600; font-size: 15px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; }
.hero { margin: 44px 0 28px; max-width: 760px; }
.hero h1 { margin: 0; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.12; letter-spacing: -.02em; color: var(--head); font-weight: 700; }
.hero p { margin: 16px 0 0; font-size: 17px; color: var(--body); max-width: 640px; }
.cast { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cast span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 13.5px; color: var(--body); }
.cast b { color: var(--head); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.customer { background: var(--customer); } .dot.staff { background: var(--staff); } .dot.accounts { background: var(--accounts); }

.tours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 30px; }
.tour-card { position: relative; display: grid; grid-template-columns: 1fr; text-align: left; background: var(--surface); border: 0; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; padding: 0; transition: transform .25s ease, box-shadow .25s ease; }
.tour-card:hover, .tour-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-lg); outline: none; }
.tour-card .thumb { position: relative; aspect-ratio: 16 / 7.2; overflow: hidden; background: var(--surface-2); }
.tour-card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform 6s ease; }
.tour-card:hover .thumb img { transform: scale(1.06); }
.tour-card .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(20, 16, 34, .55)); }
.tour-card .tag { position: absolute; left: 16px; bottom: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; }
.tour-card .tag i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; }
.tour-card .body { padding: 18px 20px 20px; }
.tour-card h2 { margin: 0; font-size: 19px; color: var(--head); font-weight: 600; }
.tour-card p { margin: 6px 0 14px; color: var(--body); font-size: 14.5px; }
.tour-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13.5px; }
.tour-card .go { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; }
.tour-card.wide { grid-column: 1 / -1; grid-template-columns: 1.25fr 1fr; }
.tour-card.wide .thumb { aspect-ratio: auto; min-height: 240px; }
.tour-card.wide .body { padding: 26px 28px; display: flex; flex-direction: column; justify-content: center; }
.tour-card.wide h2 { font-size: 23px; }
.lane-mini { display: grid; gap: 7px; margin: 4px 0 18px; }
.lane-mini div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.lane-mini svg { flex: 1; height: 8px; }
.foot { margin-top: 36px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* ---------- player shell ---------------------------------------------------------------------- */
.scrim { display: none; }
.player { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100vh; }
.rail { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.rail-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: var(--muted); font-size: 13.5px; }
.back:hover { color: var(--primary); }
.rail-head h1 { margin: 10px 0 2px; font-size: 17px; color: var(--head); font-weight: 600; line-height: 1.3; }
.rail-head .sub { font-size: 13px; color: var(--muted); }
.switch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 12px; background: var(--surface-2); border-radius: 9px; padding: 4px; }
.switch button { border: 0; background: none; border-radius: 6px; padding: 6px 2px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.switch button.on { background: var(--surface); color: var(--head); box-shadow: 0 1px 4px rgba(46, 38, 61, .12); }
.chapters { overflow-y: auto; padding: 8px 10px 24px; flex: 1; scrollbar-width: thin; }
.chapter { margin-top: 10px; }
.chapter h3 { margin: 0; padding: 8px 8px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; }
.step-link { display: flex; align-items: flex-start; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 7px 8px; border-radius: 8px; font-size: 13.5px; color: var(--body); line-height: 1.35; }
.step-link:hover { background: var(--surface-2); }
.step-link .n { flex: none; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.step-link .dot { margin-top: 6px; }
.step-link.done { color: var(--muted); }
.step-link.on { background: var(--primary-soft); color: var(--head); font-weight: 500; }
.step-link.on .n { background: var(--primary); color: #fff; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 16px 24px 14px; gap: 12px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.bar .left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar .crumb { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .crumb b { color: var(--head); font-weight: 600; }
.menu-btn { display: none; }
.ibtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 0; background: var(--surface); color: var(--body); box-shadow: var(--shadow); }
.ibtn:hover { color: var(--primary); }
.ibtn.on { color: var(--primary); background: var(--primary-soft); box-shadow: none; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- the stage: a browser window with the real screen ----------------------------------- */
.stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; container-type: size; }
.frame { width: min(100cqw, calc((100cqh - 38px) * 1.6)); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.chrome { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; background: var(--chrome); color: var(--chrome-ink); font-size: 12.5px; }
.lights { display: flex; gap: 6px; } .lights i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; } .lights i:nth-child(2) { background: #febc2e; } .lights i:nth-child(3) { background: #28c840; }
.addr { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 6px; background: var(--surface); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr .icon { width: 13px; height: 13px; }
.addr b { color: var(--head); font-weight: 500; }
.who { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-weight: 600; font-size: 12px; white-space: nowrap; }
.who .icon { width: 14px; height: 14px; }
.who.customer, .chip.customer { background: var(--customer-soft); color: var(--customer); }
.who.staff, .chip.staff { background: var(--staff-soft); color: var(--staff); }
.who.accounts, .chip.accounts { background: var(--accounts-soft); color: var(--accounts); }

.viewport { position: relative; aspect-ratio: 1440 / 900; overflow: hidden; background: #fff; }
.canvas { position: absolute; inset: 0; transform-origin: 0 0; transition: transform 1s cubic-bezier(.45, .05, .2, 1); will-change: transform; }
.canvas.slow { transition-duration: 7s; transition-timing-function: ease-out; }
.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease; user-select: none; -webkit-user-drag: none; }
.shot.show { opacity: 1; }

.spot { position: absolute; border-radius: 8px; pointer-events: none; opacity: 0; transition: opacity .35s ease, left .5s ease, top .5s ease, width .5s ease, height .5s ease;
  box-shadow: 0 0 0 3px var(--primary), 0 0 0 9999px rgba(24, 18, 40, .28); }
.spot.show { opacity: 1; }
.spot.type { box-shadow: 0 0 0 3px #16b1ff, 0 0 0 9999px rgba(24, 18, 40, .22); }
.spot.look { box-shadow: 0 0 0 3px #ffb400, 0 0 0 9999px rgba(24, 18, 40, .18); }
.spot.go { pointer-events: auto; cursor: pointer; animation: beckon 1.6s ease-in-out infinite; }
@keyframes beckon { 50% { box-shadow: 0 0 0 6px var(--primary), 0 0 0 9999px rgba(24, 18, 40, .32); } }
.spot .badge { position: absolute; top: -30px; left: 0; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; background: #16b1ff; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; transform-origin: left bottom; }
.spot.look .badge { background: #e09a00; }
.spot .badge .icon { width: 14px; height: 14px; }

.cursor { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; opacity: 0; z-index: 3;
  transition: left .85s cubic-bezier(.5, 0, .2, 1), top .85s cubic-bezier(.5, 0, .2, 1), opacity .3s ease; }
.cursor.show { opacity: 1; }
.cursor svg { position: absolute; left: -3px; top: -2px; width: 26px; height: 26px; transform-origin: 3px 2px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); transition: transform .12s ease; }
.cursor.press svg { transform: scale(var(--inv, 1)) scale(.82); }
.ripple { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 3px solid var(--primary); pointer-events: none; opacity: 0; z-index: 2; }
.ripple.go { animation: ripple .7s ease-out; }
@keyframes ripple { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(4.2); } }

.handoff { position: absolute; left: 50%; top: 18px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 12px; background: var(--surface); color: var(--head); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 15px; opacity: 0; transform: translate(-50%, -14px); transition: opacity .35s ease, transform .35s ease; pointer-events: none; }
.handoff.show { opacity: 1; transform: translate(-50%, 0); }
.handoff i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #fff; }
.handoff small { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); }

/* ---------- swimlanes (Together) ------------------------------------------------------------- */
.lanes { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px 8px; display: grid; grid-template-columns: 82px 1fr; row-gap: 3px; column-gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.lanes .lname { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.lane { position: relative; height: 14px; }
.lane::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 2px; background: var(--line); }
.lane b { position: absolute; top: 3px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; cursor: pointer; opacity: .45; transition: transform .2s ease, opacity .2s ease; }
.lane b.past { opacity: .95; }
.lane b.on { opacity: 1; transform: scale(1.9); box-shadow: 0 0 0 3px var(--surface); }
.lane.customer b { background: var(--customer); } .lane.staff b { background: var(--staff); } .lane.accounts b { background: var(--accounts); }

/* ---------- caption + controls ------------------------------------------------------------------ */
.caption { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; align-items: start; }
.caption .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.chip .icon { width: 14px; height: 14px; }
.count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.caption h2 { grid-column: 1; margin: 2px 0 0; font-size: 21px; line-height: 1.25; color: var(--head); font-weight: 600; letter-spacing: -.01em; }
.caption p { grid-column: 1; margin: 0; font-size: 15.5px; max-width: 920px; }
.caption .hint { grid-column: 1; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.caption .hint .icon { width: 15px; height: 15px; }
.fade-in { animation: up .45s ease both; }
@keyframes up { from { opacity: 0; transform: translateY(6px); } }

.controls { display: flex; align-items: center; gap: 10px; }
.play { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px 0 14px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(140, 87, 255, .35); }
.play:hover { filter: brightness(1.06); }
.track { position: relative; flex: 1; height: 26px; cursor: pointer; }
.track .rail-line { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--primary); border-radius: 4px; transition: width .4s ease; }
.track .tick { position: absolute; top: 7px; width: 2px; height: 12px; margin-left: -1px; background: var(--surface); }
.track .knob { position: absolute; top: 6px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 3px var(--primary); transition: left .4s ease; }
.speed { height: 38px; border: 0; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); padding: 0 10px; font-weight: 600; font-size: 13px; color: var(--body); min-width: 52px; }

/* ---------- small screens ---------------------------------------------------------------------- */
@media (max-width: 1080px) { .legend { display: none; } }
@media (max-width: 900px) {
  .player { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform .3s ease; box-shadow: var(--shadow-lg); }
  .player.nav .rail { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(20, 16, 34, .4); z-index: 39; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .player.nav .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; }
  .main { padding: 12px 16px 16px; }
  .stage { container-type: normal; flex: none; }
  .frame { width: 100%; }
  .chrome .addr { display: none; }
  .caption { grid-template-columns: 1fr; }
  .caption h2 { font-size: 18px; }
  .caption p { font-size: 14.5px; }
  .controls { flex-wrap: wrap; }
  .track { order: 5; flex-basis: 100%; }
  .tours { grid-template-columns: 1fr; }
  .tour-card.wide { grid-template-columns: 1fr; }
  .tour-card.wide .thumb { min-height: 0; aspect-ratio: 16 / 7.2; }
  .lanes { grid-template-columns: 64px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .canvas, .cursor, .spot, .shot, .knob, .fill { transition: none !important; }
  .spot.go, .ripple.go, .fade-in { animation: none !important; }
}
