/* The home page's own rules, on top of common.css. */

/* ---------- opening: the claim, a real code, and what it expands to ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--space-7); padding: var(--space-7) 0 var(--space-6); grid-template-areas: "text" "qr" "facts"; }
.hero-text { grid-area: text; }
.hero-qr { grid-area: qr; margin: var(--space-2) 0 var(--space-5); }
.hero-facts { grid-area: facts; }
.hero h1 { font-size: clamp(var(--fs-2xl), 1.4rem + 2.4vw, 2.75rem); max-width: 24ch; }
.hero-text p:not(.lede):not(.eyebrow) { max-width: 40rem; color: var(--fg-1); }
/* one column: the code spans the text column on a phone, and is centred (at most 28rem) when the column is wider */
.hero-qr .qr { width: 100%; max-width: 28rem; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.hero-qr .qr svg { width: 100%; }
.hero-who { font-size: var(--fs-sm); color: var(--fg-2); margin-bottom: var(--space-3); }
@media (min-width: 48rem) {
  .hero { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); grid-template-areas: "text text" "qr facts"; gap: 0 var(--space-6); align-items: start; }
  .hero-qr { margin: var(--space-2) 0 0; }
  .hero-qr .qr { max-width: none; margin: 0; } /* two columns: the code fills its own column */
}
@media (min-width: 64rem) { .hero { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 0 var(--space-7); } }

/* the three stages of one record, as a short sequence down a rule */
ol.stages { list-style: none; margin: 0 0 var(--space-4); padding: 0; max-width: 40rem; border-left: 2px solid var(--brand); }
ol.stages > li { position: relative; margin: 0; padding: var(--space-2) 0 var(--space-3) var(--space-5); display: grid; grid-template-columns: minmax(0, 1fr); }
ol.stages > li::before { content: ""; position: absolute; left: -7px; top: 1.05rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--brand); }
ol.stages > li:last-child::before { background: var(--brand); }
ol.stages .k { font-size: var(--fs-sm); font-weight: 600; color: var(--fg-2); }
ol.stages .v { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
ol.stages .d { font-size: var(--fs-sm); color: var(--fg-2); }

/* ---------- how it works: three layers, numbered because they are a sequence ---------- */
ol.layers { list-style: none; counter-reset: layer; margin: var(--space-4) 0 0; padding: 0; }
ol.layers > li { counter-increment: layer; position: relative; margin: 0 0 var(--space-5); padding-left: 2.75rem; max-width: 50rem; }
ol.layers > li::before { content: counter(layer); position: absolute; left: 0; top: 0; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: var(--fs-sm); display: grid; place-items: center; }
ol.layers h3 { margin-top: 0.1rem; }
.digits { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.digits .pre, .digits .ref { background: var(--fg-1); color: var(--bg); border-radius: 2px; padding: 0 0.2em; }
.digits .more { color: var(--fg-3); font-family: var(--font-sans); white-space: nowrap; }
.hexbytes { word-spacing: 0.15em; word-break: normal; }
pre.excerpt { max-height: 22rem; }

/* ---------- what you can do ---------- */
dl.todo dt a { font-weight: 650; }
dl.todo dt { color: var(--fg-1); font-size: var(--fs-base); }

/* ---------- results: a dot plot on one log axis, then the table ---------- */
.plot { margin: var(--space-5) 0; max-width: 60rem; }
.plot figcaption { font-size: var(--fs-sm); color: var(--fg-2); max-width: var(--measure); margin-bottom: var(--space-3); }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--fs-sm); margin: 0 0 var(--space-3); }
.legend > span { display: inline-flex; align-items: center; gap: 0.45em; }
.legend .m { position: static; transform: none; }
.legend .sw { display: inline-block; width: 1.2em; height: 0.8em; background: var(--brand-wash); border: 1px solid var(--brand); }
.prow { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); align-items: center; gap: var(--space-3); min-height: 1.9rem; }
.pl { font-size: var(--fs-sm); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptrack { position: relative; height: 1.9rem; }
.ptrack.axis { height: 1.4rem; }
.ptrack .gl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-subtle); }
.ptrack .fits { position: absolute; top: 0; bottom: 0; left: 0; background: var(--brand-wash); opacity: 0.55; }
.ptrack .line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--brand); }
.ptrack .line.l40 { border-left-width: 2px; }
.prow:not(.head):not(.foot) .ptrack { border-bottom: 1px solid var(--border-subtle); }
.tick, .qlabel { position: absolute; bottom: 0; transform: translateX(-50%); font-size: var(--fs-xs); color: var(--fg-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qlabel { top: 0.15rem; bottom: auto; color: var(--brand-ink); font-weight: 600; }
/* the two lines sit close together: each label runs away from the other, ending or starting at its line */
.qlabel.to-left { transform: translateX(calc(-100% - 3px)); }
.qlabel.to-right { transform: translateX(4px); }
.tick:first-child { transform: none; }
.tick:last-child { transform: translateX(-100%); }
/* marks: told apart by shape and lightness, never by hue */
.m { position: absolute; top: 50%; width: 0.8rem; height: 0.8rem; transform: translate(-50%, -50%); display: inline-block; }
.m.card { background: var(--fg-1); border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); z-index: 3; }
.m.deflate { background: var(--bg); border: 2px solid var(--fg-1); z-index: 2; }
.m.fhir { background: var(--fg-3); width: 0.75rem; height: 0.75rem; transform: translate(-50%, -50%) rotate(45deg); opacity: 0.55; z-index: 1; }
.legend .m.fhir { transform: rotate(45deg); }
@media (max-width: 40rem) {
  .prow { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pl { text-align: left; padding-top: var(--space-1); }
  .prow.head .pl, .prow.foot .pl { display: none; }
  .tick.odd { display: none; }
}

table.results { min-width: 46rem; }
table.results .sub { display: block; font-weight: 400; color: var(--fg-2); font-size: var(--fs-xs); max-width: 18rem; }
table.results .tag { margin-left: var(--space-1); }
table.compare { min-width: 34rem; max-width: 56rem; }
table.compare tbody th { width: 10rem; }
table.compare thead th:not(:first-child) { color: var(--fg-1); }
@media (max-width: 40rem) {
  ol.layers > li { padding-left: 0; }
  ol.layers > li::before { position: static; margin-bottom: var(--space-2); }
}
