/* The Apps page (page E; design/evolution/README.md, Apps 3): the newest app leads beside the
   title, the rest follow in a grid on a subgrid, rows on a phone. Each app is its own interface,
   redrawn from the app and lit in the garden (assets/apps/), with its blue reading drawn in by
   assets/js/apps-sweep.js. On site.css. */

.ae { --col: 580px; padding: 0 var(--margin) 160px; }
.ae .tag { padding: 0 6px; border: 1px dashed var(--hair-2); border-radius: 3px; }
.ae .label { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin: 0; }

/* ------------------------------------------------------------------ the picture and its names */
.pic { position: relative; display: block; overflow: hidden; }
.pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pic, .ae-thumb {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-composite: intersect;
}
.over { position: absolute; inset: 0; pointer-events: none; }
.over svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.over line { stroke: var(--line); stroke-opacity: 0.5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.rd { position: absolute; display: grid; gap: 2px; font: 400 11px/1.35 var(--font-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; isolation: isolate; }
.rd > :first-child { color: var(--ink); }
.rd.dim > :first-child { color: var(--ink-2); }
.rd b { font-weight: 400; color: var(--accent); font-variant-numeric: tabular-nums; }
.rd .num { display: block; font: 300 48px/1.08 var(--font-display); letter-spacing: -0.02em; text-transform: none; color: var(--accent); font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.rd.r { transform: translate(-100%, -50%); text-align: right; justify-items: end; }
.rd.r.top { transform: translate(-100%, 0); }
.rd.l { transform: translate(0, -50%); }
.rd.c { transform: translate(-50%, -50%); text-align: center; justify-items: center; }
.rd::before { content: ""; position: absolute; inset: -14px -24px; z-index: -1; background: var(--ground); -webkit-mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 0.9) 50%, transparent); mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 0.9) 50%, transparent); }

/* ------------------------------------------------------------------ the caption rule */
.ae .name { margin: 0; color: var(--ink); text-wrap: balance; }
.ae .line { margin: 0; color: var(--ink-2); text-wrap: pretty; }
.ae .why { display: grid; gap: 4px; margin: 0; }
.ae .why a { font-size: 15px; color: var(--ink); }
.ae .caveat { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.ae .foot { margin: 0; padding-top: 10px; border-top: 1px solid var(--hair-2); min-height: 44px; box-sizing: border-box; }
.ae .foot .repo { font-size: 16px; color: var(--ink); }
.ae .foot .gap { font-size: 13px; color: var(--ink-2); }

/* ------------------------------------------------------------------ desktop: the lead beside the title */
.ae-top { display: grid; gap: 24px; }
.ae-top .pic { aspect-ratio: 1560 / 1200; }
.ae-words { display: grid; align-content: start; }
.ae-words .title { margin: 0; }
.ae-words .lede { margin: 22px 0 0; }
.ae-cap { display: grid; gap: 10px; margin-top: 40px; }
.ae-cap .name { font: 300 32px/1.08 var(--font-display); letter-spacing: -0.024em; }
.ae-cap .line { font-size: 16px; line-height: 1.5; max-width: 30em; }
.ae-cap .why { margin-top: 6px; }
.ae-cap .foot { margin-top: 14px; }
@media (min-width: 900px) {
  .ae-top { grid-template-columns: var(--col) minmax(0, 1fr); column-gap: 32px; margin-right: calc(-1 * var(--margin)); }
  .ae-words { padding-top: 132px; }
  .ae-words .lede { margin-top: 26px; }
  .ae-cap { margin-top: 64px; }
  .ae-cap .name { font-size: 48px; }
  .ae-cap .line { font-size: 18px; }
  .ae-cap .why { margin-top: 16px; }
  .ae-cap .foot { margin-top: 24px; }
  .ae-top .pic { width: 780px; height: 600px; aspect-ratio: auto; margin-top: 120px; justify-self: end; }
}

/* ------------------------------------------------------------------ the grid tier */
.ae-grid { display: grid; list-style: none; margin: 64px 0 0; padding: 0; gap: 0; }
.ae-grid > li { display: grid; }
@media (min-width: 1100px) {
  /* No row gap: a subgrid inherits it between its own lines. A further row of cards takes a margin. */
  .ae-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; row-gap: 0; margin-top: 24px; }
  .ae-grid > li:nth-child(n + 4) { margin-top: 72px; }
  /* Each card spans the six rows, so labels, names, lines, notes and feet share their lines. */
  .ae-grid > li { grid-row: span 6; grid-template-rows: subgrid; row-gap: 0; }
  .ae-grid .pic { aspect-ratio: 854 / 640; margin-bottom: 4px; }
  .ae-grid .label { margin-top: 4px; }
  .ae-grid .name { font-size: 24px; line-height: 1.2; font-weight: 350; letter-spacing: -0.012em; margin-top: 8px; }
  .ae-grid .line { font-size: 15px; line-height: 1.5; margin-top: 6px; }
  .ae-grid .note-row { margin-top: 8px; }
  .ae-grid .foot { margin-top: 16px; align-self: end; }
  .ae-grid .ae-thumb, .ae-grid .reading { display: none; }
}

