/* ═══════════════════════════════════════════════════════════════════════════
   assets/student/components/tutorial.css
   Portal-wide tutorial overlay.

   Injected into EVERY student surface — the dashboard and all twelve minisites,
   each of which ships its own unrelated stylesheet. So:

     · every selector is prefixed .stut- and nothing is styled by element alone;
     · every value the card depends on is declared on .stut-root rather than
       inherited, because a host page's `body { font-size: 18px }` or `* { }`
       reset would otherwise reach in here;
     · no web font is loaded — 'Outfit' is used if the host page already has it
       and a system stack takes over if not. One overlay is not worth a
       render-blocking font request on twelve minisites.

   Palette matches assets/student/dashboard.css (warm paper / terracotta), but
   re-declared locally so the overlay looks the same on a minisite that never
   loaded dashboard.css.
   ═══════════════════════════════════════════════════════════════════════════ */

.stut-root {
  --stut-cream: #f5ede0;
  --stut-paper: #fdf8f2;
  --stut-paper-warm: #faf3e8;
  --stut-rule: #d9c9b0;
  --stut-rule-mid: #c4af90;
  --stut-ink: #1e1712;
  --stut-ink-mid: #5c4a35;
  --stut-ink-soft: #8c7560;
  --stut-terra: #8b3a2a;
  --stut-terra-light: #a84e3b;
  --stut-terra-bg: #f5e8e4;
  --stut-gold: #c9922a;
  --stut-r: 12px;
  --stut-rl: 18px;

  font-family: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--stut-ink);
}

.stut-root *,
.stut-root *::before,
.stut-root *::after { box-sizing: border-box; }


/* ── Floating replay launcher ──────────────────────────────────────────────
   Deliberately small and bottom-left: bottom-right is where minisites tend to
   put their own floating actions, and a help button is not worth a collision. */

.stut-launch {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 2147482000;

  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--stut-rule-mid);
  background: var(--stut-paper);
  color: var(--stut-terra);

  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;

  box-shadow: 0 3px 14px rgba(30, 23, 18, .13);
  opacity: .58;
  transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
}

.stut-launch:hover,
.stut-launch:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 58, 42, .22);
  outline: none;
}

.stut-launch:focus-visible { border-color: var(--stut-terra); }

/* Nudge for someone who has never opened it — a soft ring, twice, then quiet. */
.stut-launch.is-unseen {
  opacity: 1;
  animation: stut-pulse 2.4s ease-out 2;
}

@keyframes stut-pulse {
  0%, 100% { box-shadow: 0 3px 14px rgba(30, 23, 18, .13); }
  50%      { box-shadow: 0 3px 14px rgba(30, 23, 18, .13), 0 0 0 9px rgba(139, 58, 42, .10); }
}


/* ── Overlay ───────────────────────────────────────────────────────────────── */

.stut-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;

  background: rgba(30, 23, 18, .48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  opacity: 0;
  transition: opacity .2s ease;
}

.stut-overlay.is-open { opacity: 1; }


/* ── Card ──────────────────────────────────────────────────────────────────── */

.stut-card {
  width: min(620px, 100%);
  max-height: min(84vh, 720px);
  display: flex;
  flex-direction: column;

  background: var(--stut-paper);
  border: 1.5px solid var(--stut-rule);
  border-radius: var(--stut-rl);
  box-shadow: 0 24px 70px rgba(30, 23, 18, .35);
  overflow: hidden;

  transform: translateY(14px) scale(.985);
  transition: transform .22s cubic-bezier(.22, 1, .36, 1);
}

.stut-overlay.is-open .stut-card { transform: none; }


/* ── Header ────────────────────────────────────────────────────────────────── */

.stut-head {
  padding: 20px 22px 16px;
  border-bottom: 1.5px solid var(--stut-rule);
  background: var(--stut-paper-warm);
  position: relative;
  flex: 0 0 auto;
}

.stut-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--stut-ink-soft);
  margin-bottom: 7px;
}

/* "What's new" mode gets the accent; a first-run tour stays quiet. */
.stut-card[data-mode="update"] .stut-eyebrow { color: var(--stut-terra); }

.stut-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--stut-ink);
  padding-right: 40px;
}

.stut-sub {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--stut-ink-mid);
  padding-right: 40px;
}

.stut-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--stut-ink-soft);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background .15s ease, color .15s ease;
}

.stut-close:hover { background: var(--stut-cream); color: var(--stut-ink); }
.stut-close:focus-visible { outline: 2px solid var(--stut-terra); outline-offset: 1px; }


/* ── Changelog strip (update mode only) ────────────────────────────────────── */

.stut-changes {
  margin: 0;
  padding: 13px 22px;
  list-style: none;
  background: var(--stut-terra-bg);
  border-bottom: 1.5px solid var(--stut-rule);
  flex: 0 0 auto;
  max-height: 130px;
  overflow-y: auto;
}

