/* EverTown's run log. Linden Lake by day (light) and by night (dark); the only strong colours are the residents' own,
   taken from their icons. Alegreya for what is read, Alegreya Sans for what is looked up. */
:root {
  --ground: #edf1ed; --paper: #fbfcfa; --ink: #172629; --ink-2: #3a4c4f; --muted: #607270; --line: #d3ddd7;
  --wash: #e3eae5; --accent: #1d6a72; --sore: #c4463f; --good: #2f7d4f; --bad: #b4532a;
  /* the town's money: in from outside (the lake), out of town (the roofs), between residents (the lamp) */
  --s1: #1d6a72; --s2: #c25b3a; --s3: #b28716;
  /* friendship, faint to strong */
  --q0: #e5ece8; --q1: #c5dcd8; --q2: #9cc5c2; --q3: #6aa8a8; --q4: #3d8a8e; --q5: #226d73; --q6: #114c52;
  /* the residents (their icons' colours, deepened a little to read on paper) */
  --r-alice: #c55c3c; --r-bob: #3b74b0; --r-maggie: #8655d2; --r-priya: #c08a14; --r-walter: #8c6251;
  --r-leo: #6b8a48; --r-ruth: #c24748; --r-emil: #2c8878; --r-tess: #0b8fb8; --r-gus: #a36b41;
  --serif: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --top: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0e181a; --paper: #142124; --ink: #e5ede8; --ink-2: #c1cfca; --muted: #8ea39f; --line: #253a3d;
    --wash: #1a2b2e; --accent: #f2b544; --sore: #e86b62; --good: #7fcf8f; --bad: #f08a64;
    --s1: #4fb0b8; --s2: #e07a58; --s3: #e8b94a;
    --q0: #1a2a2d; --q1: #173f44; --q2: #1d5459; --q3: #276b70; --q4: #378a8d; --q5: #55aaab; --q6: #86cfcd;
    --r-alice: #e57f5d; --r-bob: #6c9fdb; --r-maggie: #ae88ee; --r-priya: #fdbf43; --r-walter: #c49884;
    --r-leo: #a6c385; --r-ruth: #e7706f; --r-emil: #4fbaa6; --r-tess: #2cc8f0; --r-gus: #d4996b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0e181a; --paper: #142124; --ink: #e5ede8; --ink-2: #c1cfca; --muted: #8ea39f; --line: #253a3d;
  --wash: #1a2b2e; --accent: #f2b544; --sore: #e86b62; --good: #7fcf8f; --bad: #f08a64;
  --s1: #4fb0b8; --s2: #e07a58; --s3: #e8b94a;
  --q0: #1a2a2d; --q1: #173f44; --q2: #1d5459; --q3: #276b70; --q4: #378a8d; --q5: #55aaab; --q6: #86cfcd;
  --r-alice: #e57f5d; --r-bob: #6c9fdb; --r-maggie: #ae88ee; --r-priya: #fdbf43; --r-walter: #c49884;
  --r-leo: #a6c385; --r-ruth: #e7706f; --r-emil: #4fbaa6; --r-tess: #2cc8f0; --r-gus: #d4996b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.55 var(--sans);
  font-feature-settings: "lnum"; padding-inline: 20px; }
.wrap { max-width: 1180px; margin: 0 auto; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; }
.dim { color: var(--muted); }
code { font: 0.9em ui-monospace, "Cascadia Mono", Consolas, monospace; }

