/* The Franklin Team: Style Guide v2.0 tokens */
:root {
  --navy: #223D4D;
  --navy-800: #1A303D;
  --navy-600: #2E4E61;
  --blue: #79C7FF;       /* on dark backgrounds only */
  --blue-700: #3FA0E8;   /* blue on white */
  --blue-100: #E4F3FF;
  --white: #FFFFFF;

  --gray-50: #F6F7F8;
  --gray-100: #E9EBEC;
  --gray-300: #C3C9CD;
  --gray-500: #8C959B;
  --gray-700: #525D64;
  --gray-900: #262E33;

  --accent: #D9683A;
  --accent-dark: #9C4522;
  --accent-light: #F7DFCE;
  --danger: #C4392E;

  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 8px 24px rgba(26, 48, 61, 0.10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--gray-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-700); }
h1, h2, h3 { color: var(--navy); margin: 0; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--gray-700); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Labels: Montserrat ExtraBold, uppercase, tracked */
.label { font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.3; }
.label-blue { color: var(--blue); }
.label-blue-dark { color: var(--blue-700); }
.label-accent { color: var(--accent); }
.label-muted { color: var(--gray-500); }

/* Icons */
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-xs { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Header */
.topbar { background: var(--white); border-bottom: 1px solid var(--gray-100); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { text-decoration: none; display: block; min-width: 0; }
.brand img { height: 40px; width: auto; }
@media (max-width: 420px) { .brand img { height: 30px; } }
.wordmark { display: block; font-weight: 700; letter-spacing: 0.08em; font-size: 15px; line-height: 1.2; white-space: nowrap; }
.wordmark small { display: block; font-weight: 400; letter-spacing: 0; font-size: 11px; }
.wordmark-dark { color: var(--navy); }
.wordmark-dark small { color: var(--gray-700); }
.wordmark-light { color: var(--white); }
.wordmark-light small { color: var(--gray-100); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 700; font-size: 15px; line-height: 1.2;
  border: 0; border-radius: var(--radius);
  padding: 12px 22px; min-height: 44px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-sm { padding: 8px 16px; min-height: 40px; font-size: 14px; }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--gray-300); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn:focus-visible, .svc:focus-visible, .card:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--blue-700); outline-offset: 2px; }

/* Hero: navy band, left-aligned copy + how-it-works steps */
.hero { background: var(--navy); color: var(--white); padding: 44px 0 48px; }
.hero-grid { display: grid; gap: 36px; }
.hero h1 { color: var(--white); font-size: 32px; line-height: 1.15; margin: 12px 0 14px; max-width: 18ch; }
.hero-sub { color: var(--gray-100); font-weight: 300; font-size: 17px; max-width: 46ch; margin-bottom: 24px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--white); border-radius: var(--radius); padding: 0 16px; max-width: 520px; }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--gray-500); stroke-width: 2; flex: none; }
.search input { border: 0; outline: 0; font: inherit; font-size: 16px; padding: 14px 0; width: 100%; color: var(--gray-900); background: transparent; }
.search:focus-within { box-shadow: 0 0 0 3px var(--blue); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-n {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--blue); color: var(--blue);
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.steps strong { display: block; color: var(--white); font-weight: 600; font-size: 15px; }
.steps p { color: var(--gray-300); font-size: 14px; line-height: 1.5; }
@media (min-width: 900px) {
  .hero { padding: 64px 0 72px; }
  .hero-grid { grid-template-columns: 1.4fr 1fr; align-items: center; gap: 56px; }
  .hero h1 { font-size: 44px; }
  .steps { border-left: 1px solid var(--navy-600); padding-left: 36px; gap: 22px; }
}

/* Directory layout: sidebar + results + ask card */
.layout { display: grid; gap: 28px; padding-top: 28px; padding-bottom: 72px; }
.layout > * { min-width: 0; }
.sidebar-title { margin-bottom: 10px; }
.svc-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.svc {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--navy);
  background: var(--white); border: 1px solid var(--gray-300); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; text-align: left;
}
.svc .ico { width: 18px; height: 18px; color: var(--blue-700); }
.svc-n { font-size: 12px; font-weight: 600; color: var(--gray-500); }
.svc-n:empty { display: none; }
.svc:hover { border-color: var(--navy); }
.svc[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.svc[aria-pressed="true"] .ico, .svc[aria-pressed="true"] .svc-n { color: var(--blue); }

@media (min-width: 900px) {
  .layout { grid-template-columns: 250px minmax(0, 1fr); grid-template-areas: "side results" "ask results"; align-items: start; gap: 24px 40px; padding-top: 44px; }
  .sidebar { grid-area: side; }
  .results { grid-area: results; }
  .ask-card { grid-area: ask; }
  .svc-list { flex-direction: column; overflow: visible; margin: 0; padding: 0; gap: 2px; }
  .svc { border: 0; border-radius: var(--radius); padding: 9px 12px; width: 100%; }
  .svc-name { flex: 1; }
  .svc:hover { background: var(--gray-50); }
  .svc[aria-pressed="true"]:hover { background: var(--navy); }
}

.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; border-bottom: 2px solid var(--navy); padding-bottom: 12px; }
.results-head h2 { font-size: 24px; line-height: 1.2; }
.results-count { font-size: 14px; color: var(--gray-700); min-height: 1.4em; margin-top: 2px; }
.clear-btn { font: inherit; font-size: 13px; font-weight: 600; color: var(--blue-700); background: none; border: 0; cursor: pointer; padding: 8px 0; white-space: nowrap; }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 18px; } }

