:root {
  color-scheme: light;
  --ink: #142a28;
  --muted: #5d706d;
  --paper: #f4f0e8;
  --surface: #fffdf8;
  --line: #d8d2c6;
  --accent: #b65032;
  --accent-soft: #f3dfd4;
  --moss: #2f665d;
  --shadow: 0 22px 70px rgb(20 42 40 / 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);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 4%, rgb(182 80 50 / 11%), transparent 24rem),
    linear-gradient(115deg, transparent 0 64%, rgb(47 102 93 / 4%) 64% 65%, transparent 65%),
    var(--paper);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

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

.site-header {
  width: min(100% - 2rem, 90rem);
  margin: 0 auto;
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(20 42 40 / 16%);
}

.brand {
  display: inline-flex;
  gap: 0.8rem;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  width: 2.6rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--surface);
  background: var(--ink);
  border-radius: 42% 58% 52% 48%;
  font: 600 1.35rem/1 Georgia, serif;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font: 600 1.03rem/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.release-badge {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 253 248 / 65%);
  font: 600 0.78rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.release-badge span {
  color: var(--muted);
  font-family: inherit;
  font-weight: 400;
}

.layout {
  width: min(100% - 2rem, 90rem);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(19rem, 0.85fr);
  gap: clamp(2rem, 6vw, 7rem);
  padding: clamp(3.5rem, 7vw, 7rem) 0 5rem;
}

.eyebrow {
  color: var(--accent);
  font: 600 0.73rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 15ch;
  margin: 0.7rem 0 1.1rem;
  font: 500 clamp(2.7rem, 5.3vw, 5.4rem)/0.98 Georgia, "Times New Roman", serif;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 44rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.65;
}

.notice {
  max-width: 48rem;
  margin: 2rem 0 2.4rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: #60483f;
  background: var(--accent-soft);
  font-size: 0.87rem;
  line-height: 1.55;
}

.search label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.search-control {
  position: relative;
  display: flex;
  align-items: center;
}

.search-control svg {
  position: absolute;
  left: 1rem;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
  pointer-events: none;
}

input[type="search"] {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.9rem 1rem 0.9rem 3rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  box-shadow: 0 8px 25px rgb(20 42 40 / 5%);
  font: inherit;
}

input[type="search"]:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.result-heading {
  margin: 2.2rem 0 0.75rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.result-heading h2 {
  margin-bottom: 0;
  font: 600 1.1rem/1.2 Georgia, serif;
}

.result-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.results {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.result-link {
  padding: 0.9rem 0.15rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.result-link:hover .result-name {
  color: var(--accent);
}

.result-name {
  font: 600 1rem/1.25 Georgia, serif;
}

.result-code {
  color: var(--muted);
  font: 0.72rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.result-kind {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  padding: 0.27rem 0.5rem;
  color: var(--moss);
  background: rgb(47 102 93 / 9%);
  border-radius: 999px;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-panel {
  align-self: start;
  position: sticky;
  top: 1.5rem;
  min-height: 28rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--ink);
  color: var(--surface);
  border-radius: 0.85rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-panel::after {
  content: "";
  position: absolute;
  right: -5rem;
  bottom: -6rem;
  width: 16rem;
  aspect-ratio: 1;
  border: 1px solid rgb(255 253 248 / 13%);
  border-radius: 45% 55% 48% 52%;
  transform: rotate(25deg);
  pointer-events: none;
}

.detail-glyph {
  width: 4rem;
  aspect-ratio: 1;
  margin-bottom: 3.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 253 248 / 25%);
  border-radius: 50%;
  color: #df9a7e;
  font: 1rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.detail-panel h2 {
  max-width: 14ch;
  font: 500 clamp(1.8rem, 3vw, 2.8rem)/1.05 Georgia, serif;
  letter-spacing: -0.025em;
}

.detail-panel p {
  color: #bdcbc8;
  line-height: 1.65;
}

.detail-code {
  margin-bottom: 0.65rem;
  color: #df9a7e;
  font: 0.76rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.detail-meta,
.mapping-list,
.parent-list {
  position: relative;
  z-index: 1;
}

.detail-meta {
  margin: 2rem 0 0;
}

.detail-meta div,
.catalog-facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid rgb(255 253 248 / 14%);
}

.detail-meta dt,
.catalog-facts dt {
  color: #91a8a3;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-meta dd,
.catalog-facts dd {
  margin: 0;
  text-align: right;
  font-size: 0.86rem;
}

.mapping-list,
.parent-list {
  margin: 1.8rem 0 0;
}

.mapping-list ul,
.parent-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mapping-list h3,
.parent-list h3 {
  margin: 0 0 0.65rem;
  color: #91a8a3;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mapping-list li,
.parent-list li {
  padding: 0.55rem 0;
  border-top: 1px solid rgb(255 253 248 / 14%);
  font-size: 0.82rem;
  line-height: 1.45;
}

.mapping-ref {
  display: block;
  margin-top: 0.18rem;
  color: #91a8a3;
  font: 0.68rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

footer {
  width: min(100% - 2rem, 90rem);
  margin: 0 auto;
  padding: 1.6rem 0 2.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  border-top: 1px solid rgb(20 42 40 / 16%);
  font-size: 0.75rem;
}

footer p {
  margin: 0;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

noscript {
  display: block;
  padding: 1rem;
  text-align: center;
  background: #fff3cd;
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
    padding-top: 3rem;
  }

  .detail-panel {
    position: static;
    min-height: auto;
  }

  .detail-glyph {
    margin-bottom: 2rem;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .site-header,
  .layout,
  footer {
    width: min(100% - 1.25rem, 90rem);
  }

  h1 {
    font-size: 2.65rem;
  }

  .release-badge span {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #e8eee9;
    --muted: #9cafaa;
    --paper: #101918;
    --surface: #172321;
    --line: #34433f;
    --accent: #e18a69;
    --accent-soft: #3b2923;
    --moss: #8abbb0;
  }

  body {
    background: radial-gradient(circle at 88% 4%, rgb(225 138 105 / 9%), transparent 24rem), var(--paper);
  }

  .detail-panel {
    color: #10201e;
    background: #dce7e2;
  }

  .notice {
    color: #f0d8cd;
  }

  .detail-panel p,
  .detail-code,
  .detail-meta dt,
  .catalog-facts dt,
  .mapping-list h3,
  .parent-list h3,
  .mapping-ref {
    color: #425f59;
  }

  .detail-meta div,
  .catalog-facts div,
  .mapping-list li,
  .parent-list li {
    border-color: rgb(16 32 30 / 18%);
  }
}
