/*
 * Service pages: the pipeline console (VOY-1529, spec KB-554 shared
 * component 5). First use: /methodology/ 04 "A shipping week, not a status
 * meeting." Next: /ai/operations/, /wordpress/managed-hosting/, /social/.
 *
 * A terminal frame around a representative run. Each line is a paragraph
 * classed by kind, and the glyph in front of it is drawn here, so an Editor
 * edits the words and nothing else:
 *
 *   .vy-svc-console__line.is-cmd   "$ "  the command (wrap it in <code>, or
 *                                         WordPress turns "--" into a dash)
 *   .vy-svc-console__line.is-ok    "✓ "  a check that passed
 *   .vy-svc-console__line          "· "  any other step
 *
 * The run ends on an empty prompt with a caret, drawn after the last line.
 *
 * svc-console.js types the run line by line when it arrives and adds a
 * Replay button. Every line is in the HTML at load; typing only changes
 * opacity, so the frame never changes height and a screen reader reads the
 * whole run. Reduced motion and the site's motion pause: the run shows
 * complete and nothing types. Below 768px the run scrolls sideways inside
 * its frame instead of wrapping.
 *
 * Successor to .voyager-term (split-terminal.php before VOY-1529). Tokens
 * only; the practice pair tints the prompt.
 */

.vy-svc-page .vy-svc-console {
	overflow: hidden;
	border: 1px solid var(--border-1);
	border-radius: 6px;
	background: color-mix(in oklab, var(--bg-canvas), black 35%);
	box-shadow: 0 40px 100px color-mix(in oklab, var(--bg-canvas), black 40%);
}

/* ---- Title bar: three dots, title, the Representative run tag ------------ */

.vy-svc-page .vy-svc-console__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border-hair);
	background: var(--bg-panel);
	font-family: var(--font-mono);
}
/* The dots hang off the title, which always has content. */
.vy-svc-page .vy-svc-console__bar::before {
	content: "";
	flex: none;
	width: 10px;
	height: 10px;
	margin-right: 36px;
	border-radius: 50%;
	background: var(--border-strong);
	box-shadow: 16px 0 0 var(--border-strong), 32px 0 0 var(--border-strong);
}
.vy-svc-page .vy-svc-console__title {
	flex: 1;
	font-size: 11px;
	color: var(--fg-4);
	text-align: center;
}
.vy-svc-page .vy-svc-console__tag {
	font-size: 10px;
	color: var(--fg-4);
}

/* ---- The run ---------------------------------------------------------------- */

.vy-svc-page .vy-svc-console__run {
	padding: 20px 22px 24px;
	font-family: var(--font-mono);
	font-size: 14px;
	line-height: 1.9;
}

.vy-svc-page .vy-svc-console__line {
	display: flex;
	gap: 10px;
	white-space: nowrap;
	color: var(--fg-3);
	transition: opacity 160ms var(--svc-ease);
}
.vy-svc-page .vy-svc-console__line::before {
	content: "·";
	flex: none;
	width: 14px;
	color: var(--fg-5);
}
.vy-svc-page .vy-svc-console__line.is-ok { color: var(--fg-2); }
.vy-svc-page .vy-svc-console__line.is-ok::before { content: "✓"; color: var(--signal-ok); }
.vy-svc-page .vy-svc-console__line.is-cmd { color: var(--fg-1); }
.vy-svc-page .vy-svc-console__line.is-cmd::before { content: "$"; color: var(--um-500); }
.vy-svc-page .vy-svc-console__line code {
	padding: 0;
	background: none;
	font: inherit;
	color: inherit;
}

/* The closing prompt: "$" and a caret, drawn as a background so the one
   pseudo-element carries both. While the run types, the caret rides the
   newest line instead (.is-tip, set by svc-console.js). */
.vy-svc-page .vy-svc-console__run::after {
	content: "$";
	display: block;
	color: var(--um-500);
	background: linear-gradient(var(--um-500), var(--um-500)) no-repeat 24px 50% / 8px 16px;
	animation: vy-svc-caret 1s steps(1) infinite;
}
.vy-svc-page .vy-svc-console__line.is-tip::after {
	content: "";
	flex: none;
	align-self: center;
	width: 8px;
	height: 16px;
	background: var(--um-500);
}
@keyframes vy-svc-caret { 50% { background-size: 0 0; } }

/* Typing: lines not yet reached are transparent, not removed. */
.vy-svc-page .vy-svc-console.is-js .vy-svc-console__line:not(.is-shown) { opacity: 0; }
.vy-svc-page .vy-svc-console.is-typing .vy-svc-console__run::after { visibility: hidden; }

/* ---- Replay -------------------------------------------------------------------- */

.vy-svc-page .vy-svc-console__replay {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid var(--border-strong);
	border-radius: 999px;
	background: transparent;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--fg-2);
	cursor: pointer;
	transition: border-color 200ms var(--svc-ease), color 200ms var(--svc-ease);
}
.vy-svc-page .vy-svc-console__replay::before { content: "↻"; color: var(--um-500); }
.vy-svc-page .vy-svc-console__replay:hover { border-color: var(--um-500); color: var(--fg-1); }
.vy-svc-page .vy-svc-console__replay:focus-visible {
	outline: 2px solid var(--um-500);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.vy-svc-page .vy-svc-console__line { transition: none; }
	.vy-svc-page .vy-svc-console__run::after { animation: none; }
}

/* ---- Mobile ---------------------------------------------------------------------- */

@media (max-width: 767px) {
	.vy-svc-page .vy-svc-console__bar { padding: 10px 12px; }
	.vy-svc-page .vy-svc-console__bar::before { display: none; }
	.vy-svc-page .vy-svc-console__title { flex: 1; font-size: 10px; text-align: left; }
	.vy-svc-page .vy-svc-console__tag { font-size: 9px; }
	.vy-svc-page .vy-svc-console__run {
		overflow-x: auto;
		padding: 14px;
		font-size: 12px;
		line-height: 1.85;
	}
	.vy-svc-page .vy-svc-console__line { gap: 8px; }
	.vy-svc-page .vy-svc-console__line::before { width: 12px; }
}
