/* Layout: a statistics release, not a landing page. One reading column, numbered figures and tables,
   rules instead of boxes, mono only where digits line up. GhostAvo teal, with a restrained orange seed. */
:root {
  --paper: #ffffff;
  --ink: #10201f;
  --graphite: #465854;
  --quiet: #596e68;
  --rule: #d9e4e0;
  --soft: #f6f9f9;
  --accent: #1e5f58;
  --accent-ink: #164b45;
  --accent-wash: #e4f2ef;
  --teal: #50c1b1;
  --orange: #b4531b;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1080px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

h1, h2, h3 { font-family: var(--sans); margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 3.9vw, 46px); line-height: 1.12; font-weight: 700; max-width: 24ch; }
h2 { font-size: clamp(24px, 2.8vw, 32px); line-height: 1.2; font-weight: 700; max-width: 30ch; }
h3 { font-size: 18px; line-height: 1.3; font-weight: 700; }
p { margin: 0; }

/* Masthead */
.mast { border-bottom: 1px solid var(--ink); }
.mast .wrap { display: flex; align-items: baseline; gap: 10px 28px; flex-wrap: wrap; padding-block: 16px; }
.mast .name { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.mast .what { color: var(--quiet); font-size: 15px; }
.mast nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; font-size: 15px; }
.mast nav a { color: var(--graphite); text-decoration: none; }
.mast nav a:hover { color: var(--ink); text-decoration: underline; }

/* Intro */
.intro { padding-block: 56px 48px; }
.intro .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 40px; align-items: start; }
.intro .text { display: grid; gap: 20px; }
.intro .lead { font-size: 20px; line-height: 1.5; color: var(--graphite); max-width: 52ch; }
.intro .contact-line { font-size: 15.5px; color: var(--graphite); }
.intro .contact-line a { font-weight: 600; }
.intro figure { margin: 0; display: grid; gap: 8px; }
.intro figure img { aspect-ratio: 4 / 5; object-fit: cover; }
.intro figcaption { font-size: 13.5px; line-height: 1.45; color: var(--graphite); }

/* Sections */
section { padding-block: 56px; border-top: 1px solid var(--rule); }
.section-text { display: grid; gap: 12px; margin-bottom: 28px; max-width: 760px; }
.section-text p { color: var(--graphite); font-size: 17.5px; }
.caption { font-size: 15px; margin-bottom: 10px; }
.caption b { font-weight: 700; }
.source { font-size: 13.5px; color: var(--quiet); margin-top: 10px; max-width: 90ch; }

