/* =====================================================================
   Back matter: one page, skills and contact (chapters/90-back.html).
   Linked after css/book.css by tools/assemble.py. Uses only the book's tokens (the end paper,
   --pp-end, lives in css/book.css with the other papers).
   Motion: transform, opacity and stroke dashes only; every pending state sits behind .mo, so no-JS
   and reduced motion show the finished pages.
   ===================================================================== */

/* ------------------------------------------------------------------ SKILLS: the index at the back */
/* Wide screens: a where-used matrix (one column per chapter, leaders run through it).
   Below 1100 px: the bubbles move into the ledger's margin, left of its double rule.
   --kw is the skill-name column, set in body-text units so the small-type column heads line up
   with the rows (an em here would resolve against each element's own font size). */
#skills { --xc: 96px; --kw: calc(10.5 * var(--t-body)); --xb: 46px; }
.xs-body { display: flex; flex-direction: column; padding-left: 100px; }   /* clear the ledger's double margin rule */
.xs-h { margin: 0; padding-bottom: 3vh; font: 700 var(--t-h1)/.85 var(--f-disp); text-transform: uppercase; letter-spacing: .02em; }

/* column heads (decorative: every bubble carries its own chapter name for screen readers) */
.xs-head { position: relative; display: grid; grid-template-columns: calc(var(--kw) + 18px) minmax(0, 1fr) repeat(3, var(--xc)); align-items: end; padding-bottom: 10px; font: 500 var(--t-label)/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.xs-hs { grid-column: 3 / -1; grid-row: 1; display: flex; align-items: center; justify-content: center; gap: 16px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line-2); }
/* the key: one bubble drawn large, "chapter" over the line and "page" under it, so the convention
   explains itself. Its ring keeps the small bubbles' line weight (the viewBox is scaled up).
   Wide screens: it stands out of flow in the empty end of the Covers column, just left of the
   chapter heads and level with their foot, so it adds no height to the head. */
.xs-key { position: absolute; right: calc(3 * var(--xc) + 18px); bottom: 10px; flex: none; display: grid; grid-template-rows: 1fr 1fr; width: 72px; height: 72px; border-radius: 50%; background: var(--paper); font: 600 10.5px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.xs-key .xb-ring { stroke-width: 1.05; }
.xs-key .xb-ring .m { stroke-width: .8; }
.xs-key-c, .xs-key-p { position: relative; display: flex; justify-content: center; }
.xs-key-c { align-items: flex-end; padding-bottom: 7px; color: var(--ink); }
.xs-key-p { align-items: flex-start; padding-top: 7px; font-weight: 500; color: var(--ink-2); }
.xs-hk, .xs-hw { grid-row: 2; }
.xs-hc { grid-row: 2; align-self: start; text-align: center; transition: color .2s; }
.xs-hc b { display: block; margin-bottom: 4px; font: 600 16px/1 var(--f-mono); color: var(--ink); letter-spacing: 0; }

/* the rows */
.xs { margin: 0; border-top: 1.5px solid var(--line); }
.xs-row { position: relative; display: grid; grid-template-columns: var(--kw) minmax(0, auto) minmax(calc(36px + 3 * var(--xc)), 1fr); column-gap: 18px; align-items: center; min-height: 78px; padding: 8px 0; border-bottom: 1px solid rgba(142, 179, 230, .45); transition: background-color .2s; }
.xs-row dt { font: 700 24px/1.05 var(--f-disp); text-transform: uppercase; letter-spacing: .04em; }
.xs-row dd { margin: 0; }
.xs-what { font-size: 18px; line-height: 1.4; }
.xs-what small { display: block; margin-top: 3px; font: italic 400 15px/1.35 var(--f-body); color: var(--ink-2); }

/* the cross-references: a leader runs from the text to the last bubble, through empty columns */
.xs-refs { display: grid; grid-template-columns: minmax(24px, 1fr) repeat(3, var(--xc)); align-items: center; align-self: stretch; }
.xs-lead { grid-row: 1; align-self: center; height: 0; margin: 0 calc((var(--xc) - var(--xb)) / -2) 0 6px; border-top: 2px dotted var(--line-2); transform-origin: 0 50%; }
.l1 .xs-lead { grid-column: 1 / 2; }
.l2 .xs-lead { grid-column: 1 / 3; }
.l3 .xs-lead { grid-column: 1 / 4; }

/* detail-reference bubble: chapter number over the page it starts on (filled in by book.js) */
.xb { position: relative; z-index: 1; grid-row: 1; justify-self: center; display: grid; grid-template-rows: 1fr 1fr; width: var(--xb); height: var(--xb); border-radius: 50%; background: var(--paper); color: var(--ink); text-decoration: none; transition: background-color .2s, color .2s; }
.xb.c1 { grid-column: 2; } .xb.c2 { grid-column: 3; } .xb.c3 { grid-column: 4; }
.xb-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--line); stroke-width: 1.6; transition: stroke .2s; }
.xb-ring .r { stroke-dasharray: 126; }
.xb-ring .m { stroke-dasharray: 40; stroke-width: 1.2; }
.xb-c, .xb-p { position: relative; display: grid; place-items: center; font: 600 15px/1 var(--f-mono); }
.xb-c { padding-top: 7px; }
.xb-p { padding-bottom: 7px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); transition: color .2s; }
.xb:focus-visible { outline-offset: 4px; }

