:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-muted: #eef3f1;
  --ink: #1f2528;
  --muted: #5d6a70;
  --line: #d8dedc;
  --accent: #1d6f78;
  --accent-strong: #144d55;
  --accent-warm: #b25c2e;
  --shadow: 0 16px 38px rgba(31, 37, 40, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 244, 0.96);
  backdrop-filter: blur(10px);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
}

.brand {
  color: var(--ink);
  font-weight: 800;
  font-size: 1.15rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-weight: 650;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 24px 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: start;
  gap: 32px;
  margin-bottom: 54px;
}

.hero-copy,
.page-title {
  max-width: 850px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-warm);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  font-size: 3rem;
  line-height: 1.08;
  font-weight: 820;
}

h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.hero-copy p:not(.eyebrow),
.page-title p:not(.eyebrow),
.section-heading p {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 720;
}

.button:hover {
  text-decoration: none;
  border-color: var(--accent);
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.section-stats {
  margin: 26px 0 42px;
}

.callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin: 28px 0 36px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.callout h2 {
  margin-bottom: 8px;
}

.callout p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.callout-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.stat-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 650;
}

.section {
  margin-top: 52px;
}

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

.section-heading p {
  max-width: 620px;
  margin: 0;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.problem-card {
  position: relative;
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.problem-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 30px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  font-weight: 800;
}

.problem-card p {
  min-height: 48px;
  color: var(--muted);
}

.problem-card .problem-meta {
  min-height: 0;
  margin: 10px 0 0;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 760;
}

.compact-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 0;
}

.compact-stats div {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.compact-stats dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.compact-stats dd {
  margin: 2px 0 0;
  font-weight: 800;
}

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

.landscape-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.landscape-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #ffffff;
}

.landscape-card figcaption {
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 650;
}

.page-title {
  margin-bottom: 28px;
}

.problem-title {
  max-width: 960px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.filters input,
.filters select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.filters output {
  min-height: 40px;
  padding: 9px 10px;
  color: var(--accent-strong);
  font-weight: 800;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.data-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.instance-table {
  min-width: 1280px;
}

.compact-table {
  min-width: 720px;
}

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

.data-table th {
  position: sticky;
  top: 0;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.data-table[data-sort-table] th {
  cursor: pointer;
  user-select: none;
}

.data-table[data-sort-table] th::after {
  content: "";
  display: inline-block;
  width: 0.7em;
}

.data-table[data-sort-table] th[aria-sort="ascending"]::after {
  content: "^";
  margin-left: 0.35rem;
  color: var(--accent);
  font-size: 0.65rem;
}

.data-table[data-sort-table] th[aria-sort="descending"]::after {
  content: "v";
  margin-left: 0.35rem;
  color: var(--accent);
  font-size: 0.65rem;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr[hidden] {
  display: none;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-optimal {
  border-color: #7aa15d;
  background: #edf5e8;
  color: #355f24;
}

.status-best_known {
  border-color: #c79d4d;
  background: #fff6de;
  color: #6d4a08;
}

.status-submitted {
  border-color: #7aa7bd;
  background: #e9f5fa;
  color: #24586f;
}

.status-open {
  border-color: var(--line);
  background: #f4f4f1;
  color: var(--muted);
}

.paper-context {
  display: block;
  margin-top: 7px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 720;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 24px 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 920px) {
  .hero,
  .landscape-grid,
  .problem-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-nav,
  .site-footer,
  .section-heading,
  .callout {
    align-items: flex-start;
    flex-direction: column;
  }

  .callout {
    display: flex;
  }

  .callout-actions {
    justify-content: flex-start;
  }

  main {
    padding: 30px 16px 48px;
  }

  h1 {
    font-size: 2.15rem;
  }

  .stats-grid,
  .filters,
  .compact-stats {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: auto;
  }
}
