:root {
  font-family: system-ui, sans-serif;
  color: #152c3f;
  background: #f4f7fa;
  font-synthesis: none;
  line-height: 1.6;
  --accent: #075bc5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

header, main, footer {
  width: min(1120px, calc(100% - 3rem));
  margin-inline: auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-block: 1.75rem;
}

.brand {
  color: #152c3f;
  font-size: 1.4rem;
  font-weight: 800;
  text-decoration: none;
}

.brand span {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.intro {
  padding-block: 3.5rem 2rem;
  max-width: 760px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  margin-block: 1rem 1.5rem;
}

.intro > p:last-child {
  font-size: 1.2rem;
  max-width: 560px;
}

form {
  padding: 1.5rem;
  background: #152c3f;
  color: white;
  border-radius: 1rem;
}

.search-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

input, select, button {
  font: inherit;
  min-height: 3rem;
  border-radius: 0.4rem;
}

input, select {
  width: 100%;
  min-width: 0;
  padding: 0.7rem;
  color: #152c3f;
  background: white;
  border: 1px solid #9eafbc;
}

button {
  padding: 0.65rem 1.2rem;
  border: 1px solid transparent;
  font-weight: 700;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button:hover {
  background: #034898;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.secondary {
  color: var(--accent);
  background: white;
  border-color: #afc0cf;
}

.secondary:hover {
  color: white;
}

:focus-visible {
  outline: 3px solid #d47b00;
  outline-offset: 3px;
}

.results {
  padding-block: 2.5rem;
}

.results-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

h2 {
  line-height: 1.2;
  font-size: 1.7rem;
}

.job-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid #c9d5df;
}

.job-card h3 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin-block: 0.3rem;
}

.job-card p {
  margin-block: 0.4rem;
}

.job-card button {
  flex-shrink: 0;
}

.excerpt {
  max-width: 760px;
  color: #42596b;
}

.meta {
  font-size: 0.875rem;
  color: #42596b;
}

#more {
  margin-top: 1rem;
}

#vacancy {
  background: white;
  padding: 2rem;
  border: 1px solid #c9d5df;
  border-radius: 1rem;
  scroll-margin-top: 1rem;
}

#vacancy .description {
  white-space: pre-wrap;
  line-height: 1.8;
  margin-block: 2rem;
}

#vacancy li {
  overflow-wrap: anywhere;
  margin-block: 0.75rem;
}

#error {
  color: #9d2417;
  background: #fff0ec;
  padding: 1rem;
  border-radius: 0.4rem;
}

.about {
  max-width: 760px;
  margin-block: 3rem;
}

footer {
  border-top: 1px solid #c9d5df;
  padding-block: 2rem;
  color: #42596b;
  font-size: 0.875rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  .search-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .job-card {
    display: block;
  }
  .job-card button {
    margin-top: 1rem;
  }
  .results-heading {
    display: block;
  }
  #vacancy {
    padding: 1.25rem;
  }
}

@media (max-width: 460px) {
  header, main, footer {
    width: calc(100% - 2rem);
  }
  header {
    align-items: start;
  }
  header > a:last-child {
    max-width: 7rem;
    font-size: 0.875rem;
    text-align: right;
  }
  .intro {
    padding-top: 2rem;
  }
  .search-fields {
    grid-template-columns: 1fr;
  }
}
