/* ---------------------------------------------------------
   echo3.co — design tokens
   Direction: authentic terminal / BBS main-menu, not generic
   "dark mode with red accent". Box-drawing corners, a real
   command-prompt nav, and a menu-style CTA list are the
   signature elements that carry the theme end to end.
--------------------------------------------------------- */

@import url("https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&family=JetBrains+Mono:ital,wght@0,400;0,500;0,700;1,400&display=swap");

:root {
  --bg: #0b0c12;
  --bg-raised: #12131c;
  --fg: #e8e6f0;
  --fg-dim: #86859a;
  --accent: #ff6a6a;
  --accent-dim: #5c2f34;
  --cyan: #5fd7ff;
  --green: #6bff95;
  --pink: #ff73b9;
  --yellow: #ffdf6d;
  --font-display: "Silkscreen", "Courier New", monospace;
  --font-body: "JetBrains Mono", "Courier New", monospace;
  --border: 2px solid var(--accent);
  --max-width: 760px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  padding: 2.5rem 1.25rem 4rem;
}

a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted var(--cyan);
}
a:hover,
a:focus-visible {
  color: var(--fg);
  border-bottom-color: var(--fg);
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.5px;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: 1.4rem;
  color: var(--accent);
}
h2 {
  font-size: 1.05rem;
  color: var(--accent);
}
h3 {
  font-size: 0.95rem;
  color: var(--accent);
}

p {
  margin: 0 0 1rem;
  max-width: 68ch;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---------- header: fake terminal title bar + prompt nav ---------- */

.termbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-raised);
  border: var(--border);
  padding: 0.5rem 0.85rem;
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 0.8rem;
  color: var(--fg-dim);
}
.termbar__dots {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}
.termbar__dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: inline-block;
}
.termbar__path {
  color: var(--fg-dim);
  overflow-wrap: anywhere;
}
.termbar__path strong {
  color: var(--accent);
  font-weight: 400;
}

nav.prompt {
  max-width: var(--max-width);
  margin: 0.6rem auto 2.5rem;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}
nav.prompt a {
  border-bottom: none;
  color: var(--fg);
}
nav.prompt a::before {
  content: "> ";
  color: var(--accent);
}
nav.prompt a:hover,
nav.prompt a[aria-current="page"] {
  color: var(--cyan);
}
nav.prompt a[aria-current="page"]::before {
  color: var(--cyan);
}

/* ---------- boxed section, corner glyphs = signature element ---------- */

.box {
  position: relative;
  border: var(--border);
  background: var(--bg-raised);
  padding: 1.5rem;
  margin: 0 0 2rem;
}
.box__corner {
  position: absolute;
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1rem;
  line-height: 1;
  background: var(--bg);
  padding: 0 2px;
}
.box__corner--tl {
  top: -0.6em;
  left: 8px;
}
.box__corner--tr {
  top: -0.6em;
  right: 8px;
}
.box__corner--bl {
  bottom: -0.6em;
  left: 8px;
}
.box__corner--br {
  bottom: -0.6em;
  right: 8px;
}

/* wraps a bordered element (e.g. .menu) to add corner glyphs without
   adding a second border/background of its own */
.glyph-frame {
  position: relative;
  margin: 0 0 2rem;
}
.glyph-frame .menu {
  margin-bottom: 0;
}

