/* Styled after datadonation.eu: Nunito / Nunito Sans, white pages, blue and coral accents. */
:root {
  --ink: #252a34;
  --text: #333;
  --ink-soft: #6a6a6a;
  --line: #e6e6e6;
  --paper: #fff;
  --card: #fff;
  --tint: #f5f7fb;
  --blue: #4272ef;
  --blue-bg: #e9effd;
  --blue-ink: #2a55c9;
  --coral: #ff5e5e;
  --coral-ink: #e04545;
  --yellow: #ffcf60;
  --yellow-bg: #fff6d6;
  --yellow-ink: #7a5a00;
  --ok: #1d7a4c;
  --ok-bg: #e4f3ea;
  --no: #c23b3b;
  --no-bg: #ffe9e9;
  --radius: 12px;
  --head: "Nunito", "Nunito Sans", -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 17px/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--head);
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); font-weight: 700; margin-top: 2.4em; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-ink); }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1072px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }

/* Draft banner (not part of the D3I look) */
.draft { background: var(--ink); color: #fff; font-size: .85rem; padding: 7px 0; }
.draft .wrap { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.draft a { color: var(--yellow); }

/* Header */
.top { border-bottom: 1px solid var(--line); background: #fff; }
.top .bar { display: flex; align-items: center; gap: 8px 32px; flex-wrap: wrap; min-height: 58px; }
.mark { text-decoration: none; line-height: 1.2; padding: 8px 0; }
.mark b { display: block; font-family: var(--head); font-weight: 800; font-size: 1rem; color: var(--ink); }
.mark span { display: block; font-size: .85rem; color: var(--ink-soft); }
.top nav { display: flex; flex-wrap: wrap; }
.primary { margin-left: auto; align-self: stretch; }
.primary a { display: flex; align-items: center; padding: 8px 20px; color: #50545d; text-decoration: none; font-size: .98rem; }
.primary a:hover { color: var(--ink); background: var(--tint); }
.primary a.active { background: #f5f5f5; color: var(--ink); }
.sub { background: #f8f8f8; border-top: 1px solid var(--line); }
.sub nav { justify-content: center; gap: 0 8px; }
.sub a { padding: 10px 14px; color: var(--ink-soft); text-decoration: none; font-size: .88rem; }
.sub a:hover { color: var(--ink); }
.sub a[aria-current] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--coral); }
body.notes .top nav { margin-left: auto; }
body.notes .mark { font-family: var(--head); font-weight: 800; color: var(--ink); }
body.notes .mark span { display: inline; font-weight: 400; }

/* Page head */
.head { padding: 64px 0 28px; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 44em; }
main { padding-bottom: 80px; }

/* Cards and grids */
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card > :last-child { margin-bottom: 0; }
/* Route rails, as on datadonation.eu's Getting started page */
.card.d3i, .card.eyra, .card.other { border: 0; border-left: 3px solid var(--blue); border-radius: 0; padding: 4px 0 4px 24px; }
.card.eyra { border-left-color: var(--yellow); }
.card.other { border-left-color: #c9ccd2; }
.card ul { padding-left: 1.1em; margin: 0 0 1em; }
.card li { margin-bottom: .35em; }

/* Arrow links, in place of buttons */
.btn, .card > a:last-child {
  display: inline-block;
  color: var(--coral);
  font-family: var(--head);
  font-weight: 700;
  text-decoration: none;
}
.btn::after, .card > a:last-child::after { content: " \2192"; }
.btn:hover, .card > a:last-child:hover { color: var(--coral-ink); text-decoration: underline; }
.actions { display: flex; gap: 10px 24px; flex-wrap: wrap; margin-top: 14px; }

/* Tags */
.tag {
  display: inline-block;
  font-family: var(--body);
  font-size: .76rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
  white-space: nowrap;
  background: #f0f2f5;
  color: #50545d;
}
.tag.d3i { background: var(--blue-bg); color: var(--blue-ink); }
.tag.eyra { background: var(--yellow-bg); color: var(--yellow-ink); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--yellow-bg); color: var(--yellow-ink); }
.tag.no { background: var(--no-bg); color: var(--no); }

/* Callouts */
.note {
  border-left: 3px solid var(--coral);
  background: var(--tint);
  padding: 18px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 26px 0;
}
.note.plain { border-color: var(--blue); }
.note > :last-child { margin-bottom: 0; }
.note strong:first-child { display: block; font-family: var(--head); color: var(--ink); margin-bottom: 2px; }

/* Facts (dl) */
dl.facts { margin: 0 0 1em; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .95rem; }
dl.facts dt { color: var(--ink-soft); }
dl.facts dd { margin: 0; font-weight: 700; color: var(--ink); }

/* Tables */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
thead th { background: var(--tint); font-family: var(--head); font-size: .9rem; color: var(--ink); }
tbody th { font-family: var(--head); font-weight: 700; color: var(--ink); min-width: 190px; }
td .tag { margin-bottom: 4px; }
td small, th small { display: block; font-family: var(--body); color: var(--ink-soft); font-weight: 400; }

/* Stack diagram */
.stack { display: grid; gap: 0; margin: 24px 0; }
.layer { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; position: relative; }
.layer + .layer { margin-top: 30px; }
.layer + .layer::before {
  content: attr(data-link);
  position: absolute;
  top: -27px; left: 30px;
  font-size: .8rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--blue);
  padding-left: 10px;
  height: 24px;
  line-height: 24px;
}
.layer h3 { margin-bottom: 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.layer p { margin: 0; color: var(--ink-soft); }
.layer .split { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.layer .split > div { background: var(--tint); border-radius: 8px; padding: 14px 16px; }
.layer .split h4 { margin: 0 0 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.layer.key { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }

/* Glossary */
.gloss { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 32px; margin: 0; }
.gloss div { padding: 14px 0; border-top: 1px solid var(--line); }
.gloss dt { font-family: var(--head); font-weight: 700; color: var(--ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gloss dd { margin: 4px 0 0; color: var(--ink-soft); }
.gloss .aka { font-size: .85rem; font-style: italic; }

/* Pipeline */
.pipe { list-style: none; padding: 0; margin: 24px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; counter-reset: p; }
.pipe li { counter-increment: p; }
.pipe li::before { content: "0" counter(p); display: block; font-family: var(--head); font-weight: 900; font-size: 2rem; line-height: 1; color: var(--coral); margin-bottom: 6px; }
.pipe h4 { margin: 0 0 4px; }
.pipe p { margin: 0; font-size: .93rem; color: var(--ink-soft); }

/* Catalogue */
.cat { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--line); }
.cat li { display: grid; grid-template-columns: 28px minmax(110px, 1fr) minmax(0, 2fr) auto auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.cat .name { font-weight: 700; color: var(--ink); }
.cat a { overflow-wrap: anywhere; }
.cat .year { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .cat li { grid-template-columns: 28px 1fr auto; }
  .cat a { grid-column: 2 / -1; }
  .cat .tag { grid-column: 2; justify-self: start; }
}

/* Steps */
.step { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; padding: 44px 0; }
.step .n { font-family: var(--head); font-weight: 900; font-size: 3.2rem; color: var(--coral); line-height: 1; margin-bottom: 6px; }
.step .n::before { content: "0"; }
.step h2 { margin-top: 0; }
.shot { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 12px 32px -20px rgba(37, 42, 52, .45); background: #fff; }
.phones { display: flex; gap: 16px; justify-content: center; }
.phones .shot { border-radius: 22px; border: 6px solid var(--ink); max-width: 190px; }
@media (max-width: 760px) {
  .step { grid-template-columns: 1fr; gap: 18px; }
  .primary { margin-left: 0; }
  .primary a { padding: 8px 12px; }
}

/* Routes on home */
.route h3 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.route .where { font-size: .85rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }

.next { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.next a:first-child { color: var(--ink-soft); }

footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: .9rem; color: var(--ink-soft); }
footer .wrap { display: flex; gap: 8px 32px; flex-wrap: wrap; justify-content: space-between; }

/* Notes page (internal, deliberately different) */
body.notes { background: var(--tint); }
body.notes .head { padding-top: 40px; }
.internal { background: var(--no-bg); color: var(--no); font-weight: 700; padding: 8px 14px; border-radius: 8px; display: inline-block; margin-bottom: 14px; font-size: .9rem; }
body.notes ol, body.notes ul { padding-left: 1.2em; }
body.notes li { margin-bottom: .5em; }
body.notes table { border: 1px solid var(--line); }
