* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button {
  font-family: inherit;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  background: #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 2px;
  width: 100%;
  max-width: 1200px;
  padding: 2px;
}

#grid canvas {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  opacity: 0;
  transition: opacity 0.8s ease-in;
}

#grid canvas.loaded {
  opacity: 1;
}

@media (max-width: 900px) {
  #grid {
    --cols: 3 !important;
  }
}

@media (max-width: 600px) {
  #grid {
    --cols: 2 !important;
  }
}

#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  will-change: transform;
}

#info-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  background: none;
  border: 1px solid #333;
  color: #444;

  font-size: 0.85rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  cursor: pointer;
  transition:
    color 0.3s,
    border-color 0.3s;
}

#info-btn:hover {
  color: #888;
  border-color: #666;
}

#info-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

#info-modal[hidden] {
  display: none;
}

#info-content {
  max-width: 500px;
  padding: 2rem;
  color: #888;
  font-size: 1.5rem;
  line-height: 1.8;
  text-align: center;
}

#info-content p {
  margin-bottom: 2rem;
}

#info-content button {
  margin-top: 1rem;
  background: none;
  border: 1px solid #333;
  color: #555;
  font-size: 1.2rem;
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  transition:
    color 0.3s,
    border-color 0.3s;
}

#info-content button:hover {
  color: #999;
  border-color: #666;
}

#progress-wrap {
  margin: 1.2rem auto 0.5rem;
  width: 80%;
  height: 2px;
  background: #222;
  border-radius: 1px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: #555;
  transition: width 0.5s ease;
}

#progress-text {
  color: #444;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.modal-footer {
  margin-top: 1.5rem;
}

.modal-footer a {
  color: #333;
  font-size: 1rem;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.3s;
}

.modal-footer a:hover {
  color: #555;
}

#epitaph[hidden] {
  display: none;
}

#epitaph {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #555;
  font-size: 2.5rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 2rem;
  line-height: 1.8;
  background: #000;
  z-index: 10;
}

#epitaph button {
  margin-top: 3rem;
  background: none;
  border: 1px solid #333;
  color: #555;
  font-size: 1.2rem;
  padding: 0.8rem 2rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition:
    color 0.3s,
    border-color 0.3s;
}

#epitaph button:hover {
  color: #999;
  border-color: #666;
}

#epitaph .date {
  margin-top: 2rem;
  font-size: 1.1rem;
  color: #333;
  font-style: italic;
}