/* ------------------------------------------------------------------ phone and tablet: rows */
@media (max-width: 1099.98px) {
  .ae-grid > li { grid-template-columns: 112px minmax(0, 1fr); column-gap: 16px; padding: 18px 0 20px; border-bottom: 1px solid var(--hair); align-items: start; }
  .ae-grid > li:first-child { border-top: 1px solid var(--hair); }
  .ae-grid .pic { display: none; }
  .ae-grid .ae-thumb { grid-row: 1 / span 6; display: block; width: 112px; height: 112px; }
  .ae-grid .ae-thumb img { display: block; width: 100%; height: 100%; }
  .ae-grid > li > :not(.ae-thumb) { grid-column: 2; }
  .ae-grid .name { font-size: 20px; line-height: 1.25; font-weight: 380; margin-top: 4px; }
  .ae-grid .line { font-size: 15px; line-height: 1.45; margin-top: 4px; }
  .ae-grid .reading { margin: 6px 0 0; font: 400 11px/1.35 var(--font-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
  .ae-grid .reading b { font-weight: 400; color: var(--accent-text); }
  .ae-grid .note-row { margin-top: 6px; }
  .ae-grid .note-row:empty { display: none; }
  .ae-grid .foot { margin-top: 10px; border-top: 0; padding-top: 0; min-height: 0; }
}
@media (max-width: 899.98px) {
  /* The lead picture stands above the title, its readings in a legend under it. */
  .ae-top { gap: 0; }
  .ae-top .pic { order: -1; margin: 64px calc(-1 * var(--margin)) 0; aspect-ratio: 780 / 600; }
  .ae-top .pic .over { display: none; }
  .ae-legend { order: -1; display: flex; justify-content: space-between; gap: 16px; margin: 4px 0 28px; }
  .ae-legend .rd { position: static; transform: none; }
  .ae-legend .rd::before { content: none; }
  .ae-legend .rd .num { font-size: 36px; }
  .ae-words .title { font-size: 34px; }
  .ae-words .lede { font-size: 17px; }
}
@media (min-width: 900px) { .ae-legend { display: none; } }

.ae .page-end { margin-top: 120px; padding: 0; color: var(--ink-2); display: grid; justify-items: start; gap: 4px; }
.ae .page-end .onward { color: var(--ink); }
/* The second way in follows the link on its line, at the link's size (2026-11-24). */
.ae .page-end .ways { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.3em; font-size: 20px; line-height: 1.25; }

/* ------------------------------------------------------------------ the sweep (sweep.js) */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 360deg; }
.pic .base, .pic .blue { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pic picture { position: absolute; inset: 0; }
/* The blue lies over its base, lightening it: black is nothing, blue is the reading. */
.pic .blue { mix-blend-mode: lighten; pointer-events: none; }
.pic .blue[data-sweep="dial"] {
  -webkit-mask-image: conic-gradient(from 0deg at var(--cx) var(--cy), #000 var(--sweep), transparent 0), radial-gradient(ellipse var(--rx) var(--ry) at var(--cx) var(--cy), #000 99%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: conic-gradient(from 0deg at var(--cx) var(--cy), #000 var(--sweep), transparent 0), radial-gradient(ellipse var(--rx) var(--ry) at var(--cx) var(--cy), #000 99%, transparent 100%);
  mask-composite: intersect;
}
.pic .blue[data-sweep="scan"] { --scan: 100%; -webkit-mask-image: linear-gradient(to bottom, #000 var(--scan), transparent calc(var(--scan) + 2%)); mask-image: linear-gradient(to bottom, #000 var(--scan), transparent calc(var(--scan) + 2%)); }
/* A reading lands with one fine blue ring. */
.ring { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 1px solid var(--accent); border-radius: 50%; opacity: 0; transform: scale(0.4); }
.sweeps .ring.landed { animation: land 600ms var(--ease) forwards; }
@keyframes land { 0% { opacity: 0.9; transform: scale(0.4); } 100% { opacity: 0; transform: scale(1.6); } }
/* Arrival: the base fades in, the names after it. */
.sweeps .pic .base { opacity: 0; transition: opacity 600ms var(--ease); }
.sweeps .pic .over { opacity: 0; transition: opacity 300ms var(--ease) 400ms; }
.sweeps .pic.is-on .base, .sweeps .pic.is-on .over { opacity: 1; }
@media (max-width: 899.98px) { .ae-top .pic .blue.for-wide { display: none; } }
@media (min-width: 900px) { .ae-top .pic .blue.for-phone { display: none; } }
/* The lead's Claude block: its label on the caption label's line, its numeral on the name's baseline. */
.rd.lead .num { margin-top: 12px; }
/* The scan line travels on its own layer. */
.pic .blue.scan-line { will-change: transform; }

/* ------------------------------------------------------------------ the apps' own interfaces */
.pic { container-type: inline-size; }
.pic .blue[data-sweep="wipe"] { --wipe: 100%; -webkit-mask-image: linear-gradient(var(--dir, to right), #000 var(--wipe), transparent calc(var(--wipe) + 1.2%)); mask-image: linear-gradient(var(--dir, to right), #000 var(--wipe), transparent calc(var(--wipe) + 1.2%)); }
.pic .blue[data-axis="y"] { --dir: to bottom; }
/* Numbers set on the panel, in its own type, so they can count up: sized as a share of the picture. */
.pn { position: absolute; transform: translate(-100%, -79%); font: 700 calc(var(--pt) * var(--k)) / 1 var(--font-text); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.pn.small { font-weight: 400; font-size: max(11px, calc(var(--pt) * var(--k))); color: var(--ink-2); letter-spacing: 0; }
/* On phones the picture is too small for the secondary reading at 11 px; the picture's label still gives it. */
@media (max-width: 899.98px) { .pn.small { display: none; } }
/* Each card's reading sits in its caption on every width. */
.ae-grid .reading { display: block !important; }
@media (min-width: 1100px) { .ae-grid .reading { margin: 8px 0 0; font: 400 11px/1.35 var(--font-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); } .ae-grid .reading b { font-weight: 400; color: var(--accent-text); } }
/* One picture per width: the lead's panel and its numbers on every screen, no separate legend. */
.ap .pic { --k: 0.1226cqw; }
@media (max-width: 899.98px) { .ap .ae-top .pic .over { display: block; } }
/* On a phone the lead's panel stands larger: the picture and its numbers scale together. */
@media (max-width: 899.98px) { .ap .ae-top .pic > * { transform: scale(1.34); transform-origin: 54% 52%; } .ap .ae-top .pic > .over .pn { transform: translate(-100%, -79%); } }
.ap .ae-grid .note-row .reading + .caveat { margin-top: 6px; }
/* A reading's items wrap between, never inside. */
.ae-grid .reading span { white-space: nowrap; }
.ae-grid .reading span + span::before { content: "·"; margin: 0 0.6em; color: var(--ink-2); }
/* The lead arrives as its popover opens from the menu bar item: from 98% at the nub, with the fade. */
.sweeps .ap .ae-top .pic > * { scale: 0.98; transform-origin: 74% 18%; transition: scale 600ms var(--ease), opacity 600ms var(--ease); }
.sweeps .ap .ae-top .pic.is-on > * { scale: 1; }
/* Phone: room between the masthead and the menu bar item, and between the panel and the title. */
@media (max-width: 899.98px) {
  .ap .ae-top .pic { margin-top: 92px !important; margin-bottom: 36px !important; }
  .ap .ae-top .pic > * { transform: scale(1.22); transform-origin: 54% 54%; }
}
/* Phone rows carry their blue reading; no thumbnail. */
@media (max-width: 1099.98px) {
  .ap .ae-grid > li { grid-template-columns: minmax(0, 1fr); }
  .ap .ae-grid .ae-thumb { display: none; }
  .ap .ae-grid > li > :not(.ae-thumb) { grid-column: 1; }
}
/* Cards fade less at top and bottom (the render already fades to the ground within 17 px), so one
   scale can hold a whole popover without its words falling in the fade. */
.ap .ae-grid .pic {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
}

/* ------------------------------------------------------------------ the light theme */
/* Each picture has a version per theme (tools/apps/build-apps.mjs), shown by site.css's
   .theme-dark-only and .theme-light-only; the light one is lazy, so a reader fetches one set. */
/* On bone neither black nor white blends away, so the light reading layer is the whole picture with its
   blue (tools/lit/apps, layer=reading), laid over the base as it is: the wipe uncovers it. */
:root[data-theme="light"] .pic .blue { mix-blend-mode: normal; }
/* Dark type on a light ground reads thinner: the names take more weight, as the titles do. */
:root[data-theme="light"] .ae .name { font-weight: 400; }
