/* QBN 2026 in review. Built on the Panopticon design system (/assets): tokens
   and pn- components come from there, and only the slide layout lives here.
   Sharp corners, hard rules, no soft shadows, colour rationed. */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-display); }
a { color: inherit; }
.pn-bar__logo img { display: block; }

/* --- slides -------------------------------------------------------------- */
.rv-slide {
  min-height: min(calc(100vh - 56px), 940px);   /* capped, so a very tall window does not strand the content */
  display: flex; align-items: center;
  padding: 72px 0;
  border-bottom: var(--bw-rule) solid var(--rule-strong);
  scroll-margin-top: 56px;
}
.rv-slide > .pn-wrap { display: flex; flex-direction: column; gap: 28px; }
.rv-stamps { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.rv-head { font-size: clamp(34px, 5.2vw, 68px); font-weight: 700; letter-spacing: -0.03em; line-height: 0.98; margin: 0; max-width: 16ch; text-wrap: balance; }
.rv-head--wide { max-width: 22ch; }
.rv-lede { font-size: 18px; line-height: 1.45; color: var(--fg-2); margin: 0; max-width: 56ch; }
.rv-lede b { color: var(--fg); font-weight: 600; }
.rv-note { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--fg-3); margin: 0; line-height: 1.6; max-width: 70ch; }
.rv-hot { color: var(--accent); }
.rv-brand { color: var(--brand); }

.rv-cover .rv-head { font-size: clamp(40px, 9.4vw, 124px); letter-spacing: -0.05em; line-height: 0.84; max-width: none; }
.rv-cover .rv-head span { display: block; color: var(--fg-3); font-size: max(0.34em, 20px); letter-spacing: -0.02em; line-height: 1.1; margin-top: 0.3em; }

.rv-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.rv-cols { display: grid; gap: 32px; grid-template-columns: 1fr 1fr; align-items: start; }
.rv-cols--wide { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 760px) { .rv-cols, .rv-cols--wide { grid-template-columns: 1fr; } }
.rv-block { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rv-block > .pn-label { color: var(--fg-3); }

.pn-bigstat__v { font-variant-numeric: tabular-nums; }
.pn-bigstat__delta { color: var(--accent); }
.pn-hero-num__v { font-variant-numeric: tabular-nums; }

/* column chart: months, weekdays, hours */
.rv-colchart { height: 200px; }
.rv-colchart--low { height: 120px; gap: 3px; }
.rv-colchart .pn-colchart__bar { background: var(--fg-3); border-color: transparent; min-height: 1px; }
.rv-colchart .pn-colchart__col.is-peak .pn-colchart__bar { background: var(--accent); }
.rv-colchart .pn-colchart__col.is-peak .pn-colchart__val,
.rv-colchart .pn-colchart__col.is-peak .pn-colchart__lab { color: var(--accent); }
.rv-colchart--low .pn-colchart__val { display: none; }

/* ranked rows */
.rv-ranked .pn-ranked__row { grid-template-columns: 34px minmax(0, 1.3fr) minmax(60px, 1fr) auto; }
.rv-ranked .pn-ranked__fill { background: var(--fg-3); }
.rv-ranked .pn-ranked__row:first-child .pn-ranked__fill { background: var(--accent); }
.rv-ranked .pn-ranked__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-ranked .pn-ranked__name a { text-decoration: none; }
.rv-ranked .pn-ranked__name a:hover { color: var(--accent); }
.rv-ranked .pn-ranked__v small { color: var(--fg-3); font-size: 10px; margin-left: 4px; }
.rv-ranked--plain .pn-ranked__row { grid-template-columns: 34px minmax(0, 1fr) auto; }

.pn-stack__seg + .pn-stack__seg { border-left: 1px solid var(--bg); }

/* a quoted post */
.rv-post { display: flex; flex-direction: column; }
.rv-post .pn-card__body { display: flex; gap: 14px; align-items: flex-start; padding: 14px; }
.rv-post__thumb { width: 96px; height: 96px; object-fit: cover; flex: none; border: 1px solid var(--rule); background: var(--bg-sunken); }
.rv-post__thumb--video { display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--fg-3); }
.rv-post__text { margin: 0; font-size: 14px; line-height: 1.45; color: var(--fg-2); overflow-wrap: anywhere; }
.rv-post__meta { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 12px; border-top: 1px solid var(--rule); font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.rv-post__meta b { color: var(--fg); font-weight: 400; }
.rv-post__meta a { margin-left: auto; text-decoration: none; letter-spacing: 0.1em; }
.rv-post__meta a:hover { color: var(--accent); }
.rv-posts { display: grid; gap: 12px; }

/* people with portraits */
.rv-people { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rv-person { display: flex; flex-direction: column; gap: 8px; text-decoration: none; border: var(--bw) solid var(--rule); padding: 10px; background: var(--bg-raised); cursor: pointer; font: inherit; color: inherit; text-align: left; }
.rv-person:hover { border-color: var(--rule-strong); }
.rv-person:focus-visible, .rv-suggest li:focus-visible, .rv-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rv-person__name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-person__sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--fg-3); line-height: 1.5; }
.rv-person__sub b { color: var(--accent); font-weight: 700; }
.rv-face { aspect-ratio: 1; background: var(--bg-sunken); overflow: hidden; }
.rv-face svg { display: block; width: 100%; height: 100%; }
.rv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rv-link { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.rv-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* --- search ---------------------------------------------------------------- */
.rv-search { position: relative; max-width: 520px; display: flex; flex-direction: column; gap: 10px; }
.rv-search .pn-search { padding: 16px 18px; }
.rv-search input { font-size: 20px !important; }
.rv-search .pn-search:focus-within { border-color: var(--accent); }
.rv-suggest { list-style: none; margin: -10px 0 0; padding: 0; border: var(--bw) solid var(--fg); border-top: none; background: var(--bg-raised); max-height: 300px; overflow: auto; }
.rv-suggest li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 18px; font-family: var(--font-mono); font-size: 13px; cursor: pointer; border-top: 1px solid var(--rule); }
.rv-suggest li small { color: var(--fg-3); font-size: 11px; }
.rv-suggest li[aria-selected="true"], .rv-suggest li:hover { background: var(--solid-bg); color: var(--solid-fg); }
.rv-suggest li[aria-selected="true"] small, .rv-suggest li:hover small { color: inherit; }