.eyebrow {
  font-size: 0.75rem;
  color: var(--fg-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

/* ---------- scanline overlay (CRT-style texture, shared) ---------- */

.termbar::after,
.scanline-box::after,
.avatar-frame::after,
.stats-strip::after,
.post-artwork-inline-container .box::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.2) 2px,
    rgba(0, 0, 0, 0.2) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ---------- terminal snippet (homepage pricing teaser) ---------- */

.terminal-snippet {
  position: relative;
  background-color: var(--bg-raised);
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  border: none !important;
  border-left: none !important;
}
.terminal-snippet .prompt {
  color: var(--green);
}

/* stats/facts strip: key/value readout inside a terminal-snippet, e.g. `$ cat career.log` */
.stats-strip {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
}
.stats-strip__text {
  flex: 1 1 auto;
  min-width: 0;
}
.stats-strip__value {
  color: var(--accent);
  font-weight: 700;
}
.stats-strip__note {
  color: var(--fg-dim);
}
.stats-strip__avatar {
  flex: 0 0 auto;
  align-self: stretch;
  height: auto;
  width: auto;
  aspect-ratio: 1 / 1;
  border: var(--border);
  image-rendering: pixelated;
  object-fit: cover;
}
@media (max-width: 480px) {
  .stats-strip {
    flex-direction: column;
  }
  .stats-strip__avatar {
    align-self: flex-start;
    width: 100px;
    height: auto;
  }
}

/* ---------- section rule: dashed glyph divider between sections ---------- */

.rule {
  overflow: hidden;
  white-space: nowrap;
  margin: 2.5rem 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 3px;
  line-height: 1;
}

/* ---------- pull-quote: single-line callout, prompt-styled ---------- */

.pull-quote {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1.5;
  max-width: 60ch;
  margin: 0 0 2rem;
}
.pull-quote::before {
  content: "> ";
}

/* ---------- scanline box (page intros: services, blog) ---------- */

.scanline-box {
  position: relative;
  background-color: var(--bg-raised);
  padding: 1.5rem;
  margin: 0 0 2rem;
}

/* ---------- BBS-style menu list (used for homepage CTAs + portfolio) ---------- */

.menu {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border: var(--border);
}
.menu li {
  border-bottom: 1px solid var(--accent-dim);
}
.menu li:last-child {
  border-bottom: none;
}
.menu a {
  position: relative;
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  padding: 0.85rem 1rem;
  border-bottom: none;
  color: var(--fg);
}
.menu a:hover,
.menu a:focus-visible {
  background: var(--accent);
  color: var(--bg);
}
.menu a:hover::after,
.menu a:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.2) 2px,
    rgba(0, 0, 0, 0.2) 4px
  );
  pointer-events: none;
}
.menu a:hover .menu__num,
.menu a:focus-visible .menu__num {
  color: var(--bg);
}
.menu__num {
  font-family: var(--font-display);
  color: var(--accent);
  flex-shrink: 0;
  min-width: 2.4em;
}
.post-list .menu__num {
  flex: 0 0 9rem;
}
.menu__label {
  flex-grow: 1;
}
.menu:not(.post-list) .menu__label {
  flex: 0 0 16rem;
  flex-shrink: 0;
}
.menu__hint {
  color: var(--fg-dim);
  font-size: 0.8rem;
}
.menu a:hover .menu__hint,
.menu a:focus-visible .menu__hint {
  color: var(--bg);
}

@media (max-width: 600px) {
  .menu a {
    flex-wrap: wrap;
  }
  .menu:not(.post-list) .menu__label {
    flex: 1 1 auto;
  }
  .menu__hint {
    flex: 0 0 100%;
    width: 100%;
    margin-top: 0.25rem;
  }
  .post-list .menu__num {
    flex: 0 0 100%;
    width: 100%;
  }
  .post-list .menu__label {
    flex: 0 0 100%;
    width: 100%;
    margin-top: 0.25rem;
  }
}


/* ---------- hero ---------- */

.hero {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.avatar-frame {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}
.hero img {
  width: 84px;
  height: 84px;
  image-rendering: pixelated;
  border: var(--border);
}
.hero__name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--fg);
  margin: 0;
}
.hero__tagline {
  color: var(--fg-dim);
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
}
.cursor {
  display: inline-block;
  width: 0.55em;
  background: var(--green);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }
}

/* ---------- tags / meta ---------- */

.meta {
  color: var(--fg-dim);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0;
  list-style: none;
}
.tags li {
  border: 1px solid var(--accent-dim);
  color: var(--fg-dim);
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
}

/* ---------- footer ---------- */

footer {
  max-width: var(--max-width);
  margin: 3rem auto 0;
  color: var(--fg-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--accent-dim);
  padding-top: 1rem;
}

/* ---------- misc content ---------- */

