/* Otto Research: an index of posts, and the post page (title centred, the cover beneath, a quiet line of details and the
   chapters in one numbered row, then a serif standfirst and the text in one column with numbered figures). */
:root { --ink: #131313; --paper: #FAF9F6; --line: #E4E2DC; --soft: #6F6E69; --soft2: #55544f; --blue: #2B7DFF; --tint: #EAF1FF; }
* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
main { max-width: 1320px; margin: 0 auto; padding: 0 clamp(20px, 3.6vw, 52px); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.04em; }

/* ---- index */
.label-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: clamp(28px, 4vw, 56px); padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 15px; }
.label-row span { color: var(--soft); }
.intro { padding: clamp(36px, 5vw, 72px) 0 clamp(24px, 3vw, 40px); }
.intro h1 { margin: 0; font-size: clamp(40px, 6vw, 84px); font-weight: 600; letter-spacing: -0.04em; line-height: 0.98; }
.intro p { max-width: 36em; margin: 20px 0 0; font-size: 18px; line-height: 1.55; color: var(--soft2); }
.card { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(24px, 3vw, 40px) 0 clamp(56px, 8vw, 104px); text-decoration: none; }
.card .cover { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); transition: transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.card .cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card:hover .cover { transform: translateY(-3px); }
.card .meta { display: flex; gap: 14px; margin: 0 0 14px; font-size: 14px; color: var(--soft); }
.card h2 { margin: 0; font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.card p.say { margin: 16px 0 24px; font-size: 17px; line-height: 1.55; color: var(--soft2); }
.soft { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; background: rgba(19, 19, 19, 0.06); color: var(--ink); font-weight: 500; font-size: 15px; line-height: 1; font-family: inherit; text-decoration: none; transition: background 180ms ease; }
.soft:hover { background: rgba(19, 19, 19, 0.11); }

/* ---- post: the title centred, the cover beneath it, then one quiet line of details and the chapters in a numbered row */
.post-head { padding: clamp(48px, 7vw, 96px) 0 clamp(28px, 3.5vw, 44px); text-align: center; }
/* the line above every post's title: Otto Research · its category */
.post-head .eyebrow { margin: 0 0 18px; font-size: 13px; letter-spacing: 0.04em; color: var(--soft); }
.post-head h1 { max-width: 18em; margin: 0 auto; font-size: clamp(30px, 4vw, 52px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.06; }
.post-head .soft { margin-top: 24px; font-size: 14px; padding: 9px 16px; }
.hero { max-width: 880px; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.hero canvas, .card .cover canvas { display: block; width: 100%; height: 100%; }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-meta { max-width: 880px; margin: 22px auto 0; }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 0 0 18px; font-size: 13px; color: var(--soft); }
.facts span + span::before { content: "·"; margin-right: 18px; color: var(--line); }
.toc { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.toc a { display: inline-flex; gap: 7px; padding: 4px 0; text-decoration: none; color: var(--soft2); transition: color 160ms ease; }
.toc a span:first-child { color: var(--soft); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; padding-top: 2px; }
.toc a:hover { color: var(--blue); }
article { max-width: 700px; margin: clamp(36px, 5vw, 64px) auto 0; padding-bottom: clamp(64px, 9vw, 120px); font-family: "Source Serif 4", Georgia, serif; font-size: 18px; line-height: 1.62; }
article .standfirst { margin: 0 0 40px; font-size: 21px; line-height: 1.5; color: #4a4943; }
article h2 { margin: 64px 0 18px; font-family: "Plus Jakarta Sans", sans-serif; font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; scroll-margin-top: 90px; }
article h3 { margin: 40px 0 10px; font-family: "Plus Jakarta Sans", sans-serif; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
article p { margin: 0 0 22px; }
article a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
article ul, article ol { padding-left: 24px; margin: 0 0 22px; }
article li { margin-bottom: 10px; }
figure { margin: 48px -60px; }
figure img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); }
figcaption { display: grid; grid-template-columns: 72px 1fr; gap: 14px; margin-top: 14px; font-family: "Plus Jakarta Sans", sans-serif; font-size: 13.5px; line-height: 1.65; color: var(--soft2); }
figcaption .mono { font-size: 12px; color: var(--soft); padding-top: 2px; }
.callout { margin: 28px 0; padding: 18px 22px; border-radius: 10px; background: var(--tint); font-family: "Plus Jakarta Sans", sans-serif; font-size: 15px; line-height: 1.6; }
.callout b { color: var(--blue); }
.numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 40px -60px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-family: "Plus Jakarta Sans", sans-serif; }
.numbers div { padding: 24px 22px; background: var(--paper); }
.numbers b { display: block; font-size: 32px; font-weight: 600; letter-spacing: -0.03em; color: var(--blue); }
.numbers span { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.45; color: var(--soft2); }
/* figures drawn in the page itself (research/build.py), in its own colours: a bold title, dots for the key, quiet monospaced
   ticks, the value on every bar, an italic caption centred beneath */
.chart { --s-otto: #2B7DFF; --s-b: #A9C4EE; --s-c: #CFCCC3; --s-a: #E2DFD7; margin: 56px -60px; font-family: "Plus Jakarta Sans", sans-serif; }
.chart .ct { margin: 0 0 10px; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 18px; font-size: 15px; }
.chart .legend span { display: inline-flex; align-items: center; gap: 9px; }
.chart .legend i { width: 13px; height: 13px; border-radius: 50%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--soft); stroke-width: 1; }
.chart .tick { fill: var(--soft); font: 12px ui-monospace, "SF Mono", Menlo, monospace; }
.chart .val { fill: var(--soft2); font-size: 14px; font-weight: 500; }
.chart .val.otto { fill: var(--ink); font-weight: 600; }
.chart .grp { fill: var(--ink); font-size: 14.5px; }
.s-otto { fill: var(--s-otto); background: var(--s-otto); } .s-b { fill: var(--s-b); background: var(--s-b); } .s-c { fill: var(--s-c); background: var(--s-c); } .s-a { fill: var(--s-a); background: var(--s-a); }
.chart figcaption { display: block; margin: 22px auto 0; max-width: 34em; text-align: center; font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-size: 16px; line-height: 1.55; color: var(--soft2); }
/* multiples: one row a comparison, the bar and its multiple */
.multiples { display: grid; gap: 22px; }
.mrow p { margin: 0 0 8px; font-size: 15.5px; font-weight: 500; }
.mrow small { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 400; color: var(--soft); }
.mbar { display: flex; align-items: center; gap: 14px; }
.mbar i { display: block; height: 28px; min-width: 6px; border-radius: 4px; background: var(--s-otto); }
.mbar b { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
/* the results table */
.tablewrap { overflow-x: auto; }
table.results { width: 100%; border-collapse: collapse; font-size: 15px; }
.results th, .results td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.results thead th { font-size: 13.5px; font-weight: 500; color: var(--soft); border-bottom-color: var(--soft); }
.results tbody th { font-weight: 500; }
.results td small { display: block; margin-top: 2px; font: 12px ui-monospace, "SF Mono", Menlo, monospace; color: var(--soft); }
.results .otto { background: color-mix(in srgb, var(--s-otto) 8%, transparent); }
.results thead th.otto { color: var(--s-otto); font-weight: 600; }
.results .best { font-weight: 600; }
.results .none { color: var(--soft); }
@media (prefers-color-scheme: dark) { .chart { --s-otto: #4D8FFF; --s-b: #3E5A82; --s-c: #57554F; --s-a: #3C3B37; } }

/* chapters down the left, as Otto's reading view draws a paper's outline (research/rail.js) */
.rail { position: fixed; left: clamp(16px, 2.4vw, 36px); top: 50%; z-index: 6; display: flex; flex-direction: column; padding: 8px 0; transform: translateY(-50%); opacity: 0; pointer-events: none; transition: opacity 240ms ease; }
.rail.on { opacity: 1; pointer-events: auto; }
.rail button { position: relative; display: flex; align-items: center; height: 14px; padding: 0 28px 0 0; border: 0; background: none; cursor: pointer; transition: height 200ms ease-out; }
.rail:hover button { height: 22px; }
.rail i { display: block; width: 30px; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--soft) 62%, transparent); transition: background 200ms ease; }
.rail button.done i { background: var(--ink); }
.rail button.sub i { width: 18px; }
.rail button.sub span { font-size: 13px; font-weight: 400; }
.rail span { position: absolute; left: 0; max-width: 260px; padding-right: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 6px; background: color-mix(in srgb, var(--paper) 90%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 14px; font-weight: 500; color: var(--soft2); opacity: 0; pointer-events: none; }
.rail button.done span { color: var(--ink); }
.rail button:hover span, .rail button:focus-visible span { opacity: 1; }
.rail button:hover i, .rail button:focus-visible i { opacity: 0; }
.rail button:focus-visible { outline: none; }
@media (max-width: 900px) { .rail { display: none; } }

/* the last word, then the footnotes on their own grey band */
article .closing { margin: 56px 0 0; padding-top: 32px; border-top: 1px solid var(--line); font-family: "Plus Jakarta Sans", sans-serif; font-size: 21px; line-height: 1.55; letter-spacing: -0.01em; }
sup.fn { font-family: "Plus Jakarta Sans", sans-serif; font-size: 0.62em; line-height: 0; margin-left: 1px; }
sup.fn a { text-decoration: none; color: var(--blue); }
.footnotes { background: #F1F0EC; }
.footnotes .in { max-width: 700px; margin: 0 auto; padding: 64px clamp(20px, 3.6vw, 52px) 72px; font-family: "Plus Jakarta Sans", sans-serif; }
.footnotes .year { display: inline-block; padding: 8px 18px; border-radius: 999px; background: rgba(19, 19, 19, 0.06); font-size: 15px; }
.footnotes .fn-label { margin: 28px 0 14px; font-size: 15px; color: var(--soft); }
.footnotes ol { margin: 0; padding-left: 22px; font-size: 15.5px; line-height: 1.7; }
.footnotes li { padding-left: 12px; margin-bottom: 12px; }
.footnotes li::marker { color: var(--soft); }
.footnotes a { color: var(--soft); text-decoration: none; }
@media (prefers-color-scheme: dark) { .footnotes { background: #1B1B1A; } .footnotes .year { background: rgba(236, 234, 227, 0.08); } sup.fn a { color: #6EA6FF; } }

@media (max-width: 1100px) {
  figure, .numbers, .chart { margin-left: 0; margin-right: 0; }
}
@media (max-width: 760px) {
  .card { grid-template-columns: 1fr; }
  article { font-size: 17px; }
  article .standfirst { font-size: 19px; }
  .toc { justify-content: flex-start; }
  .numbers { grid-template-columns: 1fr; }
  figcaption { grid-template-columns: 1fr; gap: 6px; }
}

/* the Research index: every post as one plain table under the lead, as News lists its articles */
.all { padding-bottom: clamp(48px, 7vw, 88px); }
.all h2 { margin: 0; font-size: clamp(34px, 4.4vw, 60px); font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.all .count, .all .trow.head { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.04em; text-transform: uppercase; }
.all .count { margin: clamp(28px, 4vw, 48px) 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--soft); }
.all .count b { margin-right: 8px; font-weight: 400; color: var(--ink); }
.all .table { position: relative; z-index: 0; }
.all .trow { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) 170px 130px; gap: 24px; align-items: center; padding: 18px 0; font-size: 15px; text-decoration: none; }
.all .trow.head { padding-top: 28px; font-size: 12px; color: var(--soft); }
.all .rows .trow { border-top: 1px solid var(--line); }
.all a.trow::before { content: ""; position: absolute; inset: -1px -14px 0; z-index: -1; border-radius: 12px; background: transparent; transition: background 180ms ease; }
.all a.trow:hover::before { background: rgba(19, 19, 19, 0.045); }
.all .trow b { font-weight: 600; letter-spacing: -0.01em; }
.all .trow span { min-width: 0; color: #4b4a46; }
.all .trow .fade { overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
@media (max-width: 860px) { .all .trow { grid-template-columns: minmax(0, 1fr) 96px; } .all .trow > :nth-child(2), .all .trow > :nth-child(3) { display: none; } }
@media (prefers-color-scheme: dark) { .all a.trow:hover::before { background: rgba(236, 234, 227, 0.05); } .all .trow span { color: var(--soft2); } }