/* Partner card: fully clickable */
.card {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--gray-100); border-top: 3px solid var(--navy);
  border-radius: var(--radius-lg); padding: 18px 18px 16px;
  background: var(--white); color: inherit; text-decoration: none;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.card:hover { box-shadow: var(--shadow); border-top-color: var(--accent); transform: translateY(-2px); }
.card-head { display: flex; gap: 14px; align-items: center; }
.thumb {
  width: 56px; height: 56px; flex: none; border-radius: var(--radius);
  border: 1px solid var(--gray-100); background: var(--white);
  display: grid; place-items: center; overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.thumb .initials { font-weight: 700; color: var(--navy); font-size: 18px; letter-spacing: 0.04em; }
.card h3 { font-size: 18px; line-height: 1.25; }
.partner-mark { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--blue-700); margin-top: 3px; }
.tagline { color: var(--gray-700); font-size: 15px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; font-weight: 600; color: var(--navy); text-decoration: none;
  background: var(--blue-100); border-radius: 999px; padding: 3px 10px;
}
.card-cta { margin-top: auto; padding-top: 4px; font-weight: 700; font-size: 14px; color: var(--accent); }
.card:hover .card-cta { color: var(--accent-dark); }

.empty-card {
  grid-column: 1 / -1; text-align: center;
  border: 1px dashed var(--gray-300); border-radius: var(--radius-lg);
  background: var(--gray-50); padding: 32px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty-card .ico { width: 30px; height: 30px; color: var(--blue-700); }
.empty-card h3 { font-size: 19px; }
.empty-card p { color: var(--gray-700); margin-bottom: 6px; }

/* Ask card */
.ask-card { background: var(--navy); color: var(--gray-100); border-radius: var(--radius-lg); padding: 22px 20px; }
.ask-card h2 { color: var(--white); font-size: 20px; line-height: 1.25; margin: 6px 0 8px; }
.ask-card p { font-size: 14px; line-height: 1.55; margin-bottom: 16px; }

/* Profile page */
.p-hero { background: var(--navy); color: var(--white); padding: 32px 0 36px; }
.p-hero-inner { display: flex; flex-direction: column; gap: 20px; }
.thumb-lg { width: 112px; height: 112px; border: 0; border-radius: var(--radius-lg); }
.thumb-lg img { padding: 10px; }
.thumb-lg .initials { font-size: 36px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; line-height: 1; padding: 7px 12px; border-radius: 999px; }
.pill-outline { border: 1px solid var(--blue); color: var(--blue); }
.p-id h1 { color: var(--white); font-size: 30px; line-height: 1.15; }
.p-tagline { color: var(--gray-100); font-weight: 300; font-size: 17px; margin-top: 8px; }
.p-id .tags { margin-top: 14px; }
.tag-dark { background: var(--navy-600); color: var(--white); font-size: 13px; padding: 5px 12px; }
.tag-dark:hover { background: var(--blue); color: var(--navy); }
.p-contact { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; font-weight: 600; font-size: 15px; }
.p-contact a { color: var(--blue); text-decoration: none; }
.p-contact a:hover { text-decoration: underline; }
@media (min-width: 720px) {
  .p-hero { padding: 48px 0 96px; }
  .p-hero-inner { flex-direction: row; align-items: center; gap: 28px; }
  .thumb-lg { width: 140px; height: 140px; }
  .p-id h1 { font-size: 40px; }
}

.p-body { display: grid; gap: 28px; padding-top: 28px; padding-bottom: 72px; }
.p-body > * { min-width: 0; }
@media (min-width: 900px) {
  .p-body { grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: start; padding-top: 40px; }
  .p-side { margin-top: -88px; position: relative; } /* card overlaps the navy band */
}
.p-h { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }
.about { font-size: 16px; line-height: 1.75; margin-bottom: 28px; }
.about p + p { margin-top: 12px; }
.offer {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--accent-light); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 28px;
}
.offer-ico { color: var(--accent-dark); width: 28px; height: 28px; }
.offer p { color: var(--navy); font-weight: 600; font-size: 17px; line-height: 1.5; margin-top: 4px; }
.areas { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.areas li { font-size: 14px; color: var(--gray-700); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 6px 12px; }
.p-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray-500); border-top: 1px solid var(--gray-100); padding-top: 16px; }