/* marking: pointing at or tabbing to a bubble lights every row that cites that chapter
   (a state, not an animation, so it stays on under reduced motion; transitions are zeroed there) */
.xs-row::before { content: ""; position: absolute; left: -84px; top: 50%; width: 52px; height: 2px; margin-top: -1px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform .25s var(--ease-out); pointer-events: none; }
.xs-body:has(.xb.c1:is(:hover, :focus-visible)) .xs-row:has(.xb.c1),
.xs-body:has(.xb.c2:is(:hover, :focus-visible)) .xs-row:has(.xb.c2),
.xs-body:has(.xb.c3:is(:hover, :focus-visible)) .xs-row:has(.xb.c3) { background-color: rgba(216, 232, 255, .07); }
.xs-body:has(.xb.c1:is(:hover, :focus-visible)) .xs-row:has(.xb.c1)::before,
.xs-body:has(.xb.c2:is(:hover, :focus-visible)) .xs-row:has(.xb.c2)::before,
.xs-body:has(.xb.c3:is(:hover, :focus-visible)) .xs-row:has(.xb.c3)::before { transform: scaleX(1); }
.xs-body:has(.xb.c1:is(:hover, :focus-visible)) .xb.c1,
.xs-body:has(.xb.c2:is(:hover, :focus-visible)) .xb.c2,
.xs-body:has(.xb.c3:is(:hover, :focus-visible)) .xb.c3 { background: var(--ink); color: var(--pp-end); }
.xs-body:has(.xb.c1:is(:hover, :focus-visible)) .xb.c1 .xb-p,
.xs-body:has(.xb.c2:is(:hover, :focus-visible)) .xb.c2 .xb-p,
.xs-body:has(.xb.c3:is(:hover, :focus-visible)) .xb.c3 .xb-p { color: var(--pp-end); }
.xs-body:has(.xb.c1:is(:hover, :focus-visible)) .xb.c1 .xb-ring,
.xs-body:has(.xb.c2:is(:hover, :focus-visible)) .xb.c2 .xb-ring,
.xs-body:has(.xb.c3:is(:hover, :focus-visible)) .xb.c3 .xb-ring { stroke: var(--ink); }
.xs-body:has(.xb.c1:is(:hover, :focus-visible)) .xs-hc.c1,
.xs-body:has(.xb.c2:is(:hover, :focus-visible)) .xs-hc.c2,
.xs-body:has(.xb.c3:is(:hover, :focus-visible)) .xs-hc.c3 { color: var(--ink); }

/* motion: rows stagger in (book.css), then each leader runs out and its bubbles draw:
   the bisector continues the leader, then the ring closes round it */
.mo .xs:not(.in) .xs-lead { transform: scaleX(0); }
.mo .xs.in .xs-lead { transition: transform .6s var(--ease) calc(150ms + var(--i, 0) * 80ms); }
.mo .xs:not(.in) .xb-ring .m { stroke-dashoffset: 40; }
.mo .xs.in .xb-ring .m { transition: stroke-dashoffset .2s linear calc(420ms + var(--i, 0) * 80ms + var(--j, 0) * 140ms); }
.mo .xs:not(.in) .xb-ring .r { stroke-dashoffset: 126; }
.mo .xs.in .xb-ring .r { transition: stroke-dashoffset .55s var(--ease) calc(560ms + var(--i, 0) * 80ms + var(--j, 0) * 140ms); }
.mo .xs-body:has(.xs:not(.in)) .xs-key .m { stroke-dashoffset: 40; }
.mo .xs-body:has(.xs.in) .xs-key .m { transition: stroke-dashoffset .2s linear 200ms; }
.mo .xs-body:has(.xs:not(.in)) .xs-key .r { stroke-dashoffset: 126; }
.mo .xs-body:has(.xs.in) .xs-key .r { transition: stroke-dashoffset .55s var(--ease) 340ms; }

