/* ═══════════════════════════════════════════════════════════════════
   tutorial.css — the guided walkthrough layer (window.DemoTutorial).
   Namespace: .dt-*  ONLY. It never styles .dp-* (presentation) or
   .ds-* (shell), and it never touches the app's own classes.

   Everything derives from the app's tokens (css/styles.css), so light
   and dark follow the product with no theme block of my own. The one
   local alias set lives on .dt-root.
   ═══════════════════════════════════════════════════════════════════ */

.dt-root{
  /* derived, never invented — DEMO-DIRECTION §1 */
  --d-ink:var(--text);
  --d-ink-2:var(--text-2);
  --d-ink-3:var(--text-3);
  --d-card:var(--surface);
  --d-line:var(--border);
  --d-brand:var(--brand);
  --d-accent:var(--accent);
  --d-ease:cubic-bezier(.2,.8,.2,1);
  --d-ease-io:cubic-bezier(.4,0,.2,1);
  --dt-tip-w:320px;

  position:fixed;
  inset:0;
  z-index:2147483000;      /* above every app surface (max app z-index is 3000) */
  pointer-events:none;      /* the live app underneath stays fully usable */
  font-family:var(--font);
  color:var(--d-ink);
  -webkit-font-smoothing:antialiased;
}
.dt-root[hidden]{display:none !important}

/* ── the scrim used when no single element is the subject ─────────── */
.dt-veil{
  position:fixed;
  inset:0;
  background:var(--overlay);
  opacity:0;
  transition:opacity 220ms var(--d-ease-io);
}
.dt-veil.is-on{opacity:1}

/* ── the spotlight: one box that paints the scrim, the ring and the
      glow at once, so all three move together ─────────────────────── */
.dt-hole{
  position:fixed;
  left:0; top:0; width:0; height:0;
  border-radius:var(--radius-lg);
  border:2px solid var(--d-brand);
  box-shadow:0 0 0 6px rgba(62,184,122,.16), 0 0 0 9999px var(--overlay);
  box-shadow:0 0 0 6px color-mix(in oklab, var(--brand) 16%, transparent), 0 0 0 9999px var(--overlay);
  opacity:0;
  transition:
    left 380ms var(--d-ease),
    top 380ms var(--d-ease),
    width 380ms var(--d-ease),
    height 380ms var(--d-ease),
    opacity 200ms var(--d-ease-io);
}
.dt-hole.is-on{opacity:1}
/* first appearance: fade in where it belongs, never fly in from 0,0 */
.dt-hole.is-jump{transition:opacity 200ms var(--d-ease-io)}

/* ── the tooltip ─────────────────────────────────────────────────── */
.dt-tip{
  position:fixed;
  left:0; top:0;
  width:var(--dt-tip-w);
  max-width:calc(100vw - 40px);
  padding:20px;
  background:var(--d-card);
  border:1px solid var(--d-line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-3);
  pointer-events:auto;
  opacity:0;
  transform:scale(.97);
  transition:opacity 260ms var(--d-ease) 60ms, transform 260ms var(--d-ease) 60ms, left 380ms var(--d-ease), top 380ms var(--d-ease);
}
.dt-tip.is-on{opacity:1;transform:none}
.dt-tip.is-jump{transition:opacity 260ms var(--d-ease) 60ms, transform 260ms var(--d-ease) 60ms}

.dt-caret{
  position:absolute;
  width:12px; height:12px;
  background:var(--d-card);
  border:0 solid var(--d-line);
  transform:rotate(45deg);
}
.dt-tip[data-side=left]   .dt-caret{border-left-width:1px;border-bottom-width:1px}
.dt-tip[data-side=top]    .dt-caret{border-left-width:1px;border-top-width:1px}
.dt-tip[data-side=bottom] .dt-caret{border-right-width:1px;border-bottom-width:1px}
.dt-tip[data-side=right]  .dt-caret{border-right-width:1px;border-top-width:1px}
.dt-tip[data-side=none]   .dt-caret{display:none}

.dt-count{
  font-size:11px;
  font-weight:600;
  letter-spacing:.10em;
  text-transform:uppercase;
  color:var(--d-ink-3);
  font-variant-numeric:tabular-nums;
  display:flex;
  align-items:center;
  gap:7px;
  margin-bottom:9px;
}
.dt-count .dt-dot{
  width:5px;height:5px;border-radius:50%;
  background:var(--d-brand);
  flex:none;
}
.dt-title{
  font-size:16px;
  font-weight:600;
  line-height:1.3;
  letter-spacing:-.005em;
  color:var(--d-ink);
  margin:0 0 7px;
}
.dt-body{
  font-size:13px;
  line-height:1.55;
  color:var(--d-ink-2);
  margin:0;
}
.dt-body b, .dt-body strong{color:var(--d-ink);font-weight:600}
/* some steps run on their title alone — the screen underneath already says
   what a body would have said, so no empty paragraph is drawn */
