:root {
  color-scheme: light;
  --ink: #19252a;
  --muted: #657074;
  --paper: #f7f2e8;
  --surface: #fffdf7;
  --line: #d8cfbe;
  --gold: #e5a52f;
  --red: #b84c3d;
  --blue: #1f5c69;
  --shadow: 0 20px 70px rgb(55 42 21 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 92% 4%, rgb(229 165 47 / 22%), transparent 25rem),
    linear-gradient(180deg, #fffaf0 0, var(--paper) 42rem);
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  transform: translateY(-150%);
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  transform: translateY(0);
}

.hero,
main,
footer {
  width: min(1160px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  padding: clamp(4.5rem, 10vw, 8rem) 0 4rem;
}

.hero__eyebrow,
.section-label {
  margin: 0 0 0.8rem;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 10ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 13vw, 10.5rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.8;
}

.hero__lede {
  max-width: 45rem;
  margin: 2.5rem 0 1.8rem;
  color: #334348;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  line-height: 1.45;
}

.assurance {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.assurance span,
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 253 247 / 75%);
  color: #455358;
  font-size: 0.78rem;
  font-weight: 700;
}

.assurance span {
  padding: 0.55rem 0.8rem;
}

main {
  display: grid;
  gap: 1.25rem;
}

.boundary,
.explorer,
.notes {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: rgb(255 253 247 / 88%);
  box-shadow: var(--shadow);
}

.boundary {
  display: grid;
  grid-template-columns: minmax(14rem, 0.8fr) minmax(18rem, 1.2fr);
  gap: 2rem;
  align-items: end;
  padding: clamp(1.5rem, 4vw, 2.8rem);
  border-left: 0.55rem solid var(--gold);
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.boundary > p {
  margin: 0;
  color: #48575b;
  font-size: 1.05rem;
  line-height: 1.65;
}

.explorer,
.notes {
  padding: clamp(1.25rem, 4vw, 2.8rem);
}

.explorer__heading {
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  align-items: end;
}

.result-count {
  min-width: max-content;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 0.8rem;
  margin: 2rem 0 1.25rem;
}

.controls label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.controls input,
.controls select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.7rem 0.85rem;
  outline: none;
  background: white;
  font-size: 0.95rem;
  letter-spacing: normal;
  text-transform: none;
}

.controls input:focus,
.controls select:focus,
.record:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(31 92 105 / 28%);
  outline-offset: 2px;
}

.explorer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.82fr);
  gap: 1rem;
  align-items: start;
}

.record-list {
  display: grid;
  gap: 0.65rem;
}

.record {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1rem;
  background: white;
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.record:hover {
  border-color: #b7a98f;
  transform: translateY(-1px);
  box-shadow: 0 9px 28px rgb(42 34 23 / 8%);
}

.record[aria-pressed="true"] {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgb(31 92 105 / 15%);
}

.record__topline {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
}

.tag {
  display: inline-flex;
  padding: 0.3rem 0.55rem;
}

.record__id {
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record h3 {
  margin: 0.8rem 0 0.4rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  font-weight: 600;
}

.record p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #526064;
  font-size: 0.9rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 0.9rem;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.detail {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 1rem;
  padding: 1.25rem;
  background: var(--ink);
  color: #f8f3e9;
}

.detail .section-label {
  color: #f3ba51;
}

.detail h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.detail__summary {
  margin: 0.9rem 0 1.2rem;
  color: #dce2df;
  line-height: 1.6;
  white-space: pre-wrap;
}

.meta {
  display: grid;
  grid-template-columns: minmax(6rem, 0.35fr) 1fr;
  gap: 0;
  margin: 0;
  border-top: 1px solid rgb(255 255 255 / 14%);
}

.meta dt,
.meta dd {
  margin: 0;
  border-bottom: 1px solid rgb(255 255 255 / 14%);
  padding: 0.65rem 0;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.meta dt {
  color: #aeb9b7;
  font-weight: 700;
}

.meta dd {
  padding-left: 0.75rem;
}

details {
  margin-top: 1rem;
}

summary {
  cursor: pointer;
  color: #f3c671;
  font-size: 0.86rem;
  font-weight: 700;
}

pre {
  overflow: auto;
  max-height: 25rem;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 0.65rem;
  padding: 0.8rem;
  background: #10191d;
  font-size: 0.73rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.notes {
  margin-bottom: 1.25rem;
}

.notes__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.8rem;
}

.notes article {
  border-top: 0.2rem solid var(--gold);
  padding-top: 1rem;
}

.notes h3 {
  margin: 0 0 0.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.notes article p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

footer {
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

footer p {
  max-width: 34rem;
  margin: 0;
}

.noscript {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 5;
  border: 2px solid var(--red);
  border-radius: 0.8rem;
  padding: 1rem;
  background: white;
  box-shadow: var(--shadow);
}

@media (max-width: 800px) {
  .boundary,
  .explorer__grid {
    grid-template-columns: 1fr;
  }

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

  .controls label:first-child {
    grid-column: 1 / -1;
  }

  .detail {
    position: static;
    max-height: none;
  }

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

@media (max-width: 520px) {
  .hero,
  main,
  footer {
    width: min(100% - 1rem, 1160px);
  }

  .hero {
    padding-top: 4rem;
  }

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

  .controls label:first-child {
    grid-column: auto;
  }

  .explorer__heading,
  footer {
    align-items: start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