/* --- the user: slides on the left, portrait pinned on the right ------------- */
.rv-user { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 34vw); max-width: 1320px; margin: 0 auto; width: 100%; }
.rv-user__slides { min-width: 0; border-right: 1px solid var(--rule); }
.rv-user .rv-slide { min-height: min(86vh, 900px); }
.rv-user .rv-slide > .pn-wrap { max-width: none; }
.rv-portrait { position: sticky; top: 56px; align-self: start; height: min(calc(100vh - 56px), 900px); display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px; }
.rv-portrait__frame { border: var(--bw) solid var(--rule-strong); background: var(--bg-sunken); aspect-ratio: 1; overflow: hidden; }
.rv-portrait__frame svg { display: block; width: 100%; height: 100%; }
.rv-portrait__how { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); text-decoration: none; }
.rv-portrait__how:hover { color: var(--accent); }

@media (max-width: 900px) {
  .rv-user { grid-template-columns: 1fr; }
  .rv-user__slides { border-right: none; order: 2; }
  .rv-portrait { order: 1; position: sticky; top: 56px; z-index: 5; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--rule-strong); }
  .rv-portrait__frame { width: 96px; flex: none; }
  .rv-portrait__frame { width: 72px; }
  .rv-portrait__how { margin-left: auto; }
}

.rv-final .rv-face { max-width: 520px; border: var(--bw) solid var(--rule-strong); }
.rv-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.rv-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-empty { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); letter-spacing: 0.06em; }

/* links that are components, not prose */
.pn-bar a, .pn-btn, .rv-post__meta a { text-decoration: none; }
.rv-lede b.rv-hot { color: var(--accent); }

/* On a wide screen the pinned portrait is already beside the last slide. */
@media (min-width: 901px) {
  .rv-final .rv-face { display: none; }
  .rv-final .rv-cols { grid-template-columns: 1fr; max-width: 560px; }
}

/* phones: the bar keeps to one line, so the pinned portrait sits right under it */
@media (max-width: 700px) {
  .pn-bar__readout { display: none; }
  .rv-slide { padding: 48px 0; }
}

