:root {
  --green: #1f7a5c;
  --green-dark: #155c45;
  --green-light: #e8f3ee;
  --navy: #1a3a6b;
  --ink: #16302a;
  --text: #2b3a36;
  --muted: #6b7c77;
  --line: #e2ebe7;
  --bg: #ffffff;
  --bg-soft: #f5f9f7;
  --amber: #f0a202;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 48, 40, .06), 0 1px 3px rgba(16, 48, 40, .08);
  --shadow-md: 0 8px 24px rgba(16, 48, 40, .10);
  --shadow-lg: 0 18px 50px rgba(16, 48, 40, .16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1120px, 92vw); margin: 0 auto; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px;
  padding: 12px 20px; transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-dark); }
.btn-navy { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn-navy:hover { background: #142d54; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark-img { height: 44px; width: auto; display: block; }
.brand-name { font-size: 1.3rem; font-weight: 700; color: var(--navy); letter-spacing: -.02em; }
.brand-name strong { color: var(--green); font-weight: 800; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { color: var(--text); font-weight: 500; font-size: .96rem; }
.site-nav a:hover { color: var(--green); }

/* ---------- Hero (search + categories, full viewport, no scroll needed) ---------- */
.hero {
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(31,122,92,.10), transparent 60%),
    radial-gradient(700px 320px at 10% 110%, rgba(31,122,92,.08), transparent 60%),
    linear-gradient(180deg, var(--green-light), #ffffff 78%);
  border-bottom: 1px solid var(--line);
  min-height: calc(100svh - 68px);
  display: flex; align-items: center;
  padding: 40px 0;
}
.hero-inner { text-align: center; max-width: 820px; margin: 0 auto; width: 100%; }
.hero-title { font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.08; letter-spacing: -.03em; color: var(--ink); margin: 0 0 14px; font-weight: 800; }
.hero-sub { font-size: clamp(1rem, 1.6vw, 1.16rem); color: var(--muted); margin: 0 auto 28px; max-width: 600px; }

/* category strip inside the hero */
.cat-strip { margin-top: 30px; }
.cat-strip-label { display: block; font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.category-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 760px; margin: 0 auto; }
.category-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px 9px 11px; cursor: pointer; font: inherit; font-weight: 600;
  color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.category-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--green); background: var(--green-light); }
.category-chip .chip-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--green-light); font-size: .95rem; }
.category-chip:hover .chip-icon { background: #fff; }

.search-bar {
  display: flex; gap: 10px; background: #fff; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); max-width: 720px; margin: 0 auto;
}
.field { display: flex; align-items: center; gap: 8px; flex: 1; padding: 0 12px; border-radius: 10px; background: var(--bg-soft); border: 1px solid transparent; transition: border-color .15s ease, background .15s ease; }
.field:focus-within { border-color: var(--green); background: #fff; }
.field-icon { opacity: .7; font-size: .95rem; }
.field input { flex: 1; border: 0; background: transparent; outline: none; font: inherit; padding: 14px 0; color: var(--ink); }
.field-zip { flex: 0 0 150px; }
.search-bar .btn { padding: 0 26px; }

.hero-hint { font-size: .88rem; color: var(--muted); margin-top: 16px; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; color: var(--ink); margin: 0 0 6px; font-weight: 700; }
.section-sub { color: var(--muted); margin: 0 0 32px; }

/* ---------- Category grid ---------- */
.category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.category-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; cursor: pointer; transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--green); }
.cat-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--green-light); font-size: 1.4rem; }
.cat-name { font-weight: 700; color: var(--ink); font-size: 1.02rem; }
.cat-blurb { font-size: .85rem; color: var(--muted); line-height: 1.4; }

