/* Results page.

   Colour carries one meaning everywhere: amber is what there is to build, blue is what is built,
   grey is the middle. It is only ever worn by a mark (a square, a band, a bar, a shape on the body),
   and the words and numbers beside it stay in ink. The five steps were checked for colour-blind
   readers and for contrast on both the black and the white page.

   Two modes, Night and Paper. One typeface. Every chart is a ruler. Phone first. */

:root {
  --font: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --pad: 24px;
  --gap: clamp(112px, 19vh, 220px);
  --bar: 60px;

  /* Night */
  color-scheme: dark;
  --bg: #000;
  --fg: #fff;
  --mid: #a6a6a6;
  --low: #777;
  --line: rgba(255, 255, 255, .17);
  --tick: rgba(255, 255, 255, .46);
  --edge: rgba(255, 255, 255, .36);
  --field: rgba(255, 255, 255, .06);
  --grid: rgba(255, 255, 255, .055);
  --t1: #ffb84d;   /* Undeveloped */
  --t2: #bf7f36;   /* Lagging */
  --t3: #777774;   /* Solid */
  --t4: #3f93cc;   /* Strong */
  --t5: #84ceff;   /* Elite */
  --pri: #ffb84d;  /* priorities and added work */
  --accent: #84ceff;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-o: .05;
}
:root[data-theme="light"] {
  /* Paper */
  color-scheme: light;
  --bg: #fff;
  --fg: #0b0b0c;
  --mid: #4f5357;
  --low: #6b7075;
  --line: rgba(0, 0, 0, .14);
  --tick: rgba(0, 0, 0, .5);
  --edge: rgba(0, 0, 0, .42);
  --field: rgba(0, 0, 0, .04);
  --grid: rgba(0, 0, 0, .05);
  --t1: #7f3f00;
  --t2: #b06b10;
  --t3: #959592;
  --t4: #2c80b4;
  --t5: #0a4f8c;
  --pri: #a05f08;
  --accent: #0a4f8c;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-o: .045;
}
.t1 { --c: var(--t1); } .t2 { --c: var(--t2); } .t3 { --c: var(--t3); } .t4 { --c: var(--t4); } .t5 { --c: var(--t5); }

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before { content: ""; position: fixed; inset: 0; z-index: 80; pointer-events: none; background-image: var(--grain); opacity: var(--grain-o); }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-weight: inherit; font-size: inherit; }
button { font: inherit; color: inherit; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- marks: the only things that wear the scale's colours ---------- */
.tm { display: inline-block; flex: none; width: 11px; height: 11px; background: var(--c); }
.tm-build { display: inline-block; flex: none; width: 13px; height: 11px; background: var(--fg); clip-path: polygon(0 0, 100% 0, 74% 100%, 26% 100%); }
.tm-aim { display: inline-block; flex: none; width: 12px; height: 12px; border: 2px solid var(--fg); border-radius: 50%; }
.tm-rank {                                              /* three rising bars: where you stand among others */
  display: inline-block; flex: none; width: 11px; height: 11px;
  background:
    linear-gradient(var(--fg), var(--fg)) 0 100% / 3px 4px no-repeat,
    linear-gradient(var(--fg), var(--fg)) 4px 100% / 3px 7.5px no-repeat,
    linear-gradient(var(--fg), var(--fg)) 8px 100% / 3px 11px no-repeat;
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rk { display: block; font-weight: 400; font-size: 14.5px; line-height: 1; color: var(--mid); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- type ---------- */
.h {
  font-weight: 300;
  font-size: clamp(34px, 5.7vw, 66px);
  line-height: 1.06;
  letter-spacing: -.024em;
  max-width: 14em;
  text-wrap: balance;
}
.h3 { font-size: 23px; line-height: 1.25; letter-spacing: -.008em; margin-top: clamp(76px, 11vh, 128px); }
.lead {
  font-weight: 300;
  font-size: clamp(21px, 2.25vw, 28px);
  line-height: 1.36;
  letter-spacing: -.008em;
  max-width: 29em;
  margin-top: 30px;
  text-wrap: pretty;
}
.text { color: var(--mid); max-width: 35em; margin-top: 18px; text-wrap: pretty; }
.small { font-size: 14.5px; line-height: 1.55; color: var(--mid); max-width: 37em; margin-top: 14px; }

/* ---------- bar and menu ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: var(--bar);
  display: flex; align-items: center; gap: 16px;
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 500; font-size: 18px; letter-spacing: .01em; }
.brand-mark {                                            /* the logo: five slices, shoulders to waist */
  flex: none; width: 20px; height: 18px;
  background:
    linear-gradient(var(--fg), var(--fg)) 50% 0% / 100% 2px no-repeat,
    linear-gradient(var(--fg), var(--fg)) 50% 25% / 90.62% 2px no-repeat,
    linear-gradient(var(--fg), var(--fg)) 50% 50% / 81.25% 2px no-repeat,
    linear-gradient(var(--fg), var(--fg)) 50% 75% / 71.88% 2px no-repeat,
    linear-gradient(var(--fg), var(--fg)) 50% 100% / 62.5% 2px no-repeat;
}
.serial { display: none; font-size: 14.5px; color: var(--mid); font-variant-numeric: tabular-nums; }
.where { display: flex; gap: 12px; margin-left: auto; font-size: 14.5px; color: var(--mid); font-variant-numeric: tabular-nums; }
#where-name { color: var(--fg); }
.bar-tools { display: flex; align-items: center; gap: 18px; }
.tool { padding: 8px 0; border: 0; background: none; font-size: 15.5px; cursor: pointer; }
.theme-btn { width: 19px; height: 19px; padding: 0; border: 1.5px solid var(--fg); border-radius: 50%; background: linear-gradient(90deg, var(--fg) 50%, transparent 50%); cursor: pointer; }
.bar-line { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

.menu { position: fixed; right: var(--pad); top: calc(var(--bar) - 2px); z-index: 30; width: min(290px, calc(100vw - var(--pad) * 2)); background: var(--bg); border: 1px solid var(--line); }
.menu[hidden] { display: none; }
.menu button { display: flex; justify-content: space-between; gap: 16px; width: 100%; padding: 14px 16px 15px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.menu button:last-child { border-bottom: 0; }
.menu button:hover { background: var(--field); }
.menu button span { color: var(--mid); }

/* ---------- cover: the report as an issued document ---------- */
.cover {
  position: fixed; inset: 0; z-index: 60;
  display: grid; grid-template-rows: auto 1fr auto; gap: 20px;
  padding: 22px var(--pad) 34px;
  background: var(--bg);
  transition: transform .85s cubic-bezier(.7, 0, .2, 1);
}
.cover.gone { transform: translateY(-101%); }
.cover-top { display: flex; align-items: center; justify-content: space-between; height: 38px; }
.cover-no { font-size: 15.5px; color: var(--mid); font-variant-numeric: tabular-nums; }
.cover-mid { align-self: center; min-width: 0; }
.cover-kind { font-weight: 300; font-size: clamp(22px, 2.7vw, 36px); line-height: 1.1; letter-spacing: -.02em; color: var(--mid); }
.cover-name { font-weight: 200; font-size: clamp(74px, 20vw, 280px); line-height: .86; letter-spacing: -.06em; margin: .08em 0 .12em -.055em; overflow-wrap: anywhere; }
.cover-facts { max-width: 27em; color: var(--mid); }
.cover-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 28px; }
.cover-foot .small { margin: 14px 0 0; }
.seal { display: block; width: clamp(88px, 12vw, 136px); height: auto; }
.seal .ring { fill: none; stroke: var(--line); stroke-width: 12; stroke-dasharray: 1.6 4.16; }
.seal .lit { fill: none; stroke: var(--fg); stroke-width: 12; stroke-dasharray: 1.6 4.16; }
.seal .sweep { fill: none; stroke: #fff; stroke-width: 22; stroke-dasharray: 100; stroke-dashoffset: 100; }
.cover.opening .seal .sweep { stroke-dashoffset: 0; transition: stroke-dashoffset .95s cubic-bezier(.4, 0, .2, 1); }
.seal rect { fill: var(--fg); }
.reg { position: absolute; width: 18px; height: 18px; border: 0 solid var(--line); pointer-events: none; }
.reg-a { left: 10px; top: 10px; border-width: 1px 0 0 1px; }
.reg-b { right: 10px; top: 10px; border-width: 1px 1px 0 0; }
.reg-c { left: 10px; bottom: 10px; border-width: 0 0 1px 1px; }
.reg-d { right: 10px; bottom: 10px; border-width: 0 1px 1px 0; }

/* ---------- page ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 0 var(--pad); }
.index { display: none; }
.chapter { padding-block: var(--gap); }
.hero { min-height: 100svh; padding-top: calc(var(--bar) + 6vh); }
.hero-text { margin-top: clamp(56px, 9vh, 104px); }
.facts { margin-top: 28px; color: var(--low); }

.more { margin-top: 30px; max-width: 760px; }
.more > summary { display: inline-block; border-bottom: 1px solid var(--mid); padding-bottom: 2px; }
.more > summary:hover { border-color: var(--fg); }
.more[open] > summary { margin-bottom: 10px; }

.next-link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 760px; margin-top: clamp(76px, 11vh, 132px); padding: 22px 0 23px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 19px;
}
.next-link span { color: var(--mid); }
.next-link b { font-weight: 400; display: inline-flex; align-items: center; gap: 14px; }
.next-link b::after { content: ""; width: 9px; height: 9px; border: solid var(--fg); border-width: 0 1px 1px 0; transform: rotate(-45deg); }
.next-link:hover { border-color: var(--fg); }

/* ---------- score ---------- */
.hero-top { display: grid; gap: 30px; }
.hero-line { display: block; font-weight: 300; font-size: clamp(30px, 5.2vw, 68px); line-height: 1.04; letter-spacing: -.028em; }
.hero-line.dim { color: var(--mid); }
.hero-num { display: block; font-weight: 200; font-size: clamp(172px, 39vw, 440px); line-height: .8; letter-spacing: -.07em; margin: .035em 0 .055em -.055em; }
.hero-num.counting { font-variant-numeric: tabular-nums; }
.plate { max-width: 440px; border-top: 1px solid var(--line); }
.plate p { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 14px; align-items: center; padding: 15px 0 16px; border-bottom: 1px solid var(--line); }
.plate b { font-weight: 400; font-size: 21px; line-height: 1.2; }
.plate span { font-size: 14.5px; color: var(--mid); text-align: right; }

/* ---------- rulers ---------- */
.ruler { position: relative; max-width: 940px; margin-top: clamp(52px, 8vh, 84px); }
.ruler-track { position: relative; }
.ruler-line { border-top: 1px solid var(--fg); height: 17px; }
.ruler-line svg { display: block; width: 100%; height: 16px; overflow: visible; }
.ruler-line line { stroke: var(--tick); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ruler-line line.maj { stroke: var(--fg); }
.ruler-nums { position: relative; height: 22px; margin-top: 8px; font-size: 13.5px; color: var(--mid); font-variant-numeric: tabular-nums; }
.ruler-nums span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.ruler-nums span.at-start { transform: none; }
.ruler-nums span.at-end { transform: translateX(-100%); }

/* bands: the scale's colours laid along the ruler, so the ruler is its own legend */
.bands { position: relative; height: 6px; margin-bottom: 8px; }
.band { position: absolute; top: 0; height: 100%; background: var(--c); }
.band.grey { background: var(--fg); opacity: var(--o, .3); }
.dot-you, .dot-aim { position: absolute; top: 3px; z-index: 1; width: 13px; height: 13px; border-radius: 50%; transform: translate(-50%, -50%); }
.dot-you { background: var(--fg); box-shadow: 0 0 0 3px var(--bg); }
.dot-aim { background: var(--bg); border: 2px solid var(--fg); box-shadow: 0 0 0 2px var(--bg); }
.dot-aim::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 30px; margin: 2px 0 0 -.5px; background: var(--fg); opacity: .55; }
.band-names { position: relative; height: 20px; margin-top: 4px; font-size: 13.5px; color: var(--low); }
.band-names span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; display: none; }
.band-names span.on { display: block; color: var(--fg); }

.tags { position: relative; }
.tags-top { height: 46px; }
.tags-bottom { height: 52px; margin-top: -17px; }
.tag { position: absolute; white-space: nowrap; font-size: 15px; line-height: 1; transform: translateX(-50%); }
.tag::after { content: ""; position: absolute; left: 50%; width: 1px; margin-left: -.5px; background: currentColor; }
.tag.at-start { transform: none; }
.tag.at-start::after { left: 0; margin-left: 0; }
.tag.at-end { transform: translateX(-100%); }
.tag.at-end::after { left: auto; right: 0; }
.tags-top .tag { bottom: 12px; padding-bottom: 12px; }
.tags-top .tag::after { top: 100%; height: 29px; margin-top: -4px; }
.tags-bottom .tag { top: 0; padding-top: 38px; }
.tags-bottom .tag::after { top: 0; height: 30px; }
.end { position: absolute; top: 26px; font-size: 13.5px; line-height: 1; color: var(--mid); }
.end.at-end { transform: translateX(-100%); }

.has-bands .tag::after { display: none; }
.has-bands .tags-top { height: 40px; }
.has-bands .tags-top .tag { bottom: 16px; padding-bottom: 0; }
.has-bands .tags-bottom { height: 34px; margin-top: 0; }
.has-bands .tags-bottom .tag { top: 9px; padding-top: 0; }
.has-bands .end { top: 9px; }

.ruler-gap { max-width: 620px; }
.segs { position: relative; height: 40px; }
.seg { position: absolute; top: 0; bottom: -1px; display: block; text-align: center; font-size: 16px; line-height: 1; }
.seg::after { content: ""; position: absolute; left: 1px; right: 1px; bottom: 0; height: 4px; background: var(--pri); }
.seg.hot::after, .seg:hover::after { background: var(--fg); }

.ruler-bf .tags-top { height: 14px; }
.range { position: absolute; bottom: -1px; height: 5px; background: var(--fg); }

/* ---------- strengths ---------- */
.statements { margin-top: clamp(48px, 7vh, 76px); max-width: 31em; border-top: 1px solid var(--line); }
.statements li {
  display: grid; grid-template-columns: 11px minmax(0, 1fr); column-gap: 20px; align-items: baseline;
  font-weight: 300; font-size: clamp(22px, 2.5vw, 29px); line-height: 1.3; letter-spacing: -.01em;
  padding: 24px 0 26px; border-bottom: 1px solid var(--line);
}
.statements li::before { content: ""; width: 11px; height: 11px; background: var(--accent); transform: translateY(-.12em); }

/* ---------- priorities ---------- */
.pris { margin-top: clamp(56px, 8vh, 88px); border-top: 1px solid var(--line); }
.pri { border-bottom: 1px solid var(--line); }
.pri > summary {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 14px; column-gap: 16px; row-gap: 12px; align-items: start;
  padding: 30px 0 32px;
}
.pri-main { display: contents; }
.pri-no { grid-column: 1; grid-row: 1 / span 2; font-weight: 200; font-size: 58px; line-height: .78; color: var(--pri); }
.pri-name { grid-column: 2; grid-row: 1; display: block; font-weight: 300; font-size: clamp(27px, 3.1vw, 38px); line-height: 1.08; letter-spacing: -.018em; }
.pri-nums { grid-column: 3; grid-row: 1; display: grid; justify-items: end; gap: 8px; padding-top: 3px; }
.pri > summary .pm { grid-column: 4; grid-row: 1; }
.pri-line { grid-column: 2 / -1; grid-row: 2; display: block; color: var(--mid); max-width: 29em; }
.sc { display: inline-flex; align-items: center; gap: 10px; font-weight: 300; font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.gain { font-size: 14.5px; line-height: 1; color: var(--pri); font-variant-numeric: tabular-nums; white-space: nowrap; }

.pm { position: relative; width: 14px; height: 14px; margin-top: 9px; }
.pm::before, .pm::after { content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: var(--mid); }
.pm::after { transform: rotate(90deg); }
details[open] > summary .pm::after { transform: none; }
summary:hover .pm::before, summary:hover .pm::after { background: var(--fg); }

.detail { padding: 6px 0 48px; }
.standing { margin-bottom: 30px; font-size: 15.5px; line-height: 1.5; color: var(--mid); }
.standing b { font-weight: 400; color: var(--fg); }
.detail-cols { display: grid; gap: 40px; }
.detail h4 { font-size: 14.5px; color: var(--mid); margin-bottom: 14px; }
.plain { display: grid; gap: 12px; max-width: 29em; }
.fixes li { display: grid; gap: 3px; padding: 15px 0; border-top: 1px solid var(--line); }
.fixes li:first-child { border-top: 0; padding-top: 0; }
.fix-name { font-weight: 500; }
.fix-why { color: var(--mid); font-size: 14.5px; line-height: 1.5; }

.note { margin-top: 44px; max-width: 33em; }
.note blockquote { font-weight: 300; font-size: clamp(20px, 2vw, 24px); line-height: 1.42; letter-spacing: -.006em; quotes: "\201C" "\201D"; text-indent: -.44em; }
.note blockquote::before { content: open-quote; }
.note blockquote::after { content: close-quote; }
.note figcaption { margin-top: 14px; font-size: 14.5px; color: var(--mid); }
.note-closing { margin-top: clamp(88px, 13vh, 150px); max-width: 44em; }
.note-closing blockquote { font-size: clamp(25px, 3.2vw, 40px); line-height: 1.26; letter-spacing: -.016em; }
.note-closing figcaption { margin-top: 22px; font-size: 16px; }

/* ---------- body ---------- */
.body-grid { display: grid; gap: 52px; margin-top: clamp(52px, 8vh, 84px); }
.figs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 540px; }
.figs figure { text-align: center; }
.figs figcaption { margin-top: 12px; font-size: 14.5px; color: var(--mid); }
.bodymap { width: 100%; max-width: 250px; height: auto; overflow: visible; }
.bm-base .bm-fill { fill: none; }
.bm-base .bm-edge, .bm-base ellipse { fill: none; stroke: var(--edge); stroke-width: .7; stroke-linejoin: round; }
.bm-region { fill: var(--c, var(--t3)); fill-opacity: .94; stroke: var(--bg); stroke-width: 1.1; stroke-linejoin: round; paint-order: stroke; cursor: pointer; }
.bm-region.t3 { fill-opacity: .58; }
.bm-region.hot { fill-opacity: 1; stroke: var(--fg); stroke-width: 1.2; paint-order: normal; }
.bm-mark { cursor: pointer; }
.bm-mark circle { fill: var(--bg); stroke: var(--fg); stroke-width: 1.1; }
.bm-mark text { fill: var(--fg); font-family: var(--font); font-size: 9.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; max-width: 540px; margin-top: 24px; font-size: 14.5px; color: var(--mid); }
.legend span { display: inline-flex; align-items: center; gap: 9px; }

.body-side .small { margin-top: 0; }
.rowlist { margin-top: 26px; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 11px minmax(0, 1fr) auto 46px 22px; column-gap: 14px; align-items: center; padding: 17px 0; }
a.row, .row-d { border-bottom: 1px solid var(--line); }
.row-name { font-size: 19px; line-height: 1.25; }
.row-tier { font-size: 14.5px; color: var(--mid); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .sc { display: block; font-size: 20px; text-align: right; }
.row .pm { margin-top: 0; justify-self: center; }
.row.hot .row-name, .row-d.hot .row-name { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.pin {
  display: grid; place-items: center; width: 22px; height: 22px;
  border: 1px solid var(--fg); border-radius: 50%; font-size: 12.5px; line-height: 1;
}
.row-line { color: var(--mid); max-width: 29em; padding: 0 0 18px 25px; }
.row-d .detail { padding-top: 8px; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 540px; margin-top: 26px; }
.photo img, .photo-empty { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.photo img { cursor: zoom-in; }
.photo-empty { border: 1px solid var(--line); }
.photo figcaption { margin-top: 9px; font-size: 14.5px; color: var(--mid); }
.zoom { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; padding: 16px; background: var(--bg); cursor: zoom-out; }
.zoom[hidden] { display: none; }
.zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }

.tip {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; white-space: nowrap;
  padding: 6px 11px; background: var(--fg); color: var(--bg); font-size: 14.5px; line-height: 1.3; opacity: 0;
}
.tip.on { opacity: 1; }
.tip b { font-weight: 500; }

/* ---------- frame ---------- */
.frame-grid { display: grid; gap: 30px; margin-top: clamp(48px, 7vh, 76px); }
.fig3d {
  position: relative; width: 100%; max-width: 430px; aspect-ratio: 5 / 6;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px; background-position: center;
}
.fig3d canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.switch { display: inline-flex; margin-top: 16px; border: 1px solid var(--line); }
.switch button { padding: 10px 16px 11px; border: 0; background: none; color: var(--mid); cursor: pointer; font-variant-numeric: tabular-nums; }
.switch button.on { background: var(--fg); color: var(--bg); }
/* the client's own front photo with the two measuring lines on it. The lines keep one bright colour
   in both modes, because they sit on a photo and not on the page. */
.measured { position: relative; width: 100%; max-width: 430px; margin: 0; }
.measured[hidden], .fig3d[hidden] { display: none; }
.measured img { display: block; width: 100%; height: auto; }
.measured .m-line { position: absolute; height: 2px; margin-top: -1px; background: #84ceff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); transform-origin: 0 50%; }
.measured .m-line::before, .measured .m-line::after { content: ""; position: absolute; top: -8px; width: 2px; height: 18px; background: #84ceff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); }
.measured .m-line::before { left: 0; }
.measured .m-line::after { right: 0; }
.measured .m-tag { position: absolute; transform: translateY(calc(-100% - 13px)); padding: 4px 9px 5px; background: var(--bg); color: var(--fg); font-size: 14px; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.frame-side .ruler { margin-top: 0; }
.frame-side .small { margin-top: 18px; }

.rows { max-width: 760px; margin-top: 26px; border-top: 1px solid var(--line); }
.rows-num { margin-top: clamp(56px, 8vh, 84px); }
.rows > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: baseline; padding: 19px 0 20px; border-bottom: 1px solid var(--line); }
.rows dt { font-size: 18.5px; line-height: 1.3; }
.rows dt span { display: block; margin-top: 5px; font-size: 15px; line-height: 1.55; color: var(--mid); max-width: 34em; }
.rows dt .sev { display: inline; margin: 0 0 0 12px; }
.rows dd { display: flex; flex-direction: column; align-items: flex-end; font-weight: 300; font-size: 24px; line-height: 1.1; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rows dd .sc { font-size: 24px; }
.rows dd .aim { display: block; margin-top: 7px; font-weight: 400; font-size: 14px; color: var(--mid); }
.rows dd .rk { margin-top: 11px; font-size: 14px; }
.meter { display: block; width: 120px; height: 4px; margin-top: 10px; background: var(--line); }
.meter i { display: block; height: 100%; background: var(--c); }
.cols .h3 + .small { margin-top: 8px; }
.col-mark { display: inline-block; width: 11px; height: 11px; margin-right: 12px; }
.col-fixed .col-mark { background: var(--t3); }
.col-train .col-mark { background: var(--pri); }

/* ---------- week ---------- */
.days { max-width: 760px; margin-top: clamp(48px, 7vh, 76px); border-top: 1px solid var(--line); }
.days li { display: grid; grid-template-columns: 46px 88px minmax(0, 1fr); column-gap: 12px; align-items: baseline; padding: 15px 0 16px; border-bottom: 1px solid var(--line); }
.day { font-size: 14.5px; color: var(--mid); }
.session { font-weight: 500; }
.focus { font-size: 15.5px; line-height: 1.45; color: var(--mid); }
.rest .session { font-weight: 400; color: var(--low); }

.h3 + .small { margin-top: 8px; }
.sets { max-width: 760px; margin-top: 26px; }
.set { display: grid; grid-template-columns: 96px minmax(0, 1fr) 70px; column-gap: 16px; align-items: center; padding: 11px 0; }
.set-name { font-size: 17px; }
.set-track { position: relative; height: 14px; }
.set-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; margin-top: -.5px; background: var(--line); }
.join { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--mid); transform-origin: 0 50%; }
.dot { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--bg); }
.dot-now { background: var(--bg); border: 1.5px solid var(--mid); }
.dot-new { background: var(--fg); }
.set.up .join, .set.up .dot-new { background: var(--pri); }
.set.down .join { transform-origin: 100% 50%; }
.set.hold .dot-now { display: none; }
.set-nums { font-size: 15px; color: var(--mid); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.set-nums b { font-weight: 500; color: var(--fg); }
.set-axis { align-items: start; padding-top: 8px; }
.set-axis .ruler { display: block; margin-top: 0; max-width: none; }
.set-axis .ruler-line { border-color: var(--line); }
.key { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font-size: 14.5px; color: var(--mid); }
.key span { display: inline-flex; align-items: center; gap: 9px; }
.key i { width: 10px; height: 10px; border-radius: 50%; }
.key .k-now { border: 1.5px solid var(--mid); }
.key .k-up { background: var(--pri); }
.key .k-same { background: var(--fg); }

.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 44px 24px; max-width: 940px; margin-top: 34px; }
.figure-num { font-weight: 200; font-size: clamp(46px, 5.4vw, 68px); line-height: 1; letter-spacing: -.03em; }
.figure-unit { margin-top: 12px; font-size: 16px; line-height: 1.35; }
.figure .small { margin-top: 6px; }

/* ---------- next ---------- */
.ruler-time .tags-bottom { display: none; }
.stages { max-width: 760px; margin-top: 34px; border-top: 1px solid var(--line); }
.stages li { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 16px; align-items: baseline; padding: 17px 0 18px; border-bottom: 1px solid var(--line); }
.when { font-size: 14.5px; color: var(--mid); font-variant-numeric: tabular-nums; }
.what { font-size: 15.5px; line-height: 1.5; color: var(--mid); }
.what b { display: block; margin-bottom: 3px; font-weight: 400; font-size: 19px; line-height: 1.3; color: var(--fg); }

.checks { max-width: 560px; margin-top: 22px; border-top: 1px solid var(--line); }
.checks li { border-bottom: 1px solid var(--line); }
.checks label { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 16px; align-items: center; padding: 15px 0 16px; cursor: pointer; }
.checks input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.box { position: relative; width: 21px; height: 21px; border: 1px solid var(--mid); border-radius: 50%; }
.checks input:checked + .box { background: var(--fg); border-color: var(--fg); }
.checks input:checked + .box::after {
  content: ""; position: absolute; left: 7px; top: 3.5px; width: 5px; height: 10px;
  border: solid var(--bg); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.checks input:checked ~ .check-text { color: var(--mid); text-decoration: line-through; text-decoration-thickness: 1px; }
.checks input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 4px; }

.show { display: grid; gap: 26px; align-items: center; max-width: 760px; margin-top: 30px; }
.show canvas { display: block; width: 150px; height: auto; aspect-ratio: 9 / 16; border: 1px solid var(--line); cursor: pointer; }
.show .lead { margin-top: 0; font-size: clamp(20px, 2vw, 24px); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 36px; margin-top: clamp(64px, 9vh, 100px); }
.btn { display: inline-block; padding: 19px 32px 20px; border: 0; background: var(--fg); color: var(--bg); font-weight: 500; font-size: 17.5px; line-height: 1; cursor: pointer; }
.btn:hover { background: var(--accent); }
:root[data-theme="light"] .btn:hover { color: #fff; }
.textbtn { padding: 3px 0; border: 0; border-bottom: 1px solid var(--mid); background: none; color: var(--mid); cursor: pointer; }
.textbtn:hover { color: var(--fg); border-color: var(--fg); }
.foot { max-width: 46em; margin-top: clamp(88px, 13vh, 150px); }
.foot p { margin-top: 10px; font-size: 13.5px; line-height: 1.6; color: var(--low); }
.foot .more { margin-top: 0; }
.foot .more > summary { border-color: var(--low); color: var(--mid); font-size: 14.5px; }

/* ---------- share card, messages ---------- */
.share { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); overflow: auto; }
.share[hidden] { display: none; }
.share-box { display: grid; gap: 18px; justify-items: center; }
.share-box canvas { display: block; height: min(64vh, 640px); width: auto; aspect-ratio: 9 / 16; border: 1px solid var(--line); }
.share-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 24px; }
.share-tools .btn { padding: 15px 24px 16px; font-size: 16.5px; }
.share-tools label { display: inline-flex; align-items: center; gap: 9px; color: var(--mid); cursor: pointer; }
.share-tools input { width: 17px; height: 17px; accent-color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 78; transform: translateX(-50%); padding: 10px 16px 11px; background: var(--fg); color: var(--bg); font-size: 15px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.on { opacity: 1; }
.resume { position: fixed; left: 50%; bottom: 24px; z-index: 25; transform: translateX(-50%); padding: 12px 18px 13px; border: 1px solid var(--fg); background: var(--bg); white-space: nowrap; cursor: pointer; }
.resume[hidden] { display: none; }

/* ---------- loading and error ---------- */
.state { min-height: 100vh; display: grid; align-content: center; gap: 0; padding: var(--pad); color: var(--mid); }
div.state { color: var(--fg); max-width: 900px; margin: 0 auto; }
.state-ruler { width: min(280px, 60vw); height: 15px; margin-bottom: 18px; border-top: 1px solid var(--fg); background:
  repeating-linear-gradient(to right, var(--tick) 0 1px, transparent 1px 40px) left top / 100% 14px no-repeat,
  repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 8px) left top / 100% 6px no-repeat;
  animation: measure 1.4s cubic-bezier(.2, .7, .1, 1) infinite alternate; transform-origin: 0 50%; }
@keyframes measure { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- phones: the chapter name stays, its count goes, so the bar never runs out of room ---------- */
@media (max-width: 480px) {
  #where-n { display: none; }
  .where { min-width: 0; overflow: hidden; white-space: nowrap; }
}

/* ---------- wider screens ---------- */
@media (min-width: 560px) {
  .serial { display: block; }
  .band-names span { display: block; }
}
@media (min-width: 700px) {
  :root { --pad: 40px; }
  .pri > summary { grid-template-columns: 64px minmax(0, 1fr) auto 14px; column-gap: 24px; }
  .pri-no { font-size: 76px; }
  .pri .detail { padding-left: 88px; }
  .detail-cols { grid-template-columns: 1fr 1fr; gap: 56px; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; max-width: 1000px; }
  .figures { grid-template-columns: repeat(4, 1fr); column-gap: 36px; }
  .stages li { grid-template-columns: 120px minmax(0, 1fr); }
  .set { grid-template-columns: 130px minmax(0, 1fr) 80px; column-gap: 24px; }
  .photos, .figs { gap: 16px; }
  .show { grid-template-columns: 150px minmax(0, 1fr); column-gap: 36px; }
  .reg { width: 26px; height: 26px; }
  .reg-a, .reg-b { top: 16px; } .reg-c, .reg-d { bottom: 16px; } .reg-a, .reg-c { left: 16px; } .reg-b, .reg-d { right: 16px; }
}

@media (min-width: 900px) {
  .hero-top { grid-template-columns: auto minmax(280px, 400px); column-gap: 6vw; align-items: end; justify-content: start; }
  .plate { margin-bottom: 1.6vw; }
  .body-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 72px; align-items: start; }
  .frame-grid { grid-template-columns: minmax(0, 430px) minmax(0, 1fr); column-gap: 72px; align-items: center; }
  .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 20px; max-width: none; }
  .days li { display: block; padding: 18px 0 0; border-bottom: 0; }
  .day, .session, .focus { display: block; }
  .day { margin-bottom: 10px; }
  .focus { margin-top: 6px; font-size: 14.5px; }
}

@media (min-width: 1080px) {
  :root { --pad: 56px; }
  .page { display: grid; grid-template-columns: 132px minmax(0, 1fr); column-gap: 96px; }
  .index { display: block; position: sticky; top: 0; align-self: start; height: 100vh; padding-top: calc(var(--bar) + 6vh + 14px); }
  .index ol { display: grid; gap: 11px; }
  .index a { font-size: 15.5px; line-height: 1.3; color: var(--low); }
  .index a:hover { color: var(--mid); }
  .index a.on { color: var(--fg); }
  .where { display: none; }
  .bar-tools { margin-left: auto; }
}

/* ---------- motion: rulers draw once as their chapter arrives ---------- */
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  /* arriving from the site and going back to it: the next page is drawn across like a ruler passing */
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: none; }
  ::view-transition-new(root) { animation: wipe .75s cubic-bezier(.7, 0, .2, 1) both; }
  .pm::after { transition: transform .2s ease; }
  .anim .ruler .ruler-track, .anim .ruler > .ruler-line { clip-path: inset(-40px 0 -40px 0); transition: clip-path 1s cubic-bezier(.2, .7, .1, 1); }
  .anim .ruler:not(.seen) .ruler-track, .anim .ruler:not(.seen) > .ruler-line { clip-path: inset(-40px 100% -40px 0); }
  .anim .ruler .tags, .anim .ruler .band-names, .anim .ruler .segs, .anim .ruler .ruler-nums { transition: opacity .45s .55s; }
  .anim .ruler:not(.seen) .tags, .anim .ruler:not(.seen) .band-names, .anim .ruler:not(.seen) .segs, .anim .ruler:not(.seen) .ruler-nums { opacity: 0; }
  .anim .measured .m-line { transition: transform .9s cubic-bezier(.2, .7, .1, 1); }
  .anim .measured .m-line + .m-tag + .m-line { transition-delay: .35s; }
  .anim .measured:not(.seen) .m-line { transform: scaleX(0); }
  .anim .measured .m-tag { transition: opacity .4s .9s; }
  .anim .measured:not(.seen) .m-tag { opacity: 0; }
  .anim .sets .join { transition: transform .8s cubic-bezier(.2, .7, .1, 1); }
  .anim .sets:not(.seen) .join { transform: scaleX(0); }
  .anim .sets .dot-new { transition: opacity .3s .6s; }
  .anim .sets:not(.seen) .dot-new { opacity: 0; }
}

/* ---------- print and PDF: always the Paper mode ---------- */
@media print {
  :root, :root[data-theme] {
    color-scheme: light;
    --bg: #fff; --fg: #000; --mid: #474747; --low: #6b6b6b;
    --line: rgba(0, 0, 0, .22); --tick: rgba(0, 0, 0, .5); --edge: rgba(0, 0, 0, .45); --field: rgba(0, 0, 0, .04); --grid: rgba(0, 0, 0, .06);
    --t1: #7f3f00; --t2: #b06b10; --t3: #959592; --t4: #2c80b4; --t5: #0a4f8c; --pri: #a05f08; --accent: #0a4f8c;
    --pad: 0px; --gap: 13mm;
  }
  @page { margin: 15mm 14mm 18mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 11.5pt; }
  body::before, .cover, .menu, .share, .toast, .resume, .zoom, .bar-tools, .where, .bar-line, .index, .tip, .pm, .actions, .next-link, .switch, .show, .screen { display: none !important; }
  body.locked { overflow: visible; }
  .bar { position: static; height: auto; padding: 0 0 6mm; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .serial { display: block; margin-left: auto; }
  .page { display: block; max-width: none; }
  .hero { min-height: 0; padding-top: 4mm; }
  .hero-text { margin-top: 12mm; }
  .hero-line { font-size: 24pt; }
  .hero-num { font-size: 150pt; }
  .h { font-size: 27pt; }
  .more > summary { border: 0; }
  .pri > summary { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .row { grid-template-columns: 11px minmax(0, 1fr) auto 46px 22px; }
  .bodymap { max-width: 150px; }
  .fig3d { max-width: 260px; }
  .measured, .measured[hidden] { display: block !important; max-width: 300px; }
  .measured .m-line { transform: none !important; }
  .measured .m-tag { opacity: 1 !important; }
  .has-photo .fig3d { display: none !important; }
  .ruler .ruler-track, .ruler > .ruler-line { clip-path: none !important; }
  .ruler .tags, .ruler .band-names, .ruler .segs, .ruler .ruler-nums, .sets .dot-new { opacity: 1 !important; }
  .sets .join { transform: none !important; }
  .note blockquote { padding-left: .44em; }          /* a hanging quote mark would fall off the edge of the paper */
  .note-closing { margin-top: 16mm; }
  .note-closing blockquote { font-size: 19pt; }
  .foot { margin-top: 12mm; }
  .chapter { break-before: page; }
  .hero, #strengths, #condition { break-before: auto; }
  h2, h3, summary { break-after: avoid; }
  .fixes li, .note, .rows > div, .set, .figure, .statements li, .stages li, .checks li, .ruler, .figs, .plate, .fig3d, .measured, .keep, .cols, .foot { break-inside: avoid; }
}
