/* 179차: 히어로 'Matrix' — 21st.dev 'Cyber Matrix Hero' 를 옮김 (js/hero-matrix.js 가 칸을 깜).
   다크 = 원본 그대로 검은 바탕 · 초록 글자, 라이트 = 흰 바탕 · 살짝 짙은 회색 글자(180차 사용자). 마우스에 가까울수록 밝고 크게(--intensity),
   누르면 글자가 바뀌며 번쩍(.glitch). 글자 · 랭킹 판은 원본 fadeUp 처럼 차례로 올라옴, 뒤는 바탕색으로 옅게 가림 */
.hero.is-matrix {
  --mx-bg: #ffffff; --mx-hue: 0; --mx-sat: 0%; --mx-l0: 34%; --mx-l1: -18%; --mx-glow: 0, 0%, 45%; --mx-base: .14;  /* 180차: 라이트는 살짝 짙은 회색 */
  background: var(--mx-bg); color: var(--hero-text);
}
html[data-theme="dark"] .hero.is-matrix { --mx-bg: #000000; --mx-hue: 120; --mx-sat: 100%; --mx-l0: 50%; --mx-l1: 50%; --mx-glow: 120, 100%, 50%; --mx-base: .1; }
.hero-matrix { position: absolute; inset: 0; overflow: hidden; }
.hero-matrix-tiles {
  --intensity: 0; position: absolute; inset: 0; display: grid;
  grid-template-columns: repeat(var(--columns, 24), 1fr); grid-template-rows: repeat(var(--rows, 14), 1fr);
}
.hero-matrix-tiles .tile {
  position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none;
  font: 1.2rem 'Courier New', Courier, monospace;
  opacity: calc(var(--mx-base) + var(--intensity) * (1 - var(--mx-base)));
  color: hsl(var(--mx-hue), var(--mx-sat), calc(var(--mx-l0) + var(--intensity) * var(--mx-l1)));
  text-shadow: 0 0 calc(var(--intensity) * 15px) hsl(var(--mx-glow));
  transform: scale(calc(1 + var(--intensity) * .2));
  transition: color .2s ease, text-shadow .2s ease, transform .2s ease;
}
.hero-matrix-tiles .tile.glitch { animation: matrix-glitch .2s ease; }
@keyframes matrix-glitch {
  0% { transform: scale(1); color: hsl(var(--mx-glow)); }
  50% { transform: scale(1.2); color: var(--hero-text); text-shadow: 0 0 10px hsl(var(--mx-glow)); }
  100% { transform: scale(1); color: hsl(var(--mx-glow)); }
}
.hero-matrix-wash {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 32% 40% at 50% 48%, color-mix(in srgb, var(--mx-bg) 78%, transparent) 0%, transparent 100%);
}
@media (max-width: 720px) {
  .hero-matrix-wash { background: radial-gradient(ellipse 75% 42% at 50% 46%, color-mix(in srgb, var(--mx-bg) 78%, transparent) 0%, transparent 100%); }
}
.hero.is-matrix .hero-inner { z-index: 2; pointer-events: none; }
.hero.is-matrix .hero-inner a, .hero.is-matrix .hero-inner button, .hero.is-matrix .hero-inner .hb-wrap { pointer-events: auto; }
.hero.is-matrix .hero-inner > * { animation: matrix-up .8s ease-in-out both; }
.hero.is-matrix .hero-inner > :nth-child(1) { animation-delay: .5s; }
.hero.is-matrix .hero-inner > :nth-child(2) { animation-delay: .7s; }
.hero.is-matrix .hero-inner > :nth-child(3) { animation-delay: .9s; }
.hero.is-matrix .hero-inner > :nth-child(4) { animation-delay: 1.1s; }
@keyframes matrix-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