.stut-changes li {
  display: flex;
  gap: 9px;
  font-size: 13.5px;
  color: var(--stut-ink-mid);
  line-height: 1.5;
}

.stut-changes li + li { margin-top: 6px; }

.stut-changes li::before {
  content: '';
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--stut-terra);
  margin-top: 8px;
}


/* ── Slide body ────────────────────────────────────────────────────────────── */

.stut-body {
  padding: 24px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.stut-slide { animation: stut-fade .22s ease both; }

@keyframes stut-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.stut-newpill {
  display: inline-block;
  margin-bottom: 9px;
  padding: 2.5px 9px;
  border-radius: 999px;
  background: var(--stut-terra);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.stut-slide h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--stut-ink);
}

.stut-copy { font-size: 15px; color: var(--stut-ink-mid); }
.stut-copy p { margin: 0 0 10px; }
.stut-copy p:last-child { margin-bottom: 0; }
.stut-copy ul { margin: 0 0 10px; padding-left: 20px; }
.stut-copy li { margin-bottom: 5px; }
.stut-copy li:last-child { margin-bottom: 0; }
.stut-copy strong { color: var(--stut-ink); font-weight: 600; }
.stut-copy em { font-style: italic; }

.stut-copy code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em;
  background: var(--stut-cream);
  border: 1px solid var(--stut-rule);
  border-radius: 5px;
  padding: 1px 5px;
}

/* width:auto + max-width:100%, never width:100%. A wide screenshot fills the
   card; a small one (an icon, a cropped detail) is shown at its own size and
   centred, instead of being upscaled into a blurry mess. */
.stut-media {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 14px auto 0;
  border: 1px solid var(--stut-rule);
  border-radius: var(--stut-r);
  background: var(--stut-cream);
}

/* Leading image: sits under the title, above the copy. Height-capped so a tall
   screenshot can't push the text off a laptop screen — the deck is meant to be
   read without scrolling wherever possible. */
.stut-media.is-lead {
  margin: 0 auto 14px;
  max-height: 300px;
}


/* ── Footer ────────────────────────────────────────────────────────────────── */

.stut-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1.5px solid var(--stut-rule);
  background: var(--stut-paper-warm);
  flex: 0 0 auto;
}

.stut-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.stut-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--stut-rule-mid);
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.stut-dot:hover { transform: scale(1.25); }
.stut-dot.is-active { background: var(--stut-terra); transform: scale(1.3); }
.stut-dot.is-new { background: var(--stut-gold); }
.stut-dot.is-new.is-active { background: var(--stut-terra); }
.stut-dot:focus-visible { outline: 2px solid var(--stut-terra); outline-offset: 2px; }

.stut-btn {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 9px;
  border: 1.5px solid var(--stut-rule-mid);
  background: var(--stut-paper);
  color: var(--stut-ink-mid);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.stut-btn:hover { background: var(--stut-cream); color: var(--stut-ink); }
.stut-btn:focus-visible { outline: 2px solid var(--stut-terra); outline-offset: 1px; }
.stut-btn[hidden] { display: none; }

.stut-btn.is-primary {
  background: var(--stut-terra);
  border-color: var(--stut-terra);
  color: #fff;
}

.stut-btn.is-primary:hover { background: var(--stut-terra-light); border-color: var(--stut-terra-light); }

.stut-btn.is-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--stut-ink-soft);
  padding-left: 8px;
  padding-right: 8px;
}

.stut-btn.is-quiet:hover { background: var(--stut-cream); color: var(--stut-ink-mid); }


/* ── Small screens ─────────────────────────────────────────────────────────── */

@media (max-width: 560px) {
  .stut-overlay { padding: 0; align-items: flex-end; }

  .stut-card {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--stut-rl) var(--stut-rl) 0 0;
    border-bottom: none;
  }

  .stut-title { font-size: 19px; }
  .stut-head, .stut-body, .stut-foot, .stut-changes { padding-left: 17px; padding-right: 17px; }
  .stut-foot { flex-wrap: wrap; }
  .stut-dots { order: 3; width: 100%; justify-content: center; }
  .stut-launch { left: 14px; bottom: 14px; }
}


/* ── Motion / contrast preferences ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .stut-overlay,
  .stut-card,
  .stut-slide,
  .stut-launch { transition: none; animation: none; }
  .stut-card { transform: none; }
}

@media (prefers-contrast: more) {
  .stut-card { border-width: 2px; border-color: var(--stut-ink-mid); }
  .stut-copy { color: var(--stut-ink); }
}

/* Print: a modal has no business on paper. */
@media print {
  .stut-overlay, .stut-launch { display: none !important; }
}
