/* ============================================================
   PINKYCODE — hero-grid.css
   Animated terminal grid background (4 cols × 4 rows, 16 tiles)
   ============================================================ */

.hero-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  z-index: 1;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 75% 60% at 30% 50%, transparent 5%, #000 80%);
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 30% 50%, transparent 5%, #000 80%);
  pointer-events: none;
  user-select: none;
}

.hero-grid .tile {
  background: var(--bg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--ink-3);
  overflow: hidden;
  position: relative;
}

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.tile-head .tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tile-head .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-4);
  flex-shrink: 0;
}

.tile.status-running .dot { background: var(--green); animation: tile-pulse 1.4s infinite; }
.tile.status-warn .dot    { background: var(--yellow); animation: tile-pulse 1.8s infinite; }
.tile.status-error .dot   { background: var(--red); }
.tile.status-idle .dot    { background: var(--ink-4); }

@keyframes tile-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px currentColor; }
  50% { opacity: 0.5; box-shadow: 0 0 0 currentColor; }
}

.tile-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.66rem;
  color: var(--ink-3);
  white-space: pre-wrap;
  word-break: break-all;
}

.tile-body .line { opacity: 0; animation: line-in .25s forwards; }
.tile-body .line.cmd { color: var(--ink-2); }
.tile-body .line.cmd::before { content: '> '; color: var(--violet); }
.tile-body .line.ok   { color: var(--green); }
.tile-body .line.warn { color: var(--yellow); }
.tile-body .line.err  { color: var(--red); }
.tile-body .line.info { color: var(--cyan); }
.tile-body .line.muted { color: var(--ink-4); }

@keyframes line-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 0.9em;
  background: var(--green);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    opacity: 0.4;
  }
  .hero-grid .tile:nth-child(n+13) { display: none; }
}

@media (max-width: 720px) {
  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    opacity: 0.3;
    mask-image: radial-gradient(ellipse 90% 100% at 50% 50%, transparent 0%, #000 90%);
  }
  .hero-grid .tile { padding: 8px 10px; font-size: 0.6rem; }
  .hero-grid .tile:nth-child(n+9) { display: none; }
  .tile-head { font-size: 0.54rem; margin-bottom: 6px; }
  .tile-body { font-size: 0.58rem; }
}