/* column charts shrink to their container instead of pushing the page wide */
.rv-colchart { min-width: 0; max-width: 100%; }
.rv-colchart .pn-colchart__col { min-width: 0; flex: 1 1 0; }
.rv-colchart .pn-colchart__val, .rv-colchart .pn-colchart__lab { white-space: nowrap; }
@media (max-width: 700px) {
  .rv-colchart { gap: 2px; }
  .rv-colchart .pn-colchart__val { display: none; }
  .rv-colchart .pn-colchart__lab { font-size: 8px; letter-spacing: 0; }
}

/* the standing ("top 4%") sits under the figure, so it can never run into it */
.pn-bigstat__row { flex-direction: column; align-items: flex-start; gap: 6px; }

/* badges carry a star */
.rv-star { width: 11px; height: 11px; fill: currentColor; flex: none; }
.rv-badge { display: inline-flex; align-items: center; gap: 6px; }
.rv-star-wrap { display: inline-block; margin-right: 5px; color: var(--accent); vertical-align: -1px; }

/* touching tips: the closest person, portrait left, words right */
.rv-closest { display: grid; grid-template-columns: minmax(96px, 180px) 1fr; gap: 20px; align-items: center; text-align: left; font: inherit; color: inherit; background: var(--bg-raised); border: var(--bw) solid var(--rule-strong); padding: 14px; cursor: pointer; }
.rv-closest:hover { border-color: var(--accent); }
.rv-closest:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rv-closest__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rv-closest__text .pn-label { color: var(--fg-3); }
.rv-closest__name { font-size: clamp(26px, 3.4vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; overflow-wrap: anywhere; }
.rv-closest .rv-lede { font-size: 15px; }

/* how the portrait was built: one slide, stepped through with buttons */
.rv-build__body { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 40px; align-items: center; }
.rv-build__frame { aspect-ratio: 1; border: var(--bw) solid var(--rule-strong); background: var(--bg-sunken); overflow: hidden; }
.rv-build__frame svg { display: block; width: 100%; height: 100%; }
.rv-build__step { display: flex; flex-direction: column; gap: 18px; min-height: 380px; }
.rv-build__part { color: var(--accent); font-size: 14px; }
.rv-build__figure { margin: 0; font-size: clamp(28px, 3.6vw, 48px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; text-wrap: balance; }
.rv-build__score { display: grid; grid-template-columns: auto auto 1fr; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.rv-build__score[hidden] { display: none; }
.rv-build__score .pn-label { color: var(--fg-3); }
.rv-build__score-v { font-family: var(--font-mono); font-size: 22px; font-variant-numeric: tabular-nums; color: var(--accent); }
.rv-build__meter { height: 8px; background: var(--bg-sunken); border: 1px solid var(--rule); }
.rv-build__meter i { display: block; height: 100%; background: var(--accent); }
.rv-build__dots { display: flex; gap: 6px; margin-top: auto; }
.rv-build__dots button { width: 28px; height: 8px; padding: 0; border: 1px solid var(--rule-strong); background: none; cursor: pointer; }
.rv-build__dots button.is-on { background: var(--fg); }
.rv-build__dots button[aria-current="true"] { background: var(--accent); border-color: var(--accent); }
.rv-build .pn-btn:disabled { opacity: 0.35; cursor: default; }
@media (max-width: 760px) {
  .rv-build__body { grid-template-columns: 1fr; gap: 20px; }
  .rv-build__frame { max-width: 300px; }
  .rv-build__step { min-height: 0; }
}
.rv-build__frame[data-stage="0"] :is(#face, #face-light, #cast-shadow),
.rv-build__frame:is([data-stage="0"], [data-stage="1"]) #eyes,
.rv-build__frame:is([data-stage="0"], [data-stage="1"], [data-stage="2"]) #ears,
.rv-build__frame:is([data-stage="0"], [data-stage="1"], [data-stage="2"], [data-stage="3"]) #mouth { display: none; }

.rv-post__text--ours { color: var(--accent); }

/* "What landed": cards side by side, equal height, long text cut after a few lines */
.rv-posts { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.rv-posts .rv-post .pn-card__body { flex: 1; }
.rv-posts .rv-post__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }

/* Stat figures are sized from the width of their own box, so a long number
   (up to nine characters, "1,160,000") always fits inside it. */
.pn-bigstat { container-type: inline-size; min-width: 0; }
.pn-bigstat__v { font-size: clamp(24px, 15cqw, 52px); white-space: nowrap; }
