/*
 * Rundgang (guided walk) through the member app. Uses the tokens of depots.css.
 *
 * Three layers: a shield that keeps clicks away from the page, a light on the element that
 * is being explained, and the card with the explanation.
 */

.tour-shield {
  position: fixed;
  inset: 0;
  z-index: 900;
}

/* The light: a frame around the element; its huge shadow dims everything else. */
.tour-spot {
  position: fixed;
  z-index: 901;
  border-radius: 18px;
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 0 100vmax rgb(1 12 28 / 0.74);
  pointer-events: none;
  transition:
    top 0.42s var(--ease),
    left 0.42s var(--ease),
    width 0.42s var(--ease),
    height 0.42s var(--ease);
}

:root[data-theme="light"] .tour-spot {
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 0 100vmax rgb(1 32 65 / 0.6);
}

/* No element to light: the whole page is dimmed. */
.tour-spot.is-off {
  box-shadow: 0 0 0 100vmax rgb(1 12 28 / 0.74);
}

:root[data-theme="light"] .tour-spot.is-off {
  box-shadow: 0 0 0 100vmax rgb(1 32 65 / 0.6);
}

/* ------------------------------------------------------------------ card */

.tour-card {
  position: fixed;
  z-index: 902;
  width: min(380px, calc(100vw - 32px));
  padding: 22px 22px 18px;
  border-radius: 20px;
  background: var(--panel-2);
  border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  box-shadow:
    0 2px 4px rgb(1 12 28 / 0.2),
    0 24px 60px rgb(1 12 28 / 0.45);
  color: var(--fg);
  font-family: var(--sans);
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease);
}

:root[data-theme="light"] .tour-card {
  background: #ffffff;
  border-color: var(--hair);
  box-shadow:
    0 2px 4px rgb(1 32 65 / 0.08),
    0 24px 60px rgb(1 32 65 / 0.22);
}

.tour-card.is-changing {
  opacity: 0;
  transform: translateY(6px);
}

.tour-card.is-centered {
  top: 50%;
  left: 50%;
  width: min(440px, calc(100vw - 32px));
  padding: 30px 28px 22px;
  transform: translate(-50%, -50%);
}

.tour-card.is-centered.is-changing {
  transform: translate(-50%, calc(-50% + 6px));
}

/* Phone: a sheet across the width, top or bottom (set by the script). */
.tour-card.is-sheet {
  left: 12px;
  right: 12px;
  width: auto;
  padding: 18px 18px 14px;
}

.tour-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--faint);
  cursor: pointer;
}

.tour-close:hover {
  background: color-mix(in srgb, var(--fg) 9%, transparent);
  color: var(--fg);
}

