:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #17201b;
  --muted: #5f6b63;
  --line: #d9dfd6;
  --panel: #ffffff;
  --accent: #17695d;
  --accent-strong: #0f5149;
  --gold: #c4862d;
  --rose: #b4575d;
  --blue: #436f9f;
  --shadow: 0 18px 60px rgba(23, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

a:hover {
  text-decoration: underline;
}

.site-header {
  background:
    linear-gradient(135deg, rgba(23, 105, 93, 0.14), transparent 42%),
    linear-gradient(215deg, rgba(196, 134, 45, 0.16), transparent 40%),
    #eef2ec;
  border-bottom: 1px solid var(--line);
}

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

.brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
}

.nav-links {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-weight: 650;
}

.hero {
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, 0.6fr);
  margin: 0 auto;
  max-width: 1180px;
  min-height: 520px;
  padding: 70px 24px 86px;
}

.hero-copy {
  align-self: center;
  max-width: 780px;
}

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

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

h1 {
  font-size: 96px;
  line-height: 0.92;
  margin-bottom: 24px;
}

h2 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 10px;
}

.hero-copy > p:not(.eyebrow) {
  color: #314039;
  font-size: 21px;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button,
button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 720;
  min-height: 42px;
  padding: 10px 14px;
}

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

.hero-panel {
  align-self: end;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1px;
  overflow: hidden;
}

.hero-panel > div {
  background: rgba(255, 255, 255, 0.74);
  padding: 26px;
}

.hero-panel span {
  display: block;
  font-size: 44px;
  font-weight: 820;
  line-height: 1;
}

.hero-panel p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 8px 0 0;
  text-transform: uppercase;
}

.section {
  margin: 0 auto;
  max-width: 1180px;
  padding: 58px 24px;
}

.intro {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
}

.intro p,
.section-title p,
.citation p,
.schema p {
  color: var(--muted);
}

.citation,
.chart-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.reproduction {
  padding-top: 24px;
}

.lock-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
}

.lock-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 190px;
  padding: 20px;
}

.lock-number {
  color: var(--gold);
  display: block;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.lock-card h3 {
  font-size: 17px;
  margin: 0 0 8px;
}

.lock-card p,
.lock-note {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}

code {
  background: #eef2ec;
  border-radius: 4px;
  color: var(--accent-strong);
  font-size: 0.92em;
  padding: 2px 5px;
}

.lock-note {
  background: #fff8ea;
  border-left: 3px solid var(--gold);
  margin-top: 14px;
  padding: 14px 16px;
}

.charts {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 10px;
}

canvas {
  display: block;
  width: 100%;
}

.dataset {
  max-width: 1360px;
}

.controls {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 2fr) repeat(5, minmax(130px, 1fr));
  margin: 24px 0 16px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 760;
  gap: 6px;
  text-transform: uppercase;
}

input,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

.table-meta {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

#resultCount {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

table {
  border-collapse: collapse;
  min-width: 1180px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 13px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: #f0f3ef;
  color: #38463f;
  font-size: 12px;
  font-weight: 800;
  position: sticky;
  top: 0;
  text-transform: uppercase;
  z-index: 1;
}

tbody tr:hover {
  background: #fbfcfa;
}

.pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  padding: 6px 8px;
}

.pill.category {
  background: rgba(23, 105, 93, 0.11);
  color: var(--accent-strong);
}

.pill.engine {
  background: rgba(67, 111, 159, 0.12);
  color: var(--blue);
}

.details-button {
  min-height: 32px;
  padding: 7px 10px;
}

.schema-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.schema-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.schema-item code {
  color: var(--accent-strong);
  font-weight: 800;
}

.schema-item p {
  font-size: 13px;
  margin: 8px 0 0;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: min(900px, calc(100vw - 32px));
  padding: 0;
  width: 900px;
}

dialog::backdrop {
  background: rgba(23, 32, 27, 0.46);
}

.dialog-header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 24px;
}

.dialog-header h2 {
  margin: 0;
}

dl {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  margin: 0;
  max-height: min(68vh, 720px);
  overflow: auto;
}

dt,
dd {
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 14px 18px;
}

dt {
  background: #f7f8f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  h1 {
    font-size: 72px;
  }

  .hero,
  .intro,
  .charts,
  .lock-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 46px;
  }

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

  .controls .search {
    grid-column: 1 / -1;
  }

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

@media (max-width: 640px) {
  .nav {
    align-items: flex-start;
    gap: 14px;
  }

  .nav,
  .nav-links {
    flex-direction: column;
  }

  h1 {
    font-size: 50px;
  }

  .controls,
  .schema-grid,
  .lock-grid {
    grid-template-columns: 1fr;
  }

  .table-meta {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  dl {
    grid-template-columns: 1fr;
  }

  dt {
    border-bottom: 0;
    padding-bottom: 4px;
  }
}