/* ------------------------------------------------------------------ CONTACT: the set's title block */
/* Under the skills index, the page ends as a drawing sheet does: the title block in the lower-right
   corner, plotted, and on the left the end of the book and the way back to the cover. */
.cx-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--s5) var(--s6); margin-top: var(--s6); padding-left: 100px; }
.cx-end { padding-bottom: 6px; }
.cx-end .label { margin: 0; padding-top: var(--s3); border-top: 1px solid rgba(216, 232, 255, .4); max-width: 16em; }
.back-links { margin: var(--s3) 0 0; }
.back-links a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0; font: 500 13px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; }
.cx-block { position: relative; width: min(64vw, 680px); aspect-ratio: 720 / 346; container-type: inline-size; }
.cx-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cx-lines .t-sm { font-size: 13px; letter-spacing: .12em; }
.cx-tall { display: none; }
/* the HTML sits over the plotted cells, in the same proportions as the 720 x 400 drawing */
.cx-title { position: absolute; left: 2.2%; bottom: 64.2%; margin: 0; font: 700 12.5cqi/.8 var(--f-disp); text-transform: uppercase; letter-spacing: .02em; }
.cx-list { position: absolute; left: 0; right: 0; top: 37.57%; bottom: 0; margin: 0; display: grid; grid-template-rows: 25% 25% 50%; }
.cx-row { display: grid; grid-template-columns: 22.222% minmax(0, 1fr); grid-auto-rows: 1fr; min-height: 0; }
.cx-row dd { grid-column: 2; display: flex; align-items: center; min-width: 0; margin: 0; padding: 0 2.4cqi; font: 400 max(15px, 2.75cqi)/1.2 var(--f-body); overflow-wrap: anywhere; }
.cx-name dd { font: 600 3.4cqi/1 var(--f-disp); text-transform: uppercase; letter-spacing: .05em; }
.cx-list a { display: inline-flex; align-items: center; min-height: 44px; }
.cx-list .tbd { font-size: max(12.5px, .78em); margin-left: 6px; }   /* real text: never under the 12.5 px floor */
.cx-list dd > .tbd:first-child { margin-left: 0; }