/* ---------- Results ---------- */
.results-section { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.results-head .section-title { margin: 0; }
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.service-card {
  display: flex; flex-direction: column; gap: 12px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .15s ease;
}
.service-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sc-top { display: flex; align-items: center; gap: 10px; }
.sc-cat { width: 38px; height: 38px; border-radius: 10px; background: var(--green-light); display: grid; place-items: center; font-size: 1.1rem; }
.sc-org { font-size: .8rem; color: var(--muted); }
.sc-name { font-size: 1.08rem; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.25; }
.sc-desc { font-size: .92rem; color: var(--text); margin: 0; }
.sc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-tag { font-size: .74rem; font-weight: 600; color: var(--green-dark); background: var(--green-light); border: 1px solid #d4e8df; padding: 3px 9px; border-radius: 999px; }

/* AI summary note + error */
.results-note { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 12px; padding: 14px 16px; margin-bottom: 22px; color: var(--text); font-size: .95rem; box-shadow: var(--shadow-sm); }
.results-note-icon { font-size: 1rem; }
.results-error { color: #9a3a2a; background: #fdecea; border: 1px solid #f6cabd; padding: 14px 16px; border-radius: 12px; }

/* ---------- Branded JH loader ---------- */
.jh-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 56px 0 64px; text-align: center; }
.jh-loader-mark { position: relative; width: 88px; height: 88px; display: grid; place-items: center; }
.jh-spinner {
  position: absolute; inset: 0; width: 88px; height: 88px; border-radius: 50%;
  background: conic-gradient(from 90deg, var(--green) 10%, rgba(31,122,92,0) 70%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
  animation: jh-spin .95s linear infinite;
}
.jh-monogram {
  width: 56px; height: 56px; border-radius: 16px; background: var(--green); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; letter-spacing: .02em;
  box-shadow: 0 6px 18px rgba(31,122,92,.35); animation: jh-pulse 1.4s ease-in-out infinite;
}
.jh-loader-logo { width: 60px; height: 60px; object-fit: contain; animation: jh-pulse 1.4s ease-in-out infinite; }
.jh-loader-text { font-weight: 700; color: var(--ink); font-size: 1.12rem; }
.jh-loader-sub { color: var(--muted); font-size: .94rem; min-height: 1.2em; transition: opacity .3s ease; }
.jh-dots i { opacity: .25; animation: jh-blink 1.2s infinite; }
.jh-dots i:nth-child(2) { animation-delay: .2s; }
.jh-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes jh-spin { to { transform: rotate(360deg); } }
@keyframes jh-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes jh-blink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .jh-spinner { animation-duration: 2s; }
  .jh-monogram, .jh-dots i { animation: none; }
}

/* ---------- Follow-up question ---------- */
.followup { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 14px; padding: 18px 18px 16px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.followup-head { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; color: var(--ink); font-size: 1.02rem; margin-bottom: 14px; }
.followup-icon { font-size: 1.05rem; }
.followup-options { display: flex; flex-wrap: wrap; gap: 9px; }
.followup-opt {
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--green-dark);
  background: var(--green-light); border: 1px solid #d4e8df; border-radius: 999px; padding: 9px 16px;
  transition: transform .1s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.followup-opt:hover { transform: translateY(-1px); background: var(--green); color: #fff; border-color: var(--green); }
.followup-form { display: flex; gap: 8px; margin-top: 14px; }
.followup-input { flex: 1; font: inherit; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); outline: none; transition: border-color .15s ease, background .15s ease; }
.followup-input:focus { border-color: var(--green); background: #fff; }
.followup-form .btn { white-space: nowrap; }
.sc-meta { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); margin-top: auto; }
.sc-meta span { display: inline-flex; gap: 6px; }
.sc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.badge { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .02em; }
.badge-free { background: var(--green-light); color: var(--green-dark); }
.badge-reduced { background: #fff4dc; color: #9a6b00; }

.empty-state { text-align: center; padding: 56px 0; color: var(--muted); }
.empty-emoji { font-size: 2.4rem; }
.empty-state h3 { color: var(--ink); margin: 12px 0 4px; }

/* ---------- How it works ---------- */
.how-section { background: #fff; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.how-step { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; }
.how-num { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; display: grid; place-items: center; margin-bottom: 14px; }
.how-step h3 { margin: 0 0 6px; color: var(--ink); font-size: 1.1rem; }
.how-step p { margin: 0; color: var(--muted); font-size: .94rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cdddd6; padding: 52px 0 26px; margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-brand .brand-name { color: #fff; font-size: 1.3rem; }
.footer-brand .brand-name strong { color: #7fd1b3; }
.footer-brand p { color: #9fb6ae; font-size: .92rem; max-width: 320px; margin: 12px 0 0; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h4 { color: #fff; font-size: .95rem; margin: 0 0 12px; }
.footer-cols a { display: block; color: #9fb6ae; font-size: .9rem; padding: 4px 0; }
.footer-cols a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; padding-top: 22px; font-size: .82rem; color: #84a096; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
/* The hidden attribute must win over the display rules above (author CSS otherwise beats the UA [hidden] rule). */
[hidden] { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16,48,40,.5); backdrop-filter: blur(2px); }
.modal-card { position: relative; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: min(520px, 94vw); padding: 30px; max-height: 88vh; overflow: auto; }
.modal-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-close:hover { color: var(--ink); }
.modal-body h3 { margin: 0 0 4px; color: var(--ink); font-size: 1.4rem; }
.modal-org { color: var(--green-dark); font-weight: 600; margin: 0 0 16px; }
.modal-desc { color: var(--text); margin: 0 0 20px; }
.modal-detail { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.modal-detail b { color: var(--ink); min-width: 78px; }
.modal-services { margin: 0 0 18px; }
.modal-services b { display: block; color: var(--ink); font-size: .9rem; margin-bottom: 8px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .site-nav { display: none; }
  .search-bar { flex-direction: column; }
  .field-zip { flex: 1; }
  .search-bar .btn { padding: 14px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .results-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
