/* dscovery: a quiet reading list for cosmologists.
   One distinctive element: the three-legged vertex in the logo (a contact diagram). */

:root {
  --ink: #1c2430;
  --muted: #566272;
  --paper: #f6f7f9;
  --surface: #ffffff;
  --rule: #d8dce3;
  --accent: #2a4bd7;
  --accent-ink: #ffffff;
  --danger: #a3262a;
  --ok: #1d6b45;
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e4e8ee;
    --muted: #9aa5b5;
    --paper: #10151c;
    --surface: #171d27;
    --rule: #2a3340;
    --accent: #8ea6ff;
    --accent-ink: #0c1220;
    --danger: #ff8d8f;
    --ok: #7bd6a4;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--sans);
}

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

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

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--surface); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font: 700 1.25rem/1 var(--serif); letter-spacing: -0.01em; }
.brand:hover { color: var(--accent); }
.logo { flex: none; }
.bar nav, .who { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; font-size: 0.95rem; }
.bar nav a, .who a { color: var(--ink); text-decoration: none; padding: 0.25rem 0; }
.bar nav a:hover, .who a:hover { color: var(--accent); text-decoration: underline; }
.who { margin-left: auto; }
.who form { margin: 0; }
.linklike { background: none; border: 0; padding: 0.25rem 0; color: var(--ink); font: inherit; cursor: pointer; }
.linklike:hover { color: var(--accent); text-decoration: underline; }

main { padding-top: 2rem; padding-bottom: 3rem; min-height: 60vh; }

/* Type */
h1 { font: 700 1.9rem/1.2 var(--serif); letter-spacing: -0.015em; margin: 0 0 0.75rem; }
h2 { font: 700 1.2rem/1.3 var(--serif); margin: 2rem 0 0.5rem; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 38rem; margin: 0 0 1.5rem; }
p { margin: 0 0 1rem; max-width: 40rem; }

/* Paper list */
.paper { padding: 1.25rem 0; border-top: 1px solid var(--rule); }
.paper h2 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.paper h2 a { color: var(--ink); text-decoration: none; }
.paper h2 a:hover { color: var(--accent); text-decoration: underline; }
.authors { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.5rem; }
.excerpt { margin: 0 0 0.5rem; font-family: var(--serif); font-size: 1rem; line-height: 1.65; }
.meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.meta a { color: var(--accent); }

.paper-detail h1 { font-size: 2rem; }
.paper-detail section p { font-family: var(--serif); line-height: 1.7; }
.video { position: relative; aspect-ratio: 16 / 9; margin: 1rem 0 1.5rem; background: var(--surface); border: 1px solid var(--rule); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.status { font-weight: 600; }
.status-approved { color: var(--ok); }
.status-pending { color: var(--muted); }
.status-rejected { color: var(--danger); }

.notice { background: var(--surface); border-left: 4px solid var(--accent); padding: 0.75rem 1rem; }

/* Search and pager */
.search { display: flex; gap: 0.5rem; margin: 0 0 1.5rem; max-width: 36rem; }
.search input { flex: 1; }
.count { color: var(--muted); }
.pager { display: flex; gap: 1.5rem; align-items: center; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--muted); }

/* Forms */
.stack { max-width: 36rem; }
.field { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
}
textarea { resize: vertical; line-height: 1.5; }
.help { color: var(--muted); font-size: 0.875rem; margin: 0.25rem 0 0; }
fieldset { border: 1px solid var(--rule); border-radius: 4px; padding: 0.75rem 1rem 1rem; margin: 0 0 1.25rem; }
legend { font-weight: 600; padding: 0 0.25rem; }
.choices label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin: 0.25rem 0; }
.errorlist { list-style: none; margin: 0.25rem 0 0; padding: 0; color: var(--danger); font-size: 0.925rem; }
.errors { margin-bottom: 1rem; }

button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 4px;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { filter: brightness(1.1); text-decoration: none; }
.linklike { background: none; color: var(--ink); padding: 0.25rem 0; font-weight: 400; }
.linklike:hover { filter: none; }

/* Messages */
.messages { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.messages li { background: var(--surface); border-left: 4px solid var(--accent); padding: 0.75rem 1rem; }
.messages li.success { border-color: var(--ok); }
.messages li.error { border-color: var(--danger); }

/* The honeypot: invisible to people, tempting to bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.site-footer { padding-top: 1.5rem; padding-bottom: 2.5rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.875rem; }

@media (max-width: 30rem) {
  h1 { font-size: 1.6rem; }
  .who { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
