:root {
  color-scheme: light;
  --ink: #241d19;
  --muted: #6d625b;
  --paper: #f4efe6;
  --panel: #fffaf0;
  --line: #d8cbb8;
  --accent: #8f2638;
  --accent-strong: #671a28;
  --olive: #65713c;
  --shadow: 0 18px 45px rgba(36, 29, 25, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(143, 38, 56, 0.08), transparent 22rem),
    linear-gradient(90deg, rgba(101, 113, 60, 0.1) 0 1px, transparent 1px 100%),
    var(--paper);
  background-size: auto, 42px 42px, auto;
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-repeat: no-repeat;
  opacity: 0.11;
  filter: sepia(0.45);
}

body::before {
  right: max(-120px, -8vw);
  bottom: 5vh;
  width: min(680px, 64vw);
  aspect-ratio: 620 / 300;
  background-image: url("assets/dino-skeleton.svg");
  background-size: contain;
}

body::after {
  top: 6vh;
  left: max(-70px, -4vw);
  width: min(280px, 30vw);
  aspect-ratio: 260 / 340;
  background-image: url("assets/exhibit-frame.svg");
  background-size: contain;
  transform: rotate(-5deg);
}

button,
input {
  font: inherit;
}

.shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.shell::before {
  position: absolute;
  top: 178px;
  right: 2px;
  z-index: -1;
  width: 220px;
  aspect-ratio: 320 / 180;
  pointer-events: none;
  content: "";
  background: url("assets/specimen-tag.svg") center / contain no-repeat;
  opacity: 0.13;
  transform: rotate(7deg);
}

.masthead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 156px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.94), rgba(244, 239, 230, 0.82));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  font-weight: 500;
  line-height: 0.94;
}

.stamp {
  display: grid;
  place-items: center;
  width: 104px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  transform: rotate(-8deg);
}

.stamp span {
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  padding: 6px 0;
  font-family: Arial, sans-serif;
  font-weight: 800;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 16px;
}

.search {
  display: grid;
  gap: 8px;
  width: min(520px, 100%);
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--panel);
  outline-color: var(--accent);
}

.sort-button,
.open-button,
.close-button,
.nav-button {
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.sort-button {
  min-height: 46px;
  padding: 0 18px;
  white-space: nowrap;
}

.sort-button:hover,
.open-button:hover,
.close-button:hover,
.nav-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.gallery {
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.86);
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: rgba(216, 203, 184, 0.36);
}

td:first-child {
  width: 148px;
  color: var(--olive);
  font-variant-numeric: tabular-nums;
}

td:last-child {
  width: 112px;
  text-align: right;
}

.title-cell {
  font-size: 1.08rem;
  line-height: 1.35;
}

.open-button {
  min-height: 36px;
  padding: 0 12px;
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
}

.state {
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
}

.news-dialog {
  width: min(760px, calc(100% - 28px));
  height: min(840px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px);
  border: 1px solid var(--line);
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.news-dialog::backdrop {
  background: rgba(36, 29, 25, 0.54);
}

.news-dialog article {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  padding: 34px;
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  font-family: Arial, sans-serif;
}

.dialog-date {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.news-dialog h2 {
  margin: 0 42px 18px 0;
  font-size: 2rem;
  line-height: 1.08;
}

.dialog-scroll {
  min-height: 0;
  overflow-y: auto;
  padding-right: 12px;
}

.dialog-content {
  color: #332b26;
  font-size: 1.08rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.dialog-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: Arial, sans-serif;
}

.nav-button {
  min-width: 104px;
  min-height: 38px;
  padding: 0 14px;
}

.dialog-position {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 720px) {
  body::before {
    right: -180px;
    bottom: 0;
    width: 520px;
    opacity: 0.07;
  }

  body::after,
  .shell::before {
    display: none;
  }

  .shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0 22px;
  }

  .masthead,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .masthead {
    min-height: 0;
    padding: 22px;
  }

  .stamp {
    width: 78px;
  }

  .sort-button {
    width: 100%;
  }

  .news-dialog article {
    padding: 26px 18px;
  }

  .news-dialog h2 {
    margin-right: 44px;
    font-size: 1.55rem;
  }

  .dialog-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dialog-position {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }
}