/* Figure 1 */
.figure { position: relative; }
.figure-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#market { width: 100%; min-width: 700px; height: auto; display: block; }
#market text { font-family: var(--sans); }
.legend { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.legend button {
  font: inherit; color: var(--graphite); background: none; border: 0; padding: 4px 2px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; border-bottom: 2px solid transparent;
}
.legend button[aria-pressed="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
.legend svg { flex: none; }
.swipe-hint { display: none; font-size: 13px; color: var(--quiet); margin-top: 6px; }
.tip {
  position: absolute; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4;
  padding: 8px 10px; max-width: 260px; transform: translate(-50%, calc(-100% - 12px)); z-index: 4;
}
.tip b { display: block; }

/* Example cards */
.cards-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.cards-nav { display: flex; gap: 8px; }
.cards-nav button {
  font: inherit; font-size: 15px; width: 40px; height: 40px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer;
}
.cards-nav button:hover { background: var(--soft); }
.cards-nav button:disabled { opacity: 0.3; cursor: default; }
.cards {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(88%, 470px); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.card { scroll-snap-align: start; border-top: 2px solid var(--ink); padding-top: 12px; display: grid; gap: 10px; align-content: start; }
.card .fig { font-size: 13.5px; color: var(--quiet); }
.card h3 { font-size: 19px; }
.card svg { width: 100%; height: auto; display: block; }
.card svg text { font-family: var(--sans); }
.card .how { font-size: 14.5px; color: var(--graphite); }
.card .src { font-size: 13px; color: var(--quiet); }

/* Tables */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.data th, table.data td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); }
table.data thead th { font-size: 13.5px; font-weight: 700; color: var(--ink); border-bottom: 1.5px solid var(--ink); }
table.data td.r, table.data th.r { text-align: right; padding-right: 0; }
table.data td.price { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; padding-right: 0; }
table.data td.when, table.data td.dur { white-space: nowrap; color: var(--graphite); }
/* Time, Paid and Price take only the width of their text, so What you get gets the rest. */
table.data td.when, table.data td.dur, table.data td.price { width: 1%; }
table.data td:first-child { font-weight: 700; }
table.data tr.free td { background: var(--accent-wash); }
table.data tr.free td:first-child { padding-left: 10px; }
table.data tr.free td.price { padding-right: 10px; color: var(--accent-ink); }
.fine { font-size: 14.5px; color: var(--graphite); margin-top: 14px; max-width: 86ch; }
table.data .period { font-family: var(--mono); font-size: 13.5px; font-weight: 400; white-space: nowrap; color: var(--graphite); }

/* Contact */
.contact .wrap { display: grid; gap: 14px; }
.contact p { color: var(--graphite); font-size: 18px; max-width: 58ch; }
.contact dl { margin: 10px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 22px; font-size: 16px; }
.contact dt { color: var(--quiet); }
.contact dd { margin: 0; }

/* Notes and footer */
.notes { font-size: 13.5px; color: var(--quiet); }
.notes ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; max-width: 100ch; }
footer { border-top: 1px solid var(--ink); padding-block: 22px 36px; font-size: 13.5px; color: var(--quiet); }
footer .wrap { display: grid; gap: 8px; }
footer p { margin: 0; }
footer .privacy { max-width: 86ch; }

@media (max-width: 860px) {
  .intro .wrap { grid-template-columns: minmax(0, 1fr); }
  .intro figure { grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 14px; max-width: 420px; }
  .mast nav { display: none; }
  .swipe-hint { display: block; }
}
@media (max-width: 700px) {
  section { padding-block: 44px; }
  table.data thead { display: none; }
  table.data, table.data tbody { display: block; }
  table.data tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  table.data td { display: block; border: 0; padding: 0; }
  table.data td.price { grid-column: 2; grid-row: 1; }
  table.data td:not(:first-child):not(.price) { grid-column: 1 / -1; }
  table.data td.when::before { content: "Paid: "; }
  table.data td.dur::before { content: "Time: "; }
  table.data tr.free { padding: 14px 12px; background: var(--accent-wash); }
  table.data tr.free td { background: none; padding: 0; }
  .criteria td:nth-child(3)::before { content: "Evidence: "; color: var(--quiet); }
}

