/* Layout: one narrow reading column; index is a ruled list of idea rows, detail is a single article. */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --fg: #17202a;
  --muted: #5a6774;
  --line: #d9e0e6;
  --accent: #1d5c88;
  --accent-soft: #e2edf5;
  --mark: #f6e3a1;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161c; --surface: #19212a; --fg: #e4e9ee; --muted: #94a1ad;
    --line: #2a343f; --accent: #7fb6de; --accent-soft: #1c2c3a; --mark: #5b4a17;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11161c; --surface: #19212a; --fg: #e4e9ee; --muted: #94a1ad;
  --line: #2a343f; --accent: #7fb6de; --accent-soft: #1c2c3a; --mark: #5b4a17;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--body);
}
.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding-block: 3rem 4rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
p { margin: 0; }
.label {
  font: 500 0.75rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Header */
.masthead { display: flex; flex-direction: column; gap: 0.75rem; border-bottom: 2px solid var(--fg); padding-bottom: 1.25rem; }
.masthead .lede { color: var(--muted); max-width: 36rem; }
.masthead .meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-variant-numeric: tabular-nums; }

/* Index rows */
.ideas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ideas li { border-bottom: 1px solid var(--line); }
.ideas a.row {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0 1rem;
  padding: 1.25rem 0;
  text-decoration: none;
  color: inherit;
}
.ideas a.row:hover .title, .ideas a.row:focus-visible .title { color: var(--accent); }
.ideas .num { font: 500 0.85rem/1.9 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.ideas .text { min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.ideas .title { font: 600 1.3rem/1.25 var(--display); transition: color 120ms; }
.ideas .one { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; }
.tag {
  font: 500 0.72rem/1 var(--mono);
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Detail */
.back { font: 500 0.85rem/1 var(--mono); text-decoration: none; }
.article { display: flex; flex-direction: column; gap: 2.25rem; }
.article header { display: flex; flex-direction: column; gap: 0.9rem; }
.article .one { font-size: 1.2rem; color: var(--muted); }
.section { display: flex; flex-direction: column; gap: 0.9rem; }
.prose { display: flex; flex-direction: column; gap: 1rem; }
.say { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.say li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem 1rem;
}
.say li::before { content: "\201C"; font: 700 1.4rem/0 var(--display); color: var(--accent); margin-right: 0.15rem; vertical-align: -0.35rem; }
.asks { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.fits { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; margin: 0; }
.fits dt { font: 600 0.95rem/1.6 var(--display); }
.fits dd { margin: 0; min-width: 0; }
.source {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
mark { background: var(--mark); color: inherit; padding: 0 0.15em; }
footer.foot { color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); padding-top: 1rem; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .ideas a.row { grid-template-columns: 2.25rem 1fr; }
  .fits { grid-template-columns: 1fr; gap: 0.15rem; }
  .fits dd { margin-bottom: 0.6rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Tables inside detail sections */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
table.grid { border-collapse: collapse; width: 100%; font-size: 0.92rem; line-height: 1.45; }
table.grid th, table.grid td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
table.grid th { font: 500 0.72rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid td:first-child { font: 600 0.95rem/1.4 var(--display); white-space: nowrap; }
.note { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 480px) { table.grid { min-width: 34rem; } }

/* Link to the original article */
.src { font-size: 0.92rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.5rem; }
.src .label { font-size: 0.68rem; }
.ideas li .src { padding: 0 0 1.25rem calc(3.25rem + 1rem); margin-top: -0.6rem; }
@media (max-width: 480px) { .ideas li .src { padding-left: calc(2.25rem + 1rem); } }
