:root {
  --ink: #111111;
  --muted: #636b78;
  --line: #dfe7f5;
  --soft: #f5f8ff;
  --paper: #ffffff;
  --accent: #2571f0;
  --accent-dark: #175bcc;
  --accent-soft: #eaf2ff;
  --shadow: 0 18px 45px rgba(17, 35, 74, 0.1);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 74px;
  padding: 14px clamp(20px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  font-weight: 800;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 44px;
  object-fit: contain;
  width: auto;
}

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

.header-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.hero {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
  border-bottom: 1px solid var(--line);
  display: flex;
  min-height: 220px;
  padding: clamp(44px, 7vw, 78px) clamp(20px, 5vw, 72px);
}

.hero-copy {
  max-width: 840px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(36px, 4.8vw, 58px);
  line-height: 1.08;
  margin-bottom: 0;
  max-width: 780px;
}

.finder-shell {
  align-items: start;
  display: grid;
  gap: 30px;
  grid-template-columns: 320px minmax(0, 1fr);
  padding: 36px clamp(20px, 5vw, 72px) 72px;
}

.filters {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 98px;
}

.filter-block {
  margin-bottom: 18px;
}

label {
  color: #303642;
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

select,
input {
  background: #fff;
  border: 1px solid #d8dce5;
  border-radius: 12px;
  color: var(--ink);
  min-height: 46px;
  outline: none;
  padding: 0 12px;
  width: 100%;
}

select:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 113, 240, 0.16);
}

.search-wrap {
  position: relative;
}

.search-wrap svg {
  fill: none;
  height: 19px;
  left: 13px;
  position: absolute;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  top: 13px;
  width: 19px;
}

.search-wrap input {
  padding-left: 40px;
}

.results-toolbar {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.results-toolbar h2 {
  font-size: 28px;
  margin-bottom: 0;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 560px;
}

.filter-chip,
.tag {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 999px;
  color: #164caa;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 26px;
  padding: 5px 9px;
}

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

.case-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(19, 24, 33, 0.03);
  display: flex;
  flex-direction: column;
  min-height: 356px;
  padding: 22px;
}

.case-card:hover {
  border-color: #9fc2ff;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  transition: 160ms ease;
}

.case-card h3 {
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.summary {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.best-for {
  border-left: 3px solid var(--accent);
  color: #384050;
  font-size: 13px;
  line-height: 1.5;
  margin: auto 0 18px;
  padding-left: 10px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.tag {
  background: var(--accent-soft);
  color: #164caa;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  align-items: center;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
}

.secondary-button:hover {
  background: var(--accent-soft);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
}

.ghost-button:hover {
  color: var(--ink);
}

.full-width {
  width: 100%;
}

.empty-state {
  background: var(--soft);
  border: 1px dashed #cfd5df;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
  margin-bottom: 0;
}

.modal[hidden] {
  display: none;
}

.modal {
  inset: 0;
  position: fixed;
  z-index: 100;
}

.modal-backdrop {
  background: rgba(18, 22, 30, 0.66);
  inset: 0;
  position: absolute;
}

.modal-panel {
  background: #fff;
  bottom: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  left: 50%;
  max-width: 1180px;
  position: absolute;
  top: 24px;
  transform: translateX(-50%);
  width: min(calc(100vw - 32px), 1180px);
  border-radius: 18px;
  overflow: hidden;
}

.modal-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 16px 18px;
}

.modal-header h2 {
  font-size: 20px;
  margin-bottom: 0;
}

.modal-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.icon-button {
  align-items: center;
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.icon-button svg {
  fill: none;
  height: 21px;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 21px;
}

iframe {
  border: 0;
  flex: 1;
  width: 100%;
}

@media (max-width: 1180px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header,
  .header-actions,
  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .hero,
  .finder-shell {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

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

  .active-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 540px) {
  .hero {
    padding-top: 34px;
  }

  h1 {
    font-size: 38px;
  }

  .hero-panel {
    min-height: 180px;
  }

  .card-actions,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-header {
    align-items: stretch;
    flex-direction: column;
  }
}