/* Offer list in the intro, and the who-does-the-work block */
.intro .offer { margin: 6px 0 0; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.intro .offer div { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.intro .offer dt { font-weight: 700; font-size: 16px; }
.intro .offer dd { margin: 2px 0 0; color: var(--graphite); font-size: 15px; line-height: 1.45; }
.intro .wrap { grid-template-columns: minmax(0, 1fr) 320px; }
.who { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; align-items: start; }
.who figure { margin: 0; }
.who img { aspect-ratio: 4 / 5; object-fit: cover; }
@media (max-width: 860px) {
  .intro .wrap { grid-template-columns: minmax(0, 1fr); }
  .who { grid-template-columns: 110px minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 560px) {
  .who { grid-template-columns: minmax(0, 1fr); }
  .who figure { width: 120px; }
}

/* Figure 1: logos placed by industry and type of work */
.logo-scatter { position: relative; min-width: 760px; aspect-ratio: 1000 / 470; }
.logo-scatter svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo-scatter svg text { font-family: var(--sans); }
.ls-logo { position: absolute; display: flex; align-items: center; justify-content: center; outline-offset: 3px; }
/* Logos in their own colours; the one under the pointer or focus stands out as the rest step back. */
.ls-logo img { width: 100%; height: 100%; object-fit: contain; transition: filter .2s, opacity .2s; }
.ls-logo.pale img { filter: grayscale(1) contrast(1.8) brightness(0.45); }
.logo-scatter:has(.ls-logo:hover, .ls-logo:focus-visible) .ls-logo:not(:hover):not(:focus-visible) img { opacity: .35; }
.ls-logo.text { font-size: 11.5px; line-height: 1.2; text-align: center; color: var(--graphite); border: 1px dashed #c9ced5; background: var(--paper); padding: 2px 6px; }
.tip span { display: block; margin-top: 4px; color: #c9ced5; }
@media (prefers-reduced-motion: reduce) { .ls-logo img { transition: none; } }

/* Opening terms line and the three selected cases */
.intro .terms { font-size: 17px; font-weight: 600; color: var(--ink); }
.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.case { border-top: 2px solid var(--ink); padding-top: 12px; display: grid; gap: 8px; align-content: start; }
.case .fig { font-size: 13.5px; color: var(--quiet); }
.case h3 { font-size: 19px; }
.case p { font-size: 15.5px; color: var(--graphite); }
.case .src { font-size: 13.5px; color: var(--quiet); }
@media (max-width: 860px) { .cases { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* Figure 5 as a table */
details.as-table { margin-top: 14px; font-size: 15px; }
details.as-table summary { cursor: pointer; color: var(--accent); }
details.as-table .table-scroll { max-height: 420px; overflow: auto; margin-top: 10px; }
details.as-table table.data { font-size: 14px; }
details.as-table table.data td:first-child { font-weight: 400; }
@media (max-width: 700px) {
  details.as-table table.data { display: table; min-width: 560px; }
  details.as-table table.data thead { display: table-header-group; }
  details.as-table table.data tbody { display: table-row-group; }
  details.as-table table.data tr { display: table-row; padding: 0; }
  details.as-table table.data td { display: table-cell; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); }
}

/* Evidence page */
code { font-family: var(--mono); font-size: 0.9em; }
pre.raw { font-family: var(--mono); font-size: 13px; line-height: 1.5; background: var(--soft); padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; max-width: 100%; }
.steps { margin: 0; padding-left: 24px; display: grid; gap: 22px; max-width: 820px; }
.steps li::marker { font-weight: 700; }
.steps h3 { margin-bottom: 4px; }
.steps p, .runbook p, .runbook li { color: var(--graphite); }
.steps .src-line { font-size: 13.5px; color: var(--quiet); margin-top: 6px; }
.runbook { max-width: 820px; display: grid; gap: 8px; }
.runbook h3 { margin-top: 18px; }
.runbook h3:first-child { margin-top: 0; }
.runbook ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.steps > li, .runbook > * { min-width: 0; }

/* A quiet GhostAvo signature. The illustration is decorative; the offer stays in HTML. */
.mast .wrap { align-items: center; }
.mast .name { display: inline-flex; align-items: center; gap: 9px; line-height: 1.2; }
.mast .name img { flex: none; width: 25px; height: 30px; }
.mast .byline { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; color: var(--graphite); }
.mast .what { font-size: 14px; }
.mast nav { gap: 15px; font-size: 14px; }
.intro { padding-block: 58px 40px; }
.intro .wrap { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 38px 34px; align-items: center; }
.intro .text { gap: 22px; align-self: start; }
.intro .brand-study { align-self: center; }
.brand-study img { width: 100%; height: auto; }
.intro .offer { grid-column: 1 / -1; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; margin: 0; border-top: 1px solid var(--rule); }
.intro .offer div { padding: 20px 0 0; border-bottom: 0; }
.intro .offer dt { color: var(--accent); font-size: 15px; }
.intro .offer dd { font-size: 14px; margin-top: 7px; }
@media (max-width: 860px) {
  .intro .wrap { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 30px 12px; }
  .mast .what { margin-left: auto; }
  .intro .lead { font-size: 18px; }
  .intro .offer { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 26px; }
}
@media (max-width: 600px) {
  .mast .wrap { gap: 12px; }
  .mast .what { max-width: 19ch; font-size: 12px; text-align: right; }
  .intro { padding-block: 38px 30px; }
  .intro .wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .intro .text { gap: 18px; }
  .intro .brand-study { width: min(100%, 300px); justify-self: center; }
  .intro .offer { gap: 12px 22px; }
  .intro .offer div { padding-top: 16px; }
  .intro .offer dt { font-size: 14px; }
  .intro .contact-line { font-size: 14px; }
}

/* Avo on ghost: a contour field flanked by its parameters, three a side. */
.intro .wrap { grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); }
.intro .ghost-lab { display: block; container-type: inline-size; width: 100%; max-width: 460px; justify-self: end; margin: 0; }
.lab-head { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -0.005em; margin-bottom: 6px; }
.lab-grid { display: grid; grid-template-columns: 92px minmax(0, 1fr) 92px; gap: 10px; align-items: center; }
.lab-side { display: grid; gap: 26px; align-content: center; }
.lab-side[hidden], .lab-foot[hidden] { display: none; }
.lab-stage { position: relative; aspect-ratio: 300 / 360; }
.lab-gl, .lab-plot { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lab-plot { touch-action: pan-y; }
.lab-frame path { fill: none; stroke: #9fb6b0; stroke-width: 1; }
.lab-bands path, .lab-pit path { fill-rule: evenodd; }
.lab-bands path + path { stroke: rgba(255, 255, 255, .55); stroke-width: .6; }
.lab-key text { font: 400 9px var(--mono); fill: var(--quiet); font-variant-numeric: tabular-nums; }
.lab-probe line { stroke: var(--ink); stroke-width: .6; stroke-dasharray: 2 3; opacity: .5; }
.lab-probe-text { font: 500 9.5px var(--mono); fill: var(--graphite); font-variant-numeric: tabular-nums; }
.lab-control { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.lab-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.lab-meta label { font-size: 11.5px; line-height: 1.3; color: var(--graphite); white-space: nowrap; }
.lab-meta output { font: 500 10.5px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.lab-control input {
  --p: 50%;
  display: block; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer;
  appearance: none; -webkit-appearance: none;
}
.lab-control input::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--accent) var(--p), #c6d6d2 var(--p)); }
.lab-control input::-moz-range-track { height: 2px; background: #c6d6d2; }
.lab-control input::-moz-range-progress { height: 2px; background: var(--accent); }
.lab-control input::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 13px; height: 13px; margin-top: -5.5px;
  border-radius: 50%; border: 1.5px solid var(--accent); background: var(--paper);
  box-shadow: 0 1px 2px rgba(16, 32, 31, .18); transition: transform .15s ease-out, background-color .15s ease-out;
}
.lab-control input::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--accent); background: var(--paper); box-shadow: 0 1px 2px rgba(16, 32, 31, .18); }
.lab-control input:hover::-webkit-slider-thumb, .lab-control input:active::-webkit-slider-thumb { transform: scale(1.15); background: var(--accent-wash); }
.lab-control input:hover::-moz-range-thumb { background: var(--accent-wash); }
.lab-control.is-driven input::-webkit-slider-thumb { background: var(--accent); transform: scale(1.15); }
.lab-control.is-driven input::-moz-range-thumb { background: var(--accent); }
.lab-control input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.lab-control input:disabled { opacity: .4; cursor: default; }
.lab-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 4px; }
.lab-hint { display: none; margin: 0 auto 0 0; font-size: 12.5px; color: var(--quiet); }
.lab-hint.is-shown { display: block; }
.lab-reset {
  font: 500 12.5px var(--sans); color: var(--accent); background: none; border: 0; padding: 4px 0; min-height: 28px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.lab-reset:hover { color: var(--accent-ink); }
/* Narrow figure: the drawing on top, the two groups of three side by side below it. */
@container (max-width: 420px) {
  .lab-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 24px; }
  .lab-stage { grid-column: 1 / -1; order: -1; width: min(100%, 300px); justify-self: center; }
  .lab-side { gap: 12px; align-content: start; }
  .lab-meta label { font-size: 12.5px; }
  .lab-meta output { font-size: 11.5px; }
  .lab-control input { height: 32px; }
}
@media (max-width: 860px) {
  .intro .wrap { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .intro .wrap { grid-template-columns: minmax(0, 1fr); }
  .intro .ghost-lab { max-width: none; }
}
@media (forced-colors: active) {
  .lab-control input::-webkit-slider-runnable-track { background: CanvasText; }
}
