/* The About page, edited by a human (HY-457, HY-480). Above the heading and
   above each half, the line an AI agency would print, struck out by one
   stroke of a real brush; under it, what Tinta says instead. "Mostly human."
   begins as the agents' square pixels and settles into type, then the
   person's brush paints the line under it. Under the words, the studio's
   roll-top desk opens on the agents at work at night; the page ends on the
   studio's blue wax seal. The pictures are photographs of real material from
   Paper (design/review/2026-11-18-about-built/), the same in both themes.

   The finished page is the markup's default (less motion, and any part the
   script never reaches); js/about.js holds each piece at its start until it
   comes into view, plays it once, and leaves it still. */

/* ---------- The opening ---------- */

.ab-hero {
  display: grid;
  gap: var(--space-12);
}

.ab-hero__words {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

.ab-hero h1 {
  position: relative;
  margin: 0;
}

.ab-hero__lede {
  margin: 0;
  max-width: var(--measure);
  font-size: var(--size-lede);
  line-height: var(--leading-lede);
}

/* On a computer the heading and the paragraph that explains it share a row;
   the struck line takes the whole row above them (HY-480, RB's pick a, the
   correction, 2026-11-19). An editor's correction is written larger than
   the line it corrects, so "Mostly human." grows past the struck line (74px
   at 1280, 96 from 1920) and stays on one line: its column is exactly as
   wide as the heading, and the paragraph takes the rest. Both start at the
   top, so the answer sits right under the line it corrects; the paper
   beside the paragraph's last lines runs down into the desk. Drawings:
   design/review/2026-11-19-about-opening/. */
@media (min-width: 60rem) {
  .ab-hero__words {
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: start;
    column-gap: var(--space-12);
  }

  .ab-hero__words > .ab-struck {
    grid-column: 1 / -1;
  }

  .ab-hero h1 {
    font-size: clamp(4rem, 1rem + 0.045 * var(--grow-w), 6rem);
    letter-spacing: -0.025em;
    white-space: nowrap;
  }

  /* The paragraph's first line sits on the heading's cap height, not on
     its line box, so the two read as one row. */
  .ab-hero__lede {
    padding-top: 0.35em;
  }
}

/* ---------- The struck lines ----------
   The market's words in the page's quieter ink. The opening's is the title
   step at every width, one step below the heading that answers it (RB,
   2026-11-19 06:22: make it "smaller than mostly human"); until then it was
   as large as the heading from 640 up. */

.ab-struck {
  position: relative;
  margin: 0;
  color: var(--ink-muted);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-wrap: balance;
  /* How heavy each pass of the brush lies, in ems of the struck words
     (js/about.js): the smaller the words, the bolder the brush for them. */
  --cross-weight: 0.27;
}

.ab-struck--display {
  --cross-weight: 0.19;
  font-size: var(--size-title);
  line-height: var(--leading-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ab-struck--heading {
  font-size: var(--size-heading);
  line-height: var(--leading-heading);
}

/* The heading under a struck line sits close to it, as a correction does. */
.ab-struck + h2,
.section-heading > .ab-struck + h2 {
  margin-top: var(--space-2);
}

/* Without script the strike is the browser's own line, in the pen's blue;
   with script it is the brush's passes below, on every line of the words. */
html:not(.scripted) .ab-struck {
  text-decoration: line-through;
  text-decoration-color: var(--signature);
  text-decoration-thickness: 0.1em;
}

/* Scratched out: three quick passes of a brush through each line of the
   struck words, tilted a little, side by side (RB, 2026-11-19 06:27). Each
   pass is a photograph of real sumi ink, painted in the pen's blue through
   its own shape, turned to its way across the words and uncovered in the
   direction the hand moved. The ink lies over the words without hiding them:
   on light paper it multiplies, so the words show darker through it; dark
   paper has its own rule below. It may spill past the words; the script
   keeps it inside the page. */
@property --brush {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 104%;
}

.ab-strike,
.ab-underline {
  position: absolute;
  pointer-events: none;
  background: var(--signature);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.ab-strike {
  transform-origin: 0 50%;
  opacity: 0.9;
  mix-blend-mode: multiply;
}

/* Dark paper has its own rule (RB, 2026-11-19 05:11: "the shade of the brush
   strokes looks way lighter"): a screen blend turned the blue pale beside
   the solid blue under "Mostly human.", so here the ink keeps its own blue,
   a little open so the words still show through. */
html[data-theme="dark"] .ab-strike {
  mix-blend-mode: normal;
  opacity: 0.86;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .ab-strike {
    mix-blend-mode: normal;
    opacity: 0.86;
  }
}

.ab-strike--1 {
  -webkit-mask-image: linear-gradient(to right, #000 var(--brush), transparent calc(var(--brush) + 4%)), url("../img/about/cross-1.webp");
  mask-image: linear-gradient(to right, #000 var(--brush), transparent calc(var(--brush) + 4%)), url("../img/about/cross-1.webp");
}

.ab-strike--3 {
  -webkit-mask-image: linear-gradient(to right, #000 var(--brush), transparent calc(var(--brush) + 4%)), url("../img/about/cross-3.webp");
  mask-image: linear-gradient(to right, #000 var(--brush), transparent calc(var(--brush) + 4%)), url("../img/about/cross-3.webp");
}

.ab-strike--5 {
  -webkit-mask-image: linear-gradient(to right, #000 var(--brush), transparent calc(var(--brush) + 4%)), url("../img/about/cross-5.webp");
  mask-image: linear-gradient(to right, #000 var(--brush), transparent calc(var(--brush) + 4%)), url("../img/about/cross-5.webp");
}

/* ---------- "Mostly human." and the brush under it ---------- */

.ab-title__words {
  position: relative;
  display: inline-block;
}

/* The person's brush, under the words: one real stroke that runs dry at its
   own end. */
.ab-underline {
  left: -0.02em;
  top: calc(100% - 0.04em);
  width: calc(100% + 0.18em);
  height: 0.3em;
  -webkit-mask-image: linear-gradient(to right, #000 var(--brush), transparent calc(var(--brush) + 6%)), url("../img/about/brush-underline.webp");
  mask-image: linear-gradient(to right, #000 var(--brush), transparent calc(var(--brush) + 6%)), url("../img/about/brush-underline.webp");
}

/* The agents' first draft of the heading, in square pixels: drawn by the
   script over the words while they settle, then gone. */
.ab-title__pixels {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

/* Held until in view: nothing of a piece shows before it begins. The
   headings are held by opacity, so a screen reader still finds them. */
.ab-title.is-waiting .ab-title__words,
.ab-correct.is-waiting {
  opacity: 0;
}

.ab-mark.is-waiting .mark__ink {
  visibility: hidden;
}

/* ---------- The desk ----------
   A photograph of a roll-top desk at night, its lamp on: the staff works
   day and night, so it is the same picture on both papers. Two Paper
   photographs lined up; the roll is cut from the closed one inside the
   desk's opening only, so nothing outside it moves. The open desk is the
   default; the script shows the closed one only while it waits and plays. */

.desk {
  margin: 0;
  --open: image-set(url("../img/about/desk-open-1x.webp") 1x, url("../img/about/desk-open-2x.webp") 2x);
  --closed: image-set(url("../img/about/desk-closed-1x.webp") 1x, url("../img/about/desk-closed-2x.webp") 2x);
}

.desk__frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.desk__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 var(--border-hairline) var(--image-outline);
  pointer-events: none;
}

.desk__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1376 / 768;
  --px: 2px;
}

/* On a phone the photograph is taken in on the desk itself: the stage is half
   as wide again as the screen and centred, so the wall and the lamp's pole
   fall off both sides and the pigeonholes are big enough to see the staff. */
@media (max-width: 40rem) {
  .desk__stage {
    width: 150%;
    margin-left: -25%;
    --px: 1px;
  }
}

.desk__open,
.desk__closed,
.desk__sheet {
  position: absolute;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.desk__open,
.desk__closed {
  inset: 0;
}

.desk__open {
  background-image: var(--open);
}

/* The closed photograph everywhere but the desk's opening: it gives way to
   the open one late in the roll, while the eye is on the roll. */
.desk__closed {
  background-image: var(--closed);
  clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 21.95% 30.21%, 80.53% 30.21%, 80.53% 85.29%, 21.95% 85.29%, 21.95% 30.21%);
}

/* The roll: the closed photograph's tambour, inside the opening, slides up
   into the desk's top, which hides it. */
.desk__roll,
.desk__front {
  position: absolute;
  left: 21.95%;
  width: 58.58%;
  overflow: hidden;
}

.desk__roll {
  top: 30.21%;
  height: 41.15%;
}

.desk__slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.desk__sheet {
  left: -37.47%;
  top: -73.41%;
  width: 170.71%;
  height: 243.01%;
  background-image: var(--closed);
}

/* Under the roll, the closed desk's front rail: it does not move, it gives
   way to the open desk's leather. */
.desk__front {
  top: 71.35%;
  height: 13.93%;
}

.desk__sheet--front {
  top: -512.2%;
  height: 717.88%;
}

.desk__closed,
.desk__roll,
.desk__front {
  display: none;
}

.desk.is-waiting :is(.desk__closed, .desk__roll, .desk__front),
.desk.is-playing :is(.desk__closed, .desk__roll, .desk__front) {
  display: block;
}

/* Before the roll the room is dark: the lamp switches on with the small
   catch of a real bulb. The dimming is a layer over the photograph, so the
   photograph itself never changes. */
.desk__dark {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 12% 18%, rgb(10 8 6 / 0.55), rgb(6 5 4 / 0.82));
  opacity: 0;
  pointer-events: none;
}

.desk.is-waiting .desk__dark {
  opacity: 1;
}

/* The agents, the site's arrow cursors, drawn in whole squares: two pixels
   a square on a computer, one on a phone, so they stay sharp at every size.
   The classic arrow on every paper: black with a white edge. */
.agent-px {
  display: block;
  width: calc(11 * var(--px, 2px));
  height: calc(17 * var(--px, 2px));
  shape-rendering: crispEdges;
  color: #17191F;
  --paper: #FFFFFF;
}

.desk__staff,
.ab-detail__staff {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.desk__agent,
.ab-detail__staff li {
  position: absolute;
  left: var(--x);
  top: var(--y);
}

/* One of them has drawn a selection round the letters, the way a cursor
   selects on a screen: the box stays when the work stops. */
.desk__select {
  position: absolute;
  left: 59.6%;
  top: 36.2%;
  width: 8.4%;
  height: 10.2%;
  border: 1px dashed rgb(255 255 255 / 0.95);
  outline: 1px solid rgb(23 25 31 / 0.5);
  background: rgb(255 255 255 / 0.08);
  pointer-events: none;
}

.desk.is-waiting :is(.desk__agent, .desk__select) {
  opacity: 0;
}

/* ---------- The two halves: the human part, and the agents' ---------- */

.ab-halves {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-16);
}

@media (min-width: 60rem) {
  .ab-halves {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.ab-half > * {
  margin: 0;
}

.ab-half > * + * {
  margin-top: var(--space-5);
}

.ab-half > h2 + p {
  margin-top: var(--space-6);
}

.ab-half p {
  max-width: var(--measure);
}

/* Each half's close-up of the desk, the same photograph in both themes. */
.ab-detail {
  position: relative;
  margin-bottom: var(--space-6);
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 1100 / 614;
}

.ab-detail::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 var(--border-hairline) var(--image-outline);
  pointer-events: none;
}

.ab-detail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ab-detail__staff {
  --px: 2px;
}

/* ---------- The name ----------
   On a wide screen the plate moves beside the words, so the row ends on the
   picture instead of on empty paper (Alma's note on HY-453 at 1920). */

.ab-plate {
  max-width: 20rem;
}

@container (min-width: 85rem) {
  .l-split > .ab-name__inner {
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr);
    grid-template-rows: auto;
  }

  .ab-name__inner > .split-art {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    max-width: 24rem;
  }

  .ab-name__inner > :nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
}

/* ---------- The seal, at the page's end ----------
   RB's kept piece from the footer round (HY-298): the studio's blue wax,
   poured, then pressed with the "t." of the logo. A photograph of real wax,
   the same in both themes, closing the page the way a signed letter is
   closed, beside the call to begin. */

.ab-start .section-heading {
  gap: 0;
}

.ab-seal {
  position: relative;
  width: 8rem;
  aspect-ratio: 1;
  filter: drop-shadow(0.12rem 0.25rem 0.25rem rgb(0 0 0 / 0.28));
}

.ab-seal img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ab-seal__poured {
  opacity: 0;
}

.ab-seal.is-waiting img {
  opacity: 0;
}
