/* Page CSS for lancekeay.com, on top of the kit's system.css. Only what the kit lacks. */

/* ---------- home: latest posts (peek-list) */
.posts-peek .rows__name { font-family: var(--font-display); font-weight: 400; font-size: var(--t-card); line-height: 1.3; letter-spacing: -0.01em; }
.posts-peek .rows__value { color: var(--muted); font-size: var(--t-small); padding-top: 4px; }
.posts-peek > li > p { color: var(--ink); }
.post-link { color: inherit; text-decoration: none; }
.latest-foot { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); margin-top: var(--s-5); }
.latest-foot p { margin: 0; }
@media (max-width: 1279px) { .posts-peek > li { padding-block: var(--s-3); } .posts-peek .rows__name { font-size: 18px; } }
@media (max-width: 639px) { #latest .frame { aspect-ratio: 16 / 9; height: auto; flex: none; } #latest .frame .frame__img { height: 100%; } }

/* ---------- home: contract work on the dark band */
.hire-list { list-style: none; margin: 0; padding: 0; }
.hire-list > li { padding: 0 0 var(--s-5); margin: 0 0 var(--s-5); border-bottom: 1px solid var(--line); }
.hire-list h3, .hire-list p { margin: 0; }
.hire-list p { margin-top: var(--s-2); color: var(--ink); max-width: 52ch; }
.tool-row { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.tool-row .ic-tile { --tile: 40px; }
.hire-foot { margin: 0; color: var(--ink); }
.hire-text { display: flex; flex-direction: column; }
@media (max-width: 1023px) { #hire .frame { aspect-ratio: 16 / 9; height: auto; margin-top: var(--s-6); } }

/* ---------- inner pages: a reading page is not a stack of screens */
.page { padding-top: calc(var(--nav) + var(--s-9)); padding-bottom: var(--s-9); }
@media (max-width: 639px) { .page { padding-top: calc(var(--nav) + var(--s-7)); padding-bottom: var(--s-8); } }
.page-head { max-width: 760px; }
.page-head h1 { font-size: var(--t-h2); margin: 0; }
.page-head p { font-size: var(--t-lead); line-height: 1.5; margin: var(--s-4) 0 0; }
.sample-note { display: inline-block; margin-top: var(--s-5); padding: var(--s-2) var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: var(--t-small); color: var(--muted); }

/* ---------- posts list and its tag filter */
.filter { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-7) 0 var(--s-6); padding: 0; list-style: none; }
.filter button { font: 500 15px/1 var(--font-text); min-height: 44px; padding: 0 var(--s-5); border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; transition: background-color var(--m-out) var(--m-ease), color var(--m-out) var(--m-ease), border-color var(--m-out) var(--m-ease), transform var(--m-press) var(--m-ease); }
.filter button:hover { border-color: var(--ink); transition-duration: var(--m-in), var(--m-in), var(--m-in), var(--m-press); }
.filter button:active { transform: scale(.97); }
.filter button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter .count { font-variant-numeric: tabular-nums; opacity: .7; margin-left: 6px; }
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-item { display: grid; grid-template-columns: 140px minmax(0, 1fr) 220px; gap: var(--s-2) var(--s-6); padding: var(--s-6) 0; border-bottom: 1px solid var(--line); align-items: start; scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.post-item[hidden] { display: none; }
.post-meta { font-size: var(--t-small); color: var(--muted); display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.post-meta .tag { color: var(--accent); font-weight: 500; }
.post-item h2 { font-size: var(--t-card); font-size: clamp(20px, 1.1vw + 14px, 26px); line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.post-item h2 a { color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size var(--m-slide) var(--m-ease); }
.post-item h2 a:is(:hover, :focus-visible) { background-size: 100% 1px; }
.post-item .verdict { margin: var(--s-3) 0 0; max-width: 62ch; }
.post-item .verdict b { font-weight: 500; }
.post-item .facts { font-size: var(--t-small); color: var(--muted); margin: 0; padding-top: 6px; display: grid; gap: 4px; }
.post-item .facts dt { display: none; }
.post-item .facts dd { margin: 0; }
@media (max-width: 860px) {
  .post-item { grid-template-columns: minmax(0, 1fr); }
  .post-meta { flex-direction: row; gap: var(--s-3); padding-top: 0; }
  .post-item .facts { display: flex; flex-wrap: wrap; gap: 4px var(--s-4); padding-top: 0; }
}

/* ---------- one post */
.post-head { max-width: 820px; }
.post-head .post-meta { flex-direction: row; gap: var(--s-4); padding: 0; margin-bottom: var(--s-4); }
.post-head h1 { font-size: clamp(34px, 2.6vw + 16px, 56px); line-height: 1.08; margin: 0; }
.post-head .standfirst { font-size: var(--t-lead); line-height: 1.55; margin: var(--s-5) 0 0; max-width: 62ch; }
.verdict-card { margin-top: var(--s-8); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5); background: var(--surface); border-radius: var(--r-lg); padding: var(--s-7); }
.verdict-card .vc-main { grid-column: span 5; }
.verdict-card .vc-label { font-size: var(--t-label); font-weight: 500; color: var(--muted); margin: 0 0 var(--s-2); }
.verdict-card .vc-verdict { font-family: var(--font-display); font-size: clamp(24px, 1vw + 18px, 30px); line-height: 1.25; letter-spacing: -0.01em; margin: 0; }
.verdict-card dl { grid-column: 7 / span 6; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-6); }
.verdict-card dt { font-size: var(--t-label); font-weight: 500; color: var(--muted); }
.verdict-card dd { margin: 4px 0 0; font-size: 17px; line-height: 1.45; }
.score { display: inline-flex; gap: 4px; vertical-align: middle; margin-left: var(--s-2); }
.score i { width: 18px; height: 6px; border-radius: 3px; background: var(--line-strong); }
.score i.on { background: var(--accent); }
@media (max-width: 860px) {
  .verdict-card { padding: var(--s-5); grid-template-columns: minmax(0, 1fr); }
  .verdict-card .vc-main, .verdict-card dl { grid-column: 1 / -1; }
}
@media (max-width: 420px) { .verdict-card dl { grid-template-columns: minmax(0, 1fr); } }

.post-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5); margin-top: var(--s-9); }
.post-body .toc { grid-column: 1 / span 3; position: sticky; top: calc(var(--nav) + var(--s-6)); align-self: start; font-size: var(--t-small); }
.post-body .toc p { font-weight: 500; margin: 0 0 var(--s-3); }
.post-body .toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.post-body .toc a { color: var(--muted); text-decoration: none; display: inline-block; padding: 4px 0; position: relative; transition: color var(--m-out) var(--m-ease); }
.post-body .toc a:hover, .post-body .toc a[aria-current="true"] { color: var(--ink); }
.prose { grid-column: 4 / span 7; font-size: 18px; line-height: 1.7; }
.prose h2 { font-size: clamp(26px, 1vw + 20px, 34px); line-height: 1.2; margin: var(--s-8) 0 var(--s-4); scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 20px; margin: var(--s-6) 0 var(--s-2); font-family: var(--font-text); font-weight: 500; letter-spacing: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s-4); max-width: 66ch; }
.prose li { margin-bottom: var(--s-2); }
.prose code, .data-table code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .86em; background: var(--surface); padding: 2px 6px; border-radius: 4px; }
.prose pre { background: var(--p-inv-bg); color: var(--p-inv-ink); padding: var(--s-5); border-radius: var(--r-md); overflow-x: auto; font-size: 14px; line-height: 1.6; margin: 0 0 var(--s-5); }
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
@media (max-width: 1023px) {
  .post-body .toc { display: none; }
  .prose { grid-column: 1 / -1; font-size: 17px; }
}