.post-list,
.portfolio-index {
  padding: 0;
  margin: 0;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.post-header h1 {
  margin: 0;
  flex: 2 1 0%;
}

.post-artwork-inline-container {
  max-width: 220px;
  width: 100%;
  flex: 1 1 220px;
}

.post-artwork-inline-container .box {
  margin: 0;
  padding: 0;
  background: #08200d;
}

.post-artwork-inline-container img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: -moz-crisp-edges;
  image-rendering: -o-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

code {
  background: var(--bg-raised);
  border: 1px solid var(--accent-dim);
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
  font-family: var(--font-body);
  border-radius: 3px;
  color: var(--cyan);
}

pre {
  background-color: var(--bg-raised);
  border: 1px solid var(--accent-dim);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 0 0 2rem 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: visible;
  word-break: break-word;
  overflow-wrap: break-word;
}

pre:has(code.language-diagram) {
  white-space: pre;
  overflow-x: auto;
  word-break: normal;
  overflow-wrap: normal;
}

pre code {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  font-size: inherit !important;
  color: inherit !important;
  white-space: inherit !important;
  border-radius: 0 !important;
}

/* ---------- syntax highlighting overrides ---------- */

pre[class*="language-"],
code[class*="language-"] {
  font-family: var(--font-body) !important;
  font-size: 0.85rem !important;
  background-color: var(--bg-raised) !important;
  border: 1px solid var(--accent-dim) !important;
  border-radius: 3px !important;
}

pre[class*="language-"] {
  border-left: 4px solid var(--accent) !important;
  padding: 1rem 1.25rem !important;
  margin: 0 0 2rem 0 !important;
  white-space: pre-wrap !important;
  overflow-x: visible !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

pre[class*="language-"] code[class*="language-"] {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  white-space: inherit !important;
  font-size: inherit !important;
  border-radius: 0 !important;
}

/* Ensure diagrams still scroll and do not wrap */
pre[class*="language-"]:has(code.language-diagram) {
  white-space: pre !important;
  overflow-x: auto !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}


blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 1rem;
  padding-left: 1rem;
  color: var(--fg-dim);
}

/* ---------- TLDR blocks ---------- */
.tldr,
blockquote.tldr {
  border-left: none !important;
  padding-left: 0 !important;
  font-style: italic !important;
  color: var(--fg) !important;
  margin: 0 0 1.5rem !important;
  margin-inline-start: 0 !important;
  margin-inline-end: 0 !important;
  max-width: 68ch !important;
  font-size: 1.1rem !important;
}
.tldr strong,
blockquote.tldr strong {
  color: var(--cyan) !important;
}

@media (max-width: 480px) {
  body {
    padding: 1.5rem 1rem 3rem;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .post-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .post-artwork-inline-container {
    max-width: 140px;
    flex: none;
  }
}

/* ---------- content lists inside posts/portfolio bodies ---------- */
/* deliberately excludes .menu and .tags, which have their own styling */

ul:not(.menu):not(.tags),
ol:not(.menu):not(.tags) {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

ul:not(.menu):not(.tags) li,
ol:not(.menu):not(.tags) li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: 0.4rem;
}

ul:not(.menu):not(.tags) li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-display);
}

ol:not(.menu):not(.tags) {
  counter-reset: item;
}

ol:not(.menu):not(.tags) li {
  counter-increment: item;
  padding-left: 2.4em;
}

ol:not(.menu):not(.tags) li::before {
  content: counter(item, decimal-leading-zero) ":";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-display);
}

/* ---------- inline post images ---------- */
.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 2px solid var(--accent);
  box-sizing: border-box;
  margin: 1.5rem 0;
}

/* ---------- Interactive Alien Easter Egg ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.alien-strip-container {
  margin: 0 0 2rem 0;
  width: 100%;
}

.alien-counter {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--fg-dim);
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
}

.alien-strip {
  position: relative;
  height: 90px;
  border: var(--border);
  background: var(--bg-raised);
  display: flex;
  justify-content: space-around;
  align-items: center;
  overflow: hidden;
}

.alien-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(15, 50, 20, 0.25) 0,
    rgba(15, 50, 20, 0.25) 2px,
    rgba(5, 20, 8, 0.4) 2px,
    rgba(5, 20, 8, 0.4) 4px
  );
  pointer-events: none;
  z-index: 5;
}

.alien-group {
  position: absolute;
  top: 0;
  height: 100%;
  left: 0;
  display: flex;
  gap: 16px;
}

.alien-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 100%;
  position: relative;
}

@media (max-width: 480px) {
  .alien-group .alien-slot[data-col="4"],
  .alien-group .alien-slot[data-col="5"] {
    display: none;
  }
}

.alien-btn {
  background: transparent;
  border: none;
  padding: 24px; /* Generous hit target area */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
  outline: none;
}

