:root {
  color-scheme: light;
  --ink: #15161a;
  --muted: #626978;
  --line: #d9dde5;
  --paper: #f7f8fa;
  --panel: #ffffff;
  --blue: #1f5eff;
  --green: #15803d;
  --amber: #a15c00;
  --red: #b42318;
  --violet: #6d3bc2;
  --shadow: 0 14px 40px rgba(23, 28, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid rgba(217, 221, 229, 0.86);
  background: rgba(247, 248, 250, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 15px;
  font-weight: 760;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  text-decoration: none;
}

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

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 28px;
  align-items: start;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 24px 0 10px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.status-panel {
  align-self: start;
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.status-row:last-child {
  border-bottom: 0;
}

.status-row span {
  color: var(--muted);
  font-size: 14px;
}

.status-row strong {
  font-size: 22px;
  font-weight: 780;
  text-align: right;
}

.section {
  margin-top: 34px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  list-style: none;
}

.flow li {
  min-height: 92px;
  display: flex;
  align-items: center;
  padding: 18px;
  background: var(--panel);
}

.flow li::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-right: 12px;
  border-radius: 50%;
  background: var(--blue);
}

.flow li:nth-child(2)::before {
  background: var(--violet);
}

.flow li:nth-child(3)::before {
  background: var(--amber);
}

.flow li:nth-child(4)::before {
  background: var(--green);
}

.flow li:nth-child(5)::before {
  background: var(--red);
}

.flow span {
  font-weight: 700;
}

.filter-group {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.filter {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.filter:hover,
.filter.is-active {
  background: var(--ink);
  color: #fff;
}

.case-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.case-card {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 24px rgba(23, 28, 38, 0.05);
}

.case-card-header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.case-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.status-pill.validated {
  background: var(--green);
}

.status-pill.bounded_repair_plan {
  background: var(--amber);
}

.status-pill.blocked {
  background: var(--red);
}

.status-pill.review_pending,
.status-pill.superseded {
  background: var(--violet);
}

.case-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.16;
  letter-spacing: 0;
}

.case-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.case-block strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.case-block p,
.case-block ul {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.case-block ul {
  padding-left: 18px;
}

.case-block li + li {
  margin-top: 5px;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.reference-grid .section-heading {
  grid-column: 1 / -1;
}

.reference {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-decoration: none;
}

.reference:hover {
  border-color: var(--blue);
}

.reference strong,
.reference span {
  display: block;
}

.reference strong {
  margin-bottom: 8px;
}

.reference span {
  color: var(--muted);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero,
  .case-list,
  .reference-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 24px 0 0;
  }

  .flow {
    grid-template-columns: 1fr;
  }

  .section-heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-group {
    overflow-x: auto;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  main {
    width: min(100% - 24px, 1120px);
    padding-top: 22px;
  }

  h1 {
    font-size: 34px;
  }

  .lede {
    font-size: 16px;
  }

  .status-row {
    min-height: 62px;
  }
}