/* the bar along the top */
.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-block: calc(var(--top) + 18px) 0; }
.bar .mark { font: 800 22px/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.bar nav { display: flex; gap: 20px; font-size: 16px; }

/* a run's opening */
.hero { padding-block: 44px 8px; }
.hero .when { color: var(--muted); font-size: 16px; margin: 0; }
.hero h1 { font: 800 clamp(40px, 7vw, 76px)/1.02 var(--serif); letter-spacing: -0.02em; margin: 10px 0 16px;
  text-wrap: balance; max-width: 18ch; }
.hero .lede { font-size: 20px; line-height: 1.5; color: var(--ink-2); max-width: 60ch; margin: 0; }

/* the cast: each resident on a tile of their own colour */
.cast { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 18px 12px;
  grid-template-columns: repeat(10, minmax(0, 1fr)); }
.cast li { min-width: 0; }
.cast .face { display: block; aspect-ratio: 1; width: 100%; max-width: 104px; border-radius: 14px; overflow: hidden;
  background: color-mix(in oklab, var(--c) 26%, var(--paper)); }
.cast .face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
.cast .name { display: block; font: 700 16px/1.2 var(--sans); margin-top: 8px; }
.cast .sub { display: block; font-size: 14px; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }
.cast .lost { display: block; font-size: 13px; line-height: 1.3; color: var(--sore); }
.cast li.lost-home .face { box-shadow: inset 0 0 0 2px var(--sore); }
.cast li.lost-home .face img { filter: saturate(0.55); }
.cast-note { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

/* the run in figures */
.stats { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 34px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { font-size: 15px; color: var(--muted); }
.stats dd { margin: 0; font: 700 32px/1.1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }

/* the report beside its contents */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 56px; margin-top: 28px; }
.toc { font-size: 15px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
@media (min-width: 1100px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); }
  .toc { position: sticky; top: calc(var(--top) + 28px); align-self: start; padding-top: 58px; }
  .toc ol { flex-direction: column; gap: 7px; border-left: 1px solid var(--line); padding-left: 16px; }
}
.report { max-width: 860px; min-width: 0; }
.report h2 { font: 700 34px/1.15 var(--serif); letter-spacing: -0.01em; margin: 64px 0 14px; text-wrap: balance;
  scroll-margin-top: calc(var(--top) + 20px); }
.report h3 { font: 700 20px/1.3 var(--sans); margin: 32px 0 10px; text-wrap: balance; }
.report p, .report li { max-width: 70ch; }
.report ul { padding-left: 1.2em; }
.report li { margin: 4px 0; }
.report li::marker { color: var(--muted); }
.report hr { border: 0; border-top: 1px solid var(--line); margin: 72px 0 16px; }
.report hr + p { color: var(--muted); font-size: 15px; }

/* the analysis: the part written by hand, set as prose */
.analysis { font: 20px/1.62 var(--serif); color: var(--ink); }
.analysis p, .analysis li { max-width: 64ch; }
.analysis strong { font-weight: 700; }
.analysis > p:first-child em:only-child { color: var(--muted); }

/* tables */
.scroll { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 16px; font-variant-numeric: lining-nums tabular-nums; }
th, td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 15px; white-space: nowrap; }
td[align="right"], th[align="right"] { text-align: right; white-space: nowrap; padding: 8px 0 8px 14px; }
td[align="right"] + td, th[align="right"] + th { padding-left: 18px; }
tbody tr:hover td { background: color-mix(in oklab, var(--wash) 55%, transparent); }
td.better { color: var(--good); } td.worse { color: var(--bad); }
table.env td:first-child { color: var(--muted); width: 160px; white-space: nowrap; }

/* charts */
.figure { margin: 16px 0 10px; padding: 18px 0 6px; border-top: 1px solid var(--line); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 13px var(--sans); font-variant-numeric: lining-nums tabular-nums; }
.chart .val { fill: var(--ink); font: 700 13px var(--sans); font-variant-numeric: lining-nums tabular-nums; }
.chart .line { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; stroke: var(--s1); }
.chart .area { fill: color-mix(in oklab, var(--s1) 10%, transparent); stroke: none; }
.chart .dot { stroke: var(--paper); stroke-width: 2; fill: var(--s1); }
.chart .bar.s1 { fill: var(--s1); } .chart .bar.s2 { fill: var(--s2); } .chart .bar.s3 { fill: var(--s3); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: color-mix(in oklab, var(--ink) 6%, transparent); }
.matrix rect.q0 { fill: var(--q0); } .matrix rect.q1 { fill: var(--q1); } .matrix rect.q2 { fill: var(--q2); }
.matrix rect.q3 { fill: var(--q3); } .matrix rect.q4 { fill: var(--q4); } .matrix rect.q5 { fill: var(--q5); }
.matrix rect.q6 { fill: var(--q6); }
.matrix .sore { fill: var(--sore); stroke: var(--paper); stroke-width: 2; }
svg.matrix { max-width: 640px; }
/* a chart's key: for columns, a column like the chart's beside its name and total; for lines, a short stroke */
.key { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 2px 0 18px; }
.key .k { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px;
  align-items: end; justify-content: start; }
.key i { grid-row: 1 / span 2; width: 9px; height: 40px; border-radius: 4px 4px 1px 1px; background: var(--s1);
  align-self: stretch; }
.key i.s2 { background: var(--s2); } .key i.s3 { background: var(--s3); }
.key .l { font-size: 15px; line-height: 1.2; color: var(--muted); }
.key b { font: 700 22px/1.15 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--ink); }
.key.lines { gap: 8px 24px; margin-bottom: 12px; }
.key.lines .k { grid-template-rows: auto; align-items: center; }
.key.lines i { grid-row: auto; width: 18px; height: 3px; border-radius: 2px; align-self: center; }
.key.lines .l { font-size: 15px; color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 15px; color: var(--ink-2); margin-bottom: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px;
  background: var(--s1); }
.legend i.s2 { background: var(--s2); } .legend i.s3 { background: var(--s3); }
.legend i.sore { background: var(--sore); border-radius: 50%; }
.legend .ramp { width: 120px; height: 12px; border-radius: 6px; display: inline-block; vertical-align: -1px;
  background: linear-gradient(90deg, var(--q0), var(--q3), var(--q6)); margin: 0 6px; }