/* ------------------------------------------------------------------ NARROWER: bubbles in the margin */
@media (max-width: 1099px) {
  .xs-body { padding-left: 0; }
  .cx-body { grid-template-columns: minmax(0, 1fr); padding-left: 94px; }
  .cx-block { order: -1; width: min(100%, 680px); }
  .xs-h { padding-left: 94px; }
  .xs-head { position: relative; display: flex; flex-wrap: wrap; align-content: center; gap: 4px 16px; min-height: 84px; padding: 0 0 12px 94px; letter-spacing: .08em; }
  .xs-hk, .xs-hw { display: none; }
  .xs-hs { display: block; flex-basis: 100%; margin: 0 0 2px; padding: 0; border: 0; text-align: left; }
  .xs-key { left: 2px; top: 0; right: auto; bottom: auto; }   /* centred over the bubbles' 76 px column */
  .xs-hc { text-align: left; }
  .xs-hc b { display: inline; margin: 0 3px 0 0; font-size: 13px; }
  .xs-row { grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 18px; align-items: start; padding: 12px 0; }
  .xs-row dt { grid-column: 2; grid-row: 1; margin-bottom: 4px; }
  .xs-what { grid-column: 2; grid-row: 2; }
  .xs-refs { grid-column: 1; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
  .xs-lead { display: none; }
  .xs-row::before { display: none; }
}

/* ------------------------------------------------------------------ PHONE */
@media (max-width: 760px) {
  #skills { --xb: 44px; }
  .xs-h { padding-bottom: var(--s5); }
  .xs-row dt { font-size: 20px; }
  .xs-what { font-size: 15.5px; }
  .xs-what small { font-size: 13.5px; }
  .xb-c { font-size: 14px; padding-top: 6px; }
  .xb-p { padding-bottom: 6px; }

  /* contact: the tall drawing, the block first and the way back under it */
  .cx-body { grid-template-columns: minmax(0, 1fr); padding-left: 0; margin-top: var(--s7); }
  .cx-block { order: -1; width: 100%; aspect-ratio: 340 / 306; }
  .cx-wide { display: none; }
  .cx-tall { display: block; }
  .cx-title { left: 3.5%; bottom: 75.2%; font-size: 15cqi; }
  .cx-list { top: 29.4%; }
  .cx-row { grid-template-columns: 30.588% minmax(0, 1fr); }
  .cx-row dd { padding: 0 3.6cqi; font-size: max(15px, 4.7cqi); }
  .cx-name dd { font-size: 5.6cqi; }
}

/* ------------------------------------------------------------------ what I can do (per skill)
   An arrow under each skill opens a short note across the row; the arrow turns, the note's height
   animates (js/book.js smoothDetails) and the text fades down into place. */
.xs-more { grid-column: 1 / -1; margin: -4px 0 4px; }
.xs-det { interpolate-size: allow-keywords; }
.xs-det summary { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding-right: 10px; cursor: pointer; list-style: none; font: 600 11.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.xs-det summary::-webkit-details-marker { display: none; }
.xs-det summary:hover, .xs-det[open] summary { color: var(--ink); }
.xs-det .part-arr { position: relative; width: 28px; height: 28px; margin: 0; border: 1.5px solid var(--line-2); border-radius: 50%; transition: transform .45s var(--ease), border-color .2s; }
.xs-det .part-arr::before { content: ""; position: absolute; left: 50%; top: 45%; width: 7px; height: 7px; border-right: 1.8px solid var(--ink); border-bottom: 1.8px solid var(--ink); transform: translate(-50%, -50%) rotate(45deg); }
.xs-det summary:hover .part-arr, .xs-det[open] .part-arr { border-color: var(--ink); }
.xs-det[open] .part-arr { transform: rotate(180deg); }
.xs-det p { margin: 0; padding: 2px 0 10px 38px; max-width: 48em; font-size: 17px; line-height: 1.5; color: var(--ink); }
.mo .xs-det p { transition: opacity .35s ease .1s, transform .45s var(--ease) .05s; }
.mo .xs-det:not([open]) p { opacity: 0; transform: translateY(-8px); }
.rm .xs-det .part-arr { transition: none; }
@media (max-width: 760px) {
  .xs-row:has(.xs-more) { grid-template-rows: auto auto auto; }
  .xs-more { grid-column: 2; grid-row: 3; margin: 4px 0 0; }
  .xs-det p { padding-left: 0; font-size: 15.5px; }
}

/* ------------------------------------------------------------------ where you can see it (2026-11-11)
   Readers took the numbered bubbles for 1-3 skill ratings. Each row now ends in plain links named
   after the chapter, with its page. These rules override the bubble matrix above. */
/* 2026-11-12: three columns, skill / what I can do / where I learned it. Rhett learned each skill on
   the projects, so the last column is the links to them. Fixed width so every row lines up with the heads. */
#skills { --xr: 320px; }
.xs-head2 { display: grid; grid-template-columns: var(--kw) minmax(0, 1fr) var(--xr); column-gap: 18px; padding-bottom: 10px; font: 500 var(--t-label)/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
#skills .xs-row { grid-template-columns: var(--kw) minmax(0, 1fr) var(--xr); }
#skills .xs-what { font-size: 17px; line-height: 1.4; }
/* the column's name, for screen readers on wide screens (the heads say it) and shown above the links once the heads are hidden */
#skills .xs-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#skills .xs-refs { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; align-self: center; gap: 8px; }
.xc { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 12px; border: 1px solid var(--line-2); font: 600 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; white-space: nowrap; transition: border-color .2s, background-color .2s; }
.xc:hover, .xc:focus-visible { border-color: var(--ink); background: rgba(216,232,255,.08); }
.xc-p { font-weight: 500; letter-spacing: .04em; color: var(--ink-2); }
@media (max-width: 1100px) {
  .xs-head2 { display: none; }
  #skills .xs-row { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; row-gap: 6px; }
  #skills .xs-row dt, #skills .xs-what, #skills .xs-refs, #skills .xs-more { grid-column: 1; grid-row: auto; }
  #skills .xs-lbl { position: static; width: auto; height: auto; overflow: visible; clip: auto; flex-basis: 100%; font: 500 var(--t-label)/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
  #skills .xs-refs { flex-direction: row; align-items: center; justify-content: flex-start; margin-top: 4px; }
  #skills .xs-more { margin: 0; }
}