/* wide comparison table: full wrap width, scrolls inside its own frame on narrow screens, first column stays */
.table-block { margin: var(--s-8) 0; }
.table-block h2 { font-size: clamp(26px, 1vw + 20px, 34px); margin: 0 0 var(--s-3); scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.table-block > p { max-width: 66ch; margin: 0 0 var(--s-5); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; -webkit-overflow-scrolling: touch; }
.table-scroll:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.data-table { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; font-size: 15px; line-height: 1.45; }
.data-table caption { text-align: left; padding: var(--s-4) var(--s-5); font-size: var(--t-small); color: var(--muted); caption-side: bottom; border-top: 1px solid var(--line); }
.data-table th, .data-table td { padding: 14px var(--s-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.data-table thead th { font-size: var(--t-label); font-weight: 500; color: var(--muted); background: var(--p-bg); white-space: nowrap; position: sticky; top: 0; }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody th { font-weight: 500; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { position: sticky; left: 0; background: #fff; box-shadow: 1px 0 0 var(--line); z-index: 1; }
.data-table thead th:first-child { background: var(--p-bg); z-index: 2; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tbody tr:hover td, .data-table tbody tr:hover th { background: color-mix(in oklab, var(--accent) 5%, #fff); }
.data-table tr.pick th, .data-table tr.pick td { background: color-mix(in oklab, var(--accent) 8%, #fff); }
.pill { display: inline-block; font-size: 13px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--surface); color: var(--ink); white-space: nowrap; }
.pill--yes { background: #e3eee6; color: #1f5131; }
.pill--no { background: #f3e4e1; color: #7a2b1f; }
.bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--accent); vertical-align: middle; margin-right: 8px; }
.post-figure { margin: var(--s-6) 0; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 9; }
.post-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-end { margin-top: var(--s-9); padding-top: var(--s-7); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-5); align-items: center; }
.post-end p { margin: 0; font-size: var(--t-lead); max-width: 48ch; }

/* ---------- about / CV */
.cv-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5); }
.cv-grid > .cv-side { grid-column: 1 / span 4; }
.cv-grid > .cv-main { grid-column: 6 / span 7; }
.cv-files { display: grid; gap: var(--s-3); margin-top: var(--s-6); }
.cv-file { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4) var(--s-5); border: 1px solid var(--line-strong); border-radius: var(--r-md); color: var(--ink); text-decoration: none; background: #fff; transition: transform var(--m-out) var(--m-ease), border-color var(--m-out) var(--m-ease), box-shadow var(--m-out) var(--m-ease); min-height: 72px; }
.cv-file:hover { border-color: var(--ink); transition-duration: var(--m-in); }
.cv-file:active { transform: scale(.985); transition-duration: var(--m-press); }
@media (hover: hover) and (pointer: fine) {
  .cv-file:hover { transform: translateY(var(--m-lift)); box-shadow: 0 6px 18px color-mix(in oklab, var(--ink) 8%, transparent); }
  .cv-file:hover .go { transform: translateY(2px); transition-duration: var(--m-in); }
  .cv-file:active { transform: translateY(0) scale(.985); }
}
.cv-file .t { display: flex; flex-direction: column; }
.cv-file .t b { font-weight: 500; }
.cv-file .t span { font-size: var(--t-small); color: var(--muted); }
.cv-file .go { margin-left: auto; transition: transform var(--m-out) var(--m-ease); }
.cv-section { margin-top: var(--s-9); }
.cv-section:first-child { margin-top: 0; }
.cv-section h2 { font-size: clamp(28px, 1.2vw + 20px, 40px); margin: 0 0 var(--s-5); scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.cv-section > p { font-size: 18px; line-height: 1.7; max-width: 62ch; margin: 0 0 var(--s-4); }
.skill-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
.skill-group h3 { font-family: var(--font-text); font-size: 17px; font-weight: 500; margin: 0 0 var(--s-3); letter-spacing: 0; }
.skill-group ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.skill-group li { display: flex; align-items: center; gap: var(--s-3); }
.skill-group .ic-tile { --tile: 32px; }
.xp { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.xp li { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s-2) var(--s-6); padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.xp .when { font-size: var(--t-small); color: var(--muted); padding-top: 4px; }
.xp h3 { font-family: var(--font-text); font-size: 18px; font-weight: 500; margin: 0 0 var(--s-2); letter-spacing: 0; }
.xp p { margin: 0; max-width: 60ch; }
.cv-photo { margin-top: var(--s-7); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 5; }
.cv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 1023px) {
  .cv-grid > .cv-side, .cv-grid > .cv-main { grid-column: 1 / -1; }
  .cv-photo { aspect-ratio: 16 / 9; }
}
@media (max-width: 639px) {
  .skill-groups { grid-template-columns: minmax(0, 1fr); }
  .xp li { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- home hero on a phone: a shorter photograph so both buttons sit on the first screen */
@media (max-width: 639px) { #top > .hero--photo { --photo: 34svh; } }
/* the phone shows the three newest posts; the fourth is one tap away on posts.html */
@media (max-width: 1279px) { .posts-peek > li:nth-child(4) { display: none; } }

/* ---------- inner pages: the footer is the directory only, as tall as it needs */
footer.closing.page-footer { height: auto; min-height: 0; padding: var(--s-8) 0 var(--s-7); border-top: 1px solid var(--line); display: block; }
footer.closing.page-footer > .wrap { height: auto; display: block; }
.footer .footer__h { font: 500 var(--t-small)/1.4 var(--font-text); letter-spacing: 0; color: var(--muted); margin: 0 0 var(--s-4); }
.post-body--after { margin-top: 0; }
.post-head .post-meta .tag { text-decoration: none; }
.page-head .sample-note, .cv-section > .sample-note, .post-head .sample-note { font-size: var(--t-small); line-height: 1.5; max-width: 62ch; }
.table-note { font-size: var(--t-small); color: var(--muted); margin: var(--s-3) 0 0; }
.data-table { min-width: 1180px; }
.data-table th.wide { min-width: 200px; }
.data-table td:last-child { min-width: 200px; }
.cv-photo { aspect-ratio: 4 / 3; }
.latest-col { display: flex; flex-direction: column; }
.hire-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-4); }
.hire-list .tool-row { margin: 0; }
.hire-foot { font-size: var(--t-lead); line-height: 1.5; margin-top: var(--s-3); }
@media (max-width: 1023px) { #hire .hire-grid, #latest .grid { flex: none; } }
@media (max-width: 639px) { .hire-list > li { gap: var(--s-3); padding-bottom: var(--s-4); margin-bottom: var(--s-4); } .hire-list .tool-row .ic-tile { --tile: 32px; } .hire-list .tool-row { gap: 6px; flex-wrap: nowrap; } #hire .frame { aspect-ratio: 2 / 1; } }
.latest-note { margin: var(--s-2) 0 0; color: var(--ink); }
@media (max-width: 639px) { .posts-peek > li:nth-child(3) { display: none; } }
/* the steps stack on a phone: the section takes two whole screens so the next one never peeks in */
@media (max-width: 639px) { main > #method[data-moment]:not(.is-live) { min-height: 200vh; min-height: 200lvh; } }
/* at 320 the bar holds the name and the menu; the CV button is in the hero and the menu sheet */
@media (max-width: 359px) { header.nav .wrap .nav__actions { display: none !important; } }
@media (max-width: 639px) {
  main > #method[data-moment]:not(.is-live) > .mo-pc__grid { height: 100%; align-content: stretch; grid-template-rows: 1fr; }
  #method:not(.is-live) .mo-pc__text { display: flex; flex-direction: column; height: 100%; }
  #method:not(.is-live) .mo-pc__steps { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; }
}

/* ---------- motion (step 2). Tokens come from assets/motion/motion.css (--m-*); nothing here invents a curve.
   Reduced motion: system.css already shortens every animation and transition to near zero; the rules at the
   end also drop the travel so what remains is a colour or opacity change. */

/* inner pages: the head of the page settles in once on load (rare: one per page view). Opacity and an 8px rise,
   staggered 50ms so the eye reads title, line, note, then the content. Never hides anything for longer than the
   animation: no script involved, and the end state is the page as written. */
@keyframes lk-rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="off"]) :is(.page-head, .post-head) > *,
  html:not([data-motion="off"]) :is(.verdict-card, .filter, .cv-files),
  html:not([data-motion="off"]) .post-list > li:nth-child(-n+5) {
    animation: lk-rise 420ms var(--m-ease-enter) both;
    animation-delay: calc(var(--lk-i, 0) * 50ms);
  }
  :is(.page-head, .post-head) > :nth-child(2) { --lk-i: 1; }
  :is(.page-head, .post-head) > :nth-child(3) { --lk-i: 2; }
  :is(.page-head, .post-head) > :nth-child(4), .verdict-card, .filter, .cv-files { --lk-i: 3; }
  .post-list > li:nth-child(1) { --lk-i: 4; } .post-list > li:nth-child(2) { --lk-i: 5; }
  .post-list > li:nth-child(3) { --lk-i: 6; } .post-list > li:nth-child(4) { --lk-i: 7; }
  .post-list > li:nth-child(5) { --lk-i: 8; }
}

/* the review's contents list: a 2px marker slides in beside the section being read (state indication).
   Transitions, so a fast scroll retargets instead of restarting. */
.post-body .toc ol { padding-left: 14px; }
.post-body .toc a::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 2px; border-radius: 1px;
  background: var(--accent); opacity: 0; transform: scaleY(.4); transition: opacity var(--m-out) var(--m-ease), transform var(--m-slide) var(--m-ease); }
.post-body .toc a[aria-current="true"]::before { opacity: 1; transform: none; }
.post-body .toc a:is(:hover, [aria-current="true"]) { transition-duration: var(--m-in); }

/* the wide table: a soft fade on the right edge says "more this way" and leaves once the reader reaches the end */
.table-frame { position: relative; }
.table-frame::after { content: ""; position: absolute; top: 1px; right: 1px; bottom: 1px; width: 48px; pointer-events: none; z-index: 3;
  border-radius: 0 var(--r-md) var(--r-md) 0; background: linear-gradient(to right, rgb(255 255 255 / 0), #fff 85%);
  opacity: 0; transition: opacity var(--m-panel) var(--m-ease); }
.table-frame.is-more::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .post-body .toc a::before { transform: none; transition-property: opacity; }
}
