:root {
  color-scheme: light;
  --ink: #172e26;
  --muted: #506159;
  --green: #142d26;
  --forest: #22483a;
  --lime: #d5eea5;
  --paper: #f7f8f1;
  --white: #fdfdf8;
  --line: #d8ded1;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: Manrope, system-ui, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
a, button, select, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #4e7950; outline-offset: 4px; }
section[id] { scroll-margin-top: 22px; }
.wrap { width: min(100% - 112px, 1240px); margin-inline: auto; }
.skip { position: absolute; top: 8px; left: 8px; padding: 10px; background: white; z-index: 5; transform: translateY(-160%); }
.skip:focus { transform: none; }

.masthead { background: var(--paper); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 80px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 1.77rem/1 var(--serif); white-space: nowrap; text-decoration: none; }
.wordmark img { display: block; }
.masthead nav { display: flex; align-items: center; gap: clamp(20px, 4vw, 51px); font-size: .875rem; font-weight: 700; }
.masthead nav a { text-decoration: none; }
.masthead nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.button { background: var(--forest); color: white; display: inline-flex; justify-content: center; align-items: center; min-height: 45px; padding: 10px 19px; border: 1px solid transparent; border-radius: 4px; font-weight: 800; font-size: .875rem; line-height: 1.35; text-align: center; text-decoration: none; }
.button:hover { background: #34614f; }

.hero { position: relative; isolation: isolate; background: var(--green); color: #fbfcf1; overflow: hidden; }
.hero-photo { position: absolute; z-index: -1; inset: 0 0 0 46%; background: #33483d url("courthouse.webp") center 46% / cover no-repeat; }
.hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #142d26 0%, #142d2670 26%, #182e2630 100%); }
.hero-inner { padding-block: clamp(57px, 6.6vw, 100px) clamp(55px, 6vw, 92px); }
.eyebrow { display: flex; gap: 9px; align-items: center; color: #365342; font-size: .875rem; font-weight: 800; letter-spacing: .105em; line-height: 1.4; text-transform: uppercase; }
.hero .eyebrow { color: #d8edb9; }
.hero .eyebrow span { width: 22px; height: 1px; background: #cfe9a4; }
h1 { margin-top: 15px; font: 400 clamp(4.2rem, 7.7vw, 7.5rem)/.88 var(--serif); letter-spacing: -.023em; }
h1 em { color: #d7eca9; font-weight: 400; }
.hero-description { margin-top: 24px; max-width: 440px; color: #e4ebe1; font-size: clamp(1rem, 1.5vw, 1.125rem); line-height: 1.6; }
.finder { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 6px; width: min(100%, 624px); padding: 8px; margin-top: 30px; background: var(--white); color: var(--ink); border-radius: 5px; box-shadow: 0 13px 30px #07161040; }
.field { display: flex; flex-direction: column; min-width: 0; padding: 1px 10px 1px 10px; }
.field:first-child { border-right: 1px solid var(--line); }
.field span, .filters label span { color: var(--muted); font-size: .875rem; font-weight: 800; }
select { appearance: none; width: 100%; background-image: url("chevron.svg"); background-repeat: no-repeat; background-position: right 12px center; background-size: 13px; padding-right: 33px; }
.field select { border: 0; background-color: transparent; background-position: right 2px center; font-size: .9375rem; font-weight: 700; min-height: 29px; padding-left: 0; padding-right: 19px; }
.primary { align-self: stretch; background: var(--lime); color: #1e3626; padding-inline: 21px; }
.primary:hover { background: #e7fac4; }

.section { padding-block: clamp(58px, 6.1vw, 91px); }
.services { padding-bottom: clamp(50px, 5.3vw, 76px); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 27px; }
.section-heading > p { color: var(--muted); padding-bottom: 3px; }
h2 { font: 400 clamp(3.05rem, 5.1vw, 5rem)/.97 var(--serif); letter-spacing: -.022em; margin-top: 7px; }
h3 { line-height: 1.15; }
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.specialty { display: block; padding: 20px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); text-decoration: none; }
.specialty:hover, .market:hover { border-color: #8c9e88; background: #eff4e8; }
.specialty svg, .market svg { display: block; width: 24px; height: 24px; color: var(--forest); }
.specialty svg { width: 38px; height: 38px; padding: 7px; margin-bottom: 16px; border-radius: 4px; background: #edf2e7; }
.specialty h3 { font-size: 1.0625rem; }
.specialty p { margin-top: 7px; color: var(--muted); font-size: .875rem; }

.directory { background: #edf1e8; border-block: 1px solid var(--line); }
.filters { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 12px; align-items: end; }
.filters label { display: grid; gap: 5px; min-width: 0; }
.filters select, .filters input { width: 100%; min-height: 46px; padding-left: 12px; border: 1px solid #c7d1c1; border-radius: 4px; background-color: var(--white); }
.filters input::placeholder { color: #5c6d62; opacity: 1; }
.text-button { border: 0; background: transparent; padding: 0 10px; height: 46px; color: #2d5444; text-decoration: underline; text-underline-offset: 4px; font-weight: 800; font-size: .875rem; }
.text-button:hover, .profile-link:hover, .phone:hover { color: #567444; }
.result-count { padding-block: 15px 11px; font-size: .875rem; font-weight: 700; color: var(--muted); }
.agency-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.agency { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 5px; padding: 21px; background: var(--white); }
.agency-top { display: flex; gap: 12px; align-items: center; }
.agency-mark { flex: 0 0 47px; display: grid; place-items: center; height: 47px; border-radius: 4px; font: 1.55rem/1 var(--serif); }
.agency-mark.moss { background: #dce8d3; color: #2a4935; }
.agency-mark.slate { background: #e1e9e9; color: #31504e; }
.agency-mark.sand { background: #eae9d9; color: #4e4f2c; }
.agency h3 { font: 400 1.8rem/1 var(--serif); }
.agency-location { font-size: .875rem; color: var(--muted); margin-top: 4px; }
.agency-description { margin-block: 15px 13px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.tags li { padding: 3px 8px; border: 1px solid #dce5d8; border-radius: 4px; background: #f4f7ef; color: #355240; font-size: .8125rem; font-weight: 700; }
.agency-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 15px; }
.profile-link, .phone { padding: 4px 0; border: 0; background: transparent; color: #2d5444; font-size: .875rem; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }
.empty { grid-column: 1 / -1; padding: 30px 22px; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: 5px; }
.empty p { margin-block: 8px 15px; color: var(--muted); }

.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.market { display: flex; align-items: center; gap: 9px; min-height: 60px; padding: 10px 13px; background: var(--white); border: 1px solid var(--line); border-radius: 5px; text-decoration: none; }
.market svg { width: 19px; height: 19px; flex-shrink: 0; }
.market span { margin-left: auto; font-size: .875rem; color: var(--muted); white-space: nowrap; }
.methodology { background: var(--green); color: #f5f7eb; }
.method-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 45px; }
.methodology .eyebrow { color: #d2eaaf; }
.methodology p + p { margin-top: 13px; }
.methodology p { color: #e6ede1; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 22px; }
.footer-inner p { color: var(--muted); font-size: .875rem; }
dialog { position: fixed; padding: 32px; width: min(100% - 32px, 535px); max-height: calc(100% - 36px); background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 24px 60px #132e2663; }
dialog::backdrop { background: #092018ac; }
dialog h2 { padding-right: 20px; }
.close { position: absolute; right: 12px; top: 12px; border: 0; border-radius: 4px; background: #eaf0e5; width: 38px; height: 38px; font-size: 1.5rem; line-height: 1; }
.close:hover { background: #dce8d3; }
.profile-description { margin-block: 18px; }
.profile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-block: 22px; }
.profile-sources { color: var(--muted); font-size: .875rem; }

@media (max-width: 1030px) {
  .wrap { width: calc(100% - 72px); }
  .agency-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 40px); }
  .masthead-inner { flex-wrap: wrap; column-gap: 12px; row-gap: 10px; padding-block: 13px; }
  .masthead nav { order: 3; width: 100%; gap: 20px; }
  .hero-photo { left: 15%; }
  .hero-photo::after { background: linear-gradient(90deg, #142d26 0%, #142d26da 36%, #142d2660 100%); }
  .section-heading { display: block; margin-bottom: 20px; }
  .section-heading > p { margin-top: 9px; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: 1/-1; }
  .text-button { justify-self: start; padding-left: 0; }
  .method-inner { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 500px) {
  .wrap { width: calc(100% - 32px); }
  .wordmark { font-size: 1.39rem; gap: 6px; }
  .wordmark img { width: 28px; height: 28px; }
  .header-button { min-height: 40px; padding-inline: 9px; }
  .hero-inner { padding-block: 49px 42px; }
  h1 { font-size: clamp(3.35rem, 11.4vw, 4.2rem); }
  .hero-description { margin-top: 18px; }
  .finder { margin-top: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 9px; }
  .primary { grid-column: 1/-1; }
  .field { padding-inline: 6px; }
  .field select { min-height: 34px; }
  .specialty { padding: 14px; }
  .agency-grid, .market-grid { grid-template-columns: 1fr; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 9px; }
}
