:root {
  --ink: #151d24;
  --muted: #5d6872;
  --paper: #f4f0e8;
  --panel: #ffffff;
  --line: #d8dedf;
  --green: #0f766e;
  --green-dark: #083f3b;
  --blue: #315f7c;
  --coral: #ce6d52;
  --gold: #d59a35;
  --shadow: 0 24px 70px rgba(18, 28, 34, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(49, 95, 124, 0.1), rgba(244, 240, 232, 0) 380px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(26px, 5vw, 62px) 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(34px, 5vw, 70px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--green-dark);
  color: #fff;
}

.source-note {
  min-height: 38px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(21, 29, 36, 0.1);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 470px);
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
  min-height: 460px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

h3 {
  margin: 0;
  font-size: 1.25rem;
}

.hero p:last-child {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
}

.search-panel,
.results-section,
.tool-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.search-panel label {
  font-weight: 950;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-row input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  padding: 0 12px;
}

.search-row button {
  min-height: 48px;
  border: 0;
  padding: 0 18px;
  background: var(--green-dark);
  color: #fff;
  font-weight: 950;
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.status.error {
  color: #9c2c2c;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestions button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #f5f8f7;
  color: var(--green-dark);
  padding: 7px 10px;
  font-weight: 850;
}

.results-section {
  margin-top: clamp(28px, 5vw, 54px);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: none;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

#result-count {
  color: var(--muted);
  font-weight: 850;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 240px;
  padding: 20px;
  box-shadow: none;
}

.tool-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.score {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 950;
}

.description {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  background: #edf4f3;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

@media (max-width: 920px) {
  .hero,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-note {
    width: 100%;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.8rem, 16vw, 4.2rem);
  }
}
