/* =============  Global  ============= */
:root {
  --bg-color: #111;
  --accent-color: #d20000;
  --text-color: #ffffff;
}

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

body {
  font-family: sans-serif, "Noto Sans JP", system-ui;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  padding: 1.5rem 1rem;
}

header h1 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

header h2 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--accent-color);
}

main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.tool-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  justify-items: center;
}

/* =============  Card  ============= */
.tool-card {
  max-width: 320px;
  width: 100%;
  background: #1c1c1c;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
}

.tool-card img {
  width: 100%;
  height: 180px; /* 横長に固定 */
  display: block;
  position: relative;
  object-fit: cover; /* 余白なくトリミング */
}

/* overlay */
.tool-card .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(210, 0, 0, 0.8);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-weight: 700;
  font-size: 1.1rem;
}

.tool-card:hover .overlay {
  opacity: 1;
}

.tool-card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tool-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.tool-card p {
  flex: 1;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: #cccccc;
}

.tool-card a {
  align-self: flex-start;
  text-decoration: none;
  background: var(--accent-color);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: background 0.2s ease;
  font-weight: 600;
}

.tool-card a:hover {
  background: #ff2a2a;
}

/* =============  Responsive tweaks  ============= */
@media (min-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  header h2 {
    font-size: 1.25rem;
  }
}
