:root {
  --ink: #172233;
  --muted: #627083;
  --line: #dce3ea;
  --paper: #f8fafc;
  --white: #ffffff;
  --blue: #176bdb;
  --blue-dark: #0d4b9e;
  --soft-blue: #eaf3ff;
  --orange: #ee7851;
  --shadow: 0 18px 50px rgb(21 50 83 / 9%);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f2f7fd 0, var(--paper) 410px);
  font-family: "DM Sans", Arial, sans-serif;
}

a { color: inherit; }

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
}

.brand,
.header-link { text-decoration: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  letter-spacing: -.05em;
}

.header-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.header-link:hover { color: var(--blue); }

.hero { padding: 72px 0 74px; }

.hero-copy { max-width: 760px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1,
h2,
h3 { color: var(--ink); }

h1 {
  margin-bottom: 18px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .98;
}

.hero-text {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.search-panel {
  max-width: 840px;
  margin-top: 42px;
  padding: 22px;
  border: 1px solid rgb(23 107 219 / 16%);
  border-radius: 18px;
  background: rgb(255 255 255 / 88%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.search-label {
  display: block;
  margin: 0 0 9px 2px;
  font-size: 13px;
  font-weight: 700;
}

.search-box {
  display: flex;
  align-items: center;
  min-height: 60px;
  padding: 0 13px 0 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  transition: border-color .16s, box-shadow .16s;
}

.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgb(23 107 219 / 12%);
}

.search-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-right: 12px;
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-width: 1.8;
}

input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}

input::placeholder { color: #9aa6b5; }

.clear-button {
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.clear-button:hover { color: var(--blue); background: var(--soft-blue); }

.search-help {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.results-section { padding: 8px 0 80px; }

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

.results-heading .eyebrow { margin-bottom: 7px; }

h2 {
  margin-bottom: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 31px;
  letter-spacing: -.04em;
}

.result-count {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.state-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.state-card {
  display: flex;
  align-items: center;
  gap: 21px;
  min-height: 116px;
  padding: 24px;
}

.state-number {
  color: var(--orange);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -.05em;
}

h3 { margin-bottom: 5px; font-size: 16px; }

.state-card p { margin: 0; color: var(--muted); line-height: 1.5; }

.state-loading { color: var(--muted); }

.state-error { border-color: #efc5ba; background: #fff9f7; }

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #d7e6fb;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(1turn); } }

.result-list { display: grid; gap: 10px; }

.result-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 17px 18px;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}

.result-card:hover {
  border-color: #adcdf5;
  box-shadow: 0 8px 24px rgb(21 50 83 / 7%);
  transform: translateY(-1px);
}

.code-wrap { flex: 0 0 126px; }

.code {
  display: inline-block;
  padding: 6px 9px;
  border-radius: 6px;
  color: var(--blue-dark);
  background: var(--soft-blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
}

.description { flex: 1; font-size: 16px; font-weight: 600; line-height: 1.45; }

.copy-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.copy-button:hover,
.copy-button:focus-visible { border-color: var(--blue); color: var(--blue); }

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p { margin: 0; }
.site-footer a { text-underline-offset: 3px; }

@media (max-width: 620px) {
  .site-header, main, .site-footer { width: min(100% - 28px, 1120px); }
  .site-header { min-height: 68px; }
  .header-link { font-size: 12px; }
  .hero { padding: 48px 0 48px; }
  h1 { font-size: 45px; }
  h1 br { display: none; }
  .hero-text { font-size: 16px; }
  .search-panel { margin-top: 31px; padding: 15px; }
  .search-box { min-height: 55px; }
  .results-heading { align-items: start; flex-direction: column; gap: 6px; }
  .result-count { text-align: left; }
  .result-card { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .code-wrap { flex-basis: auto; }
  .description { flex-basis: calc(100% - 108px); }
  .copy-button { margin-left: auto; }
  .site-footer { gap: 15px; }
}
