/* Machine Home — Copyright 2026 Freddy Baardsen — MIT licensed. */
.machine-home {
  --machine-orange: #ff4f2f;
  --machine-ink: #11110f;
  --machine-muted: #67645c;
  margin: 34px 0 38px;
  max-width: 920px;
  border: 1px solid var(--machine-ink);
  background: #faf8f1;
  color: var(--machine-ink);
}

.machine-home__stage {
  position: relative;
  min-height: clamp(330px, 58vw, 540px);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  background:
    radial-gradient(circle at 50% 47%, rgba(255,79,47,.10), transparent 26%),
    linear-gradient(rgba(17,17,15,.045) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(17,17,15,.045) 1px, transparent 1px) 0 0 / 32px 32px,
    #faf8f1;
}

.machine-home__stage:active { cursor: grabbing; }

.machine-home canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.machine-home__hud {
  position: absolute;
  z-index: 2;
  inset: 16px 18px auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--machine-muted);
  font: 600 .62rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
  pointer-events: none;
}

.machine-home__live { color: var(--machine-ink); }
.machine-home__live i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--machine-orange);
  animation: machine-pulse 2.4s ease-in-out infinite;
}

.machine-home__fallback {
  display: none;
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(80%, 430px);
  transform: translate(-50%, -50%);
  color: var(--machine-muted);
  text-align: center;
}

.machine-home.is-fallback canvas,
.machine-home.is-fallback .machine-home__hud { display: none; }
.machine-home.is-fallback .machine-home__fallback { display: block; }

.machine-home figcaption {
  display: grid;
  grid-template-columns: minmax(190px, .8fr) 1.4fr;
  gap: 24px;
  align-items: end;
  padding: 18px;
  border-top: 1px solid var(--machine-ink);
}

.machine-home figcaption strong,
.machine-home figcaption span { display: block; }
.machine-home figcaption strong {
  font: 700 .9rem/1.2 Arial, Helvetica, sans-serif;
  letter-spacing: -.02em;
}
.machine-home figcaption span {
  margin-top: 4px;
  color: var(--machine-muted);
  font-size: .72rem;
}

.machine-home ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
  padding: 0;
  margin: 0;
  list-style: none;
  color: var(--machine-muted);
  font: 600 .63rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: .045em;
}

.machine-home li { white-space: nowrap; }
.machine-home li i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 1px;
  background: currentColor;
}
.machine-home .is-cpu { color: var(--machine-ink); }
.machine-home .is-gpu { color: var(--machine-orange); }
.machine-home .is-memory { color: #4a4843; }
.machine-home .is-container { color: #9b978e; }

@keyframes machine-pulse { 50% { opacity: .3; } }

@media (max-width: 680px) {
  .machine-home { margin-left: calc(50% - 50vw + 16px); margin-right: calc(50% - 50vw + 16px); }
  .machine-home__stage { min-height: 350px; }
  .machine-home figcaption { grid-template-columns: 1fr; align-items: start; }
  .machine-home ul { justify-content: flex-start; }
  .machine-home__hud span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .machine-home__live i { animation: none; }
}
