/* Scout — a lexicon of emerging AI concepts.
   Headwords carry the personality; everything else stays quiet. */

:root {
  --paper: #ecebe5;
  --paper-raised: #f4f3ef;
  --ink: #1a1917;
  --ink-soft: #5c584f;
  --rule: #d2cdc4;
  --accent: #7a1f2b;

  --serif: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1817;
    --paper-raised: #221f1d;
    --ink: #e8e4db;
    --ink-soft: #a09a8e;
    --rule: #322e2a;
    --accent: #e08a94;
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}

.wordmark,
.masthead-nav a {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.wordmark { color: var(--ink); }

.masthead-nav { display: flex; gap: 1.25rem; }
.masthead-nav a { color: var(--ink-soft); }
.masthead-nav a:hover { color: var(--accent); }
.masthead-nav a[aria-current='page'] { color: var(--ink); }

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- shared type ---------- */

.meta,
.rail-label,
.read-on,
.back,
.entry-num,
.entry-date,
.count {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.meta { color: var(--ink-soft); margin: 0 0 1.5rem; }
.dot { opacity: 0.5; padding: 0 0.35em; }

.headword {
  font-size: clamp(2.75rem, 13vw, 5.5rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

.headword a { text-decoration: none; }
.headword a:hover { color: var(--accent); }

/* ---------- index: the lead entry ---------- */

.lead {
  padding: clamp(3rem, 12vh, 6rem) 0 clamp(2.5rem, 8vh, 4rem);
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.lead-excerpt {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 1.75rem 0 2rem;
  text-wrap: pretty;
}

.read-on {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.25rem;
}

.read-on::after { content: ' \2192'; }
.read-on:hover { opacity: 0.7; }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: none; }
}

/* ---------- index: earlier entries ---------- */

.rail-label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--ink-soft);
  font-weight: 400;
  margin: 0 0 0.5rem;
}

.rail-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.earlier { padding-bottom: 4rem; }

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry-row {
  display: grid;
  grid-template-columns: 2.25rem 1fr auto;
  align-items: baseline;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

.entry-num { color: var(--accent); }

.entry-title {
  font-size: 1.2rem;
  text-decoration: none;
  text-underline-offset: 0.2em;
}

.entry-title:hover { text-decoration: underline; }
.entry-date { color: var(--ink-soft); font-size: 0.65rem; }

/* ---------- brief page ---------- */

.brief { padding: clamp(2.5rem, 9vh, 4.5rem) 0 4rem; }
.brief .headword { margin-bottom: 2.5rem; }

.prose { font-size: 1.125rem; line-height: 1.72; }
.prose p { margin: 0 0 1.4em; text-wrap: pretty; }

/* The scout writes each brief as `## What it is`, `## Go deeper`, and so on.
   Setting those as mono rules turns its fixed structure into sense dividers. */
.prose h2 {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 2.75rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.prose h3 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.5rem; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.15rem; }
.prose li { margin-bottom: 0.6em; }
.prose a { color: var(--accent); text-underline-offset: 0.18em; }
.prose a:hover { text-decoration-thickness: 2px; }

.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--paper-raised);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

.prose pre {
  background: var(--paper-raised);
  padding: 1rem;
  border-radius: 3px;
  overflow-x: auto;
}

.prose pre code { background: none; padding: 0; }
.prose blockquote {
  margin: 0 0 1.4em;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--ink-soft);
}

.back {
  display: inline-block;
  margin-top: 3.5rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.back::before { content: '\2190  '; }
.back:hover { color: var(--accent); }

/* ---------- ledger ---------- */

.ledger { padding: clamp(2.5rem, 9vh, 4.5rem) 0 4rem; }

.page-head {
  font-size: clamp(2.25rem, 9vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

.page-intro {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 3.5rem;
  text-wrap: pretty;
}

.ledger-section { margin-bottom: 2.75rem; }
.count { color: var(--accent); }
.rail-label .count { margin-left: -0.35rem; }

.concept-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1.5;
}

.concept-list li { margin-bottom: 0.55rem; }

@media (min-width: 40rem) {
  .concept-list { columns: 2; column-gap: 2.5rem; }
  .concept-list li { break-inside: avoid; }
}

/* ---------- empty state ---------- */

.empty { padding: clamp(3rem, 14vh, 7rem) 0 5rem; }

.empty-head {
  font-size: clamp(1.9rem, 7vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1.75rem;
  text-wrap: balance;
}

.empty-body {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
  text-wrap: pretty;
}

/* ---------- colophon ---------- */

.colophon {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--rule);
}

.colophon p {
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* The ledger is an index, not prose: on a wide screen it wants more room than
   the reading measure allows. */
@media (min-width: 60rem) {
  main:has(.ledger) { max-width: 56rem; }
  .concept-list { columns: 3; }
}
