/* HTP · terminal polish — focus, a11y, reduced motion, mobile. Loaded last. */
:root { --focus-ring: 0 0 0 2px var(--bg0, #010402), 0 0 0 4px var(--lulz-green, var(--green)); }

/* Visible keyboard focus everywhere (previous rules set outline:none with no replacement) */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--lulz-green, var(--green));
  outline-offset: 2px;
}
button.term-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.term-form:focus-within { box-shadow: inset 0 0 0 1px var(--green-dim); }
.py-editor:focus-within { box-shadow: inset 0 0 0 1px var(--green-dim); }
#terminal:focus-visible { outline: 2px solid var(--green-dim); outline-offset: -2px; }
footer.site-foot a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* Terminal links (resources / feed) */
#terminal a.term-link {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}
#terminal a.term-link:hover { color: var(--green-bright); }

#cmd::placeholder { color: var(--muted); opacity: 1; }
#cmd:disabled { opacity: 0.5; }
.term-wrap[aria-busy="true"] .term-prompt { opacity: 0.6; }

/* No-JS fallback is toggled with [hidden] */
#terminal-static[hidden] { display: none !important; }

/* iOS zooms inputs under 16px — keep the prompt usable on phones */
@media (max-width: 640px) {
  #cmd, #py-code { font-size: 16px; }
  .term-bar { flex-wrap: wrap; row-gap: 0.35rem; }
  button.term-btn { min-height: 32px; min-width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .blink, .cursor, .glitch, .marquee, .marquee * { animation: none !important; }
  .cursor { opacity: 1; }
}

@media (forced-colors: active) {
  .cursor { background: CanvasText; }
  button.term-btn { border: 1px solid ButtonText; }
}
