:root {
  color-scheme: light;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  background: #f5f7fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fa;
}

button,
input {
  font: inherit;
}

.header {
  padding: 20px;
  background: #2c6dfc;
  color: #fff;
  text-align: center;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.logo {
  display: block;
  width: 180px;
  height: auto;
  flex: 0 0 auto;
}

.header h1 {
  margin: 0;
  font-size: clamp(22px, 4vw, 30px);
}

.search {
  display: block;
  width: min(300px, 100%);
  margin: 20px auto 0;
}

.search input {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 4px;
  outline: 0;
  background: #fff;
  color: #333;
}

.search input:focus {
  box-shadow: 0 0 0 3px rgb(255 255 255 / 40%);
}

main {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.tools-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.tool-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 10px rgb(0 0 0 / 10%);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 7px 18px rgb(0 0 0 / 14%);
}

.tool-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
  object-fit: contain;
}

.tool-card h2 {
  margin: 0 0 10px;
  color: #2c6dfc;
  font-size: 20px;
}

.tool-card p {
  margin: 0 0 15px;
  color: #666;
  line-height: 1.45;
}

.open-btn {
  width: fit-content;
  margin-top: auto;
  padding: 8px 16px;
  border-radius: 4px;
  background: #2c6dfc;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 140ms ease,
    transform 140ms ease;
}

.open-btn:hover,
.open-btn:focus-visible {
  background: #1a56d6;
  transform: translateY(-1px);
}

.open-btn:focus-visible,
.search input:focus-visible {
  outline: 3px solid rgb(44 109 252 / 35%);
  outline-offset: 2px;
}

.empty-state,
.loading {
  padding: 20px;
  color: #666;
  text-align: center;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
  }

  main {
    width: min(100% - 28px, 1200px);
  }

  .logo {
    width: 160px;
  }

  .tools-container {
    grid-template-columns: 1fr;
  }
}