.dt-body[hidden]{display:none !important}

/* ── "your turn": the step is something the viewer can do themselves.
      The tooltip grows an accent edge and a single line of instruction;
      pressing Next always does the same thing for them. ───────────── */
.dt-hint{
  margin-top:12px;
  padding:8px 11px;
  border-radius:var(--radius);
  background:color-mix(in oklab, var(--brand) 10%, transparent);
  border:1px solid color-mix(in oklab, var(--brand) 26%, transparent);
  font-size:12px;
  font-weight:600;
  line-height:1.4;
  color:var(--d-ink);
  display:flex;
  align-items:center;
  gap:8px;
}
.dt-hint[hidden]{display:none !important}
.dt-hint::before{
  content:"";
  width:6px;height:6px;border-radius:50%;
  background:var(--d-accent);
  flex:none;
}
.dt-tip.is-act{border-color:color-mix(in oklab, var(--brand) 38%, var(--d-line))}

/* ── a value the viewer has to CARRY: a one-time password, a sign-in
      address, an identifier. The step it sits on never advances on a timer,
      the value is selectable text, and the button confirms the copy.
      Tokens only, so light and dark follow the product. ───────────────── */
.dt-val{
  margin-top:12px;
  padding:10px 11px;
  border-radius:var(--radius);
  border:1px solid var(--d-line);
  background:var(--surface-2);
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:5px 10px;
}
.dt-val[hidden]{display:none !important}
.dt-val-k{
  grid-column:1 / -1;
  font-size:10.5px;
  font-weight:600;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--d-ink-3);
}
.dt-val-t{
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size:14px;
  font-weight:700;
  letter-spacing:.04em;
  color:var(--d-ink);
  min-width:0;
  word-break:break-all;
  cursor:text;
  user-select:all;
  -webkit-user-select:all;
}
.dt-val-t:focus-visible{
  outline:2px solid var(--ring);
  outline-offset:2px;
  border-radius:4px;
}
.dt-val-c{
  font-family:var(--font);
  font-size:11.5px;
  font-weight:600;
  height:26px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid var(--d-line);
  background:var(--d-card);
  color:var(--d-ink-2);
  cursor:pointer;
  white-space:nowrap;
  transition:background 160ms var(--d-ease-io), color 160ms var(--d-ease-io), border-color 160ms var(--d-ease-io);
}
.dt-val-c:hover{background:var(--surface);color:var(--d-ink)}
.dt-val-c.is-done{
  background:color-mix(in oklab, var(--brand) 16%, transparent);
  border-color:color-mix(in oklab, var(--brand) 42%, transparent);
  color:var(--d-ink);
}
.dt-tip.is-val{border-color:color-mix(in oklab, var(--brand) 30%, var(--d-line))}

/* ── a field the tutorial is filling in, so the viewer sees WHICH one
      changed and understands they can change it back ──────────────── */
.dt-fill{
  box-shadow:0 0 0 3px color-mix(in oklab, var(--brand) 26%, transparent) !important;
  border-radius:var(--radius);
  transition:box-shadow 180ms var(--d-ease-io);
}

.dt-card-note{
  margin:18px 0 0;
  font-size:12px;
  line-height:1.5;
  color:var(--d-ink-3);
}
/* attribution, verbatim and alone */
.dt-card-sig{
  margin:10px 0 0;
  font-size:11px;
  font-weight:600;
  letter-spacing:.06em;
  color:var(--d-ink-3);
}

.dt-ctl{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:18px;
}
.dt-dots{display:flex;align-items:center;gap:5px;flex:1;min-width:0;flex-wrap:wrap}
.dt-pip{
  width:5px;height:5px;border-radius:999px;
  background:var(--d-line);
  transition:width 300ms var(--d-ease-io), background 300ms var(--d-ease-io);
  flex:none;
}
.dt-pip.is-done{background:var(--d-ink-3)}
.dt-pip.is-cur{width:18px;background:var(--d-accent)}

