/* ShipVibed ASCII motion (ascii.js): the site's own layer, not a kit file. Tokens only, so it follows
   .ground-inverse and the page palette. */

.ascii {
  margin: 0; padding: 0; border: 0; background: none;
  font: 400 13px/1.22 var(--font-mono); letter-spacing: 0; white-space: pre; tab-size: 2;
  color: color-mix(in oklab, var(--ink) 72%, var(--bg));
  user-select: none; -webkit-user-select: none; pointer-events: none;
  font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0;
}
.ascii i { font-style: normal; }
.ascii .k1 { color: var(--accent); }
.ascii .k2 { color: color-mix(in oklab, var(--ink) 38%, var(--bg)); }
.ascii .k3 { color: var(--ink); }
.ground-inverse .ascii .k1, [data-ground="inverse"] .ascii .k1 { color: var(--ink); font-weight: 500; }

/* a small loop in its own panel */
.ascii-panel {
  display: grid; place-items: center; padding: 18px 22px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: color-mix(in oklab, var(--bg) 70%, var(--card, var(--bg)));
  /* 32 columns x 10 rows, so nothing shifts while it runs */
  min-height: calc(10 * 1.22em + 36px);
}
.ascii-panel > .ascii { min-width: 32ch; min-height: calc(10 * 1.22em); }

/* the inner pages' head: the loop on the right at a desktop width, under the lead below it */
.page-head--art > .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-7, 48px); align-items: end; }
.page-head--art > .wrap > .crumbs { grid-column: 1 / -1; }
.page-head--art > .wrap > .page-head__body { grid-column: 1; }
.page-head__art { grid-column: 2; align-self: end; }
@media (max-width: 1023px) {
  .page-head--art > .wrap { grid-template-columns: minmax(0, 1fr); }
  .page-head__art { grid-column: 1; justify-self: start; margin-top: var(--s-6, 32px); }
}
@media (max-width: 639px) {
  .page-head__art { justify-self: stretch; }
  .page-head__art .ascii { font-size: 11.5px; }
}

/* the terminal caret after a page's h1 */
.ascii-caret { display: inline-block; margin-left: .08em; color: var(--accent); font-family: var(--font-mono); font-weight: 400; animation: ascii-blink 1.1s steps(1, end) infinite; }
@keyframes ascii-blink { 50% { opacity: 0; } }

/* the footer horizon */
.ascii-sea { display: block; width: 100%; overflow: hidden; font-size: 13px; line-height: 1.15; margin: var(--s-7, 48px) 0 var(--s-5, 24px); }
@media (max-width: 639px) { .ascii-sea { font-size: 11px; margin-top: var(--s-6, 32px); } }

/* the pause switch (a real control: every loop here runs longer than 5 s) */
.ascii-pause {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted);
  font: 400 var(--t-small, 14px)/1 var(--font-mono); cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .12s ease;
}
.ascii-pause:hover { color: var(--ink); border-color: var(--line-strong, var(--muted)); }
.ascii-pause:active { transform: scale(.97); }
.ascii-pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ascii-pause__ico { display: inline-block; width: 1.4em; text-align: center; color: var(--accent); }
.ascii-pause[aria-pressed="true"] .ascii-pause__ico::before { content: ">"; }
.ascii-pause[aria-pressed="false"] .ascii-pause__ico::before { content: "||"; }

/* paused, or reduced motion: everything rests on its still frame */
.ascii-paused .ascii-caret { animation: none; }
@media (prefers-reduced-motion: reduce) { .ascii-caret { animation: none; } }