.tour-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.tour-eyebrow {
  margin: 0 36px 8px 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tour-title {
  margin: 0 28px 8px 0;
  font: 600 21px/1.25 var(--serif);
  letter-spacing: -0.005em;
}

.tour-card.is-centered .tour-title {
  font-size: 27px;
  line-height: 1.18;
}

.tour-text {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.tour-text strong {
  color: var(--fg);
  font-weight: 600;
}

.tour-card.is-centered .tour-text {
  font-size: 15.5px;
}

.tour-figure {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: var(--panel);
}

:root[data-theme="light"] .tour-figure {
  background: var(--panel-2);
}

.tour-figure[hidden] {
  display: none;
}

/* ------------------------------------------------------------------ footer */

.tour-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

/* Progress: a price line that grows with every stop. */
.tour-progress {
  position: relative;
  flex: 1;
  min-width: 60px;
  height: 28px;
}

.tour-progress svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tour-progress path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.tour-progress .tp-rest {
  stroke: color-mix(in srgb, var(--fg) 16%, transparent);
  stroke-dasharray: 1 5;
}

.tour-progress .tp-done {
  stroke: var(--accent);
}

.tour-progress .tp-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}

.tour-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.tour-btn {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  font: 600 14px var(--sans);
  cursor: pointer;
}

.tour-btn[hidden] {
  display: none;
}

.tour-btn--main {
  background: var(--accent);
  color: var(--on-accent, #012041);
}

.tour-btn--main:hover {
  filter: brightness(1.06);
}

.tour-btn--quiet {
  background: none;
  color: var(--muted);
}

.tour-btn--quiet:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.tour-btn:focus-visible,
.tour-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ drawings */

.tf {
  display: block;
  width: 100%;
  height: auto;
}

.tf text {
  font-family: var(--sans);
}

.tf-cap {
  fill: var(--muted);
  font-size: 9.5px;
}

.tf-cap--so {
  fill: var(--neg);
  font-weight: 600;
}

.tf-cap--su {
  fill: var(--accent);
  font-weight: 600;
}

.tf-num {
  font: 600 15px var(--serif);
  fill: var(--fg);
}

.tf-num.tf-pos {
  fill: var(--accent);
}

.tf-lead {
  fill: none;
  stroke: var(--faint);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.tf-lead--arrow {
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-dasharray: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tf-slice {
  fill: none;
  stroke-width: 9;
}

.tf-slice--wide {
  stroke-width: 15;
}

.tf-slice--1 {
  stroke: var(--s1);
}

.tf-slice--2 {
  stroke: var(--s2);
}

.tf-slice--3 {
  stroke: var(--s3);
}

.tf-slice--4 {
  stroke: var(--s4);
}

.tf-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tf-bench {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-dasharray: 1 4;
  stroke-linecap: round;
}

.tf-badge line {
  stroke-width: 1.4;
}

.tf-badge text {
  font-size: 10px;
  font-weight: 600;
}

.tf-badge--buy line,
.tf-badge--buy circle {
  stroke: var(--accent);
}

.tf-badge--sell line,
.tf-badge--sell circle {
  stroke: var(--neg);
}

.tf-badge circle {
  fill: var(--panel-2);
  stroke-width: 1.6;
}

.tf-badge--buy text {
  fill: var(--accent);
}

.tf-badge--sell text {
  fill: var(--neg);
}

.tf-rows rect {
  fill: color-mix(in srgb, var(--fg) 14%, transparent);
}

.tf-zone--so {
  fill: var(--neg);
  opacity: 0.2;
}

.tf-zone--o {
  fill: var(--warn);
  opacity: 0.13;
}

.tf-zone--u {
  fill: var(--accent);
  opacity: 0.1;
}

.tf-zone--su {
  fill: var(--accent);
  opacity: 0.22;
}

.tf-today {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.tf-out {
  fill: none;
  stroke-width: 1.6;
  stroke-dasharray: 4 4;
  stroke-linecap: round;
}

.tf-out--fair {
  stroke: var(--fg);
}

.tf-out--analyst {
  stroke: var(--s2);
}

.tf-tip--fair {
  fill: var(--fg);
}

.tf-tip--analyst {
  fill: var(--s2);
}

/* Five score rings side by side. */
.tf-rings {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  text-align: center;
}

.tf-rings span {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.tf-ring {
  width: 34px;
  height: 34px;
}

.tf-ring circle {
  fill: none;
  stroke-width: 4.5;
}

.tf-ring .tf-track {
  stroke: color-mix(in srgb, var(--fg) 13%, transparent);
}

.tf-ring .tf-fill {
  stroke: var(--rate);
  stroke-linecap: round;
}

.tf-rings b {
  font: 600 12.5px var(--serif);
  font-variant-numeric: lining-nums;
}

.tf-rings i {
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.2;
}

/* The five-zone scale. */
.tf-scale-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr 1fr 1fr;
  gap: 3px;
  height: 14px;
}

.tf-scale-bar i {
  border-radius: 4px;
}

.tf-scale-bar .s1 {
  background: var(--accent);
}

.tf-scale-bar .s2 {
  background: color-mix(in srgb, var(--accent) 38%, var(--panel-2));
}

.tf-scale-bar .s3 {
  background: color-mix(in srgb, var(--fg) 22%, var(--panel-2));
}

.tf-scale-bar .s4 {
  background: color-mix(in srgb, var(--warn) 45%, var(--panel-2));
}

.tf-scale-bar .s5 {
  background: var(--neg);
}

.tf-scale-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
}

.tf-scale ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.tf-scale li b {
  display: block;
  color: var(--fg);
  font: 600 14px var(--serif);
}

/* "Rundgang starten" at the bottom of every page: the way back in on a phone. */
.foot-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.foot-link:hover {
  color: var(--fg);
}

/* The "Rundgang" entry in the sidebar is a button that looks like its neighbours. */
.side-link[data-tour-start] {
  cursor: pointer;
  text-align: left;
}

@media (max-width: 720px) {
  .tour-title {
    font-size: 19px;
  }

  .tour-text {
    font-size: 14px;
  }

  .tour-figure {
    margin-top: 12px;
    padding: 10px 12px;
  }

  .tour-foot {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-spot,
  .tour-card {
    transition: none;
  }
}
