/* =========================================================
   Rosta User Guide — interactive tour edition (no framework)
   Each topic is a scroll-driven tour: steps on one side, a real
   device on the other whose screen and spotlight follow the step.
   Employee guide uses the blue/cyan accent, manager guide indigo.
   ========================================================= */

/* ---------- Fonts (self-hosted, no external requests) ---------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --navy-950: #030B22;
  --navy-900: #04163F;
  --blue: #0A72ED;
  --cyan: #01B8FE;
  --ok: #16A34A;
  --warn: #D97706;
  --grad-app: linear-gradient(135deg, #01B8FE 0%, #0A72ED 50%, #164AC2 100%);
  --grad-dash: linear-gradient(135deg, #8EA2FF 0%, #5B5BFF 45%, #3730A3 100%);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header-h: 68px;
  --sb-w: 300px;

  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --surface-2: #EEF2F9;
  --ink: #0B1A3A;
  --body: #46557A;
  --muted: #7182A3;
  --line: #E2E8F3;
  --line-strong: #CBD5E5;
  --ui-bg: #EEF2F8;
  --ui-line: #DCE3EE;
  --tip-bg: #EEF6FF; --tip-line: #D3E6FD; --tip-ink: #0B3B73;
  --warn-bg: #FFF8EB; --warn-line: #FBE3B7; --warn-ink: #6B3A06;
  --shadow-sm: 0 1px 2px rgba(4, 22, 63, .05), 0 6px 18px -10px rgba(4, 22, 63, .18);
  --shadow-md: 0 22px 44px -26px rgba(4, 22, 63, .38);
  --shadow-lg: 0 46px 90px -40px rgba(4, 22, 63, .5);
  --dim: rgba(3, 11, 34, .55);

  --accent: #0A72ED;
  --accent-soft: #EAF3FE;
  --accent-ink: #0B4FA8;
  --accent-grad: var(--grad-app);
  color-scheme: light;
}
[data-audience="manager"] {
  --accent: #4F46E5;
  --accent-soft: #EEEFFF;
  --accent-ink: #3730A3;
  --accent-grad: var(--grad-dash);
}
:root[data-theme="dark"] {
  --bg: #050D22;
  --surface: #0B1631;
  --surface-2: #101D3D;
  --ink: #EDF2FF;
  --body: #AEBBD9;
  --muted: #7D8BAE;
  --line: #1B2A4E;
  --line-strong: #2A3B64;
  --ui-bg: #14234A;
  --ui-line: #24365F;
  --tip-bg: #0C2347; --tip-line: #173867; --tip-ink: #BFD9FF;
  --warn-bg: #2A1C08; --warn-line: #4A3210; --warn-ink: #FAD9A1;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .6);
  --shadow-md: 0 24px 48px -28px rgba(0, 0, 0, .8);
  --shadow-lg: 0 50px 100px -40px rgba(0, 0, 0, .9);
  --accent-soft: rgba(10, 114, 237, .16);
  --accent-ink: #8CC4FF;
  color-scheme: dark;
}
:root[data-theme="dark"] [data-audience="manager"] { --accent: #7C83FF; --accent-soft: rgba(110, 123, 255, .17); --accent-ink: #B8BEFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050D22;
    --surface: #0B1631;
    --surface-2: #101D3D;
    --ink: #EDF2FF;
    --body: #AEBBD9;
    --muted: #7D8BAE;
    --line: #1B2A4E;
    --line-strong: #2A3B64;
    --ui-bg: #14234A;
    --ui-line: #24365F;
    --tip-bg: #0C2347; --tip-line: #173867; --tip-ink: #BFD9FF;
    --warn-bg: #2A1C08; --warn-line: #4A3210; --warn-ink: #FAD9A1;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .6);
    --shadow-md: 0 24px 48px -28px rgba(0, 0, 0, .8);
    --shadow-lg: 0 50px 100px -40px rgba(0, 0, 0, .9);
    --accent-soft: rgba(10, 114, 237, .16);
    --accent-ink: #8CC4FF;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) [data-audience="manager"] { --accent: #7C83FF; --accent-soft: rgba(110, 123, 255, .17); --accent-ink: #B8BEFF; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}
h1, h2, h3, h4, h5 { margin: 0; color: var(--ink); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: .6rem 1rem; font-weight: 700; color: #fff; background: var(--accent); border-radius: 10px; }
.skip:focus { top: 12px; }

/* only the chosen guide is shown */
[data-audience="employee"] [data-for="manager"],
[data-audience="manager"] [data-for="employee"] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(170%) blur(14px);
  -webkit-backdrop-filter: saturate(170%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { max-width: 1440px; height: 100%; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light-bg { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo-light-bg { display: none; }
  :root:not([data-theme="light"]) .brand .logo-dark { display: block; }
}
.brand-tag {
  padding: .22rem .6rem;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  transition: color .3s, background-color .3s;
}
.spacer { flex: 1; }
.search-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(300px, 26vw);
  height: 42px;
  padding: 0 10px 0 14px;
  font-size: .93rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.search-btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.search-btn span { flex: 1; text-align: left; }
.kbd {
  display: inline-flex;
  align-items: center;
  padding: .05rem .4rem;
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  white-space: nowrap;
}
.icon-btn {
  width: 42px; height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: background-color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.theme-btn .bi-sun { display: none; }
:root[data-theme="dark"] .theme-btn .bi-sun { display: inline; }
:root[data-theme="dark"] .theme-btn .bi-moon-stars { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .bi-sun { display: inline; }
  :root:not([data-theme="light"]) .theme-btn .bi-moon-stars { display: none; }
}
.top-switch { display: none !important; }
@media (min-width: 1100px) { .top-switch { display: inline-grid !important; } }
@media (max-width: 1023.98px) {
  .search-btn { width: 42px; padding: 0; justify-content: center; }
  .search-btn span, .search-btn .kbd { display: none; }
}
@media (max-width: 420px) { .brand-tag { display: none; } }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--read, 0)); background: var(--accent-grad); }