.alien-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.alien-btn:hover {
  transform: scale(1.1);
}

.alien-btn:active {
  transform: scale(0.9);
}

.alien-btn svg {
  display: block;
}

/* Binary walk-cycle sprite toggle (stepped loop driven by JS class toggles) */
.alien-frame-up {
  display: none;
}
.alien-frame-down {
  display: block;
}

.alien-frame-alt .alien-frame-down {
  display: none;
}
.alien-frame-alt .alien-frame-up {
  display: block;
}

/* Starburst Explosion */
.starburst-container {
  position: absolute;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.starburst-svg {
  width: 100%;
  height: 100%;
}

.ray {
  transform-origin: 16px 16px;
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.1, 0.8, 0.3, 1);
  animation-fill-mode: forwards;
}

@keyframes ray-n-anim {
  0% { transform: translateY(6px) scaleY(0.2); opacity: 1; }
  100% { transform: translateY(-4px) scaleY(1.2); opacity: 0; }
}
@keyframes ray-s-anim {
  0% { transform: translateY(-6px) scaleY(0.2); opacity: 1; }
  100% { transform: translateY(4px) scaleY(1.2); opacity: 0; }
}
@keyframes ray-w-anim {
  0% { transform: translateX(6px) scaleX(0.2); opacity: 1; }
  100% { transform: translateX(-4px) scaleX(1.2); opacity: 0; }
}
@keyframes ray-e-anim {
  0% { transform: translateX(-6px) scaleX(0.2); opacity: 1; }
  100% { transform: translateX(4px) scaleX(1.2); opacity: 0; }
}
@keyframes ray-nw-anim {
  0% { transform: translate(5px, 5px) scale(0.2); opacity: 1; }
  100% { transform: translate(-3px, -3px) scale(1.2); opacity: 0; }
}
@keyframes ray-ne-anim {
  0% { transform: translate(-5px, 5px) scale(0.2); opacity: 1; }
  100% { transform: translate(3px, -3px) scale(1.2); opacity: 0; }
}
@keyframes ray-sw-anim {
  0% { transform: translate(5px, -5px) scale(0.2); opacity: 1; }
  100% { transform: translate(-3px, 3px) scale(1.2); opacity: 0; }
}
@keyframes ray-se-anim {
  0% { transform: translate(-5px, -5px) scale(0.2); opacity: 1; }
  100% { transform: translate(3px, 3px) scale(1.2); opacity: 0; }
}

.ray-n { animation-name: ray-n-anim; }
.ray-s { animation-name: ray-s-anim; }
.ray-w { animation-name: ray-w-anim; }
.ray-e { animation-name: ray-e-anim; }
.ray-nw { animation-name: ray-nw-anim; }
.ray-ne { animation-name: ray-ne-anim; }
.ray-sw { animation-name: ray-sw-anim; }
.ray-se { animation-name: ray-se-anim; }

/* Responsive adjustments for mobile: only 4 slots visible */
@media (max-width: 480px) {
  .alien-slot.slot-5,
  .alien-slot.slot-6 {
    display: none;
  }
}

/* Mothership Flying Saucer Boss styling */
.mothership-btn {
  position: absolute;
  top: 10px;
  left: 50%;
  background: transparent;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 15;
  outline: none;
  display: block;
  transition: left 0.2s linear, top 0.2s linear;
}

.mothership-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.mothership-svg {
  display: block;
}