/* what happened, day by day */
ul.story { list-style: none; padding: 0; margin: 8px 0 0; }
ul.story li { display: grid; grid-template-columns: 62px 84px minmax(0, 1fr); gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--line); max-width: none; margin: 0; }
ul.story .d { color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.chip { font-size: 13px; line-height: 1.5; border-radius: 6px; padding: 0 8px; height: fit-content; text-align: center;
  color: var(--ink-2); background: var(--wash); }
.chip.home, .chip.death { color: var(--sore); background: color-mix(in oklab, var(--sore) 12%, var(--paper)); }
.chip.work { color: var(--accent); }
li > strong:first-child { font-variant-numeric: lining-nums tabular-nums; }

/* each resident */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 18px; }
.person { background: var(--paper); border-radius: 14px; padding: 18px 18px 10px; min-width: 0;
  box-shadow: 0 0 0 1px var(--line); }
.person .who { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; }
.person .who img { width: 52px; height: 52px; image-rendering: pixelated; border-radius: 6px; }
.person h3 { margin: 0; font: 700 22px/1.15 var(--serif); }
.person .role { margin: 2px 0 0; font-size: 14px; line-height: 1.35; color: var(--muted); }
.person .role span { display: block; }
.person .role .lost { color: var(--sore); }
.person > p { font-size: 15px; color: var(--ink-2); margin: 6px 0; }
.person .spark { margin: 12px 0 4px; }
.person .spark svg { max-width: 400px; }
.person .chart .line { stroke: var(--c); } .person .chart .dot { fill: var(--c); }
.person .chart .area { fill: color-mix(in oklab, var(--c) 12%, transparent); }
.person table { font-size: 14px; }
.person th, .person td { padding: 5px 8px 5px 0; }
.person td[align="right"], .person th[align="right"] { padding: 5px 0 5px 8px; }

/* feelings */
table.heat td.c { text-align: right; }

/* the front page */
.front { padding-block: 40px 0; }
.front h1 { font: 800 clamp(56px, 12vw, 132px)/0.95 var(--serif); letter-spacing: -0.03em; margin: 0; }
.front .lede { font: 22px/1.5 var(--serif); color: var(--ink-2); max-width: 46ch; margin: 22px 0 0; }
.street { position: relative; display: flex; align-items: flex-end; margin: 40px -20px 0; padding: 0 20px;
  overflow: hidden; height: 168px; border-bottom: 3px solid color-mix(in oklab, var(--r-leo) 60%, var(--ground)); }
.street img { height: 150px; width: auto; margin-right: -26px; flex: none; }
.street img:nth-child(odd) { height: 132px; }
.index h2 { font: 700 34px/1.15 var(--serif); margin: 64px 0 16px; letter-spacing: -0.01em; }
.front .cast { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 18px; max-width: 900px; }
.front .cast .sub { margin-top: 2px; }
ol.runs { list-style: none; padding: 0; margin: 0; }
ol.runs li { display: grid; grid-template-columns: 112px minmax(0, 1fr) 200px; gap: 8px 28px; align-items: start;
  padding: 24px 0; border-top: 1px solid var(--line); }
ol.runs .date { color: var(--muted); font-variant-numeric: lining-nums tabular-nums; padding-top: 6px; }
ol.runs a.t { font: 700 28px/1.2 var(--serif); color: var(--ink); text-decoration: none; }
ol.runs a.t:hover { color: var(--accent); }
ol.runs p { margin: 6px 0 0; color: var(--ink-2); max-width: 60ch; }
ol.runs .model { font-size: 15px; color: var(--muted); }
ol.runs .chart.spark-line { width: 200px; max-width: 100%; }
td.run { white-space: nowrap; }
ol.runs .cash small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
footer.end { margin: 88px auto 0; padding-block: 18px calc(env(safe-area-inset-bottom, 0px) + 40px); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 15px; max-width: 1180px; }
footer.end p { margin: 0; max-width: 80ch; }

@media (max-width: 1000px) {
  .cast { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .hero .lede, .front .lede { font-size: 18px; }
  .cast, .front .cast { gap: 14px 10px; }
  .cast .name { font-size: 14px; } .cast .sub { font-size: 12px; } .front .cast .sub { display: none; }
  .stats { gap: 12px 28px; } .stats dd { font-size: 26px; }
  .analysis { font-size: 18px; }
  .report h2 { font-size: 28px; margin-top: 52px; }
  ul.story li { grid-template-columns: 52px minmax(0, 1fr); } ul.story .chip { display: none; }
  table.env td:first-child { width: auto; }
  ol.runs li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  ol.runs .date { padding-top: 0; }
  .street { height: 112px; } .street img { height: 100px; margin-right: -18px; } .street img:nth-child(odd) { height: 88px; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .street img { filter: brightness(0.82) saturate(0.9); } }
:root[data-theme="dark"] .street img { filter: brightness(0.82) saturate(0.9); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
