:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #607066;
  --paper: #f7f5ef;
  --card: #fffefa;
  --line: #d9ddd6;
  --accent: #146447;
  --accent-soft: #e3f0e9;
  --focus: #9a4b18;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55; }
a { color: var(--accent); }
header, main, footer { width: min(1280px, calc(100% - 2rem)); margin-inline: auto; }
header { display: flex; justify-content: space-between; gap: 2rem; align-items: end; padding: 3rem 0 2rem; }
h1 { font-family: Georgia, serif; font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: .95; margin: .25rem 0 1rem; max-width: 13ch; }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.eyebrow, .summary { color: var(--muted); }
.doi { border: 1px solid var(--accent); border-radius: 999px; padding: .6rem 1rem; text-decoration: none; white-space: nowrap; }
.doi span { background: var(--accent-soft); border-radius: 999px; margin-left: .35rem; padding: .1rem .45rem; font-size: .75rem; }
.controls { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem; }
.controls label { display: block; font-weight: 650; margin-bottom: .45rem; }
.search-row { display: grid; grid-template-columns: 1fr minmax(9rem, 14rem); gap: .75rem; }
input, select { width: 100%; border: 1px solid #aeb8b0; border-radius: .55rem; background: white; color: var(--ink); padding: .8rem; font: inherit; }
input:focus, select:focus, button:focus, a:focus { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 2px; }
.workspace { display: grid; grid-template-columns: minmax(17rem, 1fr) minmax(22rem, 2fr); gap: 1rem; margin: 1rem 0 3rem; align-items: start; }
nav, article, #results { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem; max-height: 72vh; overflow: auto; }
#results { grid-column: 1; }
#detail { grid-column: 2; grid-row: 1; }
.tree ul { list-style: none; padding-left: 1rem; border-left: 1px solid var(--line); }
.tree > ul { padding-left: 0; border: 0; }
button.item { border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left; padding: .3rem .2rem; font: inherit; }
button.item:hover, button.item[aria-current="true"] { color: var(--accent); text-decoration: underline; }
.notation { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin-right: .4rem; }
.search-feedback { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
#search-status { margin: 0; }
#clear-search { border: 1px solid var(--line); border-radius: .4rem; background: white; color: var(--accent); padding: .3rem .6rem; font: inherit; cursor: pointer; }
.result-list { display: grid; gap: .45rem; }
.result { border: 1px solid var(--line); border-radius: .55rem; padding: .65rem; width: 100%; background: white; cursor: pointer; text-align: left; }
.result:hover { border-color: var(--accent); }
.kind { text-transform: uppercase; letter-spacing: .07em; font-size: .7rem; color: var(--muted); }
.labels { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; }
.labels dt { font-weight: 700; }
.labels dd { margin: 0; }
.language-code { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; font-weight: 500; }
.pill-list { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; list-style: none; }
.pill-list button { border: 1px solid var(--line); background: var(--accent-soft); border-radius: 999px; padding: .35rem .65rem; cursor: pointer; }
.uri { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
footer { border-top: 1px solid var(--line); color: var(--muted); padding: 1.5rem 0 3rem; }

@media (max-width: 760px) {
  header { display: block; padding-top: 2rem; }
  .doi { display: inline-block; margin-top: 1rem; }
  .search-row, .workspace { grid-template-columns: 1fr; }
  #detail, #results { grid-column: 1; grid-row: auto; max-height: none; }
  #results { max-height: 45vh; }
  nav { max-height: 55vh; }
}

.resource-links { display:flex; flex-wrap:wrap; gap:.5rem 1.5rem; padding:0 0 1rem; }
.resource-links a { font-weight:600; text-underline-offset:.2em; }
.source-note { max-width:78ch; color:var(--muted); margin:0 0 1.5rem; }
.skip-link { position:absolute; left:1rem; top:-5rem; background:white; padding:1rem; z-index:10; }
.skip-link:focus { top:1rem; }
header > div { max-width:55rem; }
.doi { white-space:normal; overflow-wrap:anywhere; }
.labels dd, article, footer { overflow-wrap:anywhere; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior:auto !important; } }