.contact-card { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 24px 20px; box-shadow: var(--shadow); }
.contact-card h2 { font-size: 22px; line-height: 1.25; margin: 6px 0 4px; }
.contact-card > .muted { font-size: 14px; margin-bottom: 18px; }
.contact-card .fine { margin-top: 14px; }

.not-found { text-align: center; padding: 72px 16px; }
.not-found h1 { font-size: 32px; margin-bottom: 10px; }
.not-found p { color: var(--gray-700); margin-bottom: 22px; }

/* Forms */
.field { display: block; margin-bottom: 12px; }
.field input, .field select, .field textarea {
  display: block; width: 100%;
  font: inherit; font-size: 16px; font-weight: 400; color: var(--gray-900);
  border: 1px solid var(--gray-300); border-radius: var(--radius);
  padding: 11px 12px; background: var(--white);
}
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C959B' stroke-width='2'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px; }
.field select:invalid { color: var(--gray-500); }
.field ::placeholder { color: var(--gray-500); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--blue-700); box-shadow: 0 0 0 3px var(--blue-100); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--gray-700); line-height: 1.5; margin: 4px 0 14px; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--navy); }
.fine { font-size: 12px; color: var(--gray-500); line-height: 1.5; }
.fine strong { color: var(--gray-700); }
.form-error { color: var(--danger); font-size: 14px; margin-bottom: 12px; }
.form-done h3 { font-size: 22px; margin-bottom: 8px; }
.form-done p { color: var(--gray-700); }
.hp { position: absolute; left: -9999px; }

/* Dialog */
dialog {
  border: 0; border-radius: var(--radius-lg); padding: 0;
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  color: var(--gray-900);
}
dialog::backdrop { background: rgba(26, 48, 61, 0.6); }
.dialog-body { padding: 28px 22px 24px; }
@media (min-width: 720px) { .dialog-body { padding: 32px; } }
.dialog-body h2 { font-size: 24px; line-height: 1.2; margin: 6px 0 4px; }
.dialog-body > .muted { font-size: 15px; margin-bottom: 18px; }
.dialog-close {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px;
  border: 0; background: none; font-size: 28px; line-height: 1; color: var(--gray-500); cursor: pointer;
}
.dialog-close:hover { color: var(--navy); }

/* Footer */
.footer { background: var(--navy-800); color: var(--gray-100); padding: 40px 0 48px; font-size: 13px; line-height: 1.6; }
.footer-logo { height: 40px; width: auto; margin-bottom: 20px; }
.footer .wordmark { margin-bottom: 20px; }
.footer .disclaimer { max-width: 80ch; margin-bottom: 16px; }
.footer a { color: var(--blue); }
.footer .legal { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.footer .copyright { color: var(--gray-300); }
