:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f5f4ee;
  --ink: #0a0a0a;
  --ink-2: #2a2a2a;
  --muted: #6b6b6b;
  --border: #e6e3da;
  --border-strong: #d2cec1;
  --accent: #c2410c;
  --accent-soft: #fff1e6;
  --radius: 12px;
  --maxw: 1140px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Charter", "Georgia", "Times New Roman",
    serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--ink);
  text-decoration: none;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(250, 250, 247, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}

.brand-name {
  font-size: 17px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14.5px;
}

.site-nav a {
  color: var(--muted);
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
}

.nav-cta {
  background: var(--ink);
  color: var(--bg) !important;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 500;
}

.nav-cta:hover {
  background: var(--accent);
  color: #fff !important;
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(38px, 5.6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  max-width: 16ch;
  font-weight: 500;
}

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0 0 36px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  margin-bottom: 32px;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  color: var(--accent);
}

.stat-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 6px;
}

.search-wrap {
  max-width: 560px;
}

#search {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---------- Filter bar ---------- */
.filter-bar-wrap {
  position: sticky;
  top: 56px;
  z-index: 9;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.filter-bar {
  display: flex;
  gap: 8px;
  padding: 14px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.filter-chip.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.filter-chip .chip-count {
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Status-flavored chip accents when not active */
.filter-chip.chip-researching:not(.active) .chip-count {
  background: #e0ecff;
  color: #1d4ed8;
}
.filter-chip.chip-shortlisted:not(.active) .chip-count {
  background: #fff1c6;
  color: #92400e;
}
.filter-chip.chip-building:not(.active) .chip-count {
  background: #d8f3dc;
  color: #166534;
}
.filter-chip.chip-skipped:not(.active) .chip-count {
  background: #ececec;
  color: #525252;
}

/* ---------- Sectors ---------- */
.sectors {
  padding: 40px 24px 96px;
}

.sector {
  margin-bottom: 64px;
}

.sector-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sector-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0;
}

.sector-count {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.industries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

/* ---------- Industry card ---------- */
.industry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease,
    box-shadow 0.2s ease;
}

.industry:hover {
  border-color: var(--border-strong);
}

.industry.open {
  border-color: var(--accent);
  box-shadow: 0 6px 24px -12px rgba(194, 65, 12, 0.25);
}

.industry-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.industry-summary:hover {
  background: var(--surface-2);
}

.industry-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 4px;
}

.industry-blurb {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.chevron {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  background: var(--surface-2);
  transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
  margin-top: 2px;
}

.industry.open .chevron {
  transform: rotate(45deg);
  background: var(--accent);
  color: #fff;
}

.industry-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  margin-top: -1px;
}

.industry.open .industry-body {
  display: block;
}

.cases-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 16px 0 10px;
  font-weight: 600;
}

.cases {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.cases li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

.cases li::before {
  content: "→";
  color: var(--accent);
  position: absolute;
  left: 0;
  top: 0;
}

/* ---------- Status meta on collapsed card ---------- */
.industry-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.industry-meta:empty {
  display: none;
}

.status-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  line-height: 1.6;
}

.status-badge.status-researching { background: #e0ecff; color: #1d4ed8; }
.status-badge.status-shortlisted { background: #fff1c6; color: #92400e; }
.status-badge.status-building    { background: #d8f3dc; color: #166534; }
.status-badge.status-skipped     { background: #ececec; color: #525252; }

.priority-badge {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Card tint by status (subtle left border) */
.industry.has-status { position: relative; }
.industry.has-status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}
.industry.status-tint-researching::before { background: #2563eb; }
.industry.status-tint-shortlisted::before { background: #d97706; }
.industry.status-tint-building::before    { background: #16a34a; }
.industry.status-tint-skipped::before     { background: #a3a3a3; }

/* ---------- Planning controls inside expanded card ---------- */
.planning {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.planning-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.planning-notes-row {
  align-items: flex-start;
}

.planning-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  min-width: 64px;
}

.status-group,
.priority-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-btn,
.priority-btn,
.status-clear {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.12s ease;
  line-height: 1.4;
}

.status-btn:hover,
.priority-btn:hover,
.status-clear:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.priority-btn {
  min-width: 30px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.priority-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.status-btn.status-researching.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.status-btn.status-shortlisted.active { background: #d97706; color: #fff; border-color: #d97706; }
.status-btn.status-building.active    { background: #16a34a; color: #fff; border-color: #16a34a; }
.status-btn.status-skipped.active     { background: #525252; color: #fff; border-color: #525252; }

.status-clear {
  font-size: 14px;
  padding: 4px 9px;
  color: var(--muted);
}

.notes-input {
  flex: 1;
  min-width: 240px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  resize: vertical;
  font-family: var(--font-sans);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.notes-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Highlight matched search terms */
mark {
  background: var(--accent-soft);
  color: var(--ink);
  padding: 0 2px;
  border-radius: 2px;
}

.no-results {
  padding: 80px 0;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Thesis ---------- */
.thesis {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 0;
}

.thesis h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 40px);
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  font-weight: 500;
}

.thesis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 36px;
}

.thesis p {
  font-size: 16.5px;
  color: var(--ink-2);
  margin: 0 0 14px;
  max-width: 56ch;
}

.thesis strong {
  color: var(--ink);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0 56px;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-tag {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 14px;
}

.footer-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .site-nav a:not(.nav-cta) {
    display: none;
  }
  .hero {
    padding: 56px 0 40px;
  }
  .hero-stats {
    gap: 32px;
  }
  .stat-value {
    font-size: 32px;
  }
  .sectors {
    padding: 40px 24px 72px;
  }
  .industries {
    grid-template-columns: 1fr;
  }
}