/* ---------- Audience switch ---------- */
.switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.switch-pill {
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  background: var(--accent-grad);
  border-radius: 10px;
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--accent) 90%, transparent);
  transition: transform .45s var(--ease);
}
[data-audience="manager"] .switch-pill { transform: translateX(100%); }
.switch button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .42rem .9rem;
  font-size: .86rem;
  font-weight: 700;
  color: var(--body);
  background: none;
  border: 0;
  border-radius: 10px;
  white-space: nowrap;
  transition: color .3s;
}
.switch button[aria-pressed="true"] { color: #fff; }
.hero .switch { width: 100%; max-width: 500px; padding: 6px; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); border-radius: 20px; }
.hero .switch-pill { top: 6px; bottom: 6px; left: 6px; width: calc(50% - 6px); border-radius: 15px; }
.hero .switch button { justify-content: flex-start; gap: 12px; padding: 12px 14px; text-align: start; color: #fff; border-radius: 15px; }
.hero .switch button i { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 1.15rem; color: #fff; background: rgba(255, 255, 255, .1); border-radius: 12px; }
.hero .switch button[aria-pressed="true"] i { background: rgba(255, 255, 255, .2); }
.hero .switch button span { min-width: 0; }
.hero .switch b { display: block; font-size: .98rem; line-height: 1.2; color: #fff; }
.hero .switch small { display: block; font-size: .76rem; font-weight: 600; color: #fff; opacity: .78; }
@media (max-width: 480px) {
  .hero .switch { padding: 5px; }
  .hero .switch-pill { top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); }
  .hero .switch button { padding: 10px 8px; gap: 8px; }
  .hero .switch button i { width: 30px; height: 30px; font-size: .95rem; border-radius: 9px; }
  .hero .switch b { font-size: .84rem; }
  .hero .switch small { font-size: .66rem; }
}
@media (max-width: 360px) { .hero .switch small { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: #B9C6E4; background: var(--navy-950); isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg .glow { position: absolute; border-radius: 50%; filter: blur(80px); animation: drift 18s ease-in-out infinite alternate; }
.hero-bg .g1 { width: 620px; height: 620px; top: -260px; right: -120px; background: #01B8FE; opacity: .32; transition: background-color .8s; }
.hero-bg .g2 { width: 560px; height: 560px; bottom: -200px; left: -180px; background: #0A72ED; opacity: .4; animation-delay: -6s; }
.hero-bg .g3 { width: 420px; height: 420px; top: 30%; left: 42%; background: #5B5BFF; opacity: .25; animation-delay: -11s; }
[data-audience="manager"] .hero-bg .g1 { background: #6E7BFF; }
.hero-bg .grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, #000 20%, transparent 75%);
}
@keyframes drift { to { transform: translate3d(40px, 30px, 0) scale(1.08); } }

/* light rays falling on the stage */
.hero-bg .beams {
  position: absolute;
  left: 50%; top: -6%;
  width: 1400px; height: 1000px;
  transform: translateX(-50%);
  background: conic-gradient(from 180deg at 50% 0%, transparent 158deg, rgba(1, 184, 254, .13) 168deg, transparent 176deg, rgba(255, 255, 255, .05) 180deg, transparent 184deg, rgba(110, 123, 255, .12) 192deg, transparent 202deg);
  filter: blur(4px);
  animation: sway 14s ease-in-out infinite alternate;
}
@keyframes sway { to { transform: translateX(-50%) rotate(3deg); } }

.hero-intro { position: relative; z-index: 2; max-width: 900px; padding-top: 56px; padding-bottom: 64px; text-align: center; }
@media (min-width: 1024px) { .hero-intro { padding-top: 72px; padding-bottom: 84px; } }
.hero-intro .hero-lead { max-width: 40rem; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero-actions .hero-search { margin-top: 0; max-width: 500px; height: 56px; }
.hero-actions .switch button { text-align: left; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.3rem;
  padding: .35rem .8rem .35rem .55rem;
  font-size: .8rem;
  font-weight: 700;
  color: #D6E2FF;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .18); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(74, 222, 128, .06); } }
.hero h1 { font-size: clamp(2.5rem, 1.5rem + 4.2vw, 4.7rem); line-height: 1.02; letter-spacing: -.045em; color: #fff; margin-bottom: 1.1rem; }
.hero h1 .grad { background: linear-gradient(110deg, #7FDBFF, #01B8FE 35%, #6EA8FF 70%, #A5B4FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .grad { white-space: nowrap; }
.hero-lead { max-width: 34rem; font-size: 1.12rem; margin-bottom: 1.8rem; }
.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 500px;
  height: 56px;
  margin-top: 14px;
  padding: 0 12px 0 18px;
  font-size: 1rem;
  background: rgba(255, 255, 255, .95);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .7);
  transition: transform .25s var(--ease);
}
.hero-search:hover { transform: translateY(-2px); }
.hero-search i { font-size: 1.15rem; color: var(--blue); }
.hero-search span { flex: 1; text-align: left; color: #64748B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-search .kbd { background: #F1F5F9; border-color: #E2E8F0; color: #64748B; }
@media (hover: none), (max-width: 575.98px) { .hero-search .kbd, .search-btn .kbd, .sb-search .kbd { display: none; } }

/* ---------- Parts & topics ---------- */
.content { padding-top: 24px; padding-bottom: 96px; }
.part { padding-top: 40px; }
.part-head {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px 28px;
  color: #C8D4F0;
  background: var(--navy-900);
  border-radius: 24px;
  isolation: isolate;
}
.part-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(520px 220px at 100% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%); }
.part-head h2 { color: #fff; font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.1rem); margin-bottom: .25rem; }
.part-head p { margin: 0; }
@media (max-width: 575.98px) { .part-head { flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px 20px; } }
.badge-icon { width: 56px; height: 56px; flex: none; display: grid; place-items: center; font-size: 1.45rem; color: #fff; background: var(--accent-grad); border-radius: 17px; box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--accent) 90%, transparent); }

.topic { padding: 72px 0 8px; }
.topic + .topic { border-top: 1px solid var(--line); }
.topic-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 20px; align-items: end; margin-bottom: 1.1rem; }
.topic-num {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-size: clamp(3rem, 2.2rem + 2.6vw, 4.8rem);
  font-weight: 800;
  line-height: .85;
  letter-spacing: -.05em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line-strong);
  transition: -webkit-text-stroke-color .4s;
  user-select: none;
}
.topic.is-active .topic-num { -webkit-text-stroke-color: var(--accent); }
.topic h3 { grid-column: 2; grid-row: 1; font-size: clamp(1.45rem, 1.2rem + .9vw, 1.95rem); }
.topic h3 .anchor { margin-left: .4rem; font-size: .9rem; color: var(--muted); opacity: 0; transition: opacity .2s; }
.topic h3:hover .anchor, .topic h3 .anchor:focus-visible { opacity: 1; text-decoration: none; }
.crumb { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; margin: 0; font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.crumb .bi-chevron-right { font-size: .6rem; opacity: .7; }
.tag { padding: .1rem .5rem; font-family: var(--font); font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; }
.play {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.05rem;
  font-size: .88rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-grad);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--accent) 90%, transparent);
  white-space: nowrap;
  transition: transform .25s var(--ease);
}
.play:hover { transform: translateY(-2px); }
.play .bi-pause-fill { display: none; }
.play.is-playing .bi-pause-fill { display: inline; }
.play.is-playing .bi-play-fill { display: none; }
@media (max-width: 575.98px) {
  .topic-head { grid-template-columns: auto minmax(0, 1fr); }
  .topic-num { grid-row: 1 / span 2; }
  .play { grid-row: 3; grid-column: 1 / -1; justify-self: start; margin-top: .6rem; }
}
.lead { font-size: 1.08rem; max-width: 46rem; }
.topic strong { color: var(--ink); }

/* ---------- Tour ---------- */
.tour { display: grid; gap: 56px; margin-top: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tour.is-phone, .tour.is-tablet { grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr); }
.tour.is-browser { grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr); }
.tour-stage {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--header-h) + 16px);
  height: calc(100vh - var(--header-h) - 32px);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.tour-steps { grid-column: 1; grid-row: 1; counter-reset: step; list-style: none; margin: 0; padding: 14vh 0 26vh; }
.step {
  position: relative;
  counter-increment: step;
  margin-bottom: 24vh;
  padding: 20px 22px 20px 72px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  opacity: .42;
  transform: scale(.97);
  transform-origin: left center;
  cursor: pointer;
  transition: opacity .45s, transform .45s var(--ease), border-color .45s, box-shadow .45s;
}
.step:last-child { margin-bottom: 0; }
.step::before {
  content: counter(step);
  position: absolute;
  left: 20px; top: 20px;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  font-size: .85rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 12px;
  transition: all .45s var(--ease);
}
.step:hover { opacity: .75; }
.step.is-active { opacity: 1; transform: none; border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: var(--shadow-md); }
.step.is-active::before { color: #fff; background: var(--accent-grad); box-shadow: 0 10px 18px -10px color-mix(in srgb, var(--accent) 90%, transparent); transform: rotate(-6deg); }
.step h4 { font-size: 1.1rem; margin: .3rem 0 .4rem; }
.step p { margin: 0; }
.step p + p { margin-top: .5rem; }

.tour-hud { display: flex; align-items: center; gap: 12px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.hud-count b { color: var(--ink); }
.hud-dots { display: flex; gap: 5px; }
.hud-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line-strong); transition: all .35s var(--ease); }
.hud-dots i.on { width: 22px; background: var(--accent); }

@media (max-width: 899.98px) {
  .tour, .tour.is-phone, .tour.is-tablet, .tour.is-browser { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tour-stage {
    grid-column: 1;
    grid-row: 1;
    z-index: 5;
    top: var(--header-h);
    height: auto;
    min-height: 0;
    gap: 8px;
    margin: 0 -16px;
    padding: 12px 16px 14px;
    background: linear-gradient(var(--bg) 88%, color-mix(in srgb, var(--bg) 0%, transparent));
  }
  .tour-steps { grid-row: 2; padding: 18px 0 34vh; }
  .step { margin-bottom: 16vh; padding: 16px 16px 16px 62px; }
  .step::before { left: 14px; top: 16px; width: 34px; height: 34px; }
  .tour .phone, .tour .tablet { --pw: clamp(140px, calc((46vh - 64px) / 2.06), 230px); }
  .tour .browser { width: 100%; }
}

/* ---------- Devices ---------- */
.device { position: relative; flex: none; }
.device-vp { position: relative; overflow: hidden; aspect-ratio: var(--ar, 737 / 1430); background: #fff; cursor: zoom-in; }
.device-vp .layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transform: scale(1.025); transition: opacity .55s ease, transform .7s var(--ease); }
.device-vp .layer.is-on { opacity: 1; transform: none; }

.phone {
  --pw: 290px;
  width: var(--pw);
  padding: calc(var(--pw) * .034);
  background: linear-gradient(150deg, #2B3446, #0A0E17 60%);
  border-radius: calc(var(--pw) * .16);
  box-shadow: inset 0 0 0 1.5px #3A4357, var(--shadow-lg);
}
@media (min-width: 900px) { .tour .phone { --pw: min(300px, calc((100vh - 200px) / 2.06)); } }
.phone .device-screen { overflow: hidden; background: #fff; border-radius: calc(var(--pw) * .125); }
.status { position: relative; height: calc(var(--pw) * .085); display: flex; align-items: center; justify-content: space-between; padding: 0 calc(var(--pw) * .08); font-size: calc(var(--pw) * .038); font-weight: 700; color: #111; background: #fff; }
.status::after { content: ""; position: absolute; left: 50%; top: 22%; width: 30%; height: 58%; transform: translateX(-50%); background: #0A0E17; border-radius: 999px; }

.tablet { --pw: 290px; width: var(--pw); padding: 12px; background: linear-gradient(150deg, #2B3446, #0A0E17 60%); border-radius: 28px; box-shadow: inset 0 0 0 1.5px #3A4357, var(--shadow-lg); }
@media (min-width: 900px) { .tour .tablet { --pw: min(300px, calc((100vh - 200px) / 2.06)); } }
.tablet .device-screen { overflow: hidden; border-radius: 16px; }

.browser { width: 100%; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.browser .bar { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.browser .dots { display: flex; gap: 6px; }
.browser .dots i { width: 10px; height: 10px; border-radius: 50%; }
.browser .dots i:nth-child(1) { background: #FF6B6B; }
.browser .dots i:nth-child(2) { background: #FFC24B; }
.browser .dots i:nth-child(3) { background: #3DD68C; }
.browser .url { flex: 1; max-width: 340px; margin: 0 auto; padding: .1rem .8rem; font-family: var(--mono); font-size: .7rem; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.browser .device-vp { --ar: 1264 / 705; }

/* the spotlight: everything outside the box is dimmed */
.device-vp { --x: 0; --y: 0; --w: 100; --h: 100; }
.spot {
  position: absolute;
  z-index: 2;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  border-radius: 10px;
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 7px color-mix(in srgb, var(--accent) 28%, transparent), 0 0 0 9999px var(--dim);
  pointer-events: none;
  transition: left .65s var(--ease), top .65s var(--ease), width .65s var(--ease), height .65s var(--ease), box-shadow .5s, opacity .4s;
}
.spot::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent); animation: ring 1.8s ease-out infinite; }
@keyframes ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.12); } }
.spot.is-off { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent, 0 0 0 9999px rgba(3, 11, 34, 0); }
.spot.is-off::after { display: none; }
.browser .spot { border-radius: 6px; }

.tap {
  position: absolute;
  z-index: 3;
  left: calc((var(--x) + var(--w) / 2) * 1%);
  top: calc((var(--y) + var(--h) / 2) * 1%);
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: left .65s var(--ease), top .65s var(--ease);
}
.tap.go { animation: tap 1.3s .55s var(--ease) both; }
@keyframes tap { 0% { opacity: 0; transform: scale(1.6); } 30% { opacity: 1; transform: scale(.8); } 60% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.8); } }
.browser .tap { width: 18px; height: 18px; margin: -9px 0 0 -9px; }

.spot-tag {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 80%;
  padding: 6px 10px 6px 6px;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy-900);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5);
  pointer-events: none;
  transition: left .65s var(--ease), top .65s var(--ease), right .65s var(--ease), opacity .35s;
}
.spot-tag b { flex: none; width: 22px; height: 22px; display: grid; place-items: center; font-size: .72rem; color: #fff; background: var(--accent-grad); border-radius: 7px; }
.spot-tag.is-off { opacity: 0; }
.phone .spot-tag { font-size: .7rem; }
@media (max-width: 899.98px) { .tour .spot-tag { display: none; } }

/* ---------- Content after a tour ---------- */
.after { max-width: 860px; margin-top: 40px; }
.after h4 { display: flex; align-items: center; gap: .5rem; font-size: 1.08rem; margin: 1.8rem 0 .8rem; }
.after h4::before { content: ""; width: 14px; height: 3px; border-radius: 3px; background: var(--accent-grad); }
.after > :first-child { margin-top: 0; }

.ticks { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .6rem; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; display: grid; place-items: center; font-size: .9rem; color: var(--accent); background: var(--accent-soft); border-radius: 6px; }

.ui { display: inline-block; padding: 0 .42rem; font-weight: 700; font-size: .9em; line-height: 1.65; color: var(--ink); background: var(--ui-bg); border: 1px solid var(--ui-line); border-bottom-width: 2px; border-radius: 7px; white-space: nowrap; }

.callout { display: flex; gap: 12px; margin: 1.3rem 0; padding: 14px 16px; font-size: .95rem; border: 1px solid; border-radius: 16px; }
.callout > i { flex: none; font-size: 1.15rem; line-height: 1.5; }
.callout p { margin: 0; }
.callout p + p { margin-top: .45rem; }
.callout strong { color: inherit; }
.callout-tip { color: var(--tip-ink); background: var(--tip-bg); border-color: var(--tip-line); }
.callout-tip > i { color: var(--accent); }
.callout-warn { color: var(--warn-ink); background: var(--warn-bg); border-color: var(--warn-line); }
.callout-warn > i { color: var(--warn); }
.callout-note { color: var(--body); background: var(--surface); border-color: var(--line); }
.callout-note > i { color: var(--muted); }

.table-wrap { margin: 0 0 1.4rem; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { padding: 11px 16px; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; text-align: left; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; line-height: 1.55; vertical-align: top; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
.table .sub { display: block; font-weight: 500; font-size: .82rem; color: var(--muted); white-space: normal; }

.figure { margin: .4rem 0 1.2rem; max-width: 460px; }
.figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.figure figcaption { margin-top: .55rem; font-size: .84rem; color: var(--muted); }
.figure figcaption strong { color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; font-size: .84rem; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.legend .sw { width: 10px; height: 10px; border-radius: 50%; }

.next { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 860px; margin-top: 32px; padding: 16px 20px; color: var(--body); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color .25s, transform .25s var(--ease), box-shadow .25s; }
.next:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.next small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.next b { color: var(--ink); }
.next i { font-size: 1.2rem; color: var(--accent); transition: transform .25s var(--ease); }
.next:hover i { transform: translateX(4px); }

/* first-time setup cards */
.stops { list-style: none; counter-reset: s; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stops li { counter-increment: s; }
.stops a { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; color: var(--body); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; transition: border-color .25s, transform .25s var(--ease), box-shadow .25s; }
.stops a:hover { text-decoration: none; transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: var(--shadow-md); }
.stops a::before { content: counter(s, decimal-leading-zero); align-self: flex-start; font-family: var(--mono); font-size: .8rem; font-weight: 700; color: var(--accent-ink); padding: .2rem .5rem; background: var(--accent-soft); border-radius: 8px; }
.stops a i { position: absolute; top: 16px; right: 16px; font-size: 1.3rem; color: var(--accent); }
.stops strong { color: var(--ink); line-height: 1.35; }
.stops small { font-size: .85rem; line-height: 1.45; color: var(--muted); }
@media (max-width: 991.98px) { .stops { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479.98px) { .stops { grid-template-columns: minmax(0, 1fr); } }

/* ---------- FAQ, glossary, CTA ---------- */
.faq { display: grid; gap: 10px; max-width: 860px; margin: 8px 0 1.6rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: var(--shadow-sm); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; font-weight: 700; color: var(--ink); list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "\F64D"; font-family: "bootstrap-icons"; flex: none; width: 28px; height: 28px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 8px; transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .ans { padding: 0 18px 18px; }
.faq .ans p { margin: 0; }
.glossary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 8px 0 0; }
.glossary div { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.glossary dt { font-weight: 800; color: var(--ink); margin-bottom: .2rem; }
.glossary dd { margin: 0; font-size: .92rem; line-height: 1.55; }
@media (max-width: 991.98px) { .glossary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .glossary { grid-template-columns: minmax(0, 1fr); } }
.cta { position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; margin-top: 48px; padding: 28px; color: #B9C6E4; background: var(--navy-900); border-radius: 24px; isolation: isolate; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(420px 220px at 0% 100%, rgba(1, 184, 254, .35), transparent 70%), radial-gradient(420px 220px at 100% 0%, rgba(91, 91, 255, .35), transparent 70%); }
.cta h3 { color: #fff; font-size: 1.3rem; margin-bottom: .3rem; }
.cta p { margin: 0; }
.cta .grow { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .85rem 1.3rem; font-weight: 700; color: #fff; background: var(--grad-app); border: 0; border-radius: 14px; box-shadow: 0 14px 28px -14px rgba(10, 114, 237, .9); white-space: nowrap; transition: transform .25s var(--ease); }
.btn:hover { color: #fff; text-decoration: none; transform: translateY(-2px); }
@media (max-width: 767.98px) { .cta { flex-direction: column; align-items: flex-start; } }

/* ---------- Footer ---------- */
.footer { padding: 56px 0 28px; color: #8FA0C6; background: var(--navy-950); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer img { height: 34px; width: auto; display: block; margin-bottom: 1rem; }
.footer p { max-width: 24rem; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 48px; }
.footer h4 { margin-bottom: .9rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #fff; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer a { color: #A3B2D4; }
.footer a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 22px; font-size: .85rem; border-top: 1px solid rgba(255, 255, 255, .08); }

/* ---------- Command palette ---------- */
.palette { width: min(640px, calc(100vw - 24px)); max-width: none; max-height: min(70vh, 620px); margin: 10vh auto auto; padding: 0; color: var(--body); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .55); overflow: hidden; }
.palette[open] { display: flex; flex-direction: column; animation: pop .25s var(--ease); }
.palette::backdrop { background: rgba(3, 11, 34, .55); backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input i { font-size: 1.15rem; color: var(--accent); }
.palette-input input { flex: 1; height: 60px; font: inherit; font-size: 1.05rem; color: var(--ink); background: none; border: 0; outline: none; }
.palette-input input::placeholder { color: var(--muted); }
.palette-list { flex: 1; overflow-y: auto; margin: 0; padding: 8px; list-style: none; }
.palette-list li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--body); border-radius: 12px; }
.palette-list li a:hover { text-decoration: none; }
.palette-list li a.is-sel { background: var(--accent-soft); }
.palette-list .p-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; font-size: 1rem; color: var(--accent); background: var(--surface-2); border-radius: 10px; }
.palette-list .is-sel .p-ic { color: #fff; background: var(--accent); }
.palette-list .p-txt { flex: 1; min-width: 0; }
.palette-list b { display: block; color: var(--ink); font-size: .95rem; }
.palette-list small { display: block; font-family: var(--mono); font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-list mark { padding: 0 .1em; color: inherit; background: color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 3px; }
.palette-list b mark { color: var(--accent-ink); }
.p-aud { flex: none; font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 999px; }
.p-aud.emp { color: #0369A1; background: #E0F4FF; }
.p-aud.mgr { color: #3730A3; background: #ECEEFF; }
.p-aud.hlp { color: #475569; background: #EEF2F6; }
.palette-empty { padding: 36px 20px; margin: 0; text-align: center; color: var(--muted); }
.palette-close { width: 36px; height: 36px; font-size: .95rem; color: var(--muted); border-color: transparent; }
.palette-close:hover { color: var(--ink); }

/* ---------- Sidebar (contents) ---------- */
.page { transition: margin-left .35s var(--ease); }
@media (min-width: 1200px) { body.sb-open .page { margin-left: var(--sb-w); } }
.sidebar {
  position: fixed;
  z-index: 45;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  width: var(--sb-w);
  display: flex;
  flex-direction: column;
  color: var(--body);
  background: var(--surface);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform .35s var(--ease), visibility 0s linear .35s, background-color .3s;
}
body.sb-open .sidebar { transform: none; visibility: visible; transition: transform .35s var(--ease), visibility 0s, background-color .3s; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line); }
.sb-head h2 { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sb-head .icon-btn { width: 36px; height: 36px; font-size: .95rem; }
.sb-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 24px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sb-body .switch { width: 100%; margin-bottom: 12px; }
.sb-search { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; margin-bottom: 22px; padding: 0 8px 0 12px; font-size: .88rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s; }
.sb-search:hover { border-color: var(--line-strong); }
.sb-search span { flex: 1; text-align: left; }
.sb-foot { padding: 12px 18px; font-size: .85rem; border-top: 1px solid var(--line); }
.sb-foot a { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sb-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(3, 11, 34, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 1199.98px) {
  .sidebar { top: 0; z-index: 60; width: min(88vw, 340px); }
  body.sb-open .sidebar { box-shadow: var(--shadow-lg); }
}
@media (min-width: 1200px) { .sb-backdrop { display: none !important; } }

.sb-toggle .bi-list { display: none; }
@media (max-width: 1199.98px) {
  .sb-toggle .bi-layout-sidebar-inset { display: none; }
  .sb-toggle .bi-list { display: inline-block; }
}
.sb-toggle[aria-expanded="true"] { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }

.toc-group { margin: 0 0 .5rem; padding: 0 8px; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.toc-group.help { margin-top: 1.5rem; }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; font-size: .9rem; font-weight: 500; line-height: 1.3; color: var(--body); border-radius: 10px; transition: background-color .2s, color .2s; }
.toc a:hover { text-decoration: none; color: var(--ink); background: var(--surface-2); }
.toc .n { width: 26px; height: 26px; flex: none; display: grid; place-items: center; font-family: var(--mono); font-size: .64rem; font-weight: 700; color: var(--muted); border: 1.5px solid var(--line-strong); border-radius: 50%; transition: all .25s var(--ease); }
.toc a.is-read .n { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.toc a.is-active { color: var(--ink); font-weight: 700; background: var(--accent-soft); }
.toc a.is-active .n { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------- Lightbox ---------- */
.lightbox { width: min(96vw, 1400px); max-width: none; max-height: 94vh; padding: 0; background: transparent; border: 0; overflow: visible; }
.lightbox::backdrop { background: rgba(3, 11, 34, .85); backdrop-filter: blur(4px); }
.lightbox img { display: block; max-width: 100%; max-height: 90vh; margin: 0 auto; border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
.lightbox-close { position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.2rem; color: #fff; background: rgba(255, 255, 255, .14); border: 0; border-radius: 12px; }

/* =========================================================
   Creative layer — hero showcase, ambient light, journey rail,
   pointer glow, scroll reveal, theme ripple, back-to-top ring
   ========================================================= */

/* ---------- Film grain on the dark surfaces ---------- */
.hero::before, .part-head::after, .cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.part-head::after, .cta::after { z-index: -1; opacity: .12; }
.part-head > *, .cta > * { position: relative; z-index: 1; }

/* ---------- Hero: shimmering headline, chips, stats ---------- */
.hero h1 .grad { background-size: 220% 100%; animation: shimmer 7s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
/* ---------- Ambient light behind the tour device ---------- */
.tour-stage { isolation: isolate; }
.tour-stage .device { position: relative; z-index: 1; }
.ambient {
  position: absolute;
  z-index: 0;
  left: 50%; top: 50%;
  width: min(70%, 520px);
  aspect-ratio: 1;
  transform: translate(-50%, -52%);
  border-radius: 50%;
  background: var(--shot, none) center / cover no-repeat;
  filter: blur(54px) saturate(1.7);
  opacity: .45;
  pointer-events: none;
  transition: opacity .6s, background-image .6s;
  animation: breathe 7s ease-in-out infinite alternate;
}
@keyframes breathe { to { transform: translate(-50%, -48%) scale(1.07); } }
:root[data-theme="dark"] .ambient { opacity: .55; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ambient { opacity: .55; } }
@media (max-width: 899.98px) { .ambient { display: none; } }

/* ---------- Journey rail between steps ---------- */
@property --prog { syntax: "<number>"; inherits: false; initial-value: 0; }
.tour-steps { position: relative; --prog: 0; }
.tour-steps::before {
  content: "";
  position: absolute;
  left: 37px;
  top: calc(14vh + 40px);
  bottom: calc(26vh + 40px);
  width: 2px;
  background: linear-gradient(var(--accent) 0 calc(var(--prog) * 100%), var(--line-strong) calc(var(--prog) * 100%));
  transition: --prog .5s;
  pointer-events: none;
}
@media (max-width: 899.98px) { .tour-steps::before { left: 30px; top: calc(18px + 34px); bottom: calc(34vh + 34px); } }
.step { z-index: 1; }
.step.is-active { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 42%); }
.step::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
}
.topic.is-active .topic-num { color: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------- Pointer-following glow on cards ---------- */
.glow { position: relative; overflow: hidden; }
.glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 62%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
}
@media (hover: hover) {
  .glow:hover::after, .step:hover::after { opacity: 1; }
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Theme ripple (View Transitions) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* ---------- Phone: bottom topic bar that opens the contents ---------- */
.topic-bar {
  position: fixed;
  left: 14px; right: 70px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 40;
  display: none;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 14px 0 12px;
  color: #fff;
  text-align: left;
  background: var(--accent-grad);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--accent) 95%, transparent), 0 2px 6px rgba(3, 11, 34, .2);
  animation: pop .3s var(--ease);
  transition: transform .25s var(--ease), opacity .25s;
}
@media (max-width: 899.98px) { .topic-bar { display: flex; } }
body.sb-open .topic-bar { opacity: 0; pointer-events: none; transform: translateY(10px); }
.topic-bar > .bi-list { flex: none; display: grid; place-items: center; width: 32px; height: 32px; font-size: 1.25rem; background: rgba(255, 255, 255, .18); border-radius: 50%; }
.topic-bar .tb-txt { flex: 1; min-width: 0; line-height: 1.15; }
.topic-bar small { display: block; font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.topic-bar b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-bar .tb-count { flex: none; padding: .15rem .5rem; font-family: var(--mono); font-size: .7rem; font-weight: 700; background: rgba(255, 255, 255, .18); border-radius: 999px; }
.topic-bar .tb-chev { flex: none; font-size: .8rem; opacity: .85; }
/* first visit: a few slow pulses so the bar gets noticed; audience switch: a quick flash */
.topic-bar.is-new::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 2px solid var(--accent); animation: ring 1.6s ease-out 4; pointer-events: none; }
.topic-bar.flash { animation: flash .7s var(--ease); }
@keyframes flash { 30% { transform: translateY(-6px) scale(1.03); } }
/* the top-bar menu button stands out more on small screens */
@media (max-width: 1199.98px) { .sb-toggle { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; } }

/* ---------- Back to top with reading ring ---------- */
.totop {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 40;
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 0;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  animation: pop .3s var(--ease);
  transition: transform .25s var(--ease), color .3s;
}
.totop:hover { transform: translateY(-3px); }
.totop svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.totop circle { fill: none; stroke-width: 2.5; }
.totop .track { stroke: var(--line); }
.totop .ring { stroke: var(--accent); stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--read, 0) * 100); transition: stroke-dashoffset .2s linear; }
.totop i { position: relative; font-size: 1.1rem; }
@media (max-width: 899.98px) { .totop { right: 14px; bottom: 14px; width: 44px; height: 44px; } }

/* ---------- Motion preferences & print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .topbar, .hero, .sidebar, .sb-backdrop, .tour-stage, .play, .next, .cta, .footer, .totop, .topic-bar { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .tour-steps::before { display: none; }
  .page { margin-left: 0 !important; }
  [data-for] { display: block !important; }
  .tour { display: block; }
  .tour-steps { padding: 0; }
  .step { opacity: 1; transform: none; margin-bottom: 12px; }
}
