/* Palette shared with the figures, so the page and the charts read as one artefact. */
:root {
  --ink:        #1c2529;
  --ink-soft:   #4a565c;
  --ink-faint:  #79868c;
  --bg:         #fbfaf7;
  --card:       #ffffff;
  --rule:       #e3e0d9;
  --slate:      #264653;
  --teal:       #2a9d8f;
  --orange:     #e76f51;
  --measure:    38rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:       #e6e9ea;
    --ink-soft:  #a9b4b8;
    --ink-faint: #7c878c;
    --bg:        #14191c;
    --card:      #1b2225;
    --rule:      #2c3639;
    --teal:      #45b3a4;
    --orange:    #f08a6e;
  }
}

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

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

body {
  margin: 0;
  padding: 4.5rem 1.5rem 6rem;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.62;
  font-variant-numeric: tabular-nums;
}

main { max-width: var(--measure); margin: 0 auto; }
main.wide { max-width: 58rem; }

/* ---------- hero ---------- */

.name {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.4rem;
}

h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
  line-height: 1.22;
  font-weight: 600;
  margin: 0 0 2.6rem;
  letter-spacing: -0.011em;
}

h1 em { font-style: italic; color: var(--teal); }

.lede {
  font-family: Inter, sans-serif;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: -2.1rem 0 2.8rem;
  line-height: 1.55;
}

/* ---------- project cards ---------- */

.card, .project {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.9rem 1.75rem 1.6rem;
  margin: 0 0 2.25rem;
}

.card h2, .project h2 {
  font-family: Inter, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.85rem;
}

.finding {
  font-size: 1.1875rem;
  line-height: 1.42;
  margin: 0 0 1.15rem;
  letter-spacing: -0.006em;
}

.finding strong { font-weight: 600; box-shadow: inset 0 -0.42em 0 rgba(42, 157, 143, 0.16); }

.card p, .project p { margin: 0 0 1.15rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-family: Inter, sans-serif;
  font-size: 0.8125rem;
  margin: 0 0 1.3rem;
}

th {
  text-align: right;
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 0 0.45rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: bottom;
}
th:first-child { text-align: left; padding-left: 0; }
th span { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; font-style: italic; }

td { padding: 0.42rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-soft); }
tr:last-child td { border-bottom: none; }
td.n { text-align: right; font-weight: 600; color: var(--ink); white-space: nowrap; padding-left: 0.7rem; }
td.n.hi { color: var(--orange); }

figure { margin: 0 0 1.15rem; }

figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  background: #fff;          /* the figures are drawn on white; keep them legible in dark mode */
  padding: 0.5rem;
}

figcaption {
  font-family: Inter, sans-serif;
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 0.55rem;
  line-height: 1.5;
}

.not-shown {
  font-family: Inter, sans-serif;
  font-size: 0.78125rem;
  color: var(--ink-faint);
  border-left: 2px solid var(--rule);
  padding-left: 0.8rem;
  margin: 0 0 1.3rem;
  line-height: 1.55;
}

.links { font-family: Inter, sans-serif; font-size: 0.8125rem; margin: 0; }
.links a { margin-right: 1.4rem; }

a { color: var(--teal); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: currentColor; }

/* ---------- tail ---------- */

.tail {
  border-top: 1px solid var(--rule);
  margin-top: 3.25rem;
  padding-top: 1.75rem;
  font-family: Inter, sans-serif;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.tail p { margin: 0 0 1rem; }
.tail .contact a { margin-right: 1.4rem; }



/* ---------- index: two cards side by side ---------- */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 0.9rem;
}

@media (min-width: 48rem) {
  .cards { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover { border-color: var(--teal); }

.card .finding { font-size: 1.125rem; }

.card figure { margin-bottom: 1.15rem; }

/* the whole card follows the "read the detail" link; the repo link sits above it */
.card .go { margin: auto 0 0; font-family: Inter, sans-serif; font-size: 0.8125rem; font-weight: 500; }
.card .go a::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.card .go a { border-bottom: none; }
.card:hover .go a { border-bottom: 1px solid currentColor; }

.card .aside {
  position: relative;
  z-index: 1;
  margin: 0.55rem 0 0;
  font-family: Inter, sans-serif;
  font-size: 0.8125rem;
}
.card .aside a { color: var(--ink-faint); }
.card .aside a:hover { color: var(--teal); }

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin: 0.2rem 0 1.5rem;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--rule);
  font-family: Inter, sans-serif;
}

.stats li { display: flex; flex-direction: column; }
.stats b { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
.stats li:first-child b { color: var(--orange); }
.stats span { font-size: 0.6875rem; color: var(--ink-faint); line-height: 1.35; margin-top: 0.2rem; }

/* ---------- detail pages ---------- */

.crumb {
  font-family: Inter, sans-serif;
  font-size: 0.8125rem;
  margin: 0 0 2.4rem;
}
.crumb a { color: var(--ink-faint); }
.crumb a:hover { color: var(--teal); }

.eyebrow {
  font-family: Inter, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.7rem;
}

.detail h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin-bottom: 1.5rem;
}

.detail .lede { margin: 0 0 2.2rem; font-size: 1rem; }

.detail h2 {
  font-family: Inter, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  margin: 2.6rem 0 0.9rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}

.detail p { margin: 0 0 1.15rem; }
.detail figure { margin: 0 0 1.6rem; }
.detail table { margin-bottom: 1.5rem; }

.detail .links { margin-top: 1.6rem; }
.detail .tail { margin-top: 2.75rem; }

@media (max-width: 34rem) {
  body { padding: 3rem 1.1rem 4rem; }
  .card, .project { padding: 1.4rem 1.2rem 1.2rem; }
  .stats { gap: 0.4rem 1.1rem; }
}