/* Mothership spinning lights animation */
@keyframes ufo-spin-1 {
  0%, 49.99% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes ufo-spin-2 {
  0%, 49.99% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

.mothership-lights-1 {
  animation: ufo-spin-1 0.4s step-end infinite;
}
.mothership-lights-2 {
  animation: ufo-spin-2 0.4s step-end infinite;
}

.alien-paused .mothership-lights-1,
.alien-paused .mothership-lights-2 {
  animation-play-state: paused !important;
}

/* Brief red flash when hit */
.mothership-hit-glow g {
  fill: #ff0000 !important;
}

/* Motion accessibility fallback */
@media (prefers-reduced-motion: reduce) {
  .mothership-btn {
    transition: none !important;
  }
  .mothership-lights-1,
  .mothership-lights-2 {
    animation: none !important;
  }
  .mothership-lights-2 {
    opacity: 0 !important;
  }
}

/* Live Alien bright red override */
.alien-live svg g.alien-core,
.alien-live svg g.alien-frame-down,
.alien-live svg g.alien-frame-up,
.alien-live svg g[fill] {
  fill: #ff0000 !important;
}

/* ZX Spectrum Screen Flash Overlay */
.spectrum-flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  animation: spectrum-flash 0.08s infinite step-end;
}

@keyframes spectrum-flash {
  0% { background-color: rgba(255, 0, 0, 0.4); }
  14% { background-color: rgba(0, 255, 0, 0.4); }
  28% { background-color: rgba(0, 0, 255, 0.4); }
  42% { background-color: rgba(255, 255, 0, 0.4); }
  57% { background-color: rgba(255, 0, 255, 0.4); }
  71% { background-color: rgba(0, 255, 255, 0.4); }
  85% { background-color: rgba(255, 255, 255, 0.4); }
  100% { background-color: rgba(0, 0, 0, 0.4); }
}

/* Blocky glowing retro Bomb Orbs */
.bomb-orb {
  position: absolute;
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 20;
  image-rendering: pixelated;
  transform: translate(-50%, -50%);
  animation: bomb-pulse 0.4s infinite step-end;
  background: none;
  border: none;
  padding: 0;
  outline: none;
}

@keyframes bomb-pulse {
  0% { background-color: #310062; box-shadow: 0 0 4px #310062; }
  25% { background-color: #5b00b7; box-shadow: 0 0 6px #5b00b7; }
  50% { background-color: #a43eff; box-shadow: 0 0 10px #a43eff; }
  75% { background-color: #dcb3ff; box-shadow: 0 0 14px #dcb3ff; }
}

/* Pixel Starburst Particles */
.pixel-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: pixel-explode 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes pixel-explode {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) scale(1);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(0.5);
    opacity: 0;
  }
}

/* Game Cleared Congratulations screen overlay */
.game-cleared-msg {
  position: absolute;
  inset: 0;
  background: var(--bg-raised);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  cursor: pointer;
  z-index: 10;
  text-align: center;
}

.game-cleared-msg .congrats {
  color: var(--green);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.game-cleared-msg .hiscore {
  color: var(--fg);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.game-cleared-msg .tap-reset {
  color: var(--fg-dim);
  font-size: 0.75rem;
  animation: blink 1.2s steps(1) infinite;
}

/* Mothership HUD below the game window */
.mothership-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  min-height: 18px;
  visibility: hidden;
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  flex-wrap: nowrap;
}

.mothership-health-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.mothership-timer-wrapper {
  width: 80px;
  height: 8px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.mothership-timer-bar {
  height: 100%;
  background: var(--cyan);
  width: 100%;
  transition: width 0.1s linear;
}

/* ---------- Homepage Responsive Grid Dashboard ---------- */

/* Expand page margins on homepage only to allow 1600px max-width */
.home-body .termbar,
.home-body nav.prompt,
.home-body main,
.home-body footer {
  max-width: 1600px;
}

/* Home Grid Container */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

/* Remove bottom margins inside grid layout */
.home-grid > * {
  margin-bottom: 0 !important;
}

/* Ensure pricing snippet behaves as a flex column and fills its grid row height */
.home-grid__pricing {
  display: flex;
  flex-direction: column;
}
.home-grid__pricing .terminal-snippet {
  flex-grow: 1;
  margin-bottom: 0 !important;
}

/* Ensure menu behaves as a flex column and fills its grid row height */
.home-grid__menu {
  display: flex;
  flex-direction: column;
}
.home-grid__menu .menu {
  flex-grow: 1;
  margin-bottom: 0 !important;
}

/* Adjustments for the game tile inside the grid */
.home-grid__game {
  display: flex;
  flex-direction: column;
}

/* Ensure the hero matches visual flow inside grid */
.home-grid__hero {
  display: flex;
  align-items: center;
}
.home-grid__hero .hero {
  margin-bottom: 0 !important;
}