/* ---------- sections ---------- */
.section { padding-top: clamp(64px, 9vw, 128px); }
.sec-head { margin-bottom: clamp(28px, 4vw, 48px); max-width: 960px; }
.sec-head--row { display: flex; justify-content: space-between; align-items: end; gap: 24px; max-width: none; flex-wrap: wrap; }
.sec-head--row > div { flex: 1 1 420px; min-width: 0; }
.sec-head--row > .btn { flex: none; }

/* the screen: a dark panel whose contents take the monitor's palette, in either theme */
.screen {
  --ink: var(--screen-ink); --ink-2: var(--screen-ink-2); --muted: var(--screen-muted);
  --line: var(--screen-line); --line-2: var(--screen-line); --surface: var(--screen-bar);
  --ok: var(--screen-ok); --ok-mark: var(--screen-ok); --ok-soft: var(--screen-ok-soft);
  --warn: var(--screen-warn); --warn-mark: var(--screen-warn); --warn-soft: var(--screen-warn-soft);
  --accent: var(--screen-accent); --accent-ink: var(--screen-accent-ink);
  color: var(--ink); color-scheme: dark;
}
.screen :focus-visible { outline-color: var(--screen-accent-ink); }

/* two desks: the blotter on the desk's monitor, at full size. Each row is one control, recorded on
   both desks and matched across; a pair is always read left to right, at every width.
   It clips its corners with overflow: clip, not hidden. A hidden overflow makes the blotter a
   scroll container, and the rows' scroll-linked matching (09-footer-touch-motion-print.css) then
   follows the blotter, which never scrolls, instead of the page: every row froze where it sat, and
   the last one stayed Pending under "5/5 matched". Browsers without clip keep hidden; they have no
   scroll-linked animations either. */
.blotter {
  --pad: clamp(16px, 2.4vw, 30px);
  border: 1px solid var(--screen-edge); border-radius: calc(var(--radius) + 6px); overflow: hidden; overflow: clip;
  background: radial-gradient(55% 45% at 100% 0%, var(--screen-glow), transparent 70%), var(--screen-bg);
  box-shadow: var(--shadow-screen);
}
.blotter-bar { display: flex; align-items: center; gap: 8px 24px; min-height: 46px; padding: 0 var(--pad); background: var(--screen-bar); border-bottom: 1px solid var(--line); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.blotter-app { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.blotter-app i { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.blotter-count { margin-left: auto; color: var(--ok); }
.blotter-cols, .match-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) 184px minmax(0, 1fr); padding-inline: var(--pad); }
.blotter-cols { padding-block: 13px 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .6875rem; }
.blotter-cols span:nth-child(3) { text-align: center; }
.match-row { position: relative; align-items: start; padding-block: 22px 24px; border-bottom: 1px solid var(--line); transition: background-color .2s; }
.match-row:hover { background: var(--screen-focus); }
.match-ref { color: var(--muted); font-variant-numeric: tabular-nums; }
.match-card { min-width: 0; }
.match-card .ref { display: block; margin-bottom: 8px; color: var(--muted); text-wrap: balance; }
.match-row .match-card:last-child .ref { color: var(--accent-ink); }
.match-card h3 { font-size: 1.1875rem; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 6px; }
.match-card p { margin: 0; max-width: 46ch; color: var(--ink-2); font-size: .975rem; }
/* the status sits on the titles' line; a rule runs from one entry to the other behind it */
.match-link { position: relative; display: grid; place-items: center; height: 24px; margin: 25px 18px 0 6px; }
.match-link::before, .match-link::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.match-link::after { height: 2px; margin-top: -.5px; background: var(--ok); transform-origin: left; }
.match-link .pill { grid-area: 1 / 1; position: relative; z-index: 1; box-shadow: 0 0 0 5px var(--screen-bg); }
.match-link .is-pending { opacity: 0; }
.blotter-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; margin: 0; padding: 13px var(--pad) 14px; color: var(--muted); font-size: .6875rem; }
.blotter .match-row:last-of-type { border-bottom-color: var(--line); }
@media (max-width: 900px) and (min-width: 761px) { .blotter-cols, .match-row { grid-template-columns: 64px minmax(0, 1fr) 132px minmax(0, 1fr); } .match-link { margin-inline: 8px; } }
@media (max-width: 760px) {
  /* Narrow screens: the ref and the status head each row, and the pair sits under them side by
     side, ops desk left and build desk right, with a rule between. */
  .blotter-cols, .match-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .blotter-cols span:nth-child(odd) { display: none; }
  .blotter-cols span:last-child { padding-left: 13px; }
  .match-row { grid-template-areas: "ref st" "a b"; row-gap: 12px; padding-block: 16px 18px; }
  .match-ref { grid-area: ref; align-self: center; }
  .match-link { grid-area: st; justify-self: end; height: auto; margin: 0; }
  .match-link::before, .match-link::after { display: none; }
  .match-link .pill { box-shadow: none; }
  .match-card:first-of-type { grid-area: a; padding-right: 12px; }
  .match-card:last-child { grid-area: b; padding-left: 12px; border-left: 1px solid var(--line); }
  .match-card h3 { font-size: 1rem; line-height: 1.25; }
  .match-card p { font-size: .875rem; line-height: 1.45; }
}
@media (max-width: 560px) {
  /* phones: the screen runs edge to edge, so each half of a pair gets the most room it can */
  .blotter { --pad: max(14px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); border-inline: 0; border-radius: 0; }
  .blotter-mode { display: none; }
  .blotter-bar { gap: 8px 14px; }
  .match-card .ref { font-size: .625rem; letter-spacing: .04em; margin-bottom: 6px; }
  .match-card h3 { font-size: .9375rem; margin-bottom: 5px; }
  .match-card p { font-size: .8125rem; line-height: 1.42; }
  .match-card:first-of-type { padding-right: 10px; }
  .match-card:last-child { padding-left: 10px; }
}

