:root {
  --primary-color: #3498db; /* A softer, more sophisticated blue */
  --secondary-color: #2ecc71; /* A calm green for accents */
  --text-color: #2c3e50; /* Darker text color for better readability */
  --background-color: #fdfdfd; /* Slightly off-white background for less strain */
  --card-border-color: #dcdcdc; /* Softer gray for subtle card borders */
  --hover-color: #ecf0f1; /* Light, airy hover effect */
  --border-radius: 12px;
  --transition-duration: 0.3s;
  --max-width: 1280px;
}

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

body {
  font-family: 'Poppins', sans-serif; /* Modern, clean font */
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  border-bottom: 1px solid #ebebeb;
  padding: 15px 0;
  width: 100%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 26px;
  font-weight: bold;
  color: var(--primary-color);
  letter-spacing: 1px;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

h1 {
  font-size: 2.5vw;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 1.2px;
  margin-bottom: 20px;
}

.tool-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.tool-card {
  flex: 1 1 calc(25% - 40px);
  max-width: calc(25% - 40px);
  min-width: 200px;
  border: 1px solid var(--card-border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: var(--text-color);
  background-color: var(--background-color);
  transition: background-color var(--transition-duration), transform var(--transition-duration), box-shadow var(--transition-duration);
  font-size: 16px;
  position: relative;
}

.tool-card:hover {
  background-color: var(--hover-color);
  color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.tool-icon {
  font-size: 40px;
  margin-bottom: 15px;
}

.tool-card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 8px;
}

footer {
  border-top: 1px solid #ebebeb;
  padding: 15px 0;
  text-align: center;
  font-size: 14px;
  color: #717171;
  background-color: #f7f7f7;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 1128px) {
  main {
    padding: 30px 20px;
  }

  nav, main {
    padding: 10px 20px;
  }

  h1 {
    font-size: 28px;
  }

  .tool-card {
    flex: 1 1 calc(30% - 40px);
    max-width: calc(30% - 40px);
  }
}

@media (max-width: 743px) {
  h1 {
    font-size: 24px;
  }

  .tool-card {
    flex: 1 1 calc(45% - 40px);
    max-width: calc(45% - 40px);
  }

  .tool-icon {
    font-size: 32px;
  }

  .tool-card h2 {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .tool-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Accessibility Enhancements */
.tool-card:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
}