.dt-btn{
  font-family:var(--font);
  font-size:12.5px;
  font-weight:600;
  border-radius:999px;
  height:34px;
  padding:0 16px;
  cursor:pointer;
  border:1px solid transparent;
  transition:background 160ms var(--d-ease-io), color 160ms var(--d-ease-io), opacity 160ms var(--d-ease-io);
  white-space:nowrap;
  flex:none;
}
.dt-btn-ghost{
  background:transparent;
  color:var(--d-ink-2);
  border-color:var(--d-line);
}
.dt-btn-ghost:hover{background:var(--surface-2);color:var(--d-ink)}
.dt-btn-solid{
  background:var(--ink);
  color:var(--on-ink);
  border-color:var(--ink);
}
.dt-btn-solid:hover{opacity:.9}

/* ── the quiet exits, pinned to the viewport, not to the tooltip ──── */
.dt-skips[hidden]{display:none!important}
.dt-skips{
  position:fixed;
  right:24px;
  bottom:24px;
  display:flex;
  align-items:center;
  gap:14px;
  pointer-events:auto;
}
.dt-link{
  background:none;
  border:none;
  padding:4px 2px;
  font-family:var(--font);
  font-size:12px;
  font-weight:500;
  color:var(--nav-fg-2);
  cursor:pointer;
  text-decoration:none;
  transition:color 160ms var(--d-ease-io);
}
.dt-link:hover{color:var(--nav-fg);text-decoration:underline}

/* ── the chapter card and the closing card ───────────────────────── */
.dt-card{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(520px, calc(100vw - 48px));
  padding:32px;
  background:var(--d-card);
  border:1px solid var(--d-line);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow-3);
  pointer-events:auto;
  opacity:0;
  transition:opacity 400ms var(--d-ease);
  text-align:left;
}
.dt-card.is-on{opacity:1}
.dt-eyebrow{
  font-size:11px;
  font-weight:600;
  letter-spacing:.10em;
  text-transform:uppercase;
  color:var(--d-ink-3);
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:18px;
}
.dt-eyebrow .dt-dot{width:6px;height:6px;border-radius:50%;background:var(--d-brand);flex:none}
.dt-card-h{
  font-size:26px;
  line-height:1.14;
  font-weight:600;
  letter-spacing:-.02em;
  color:var(--d-ink);
  margin:0 0 14px;
}
.dt-card-p{
  font-size:14px;
  line-height:1.55;
  color:var(--d-ink-2);
  margin:0;
  max-width:46ch;
}
.dt-card-list{
  list-style:none;
  margin:18px 0 0;
  padding:0;
  border-top:1px solid var(--d-line);
}
/* the recap list now leads the closing card, with no paragraph above it */
.dt-card-list-top{margin-top:20px}
.dt-card-list li{
  display:flex;
  align-items:baseline;
  gap:10px;
  padding:9px 0;
  border-bottom:1px solid var(--d-line);
  font-size:13px;
  color:var(--d-ink-2);
}
.dt-card-list b{
  color:var(--d-ink);
  font-weight:600;
  font-variant-numeric:tabular-nums;
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  min-width:52px;
  flex:none;
}
.dt-card-acts{display:flex;gap:10px;margin-top:24px;flex-wrap:wrap}
.dt-card-acts .dt-btn{height:38px;padding:0 20px;font-size:13px}

/* screen-reader-only live region */
.dt-sr{
  position:absolute;
  width:1px;height:1px;
  margin:-1px;padding:0;border:0;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  overflow:hidden;
  white-space:nowrap;
}

/* visible focus, always */
.dt-root button:focus-visible{
  outline:2px solid var(--ring);
  outline-offset:2px;
}

/* ── phones: the tooltip becomes a bottom sheet ──────────────────── */
@media (max-width:720px){
  .dt-tip{
    left:12px !important;
    right:12px;
    top:auto !important;
    bottom:74px;
    width:auto;
    max-width:none;
  }
  .dt-tip .dt-caret{display:none}
  .dt-skips{right:12px;bottom:14px;gap:12px}
  .dt-card{padding:24px}
  .dt-card-h{font-size:22px}
}

/* ── reduced motion: nothing moves, nothing is ever left invisible ── */
@media (prefers-reduced-motion:reduce){
  .dt-hole{transition:opacity 140ms linear}
  .dt-tip{
    transform:none;
    transition:opacity 140ms linear;
  }
  .dt-tip.is-on{transform:none}
  .dt-veil{transition:opacity 140ms linear}
  .dt-card{transition:opacity 140ms linear}
  .dt-pip{transition:none}
  .dt-btn{transition:none}
  .dt-val-c{transition:none}
  .dt-fill{transition:none}
}