/* tickets */
.tickets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
/* Six tickets in full rows: FPSLabs (the business) and the skills (the rulebook) run the full width,
   and the four products sit between them, two a row and then four. */
@media (min-width: 700px) { .tickets { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ticket--feature, .ticket--wide { grid-column: 1 / -1; } }
@media (min-width: 1200px) { .tickets { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ticket {
  --notch-y: 58px;
  --notch-bg: var(--bg);
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit; box-shadow: var(--shadow-1);
  transition: transform .25s var(--ease-out), box-shadow .25s, border-color .25s;
}
a.ticket:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.ticket::before, .ticket::after {
  content: ""; position: absolute; top: calc(var(--notch-y) - 9px); width: 18px; height: 18px; border-radius: 50%;
  background: var(--notch-bg); border: 1px solid var(--line);
}
.ticket::before { left: -10px; clip-path: inset(0 0 0 50%); }
.ticket::after { right: -10px; clip-path: inset(0 50% 0 0); }
.ticket-head { height: var(--notch-y); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 20px; border-bottom: 1px dashed var(--line); }
.ticket-head .ref { color: var(--muted); }
.ticket-body { padding: 18px 20px 6px; flex: 1; }
.ticket-title { font-size: 1.75rem; line-height: 1; margin-bottom: 6px; text-wrap: balance; }
.ticket-sub { color: var(--accent-ink); font-weight: 600; font-size: .9375rem; margin-bottom: 10px; text-wrap: balance; }
.ticket-body p { color: var(--ink-2); font-size: .975rem; margin-bottom: 14px; }
/* the label never breaks; if it and "Read" do not fit on one line, "Read" moves under it */
.ticket-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 12px 20px 16px; color: var(--muted); }
.ticket-foot > span:first-child { white-space: nowrap; }
.ticket-foot .go { margin-left: auto; }
@media (max-width: 380px) { .ticket-foot > span:first-child { white-space: normal; } } /* the narrowest phones: the label may wrap */
.ticket-foot .go { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; font-size: .875rem; text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
.ticket-foot .go svg { width: 16px; height: 16px; transition: transform .2s var(--ease-out); }
a.ticket:hover .go svg { transform: translateX(3px); }
.ticket-body > p { max-width: 50ch; }
/* A project's ticket: the stub carries the ref, the status and a render of the project's own
   object from the desk, on a ground tinted with the object's colour; the perforation runs
   under it (or beside it, on the two wide tickets). */
.ticket--obj { --hue: var(--accent); --stub-h: 190px; --notch-y: var(--stub-h); }
[data-obj="fpslabs"] { --hue: var(--p-fpslabs); }
[data-obj="briarwatch"] { --hue: var(--p-briarwatch); }
[data-obj="micandmore"] { --hue: var(--p-micandmore); }
[data-obj="renostack"] { --hue: var(--p-renostack); }
[data-obj="pingowl"] { --hue: var(--p-pingowl); }
[data-obj="skills"] { --hue: var(--p-skills); }
.ticket-stub {
  position: relative; height: var(--stub-h); overflow: hidden;
  border-bottom: 1px dashed var(--line); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: radial-gradient(85% 75% at 50% 112%, color-mix(in srgb, var(--hue) var(--stub-mix-2), var(--surface)), color-mix(in srgb, var(--hue) var(--stub-mix), var(--surface)) 78%);
  transition: background-color .3s;
}
.ticket-stub .ticket-head { position: relative; z-index: 1; height: 52px; border-bottom: 0; }
.ticket-stub .ticket-head .ref { color: var(--ink-2); }
.ticket-stub .obj {
  position: absolute; left: 50%; bottom: 4px; width: auto; max-width: 88%; height: calc(100% - 42px);
  object-fit: contain; object-position: 50% 100%; transform: translateX(-50%); transform-origin: 50% 100%;
  transition: transform .5s var(--ease-out); pointer-events: none; user-select: none;
}
a.ticket:hover .ticket-stub .obj { transform: translateX(-50%) scale(1.06); }
a.ticket--obj:hover { border-color: color-mix(in srgb, var(--hue) 55%, var(--line)); }
/* The live object (js/3d/tickets.js): a canvas over the whole stub, drawn from the same stage as the
   picture, that takes the picture's place the first time the ticket is pointed at. The picture stays
   underneath, for print and as the fallback. */
.ticket-stub .obj-live { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; visibility: hidden; }
.ticket-stub.is-live .obj-live { visibility: visible; }
.ticket-stub.is-live .obj { visibility: hidden; }
@media print { .ticket-stub .obj-live { display: none; } .ticket-stub.is-live .obj { visibility: visible; } }
.ticket-stub .on-dark { display: none; }
:root[data-theme="dark"] .ticket-stub .on-dark { display: block; }
:root[data-theme="dark"] .ticket-stub .on-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ticket-stub .on-dark { display: block; }
  :root:not([data-theme="light"]) .ticket-stub .on-light { display: none; }
}
.ticket--obj .ticket-body { padding-top: 20px; }
.ticket--obj .ticket-sub { color: var(--ink); }
@media (min-width: 700px) {
  /* the two wide tickets tear down the side: body on the left, stub on the right */
  .ticket--feature.ticket--obj, .ticket--wide.ticket--obj { --stub-w: clamp(250px, 38%, 400px); display: grid; grid-template-columns: minmax(0, 1fr) var(--stub-w); grid-template-rows: 1fr auto; }
  .ticket--feature .ticket-stub, .ticket--wide .ticket-stub { grid-column: 2; grid-row: 1 / -1; height: auto; min-height: 236px; border-bottom: 0; border-left: 1px dashed var(--line); border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0; }
  .ticket--feature .ticket-body, .ticket--wide .ticket-body { grid-column: 1; grid-row: 1; padding-top: 24px; }
  .ticket--feature .ticket-foot, .ticket--wide .ticket-foot { grid-column: 1; grid-row: 2; }
  .ticket--feature.ticket--obj::before, .ticket--wide.ticket--obj::before { top: -10px; left: auto; right: calc(var(--stub-w) - 9px); clip-path: inset(50% 0 0 0); }
  .ticket--feature.ticket--obj::after, .ticket--wide.ticket--obj::after { top: auto; bottom: -10px; right: calc(var(--stub-w) - 9px); clip-path: inset(0 0 50% 0); }
  .ticket--feature .ticket-title, .ticket--wide .ticket-title { font-size: 2.25rem; }
  .ticket--feature .ticket-stub .obj, .ticket--wide .ticket-stub .obj { height: calc(100% - 52px); bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { a.ticket:hover .ticket-stub .obj { transform: translateX(-50%); } }

.workshop { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px; margin-top: 18px; }
.mini { background: transparent; border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px 22px; }
.mini h3 { font-size: 1.125rem; margin: 8px 0 6px; }
.mini p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.mini .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* Workshop write-ups: closed, the cards sit side by side; once one is open, each card takes a full
   row, and an open one lays its five parts out in two columns. */
.workshop { align-items: start; }
.workshop:has(details[open]) .mini { grid-column: 1 / -1; }
.mini > p { max-width: 50ch; }
details.writeup { margin-top: 14px; border-top: 1px dashed var(--line); }
details.writeup summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent-ink); font-weight: 600; font-size: .9375rem; }
details.writeup summary::-webkit-details-marker { display: none; }
details.writeup summary:hover { text-decoration: underline; text-underline-offset: 3px; }
details.writeup .chev { width: 14px; height: 14px; transition: transform .2s ease; }
details.writeup[open] .chev { transform: rotate(180deg); }
details.writeup:not([open]) .when-open, details.writeup[open] .when-closed { display: none; }
.writeup-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px 48px; padding: 6px 0 4px; }
.writeup-body .span2 { grid-column: 1 / -1; }
.writeup-body h4 { font-family: var(--font-mono); font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.writeup-body p { max-width: 50ch; }
.writeup-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 48px; }
@media (min-width: 760px) {
  .writeup-body, .writeup-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.writeup-list li { color: var(--ink-2); font-size: .95rem; max-width: 50ch; }
.writeup-list b { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { details.writeup .chev { transition: none; } }

/* career strip (home) */
.strip { position: relative; --who: 290px; border-top: 2px solid var(--ink); }
.strip-axis { position: relative; height: 36px; margin: 0 0 0 var(--who); color: var(--muted); }
.strip-axis span { position: absolute; top: 0; bottom: 0; font-family: var(--font-mono); font-size: .6875rem; padding-left: 7px; border-left: 1px solid var(--line); line-height: 36px; }
.strip-rows { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.strip-rows::before { content: ""; position: absolute; top: 0; bottom: 0; left: var(--who); right: 0; pointer-events: none;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: 12.5% 100%; }
.strip-row { position: relative; display: grid; grid-template-columns: var(--who) 1fr; align-items: center; min-height: 58px; border-top: 1px solid var(--line); transition: background-color .2s; }
.strip-row:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.strip-who { display: block; text-decoration: none; padding: 6px 12px 6px 0; line-height: 1.25; }
.strip-who b { display: block; font-size: .9375rem; }
.strip-who small { display: block; color: var(--muted); font-size: .8125rem; }
.strip-who:hover b { text-decoration: underline; text-underline-offset: .2em; }
.strip-track { position: relative; height: 18px; overflow: hidden; }
.strip-bar { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--ink); transform-origin: left; }
.strip-bar.is-client { background: color-mix(in srgb, var(--ink) 50%, var(--bg)); }
.strip-bar.is-now { background: var(--accent); border-radius: 3px 0 0 3px; }
.strip-bar.is-now::after { content: ""; position: absolute; left: 100%; top: 0; bottom: 0; width: 22px; background: linear-gradient(to right, var(--accent), transparent); }
.strip-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; color: var(--muted); font-size: .8125rem; }
.strip-legend i { display: inline-block; width: 18px; height: 8px; border-radius: 2px; margin-right: 8px; vertical-align: 1px; background: var(--ink); }
.strip-legend i.client { background: color-mix(in srgb, var(--ink) 50%, var(--bg)); }
.strip-legend i.now { background: var(--accent); }
/* Phones: each role's name sits above a full-width bar, so the years get the whole width. */
@media (max-width: 760px) {
  .strip { --who: 0px; }
  .strip-axis span:nth-child(even) { display: none; }
  .strip-row { grid-template-columns: minmax(0, 1fr); padding: 10px 0 12px; min-height: 0; }
  .strip-who { padding: 0 0 8px; }
  .strip-who b { font-size: .9375rem; }
  .strip-who small { font-size: .8125rem; }
}

/* contact band */
.band { margin-top: clamp(64px, 9vw, 128px); border-radius: calc(var(--radius) + 6px); border: 1px solid var(--screen-edge); box-shadow: var(--shadow-screen); background: radial-gradient(55% 90% at 100% 0%, var(--screen-glow), transparent 70%), var(--screen-bg); color: var(--band-ink); padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: end; position: relative; overflow: hidden; }
.band h2 { font-family: var(--font-display); font-weight: 800; font-variation-settings: "wdth" 115; letter-spacing: -.02em; font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem); line-height: 1; margin-bottom: 14px; }
.band p { color: color-mix(in srgb, var(--band-ink) 80%, transparent); max-width: 48ch; margin: 0; }
.band .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.band .btn { background: var(--band-btn); color: var(--band-btn-ink); }
.band .btn--ghost { background: transparent; color: var(--band-ink); border-color: color-mix(in srgb, var(--band-ink) 35%, transparent); }
.band .btn--ghost:hover { border-color: var(--band-ink); }
.band .kicker { color: color-mix(in srgb, var(--band-ink) 70%, transparent); }
.band .kicker::before { background: var(--accent); }
/* rings on the dark band: the ghost button takes its own ink, the filled button its own fill */
.band .btn--ghost:focus-visible { outline-color: currentColor; }
.band .btn:not(.btn--ghost):focus-visible { outline-color: var(--band-btn); }
.band::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--band-ink) 22%, transparent); }
@media (max-width: 760px) { .band { grid-template-columns: 1fr; } .band .actions { justify-content: flex-start; } }

