:root {
  --ink: #17201b;
  --muted: #68736d;
  --line: #d9ded8;
  --paper: #f6f5f0;
  --panel: #ffffff;
  --sage: #486658;
  --gold: #b58a4a;
  --blue: #476c83;
  --rose: #a85d56;
  --shadow: 0 18px 50px rgba(23, 32, 27, 0.12);
}

* {
  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;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hero {
  min-height: 78vh;
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #1d2924;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 19, 15, 0.86), rgba(10, 19, 15, 0.44) 48%, rgba(10, 19, 15, 0.12));
}

.hero-media {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92);
}

.topbar,
.hero-copy {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px clamp(18px, 5vw, 64px);
}

.topbar div {
  display: grid;
  gap: 3px;
}

.topbar span,
.hero-copy p,
.panel-head p {
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.topbar button,
.filters button {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  cursor: pointer;
}

.hero-copy {
  width: min(720px, calc(100% - 36px));
  padding: clamp(90px, 12vh, 150px) 0 56px clamp(18px, 5vw, 64px);
}

.hero-copy h1 {
  margin: 12px 0 0;
  font-size: clamp(2.35rem, 7vw, 5.9rem);
  line-height: 0.98;
  letter-spacing: 0;
  max-width: 760px;
}

main {
  width: min(1480px, calc(100% - 28px));
  margin: -58px auto 48px;
  position: relative;
  z-index: 2;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 14px;
}

.tab {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  font-weight: 800;
}

.tab.active {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.workspace.tab-panel.active {
  display: grid;
}

.metric,
.panel,
.filters {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.metric strong {
  font-size: 1.75rem;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.filters {
  padding: 16px;
  display: grid;
  gap: 16px;
  position: sticky;
  top: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.inline-filter {
  max-width: 340px;
  margin-bottom: 16px;
}

select,
input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
}

input[type="range"] {
  padding: 0;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-head p {
  color: var(--muted);
}

.panel h2 {
  margin: 3px 0 0;
  font-size: 1.25rem;
}

#resultCount {
  color: var(--sage);
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  max-height: 620px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  font-size: 0.9rem;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #eef2ed;
  color: #41514a;
  z-index: 1;
}

th .sort {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-weight: 850;
  min-height: 24px;
}

th .sort.active::after {
  content: attr(data-arrow);
  display: inline-block;
  margin-left: 5px;
}

td strong {
  display: block;
}

.score {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 30px;
  border-radius: 999px;
  background: #e9f0eb;
  color: var(--sage);
  font-weight: 800;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.project-cards,
.advisor,
.comps,
.plans,
.media-grid,
.audit-grid {
  display: grid;
  gap: 12px;
}

.project-card,
.advice-card,
.comp-card,
.plan-card,
.media-card,
.audit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfbf8;
}

.project-card {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
}

.project-card img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 6px;
}

.project-card h3,
.advice-card h3,
.comp-card h3,
.plan-card h3,
.media-card h3,
.audit-card h3 {
  margin: 0 0 8px;
}

.project-card p,
.advice-card p,
.comp-card p,
.plan-card p,
.media-card p,
.audit-card p,
.sources li {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.plan-table {
  width: 100%;
  min-width: 0;
  margin-top: 10px;
  font-size: 0.84rem;
}

.plan-table th,
.plan-table td {
  padding: 8px;
}

.media-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.media-card a {
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

.media-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #101815;
  margin-top: 10px;
}

.audit-card strong {
  display: block;
  font-size: 1.45rem;
  margin: 8px 0;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  background: var(--sage);
  font-size: 0.8rem;
  font-weight: 700;
}

.pill.gold {
  background: var(--gold);
}

.pill.blue {
  background: var(--blue);
}

.pill.rose {
  background: var(--rose);
}

.sources ul,
.sources li {
  list-style: none;
  padding: 0;
}

.sources li + li {
  margin-top: 10px;
}

.sources a {
  color: var(--blue);
  font-weight: 700;
}

@media (max-width: 980px) {
  .metrics,
  .workspace,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .hero-media {
    grid-template-columns: 1fr;
  }

  .hero-media img:nth-child(2) {
    display: none;
  }
}

@media (max-width: 560px) {
  main {
    width: calc(100% - 18px);
  }

  .topbar {
    padding: 16px;
  }

  .hero-copy {
    width: calc(100% - 28px);
    padding-left: 16px;
  }

  .metrics {
    gap: 9px;
  }

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

  .project-card img {
    width: 100%;
    height: 180px;
  }
}
