:root {
  color-scheme: light dark;
  --navy-950: #0a1830;
  --navy-900: #0f2144;
  --navy-800: #16305c;
  --navy-700: #1e3d73;
  --gold: #b8923f;
  --gold-light: #d4af5f;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: #e1e4ea;
  --border-strong: #c7cbd4;
  --text: #161b26;
  --text-muted: #5b6472;
  --text-faint: #8b93a1;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.06);
  --radius: 10px;
  --radius-sm: 6px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #121a2b;
    --surface-raised: #16203548;
    --border: #26314a;
    --border-strong: #35415c;
    --text: #e7eaf1;
    --text-muted: #a3acbe;
    --text-faint: #77839b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(155deg, var(--navy-800), var(--navy-950));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-mark svg { display: block; }

.brand-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

nav.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

nav.site-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

nav.site-nav a:hover { color: var(--text); }
nav.site-nav a.active { color: var(--text); border-bottom-color: var(--gold); }

/* ---------- Layout shells ---------- */

main { flex: 1; }

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.prose h1 {
  font-family: var(--serif);
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.prose .updated {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 2.5rem;
}

.prose h2 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
  color: var(--navy-800);
}

@media (prefers-color-scheme: dark) {
  .prose h2 { color: var(--gold-light); }
}

.prose p, .prose li {
  line-height: 1.7;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }

.prose strong { color: var(--text); }

/* ---------- Hero / search ---------- */

.hero {
  padding: 4.5rem 0 1rem;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.hero p.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 2.5rem;
}

.search-panel {
  max-width: 640px;
  margin: 0 auto;
}

.search-row {
  display: flex;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  box-shadow: var(--shadow-md);
}

input[type="text"] {
  flex: 1;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
}

input[type="text"]:focus {
  outline: none;
}

input[type="text"]::placeholder { color: var(--text-faint); }

button {
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: white;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

button:disabled { opacity: 0.5; cursor: default; }
button:hover:not(:disabled) { background: var(--navy-800); }

.results {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.results li {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.results li:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.results .firm-name { font-weight: 600; font-size: 0.98rem; }
.results .firm-meta { font-size: 0.83rem; color: var(--text-faint); margin-top: 0.15rem; }

.status {
  margin-top: 1.75rem;
  font-size: 0.92rem;
  text-align: center;
}

.status.error { color: #d1453b; }
.status.loading { color: var(--text-muted); }
.status.done { color: #1a7f4f; }

.spinner {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  border: 2px solid var(--border-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5em;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.disclaimer-strip {
  max-width: 640px;
  margin: 2.5rem auto 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.5;
}

.disclaimer-strip a { color: var(--text-muted); text-decoration: underline; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.site-footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-faint);
  text-decoration: none;
}

.footer-links a:hover { color: var(--text-muted); }

@media (max-width: 560px) {
  .site-header-inner { padding: 0 1rem; }
  nav.site-nav { gap: 1rem; }
  .hero h1 { font-size: 1.85rem; }
  .search-row { flex-direction: column; }
  button { width: 100%; }
}
